var netMask;var netMap;var iNetMap;var cNetMap;var netMenu;var nMw;var nMh;var nInit;var nStatus;var nSpeed=8;
var ntwList; var ntwList_s=0; var ntwList_h; var iList=0;

function Ntw_SwitchLink(obj_id,func){try{var obj=document.getElementById(obj_id);obj.href='javascript:'+func+';';obj.target='';}catch(e){}}
function Ntw_addEvent(obj,type,fn){try{if(obj.attachEvent){obj['e'+type+fn]=fn;obj[type+fn]=function(){obj['e'+type+fn](window.event);};obj.attachEvent('on'+type,obj[type+fn]);}else{obj.addEventListener(type,fn,false);}}catch(e){}}
function Ntw_removeEvent(obj,type,fn){try{if(obj.detachEvent){obj.detachEvent('on'+type,obj[type+fn]);obj[type+fn]=null;}else{obj.removeEventListener(type,fn,false);}}catch(e){}}

try{
	Ntw_addEvent(window, 'scroll', function(){ ntw_bar_onTop(); });
	Ntw_addEvent(window, 'resize', function(){ ntw_bar_onTop(); }); 
	Ntw_addEvent(window, 'noscroll', function(){ ntw_bar_onTop(); });
}catch(e){}



function ntw_bar_onTop(){
	try{
  var offsetTop=0;
  if (typeof(window.pageYOffset)=='number'){offsetTop=window.pageYOffset;} //Netscape
	if(document.body && document.body.scrollTop){offsetTop=document.body.scrollTop;} //DOM
	if(document.documentElement && document.documentElement.scrollTop ){offsetTop=document.documentElement.scrollTop;} //IE6 
	document.getElementById('ntw_bar').style.top=offsetTop+'px';
	}catch(e){}
}


function NwtSetAlpha(o,v){try{o.style.opacity=v/100;o.style.MozOpacity=v/100;o.style.filter='alpha(opacity='+v+')';}catch(e){}}

function NoPxVal(s){try{if(s.length>0){return s.substring(0,s.indexOf('px'));}else{return '';}}catch(e){}}

function NtwElementShow(){
	try{
	if(nStatus==true){return;}
	clearInterval(iNetMap);
	cNetMap=0;
	netMenu=false;
	netMap.style.width='0px';
	netMap.style.height='0px';
	netMap.style.display='';
	netMask.style.visibility='visible';
	NwtSetAlpha(netMap,cNetMap);
	NwtSetAlpha(netMask,cNetMap);
	NtwselectHideShow('hidden');
	}catch(e){}
}

function NtwElementHide(){
	try{
	if(nStatus==true){return;}
	clearInterval(iNetMap);
	cNetMap=0;
	netMenu=false;
	netMap.style.width='0px';
	netMap.style.height='0px';
	netMap.style.display='none';
	netMask.style.visibility='hidden';
	NwtSetAlpha(netMap,cNetMap);
	NwtSetAlpha(netMask,cNetMap);
	NtwselectHideShow('visible');
	}catch(e){}
}

function NwtMenuClose(){try{if(nStatus==true){return;}window.setTimeout("NwtMenuCloseStart()",1000);}catch(e){}}

function NwtMenuCloseStart() {
	try{
	if(nStatus==true){return;}
	if(!netMenu){return;}
	iNetMap=setInterval(NtwClose,1);
	netMenu=false;
	}catch(e){}
}

function NwtMapMaintain(){try{if(nStatus==true){return;}netMenu=false;}catch(e){}}

function NtwInit(){
	try{
	nInit=true;
	nStatus=false;
	netMask=document.getElementById('ntw_mask');
	netMap=document.getElementById('ntw_map');
	nMw=netMap.style.width;
	nMh=netMap.style.height;
	nMw=NoPxVal(nMw);
	nMh=NoPxVal(nMh);
	var ref = document.getElementById('ntw_map_bt');
  var myHeight=0; myLeft=0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
		myLeft = ref.offsetLeft;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
		myLeft = ref.parentElement.parentElement.offsetLeft+35;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
		myLeft = ref.parentElement.offsetLeft;
  }
	document.getElementById('ntw_mask_spacer').height=myHeight-33;
	netMap.style.left = myLeft + 'px';	
	}catch(e){}
}

function NtwMap(){
	try{
	if(nStatus==true){return;}
	if(typeof(nInit)=='undefined'){NtwInit();}
	if(netMap.style.display=='none'){NtwElementShow();iNetMap=setInterval("NtwOpen()",1);}
	 else{cNetMap=100;iNetMap=setInterval("NtwClose()",1);}
	}catch(e){}
}

function NtwOpen(){
	try{
	nStatus=true;
	cNetMap=cNetMap+nSpeed;
	NwtSetAlpha(netMap,cNetMap);
	NwtSetAlpha(netMask,(cNetMap/2));
	NtwMapResize();
	if(cNetMap>=100){clearInterval(iNetMap);netMenu=true;nStatus=false;}
	}catch(e){}
}

function NtwClose(){
	try{ 
	nStatus=true;
	cNetMap=cNetMap-nSpeed;
	NwtSetAlpha(netMap,cNetMap);
	NwtSetAlpha(netMask,(cNetMap/2));
	NtwMapResize();
	if(cNetMap<=0){clearInterval(iNetMap);nStatus=false;NtwElementHide();}
	}catch(e){}
}

function NtwMapResize(){
	try{
	nStatus=true;
	var pW=(nMw*(cNetMap+2))/100;
	var pH=(nMh*(cNetMap+2))/100;
	if(pW<0){pW=0;}
	if(pH<0){pH=0;}
	if(pW>nMw){pW=nMw;}
	if(pH>nMh){pH=nMh;}
	netMap.style.width=pW+'px';
	netMap.style.height=pH+'px';
	}catch(e){}
}

function NtwselectHideShow(stile){
	try{
	if(nStatus==true){return;}
	var oDoc=document.getElementsByTagName("SELECT");
	for(var h=0;h<oDoc.length;h++){if(oDoc[h].type=='select-one'){oDoc[h].style.visibility=stile;}}
	var oDoc=document.getElementsByTagName("embed");
	for(var h=0;h<oDoc.length;h++){oDoc[h].style.visibility=stile; }
	var oDoc=document.getElementsByTagName("object");
	for(var h=0;h<oDoc.length;h++){oDoc[h].style.visibility=stile; }
	}catch(e){}
}

function NtwGoToSite(objSel){
	try{
		if(typeof(objSel)!='object'){return;}
		if(objSel.type!='select-one'){return;}
		oValue=objSel.options[objSel.selectedIndex].value;
		if(oValue.length==0){return;}
		if(objSel.options[objSel.selectedIndex].id=='ntw'){
			document.location.href=oValue;
		}else{
			window.open(oValue,'','');
		}
	}catch(e){}
}

function NwtListInit(obj){try{if(ntwList_s!=0){return;}ntwList=obj;var o;o=obj.getElementsByTagName("UL")[1];o.style.visibility='visible';ntwList_h=0;NwtSetAlpha(o,0);ntwList_s=1;iList=setInterval("NwtListStart();",30);}catch(e){}}
function NwtListStart(){try{o=ntwList.getElementsByTagName("UL")[1];if(ntwList_h<95){ntwList_h=ntwList_h+5;NwtSetAlpha(o,ntwList_h);}else{NwtSetAlpha(o,95);clearInterval(iList);ntwList_s=2;}}catch(e){}}
function NwtListMaintain(obj){try{if(ntwList_s>1){ntwList_s=2;}}catch(e){}}
function NwtListOut(obj){try{ntwList_s=3;window.setTimeout("NwtListEnd()",1000);}catch(e){}}
function NwtListEnd(){try{if(ntwList_s==3){o=ntwList.getElementsByTagName("UL")[1];o.style.visibility='hidden';NwtSetAlpha(o,0);ntwList_s=0;}}catch(e){}}

