
//	EXP out menu

function P7_swapClass(){ //v1.4 by PVII
 var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;

 if(document.getElementsByTagName){
	for(i=4;i<arg.length;i++){
		tB=document.getElementsByTagName(arg[i]);
  		for(x=0;x<tB.length;x++){tA[j]=tB[x];j++;}}for(i=0;i<tA.length;i++){
  			if(tA[i].className){if(tA[i].id==arg[1])
			 {if(arg[0]==1){
  				tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
			 else{tA[i].className=arg[2];}
  			}else if(arg[0]==1 && arg[1]=='none'){if(tA[i].className==arg[2] || tA[i].className==arg[3]){
  tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];}
  }else if(tA[i].className==arg[2]){tA[i].className=arg[3];}}}}
}

function P7_writeStyles(op,a){ //v1.5 by PVII
if(op==0||document.getElementById){var tS="<sty"+"le type=\"text/css\">";
tS+=a+"<"+"/sty"+"le>";document.write(tS);document.close();}
}


P7_writeStyles(1,'.closed ul{ display:none;}.open ul{ display:block;}');



//	POP Out Menu
activateMenu = function(nav) {

    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
        var navroot = document.getElementById(nav);
        
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
        for (i=0; i<lis.length; i++) {
        
           /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
            
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {	
                
                   /* display the inner menu */
                   this.lastChild.style.display="block";
                }
                lis[i].onmouseout=function() {                       
                   this.lastChild.style.display="none";
                }
            }
        }
    }
}


function textSize(val)
{
devMain = document.getElementById("wrapper");
devMain.style.fontSize = val;
}

function toggleLayout()
{
		var val = '760px'

		var check = document.getElementById("wrapper").offsetWidth;
		if (check == 760)
			{ val = '90%'; }


// 		alert("wrapper width: " + check + "\nchange to: " + val);

		document.getElementById("wrapper").style.width = val;

}


function resizeWindow() {
  	
		winW = document.body.offsetWidth;	

		if(winW <= 760)
			{
				document.getElementById("wrapper").style.width = '760px';
				document.getElementById("content").style.width = '250px';
			}
		else
			{
				document.getElementById("wrapper").style.width = '90%';
				document.getElementById("content").style.width = 'auto';
			}
                }


function externalLinks() {

  var theLinks = document.links;

	if (!document.links)
		{
		document.links = document.getElementsByTagName('a');
		}


var thisDomain = window.location.hostname;


	for (i=0; i < theLinks.length; i++) {
		var thisLink = theLinks[i];
		  if (thisLink.href.indexOf(thisDomain) == -1 && thisLink.href.indexOf("javascript") == -1) {
    			thisLink.target = "_blank";
   			}
  	}
}



function init()
{

	//toggleLayout('90%');
	externalLinks();
	document.getElementById("fontsize").style.display = 'block';
	resizeWindow();

	//if (document.getElementById("vertnav"))
	// {
//		activateMenu('vertnav');
//	 }

}


window.onload = init;