//version 2010.03.14

//onresize="closegrayingbox();

//hover video block start

document.write('<div class="VPUBG none" id="VPUBG" onclick="CloseVPU()"></div>');
document.write('<div class="CloseVPUBtn none" id="CloseVPUBtn">');
document.write('<a href="javascript:CloseVPU()"><div>X CLOSE</div></a></div>');
document.write('<div class="VPU none" id="VPU">');
document.write('video-flash-img-content</div>');

//hover video block end


function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}


function CheckSize(_w)
{
	if(_w==undefined)_w=800;
	document.getElementById('VPUBG').style.height = document.body.scrollHeight + 'px';
	//document.getElementById('VPUBG').style.width = (document.body.scrollWidth<_w?_w:document.body.scrollWidth) + 'px';
	document.getElementById('VPUBG').style.width = (document.body.clientWidth<_w?_w:document.body.clientWidth) + 'px';
	//alert(document.body.clientWidth+" "+_w+" "+document.body.scrollWidth +" "+document.getElementById('VPUBG').style.width);
}

function CloseVPU()
{
	document.getElementById('VPU').innerHTML="";
	document.getElementById('VPUBG').style.display = 'none';
	document.getElementById('VPU').style.display = 'none';
	if(document.getElementById('CloseVPUBtn')!=null) document.getElementById('CloseVPUBtn').style.display = 'none';
}

function VPUResize(__w,__h)
{
	if(__w==undefined)__w = 600;
	if(__h==undefined)__h = 600;
	document.getElementById('VPU').style.width = __w + 'px';
	document.getElementById('VPU').style.height = __h + 'px';

	var top = (self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop)) + (getClientHeight()-__h)/2
	if(top<0) top=0;
	document.getElementById('VPU').style.top = top+'px';
	
	var left = (getClientWidth()-__w-20)/2
	if(left<0) left=0;
	document.getElementById('VPU').style.left = left+'px';
	
	if(document.getElementById('CloseVPUBtn')!=null){
		document.getElementById('CloseVPUBtn').style.top = (self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop)) + (getClientHeight()-__h)/2 - 10 +'px';
		document.getElementById('CloseVPUBtn').style.left = getClientWidth()/2+__w/2 - 50 +'px'; 
		}
}

function OpenVPU(_type,_src,_w,_h,_desc)
{ 
	var Chars=55;
	if(_desc=='') _desc=" &nbsp; &nbsp;";
	if(_desc==undefined) _desc=" &nbsp; &nbsp;";
	document.getElementById('VPUBG').style.display = 'block';
	document.getElementById('VPU').style.display = 'block';
	if(document.getElementById('CloseVPUBtn')!=null) document.getElementById('CloseVPUBtn').style.display = 'block';
	CheckSize(790);  // check width 
	
	if(_type=='img'){
	document.getElementById('VPU').className='VPU';
	VPUResize(_w,_h);
	document.getElementById('VPU').innerHTML='<a href="javascript:CloseVPU();"><img src="'+_src+'" height="'+_h+'" width="'+_w+'" alt="'+ _desc +'"></a>';
	}	
	
	/*
	if(_type=="flash")
	{
	flashboxresize(_w,_h);
	var s1 = new SWFObject(_src+".swf","flash",_w,_h,"7");
	s1.addVariable("width",_w);
	s1.addVariable("height",_h);
	s1.write("hoverdiv");
	}
	if(_type=="flashvideo")
	{
	flashboxresize(_w,_h);
	var s1 = new SWFObject("mediaplayer.swf","mediaplayer",_w,_h,"7");
	s1.addParam("allowfullscreen","true");
	s1.addVariable("width",_w);
	s1.addVariable("height",_h);
	s1.addVariable("autostart","true");
	s1.addVariable("file",_src);
	//s1.addVariable("file",".flv");
	//s1.addVariable("image",".jpg");
	s1.write("hoverdiv");
	}
	if(_type=='iframe'){
	document.getElementById('hoverdiv').className='hoverdiv blue';
	if(document.getElementById('close_hoverdiv')!=null) document.getElementById('close_hoverdiv').style.display = 'none';
	flashboxresize(_w,_h);
	var tmp_str='';
	tmp_str+='<div class="headhover">';
	tmp_str+='<table cellpadding="0" cellspacing="0" border="0" width="'+(_w-20)+'">';
	tmp_str+='<tr><td><h1 class="nomargin">'+_desc+'</h1></td><td class="print_td"><a href="javascript:document.getElementById(\'iframe\').contentWindow.focus();javascript:document.getElementById(\'iframe\').contentWindow.print();"><div>PRINT</div></a></td><td class="close_td"><a href="javascript:closegrayingbox()"><div>CLOSE</div></a></td></tr>';
	tmp_str+='</table>';
	tmp_str+='</div>';
	if(_desc.length>47) mif=90;
	tmp_str+='<iframe frameborder="0" src="'+_src+'" width="'+_w+'" id="iframe" height="'+(_h-mif)+'"></iframe>';
	document.getElementById('hoverdiv').innerHTML=tmp_str;
	}
	if(_type=='iframeclear'){
	//document.getElementById('hoverdiv').className='hoverdiv blue';
//	if(document.getElementById('close_hoverdiv')!=null) document.getElementById('close_hoverdiv').style.display = 'none';
	flashboxresize(_w,_h);
	var tmp_str='';
	//tmp_str+='<div class="headhover">';
	//tmp_str+='<table cellpadding="0" cellspacing="0" border="0" width="'+(_w-20)+'">';
	//tmp_str+='<tr><td><h1 class="nomargin">'+_desc+'</h1></td><td class="print_td"><a href="javascript:document.getElementById(\'iframe\').contentWindow.focus();javascript:document.getElementById(\'iframe\').contentWindow.print();"><div>PRINT</div></a></td><td class="close_td"><a href="javascript:closegrayingbox()"><div>CLOSE</div></a></td></tr>';
	//tmp_str+='</table>';
	//tmp_str+='</div>';
	tmp_str+='<iframe scrolling="no" frameborder="0" src="'+_src+'" width="'+_w+'" id="iframe" height="'+_h+'"></iframe>';
	document.getElementById('hoverdiv').innerHTML=tmp_str;
	}
	if(_type=='iframenoscroll'){
	document.getElementById('hoverdiv').className='hoverdiv blue';
	if(document.getElementById('close_hoverdiv')!=null) document.getElementById('close_hoverdiv').style.display = 'none';
	flashboxresize(_w,_h);
	var tmp_str='';
	tmp_str+='<div class="headhover">';
	tmp_str+='<table cellpadding="0" cellspacing="0" border="0" width="'+(_w-20)+'">';
	tmp_str+='<tr><td><h1 class="nomargin">'+_desc+'</h1></td><td class="print_td"><a href="javascript:document.getElementById(\'iframe\').contentWindow.focus();javascript:document.getElementById(\'iframe\').contentWindow.print();"><div>PRINT</div></a></td><td class="close_td"><a href="javascript:closegrayingbox()"><div>CLOSE</div></a></td></tr>';
	tmp_str+='</table>';
	tmp_str+='</div>';
	tmp_str+='<iframe scrolling="no" frameborder="0" src="'+_src+'" width="'+_w+'" id="iframe" height="'+(_h-55)+'"></iframe>';
	document.getElementById('hoverdiv').innerHTML=tmp_str;
	}
	if(_type=='iframe2'){
	if(document.getElementById('close_hoverdiv')!=null) document.getElementById('close_hoverdiv').style.display = 'block';
	flashboxresize(_w,_h);
	//820,600
	var tmp_str='';
	tmp_str+='<div class="headhover">';
	tmp_str+='<table cellpadding="0" cellspacing="0" border="0" width="'+(_w-20)+'">';
	tmp_str+='<tr><td><h2 class="nomargin">INSTALLATIONS</h2></td></tr>';
	tmp_str+='</table>';
	tmp_str+='</div>';
	tmp_str+='<iframe frameborder="0" src="'+_src+'" width="'+_w+'" id="iframe" height="'+(_h-55)+'"></iframe>';
	document.getElementById('hoverdiv').innerHTML=tmp_str;
	}
	if(_type=='newsframe'){
	document.getElementById('hoverdiv').className='hoverdiv blue';
	if(document.getElementById('close_hoverdiv')!=null) document.getElementById('close_hoverdiv').style.display = 'none';
	flashboxresize(_w,_h);
	var tmp_str='';
	tmp_str+='<div class="headhover">';
	tmp_str+='<table cellpadding="0" cellspacing="0" border="0" width="'+(_w-20)+'">';
	tmp_str+='<tr><td><h1 class="nomargin">'+_desc+'</h1></td><td class="print_td"><a href="javascript:document.getElementById(\'iframe\').contentWindow.focus();javascript:document.getElementById(\'iframe\').contentWindow.print();"><div>PRINT</div></a></td><td class="close_td"><a href="javascript:closegrayingbox()"><div>CLOSE</div></a></td></tr>';
	tmp_str+='</table>';
	tmp_str+='</div>';
	tmp_str+='<iframe frameborder="0" src="'+_src+'" width="'+_w+'" id="iframe" height="'+(_h-55)+'"></iframe>';
	document.getElementById('hoverdiv').innerHTML=tmp_str;
	return false;
	}*/
	
	return false;
}

/*
function CheckVPU(){
	if(window.location.search!="")
	{
	var tmp_str=window.location.search;
	var tmp_str1=tmp_str.substring(1,tmp_str.length);
	if(document.getElementById(tmp_str1)!=""){
		tmp_str = document.getElementById(tmp_str1).innerHTML;
		tmp_str1=tmp_str.substring(tmp_str.indexOf('href=')+6,tmp_str.length);
		tmp_str=tmp_str1.substring(0,tmp_str1.indexOf('"'));
		if(tmp_str!="#"){window.scroll(0,-100);opengrayingbox('iframe',tmp_str,820,600,'NEWS RELEASE');}
		}
	}
}
*/