// JScript source code
var ismenu;
var m1;
var act=0;
var subact=0;
window.onresize=docenter;
window.onload=docenter;

function docenter(){
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {myWidth = window.innerWidth;} 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { myWidth = document.documentElement.clientWidth;} 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { myWidth = document.body.clientWidth;}
	var d = getObject('pagecontainer');
	if(myWidth<755){myWidth=755;}
	d.style.left = (myWidth-755)/2;
}


function m_over(linknum){
	if(null!=m1){window.clearTimeout(m1);}
	if(act!=linknum){m_sub_off(act,subact);}
	act=linknum;	
	m_sub_on(linknum, 0);
	m1 = window.setTimeout('m_sub_off(act,subact)',4000);
}


function m_sub_over(linknum, subnum){
	if(act!=linknum){m_sub_off(act,subact);act=linknum;subact=subnum}
	subact=subnum;
	m_sub_on(linknum, subnum);
	if(null!=m1){window.clearTimeout(m1);}
	
}

function m_out(linknum){
	if(null!=m1){window.clearTimeout(m1);}
	m1 = window.setTimeout('m_sub_off(act, subact)',1000);
}

function m_sub_out(linknum, subnum){
	if(null!=m1){window.clearTimeout(m1);}
	suboff(linknum,subnum);
	m1 = window.setTimeout('m_sub_off(act, subact)',1000);
}

function m_sub_off(linknum, subnum){
if(linknum!=0){
	var d = getObject('nav'+linknum);
	if(null!=d){
	d.style.backgroundColor='#FFF143';
	d.style.color='#000000';
	}
	var c = getObject('menu'+linknum);
	if(null!=c){
	c.style.visibility='hidden';
	}
	suboff(act, subact);

	}
}

function m_sub_on(linknum, subnum){
if(linknum!=0){
	var d = getObject('nav'+linknum);
	if(null!=d){
	d.style.backgroundColor='#58574E';
	d.style.color='#FFF143';
	}
	var c = getObject('menu'+linknum);
	if(null!=c){
	c.style.visibility='visible';
	}
	suboff(act, subact);
	subact=subnum;
	subon(act, subact);


	}
}

function suboff(linknum, subnum){
	if(subnum!=0 && linknum!=0){
		var e= getObject('sub'+linknum+subnum);
		if(null!=e){
		e.style.backgroundColor='#58574E';
		e.style.color='#FFFFFF';
		}
	}
}
function subon(linknum, subnum){
	if(subnum!=0 && linknum!=0){
		var e= getObject('sub'+linknum+subnum);
		if(null!=e){
		e.style.backgroundColor='#58574E';
		e.style.color='#FFF143';
		}
	}
}


function p_over(pagename){
	var d = getObject(pagename);
	if(null!=d){
	d.style.backgroundColor='#58574E';
	d.style.color='#FFF143';
	}
}

function p_out(pagename){
	var d = getObject(pagename);
	if(null!=d){
	d.style.backgroundColor='#FFF143';
	d.style.color='#000000';
	}
}

function q_over(pagename){
	var d = getObject(pagename);
//	d.style.backgroundColor='#666666';
	if(null!=d){
	d.style.color='#FFF143';
	}
}

function q_out(pagename){
	var d = getObject(pagename);
//	d.style.backgroundColor='#58574E';
	if(null!=d){
	d.style.color='#cccccc';
	}
}

function s_over(pagename){
	var d = getObject(pagename);
	if(null!=d){
	d.style.backgroundColor='#FFF8a1';
	d.style.color='#666666';
	}
}
function s_out(pagename){	
	var d = getObject(pagename);
	if(null!=d){
	d.style.backgroundColor='#f2f2f2';
	d.style.color='#666666';
	}
}

function go_to(pagename) {
switch(pagename){
case 'events': 
window.location.href='events.asp';
break;

case 'installation' : 
window.location.href='http://' + s + '/installation.asp';
break;
case 'interested' : 
window.location.href='http://' + s + '/interested.asp';
break;
case 'adm' :
window.open('http://pellaadm.com');
break;
default : 
window.location.href='http://' + s + '/pro.asp?page='+pagename+'&u=' + u;
break;
}

}
function getObject( obj ) {
  if ( document.getElementById ) {
    obj = document.getElementById( obj );
  } else if ( document.all ) {
    obj = document.all.item( obj );
  } else {
    obj = null;
  }
  return obj;
  }
  
function openPDF(pdf){
window.open(pdf,'pdf','height=550,width=700,resizable=yes,scrollbars=yes,toolbar=no');
}
  
	function openGraphicEmailWindow( ) {
	
		var strURL = "graphic_email.asp" ;
		var strFeatures = "height=375, width=500, left=200, screenX=200, top=100, screenY=100, scrollbars=no, location=no, menubar=no, resizable=no, status=no, toolbar=no" ;
		window.open( strURL, "gemail", strFeatures);
	}  
	function openVideoPopup( ) {
	
		var strURL = "video_pop.asp" ;
		var strFeatures = "height=600, width=500, left=200, screenX=200, top=100, screenY=100, scrollbars=no, location=no, menubar=no, resizable=no, status=no, toolbar=no" ;
		window.open( strURL, "vid", strFeatures);

	}

	function openVideoWindow( strVideoURL, strName, strVideoType ) {
	
		var strURL = "video.asp?video=" + strVideoURL + "&name=" + strName + "&type=" + strVideoType ;
		var strFeatures = "height=300,width=300,left=200,top=100,scrollbars=no,location=no,menubar=no,resizable=no,status=no,toolbar=no" ;
		var win

		win = window.open( strURL, "video", strFeatures);
		win.focus();
	}
	function openZoomWindow(  ) {
	
		var strURL = "zoom.asp"
		var strFeatures = "height=450,width=475,left=200,top=100,scrollbars=no,location=no,menubar=no,resizable=no,status=no,toolbar=no" ;
		var win

		win = window.open( strURL, "zoom", strFeatures);
		win.focus();
	
	}
	function openCompareWindow(  ) {
	
		var strURL = "compare.asp"
		var strFeatures = "height=900,width=770,left=200,top=100,scrollbars=yes,location=no,menubar=no,resizable=no,status=no,toolbar=no" ;
		var win

		win = window.open( strURL, "compare", strFeatures);
		win.focus();
	
	}