var text_array = new Array();
	text_array[0] = 'welcome';
	text_array[1] = 'products';
	text_array[2] = 'requestinfo';
	text_array[3] = 'locations';
	text_array[4] = 'specifications';
	text_array[5] = 'services';

function showHide_nav(show_who){
	for (i=0;i<text_array.length;i++){
		var temp_obj = document.getElementById('text_' + text_array[i]);
		temp_obj.style.display = 'none';
	}
	var show_obj = document.getElementById('text_'+show_who);
	show_obj.style.display = 'block';
}

function getwindowsize(i) {
	if (navigator.userAgent.indexOf("MSIE") > 0) {
		var sWidth = (document.body.clientWidth);
		var sHeight = (document.body.clientHeight);
	} else {
		var sWidth = (window.innerWidth - 10);
		var sHeight = (window.innerHeight - 10);
	}
	if (i == 'W'){
		return sWidth;
	} else if (i == 'H'){
		return sHeight;
	}
}

function centerContent(){
	//alert('centerContent');
	var content_width = 620;
	var window_width = getwindowsize('W');
	var new_left_margin = (window_width - content_width) / 2;
	var new_left_margin = parseInt(new_left_margin);
	var center_obj = document.getElementById('body_container');
	center_obj.style.left = new_left_margin + 'px';
}

function loadBodyText(txtObj){
	var body_content	= document.getElementById('body_content_txt');
	var body_bg			= document.getElementById('body_content_bg');
	var close_obj		= document.getElementById('body_content_close');
	if (txtObj == '' || txtObj == 'undefined'){
		var txtObj = 'text_welcome';
	}
	var load_text = document.getElementById(txtObj);
	body_content.innerHTML = load_text.innerHTML;
	body_bg.innerHTML = '<span class="transparent_placeholder">'+body_content.innerHTML+'</span>';
	body_content.style.display	= 'block';
	body_bg.style.display		= 'block';
	close_obj.style.display		= 'block';
}

function closeBody(){
	var body_content	= document.getElementById('body_content_txt');
	var body_bg			= document.getElementById('body_content_bg');
	var close_obj		= document.getElementById('body_content_close');
	body_content.style.display	= 'none';
	body_bg.style.display		= 'none';
	close_obj.style.display		= 'none';

}

function loadFileText(file){
	if (file == 'welcome'){
		document.location = "http://www.performanceroofingsupply.com/index.cfm";
	} else {
		document.location = "http://www.performanceroofingsupply.com/get.cfm?get="+file;
	}
}

function popUp(img, h, w){
	var thisUrl = "http://www.performanceroofingsupply.com/image.cfm?img=";
	var Feat = "fullscreen=no,toolbar=no,location=no,directories=no,left=10,top=10,width="+w+", height="+h+",status=no,resizable=no,menubar=no,scrollbars=no";
	var gotoUrl = thisUrl + img;
	imageWindow = window.open(gotoUrl,"imageWindow",Feat);
	imageWindow.focus();
}

var nxtStep = 'hidden'; 
			
function flipDiv(act){
	if (act == 'show'){
		if (nxtStep != 'showing'){
			nxtStep = 'showing';
			var obj		= document.getElementById('body_alt_title');
			var obj2	= document.getElementById('body_alt_bg_option');
			obj2.style.display = 'block';
			if (obj.filters) {
				obj.filters.alpha.opacity	= 100;
			} else {
				obj.style.MozOpacity		= 1;
			}
		}
	} else if (act == 'hide'){
		nxtStep = 'hidden';
		setTimeout('hideDiv()',2000);
	}
}

function hideDiv(){
	if (nxtStep == 'hidden'){
		var obj		= document.getElementById('body_alt_title');
		var obj2	= document.getElementById('body_alt_bg_option');
		obj2.style.display = 'none';
		if (obj.filters) {
			obj.filters.alpha.opacity	= 70;
		} else {
			obj.style.MozOpacity		= .7;
		}
	}
}

function switchImg(img){
	var bgImgObj = document.getElementById('body_bg');
	bgImgObj.innerHTML = '<img src="/front_bg/'+img+'">';
	closeBody();
}