// ||||||||||||||||||||||||||||||BEGIN TRANSITION EFFECT|||||||||||||||||||||
	function getStyleObject(objectId) {
	    // cross-browser function to get an object's style object given its id
	    if(document.getElementById && document.getElementById(objectId)) {
		// W3C DOM
		return document.getElementById(objectId).style;
	    } else if (document.all && document.all(objectId)) {
		// MSIE 4 DOM
		return document.all(objectId).style;
	    } else if (document.layers && document.layers[objectId]) {
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
	    } else {
		return false;
	    }
	} 
	
	function changeObjectVisibility(objectId, newVisibility) {
	    // get a reference to the cross-browser style object and make sure the object exists
	    var styleObject = getStyleObject(objectId);
	    if(styleObject) {
		styleObject.visibility = newVisibility;
		return true;
	    } else {
		//we couldn't find the object, so we can't change its visibility
		return false;
	    }
	} 
// ||||||||||||||||||||||||||||||END TRANSITION EFFECT|||||||||||||||||||||

function showLayer(layerName, shadowLayerName){
	if (document.getElementById){
          	var targetElement = document.getElementById(layerName);
          	var shadowElement = document.getElementById(shadowLayerName);
          	targetElement.style.top = shadowElement.style.top;
          	targetElement.style.display = 'block';
      	}
  	}
  	function hideLayer(layerName){
   	if (document.getElementById){
		var targetElement = document.getElementById(layerName);
		targetElement.style.display = 'none';
      	}
  	}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
var ie4=document.all
var ns6=document.getElementById&&!document.all


// Hide all select boxes
function hideSelect() {
  if (document.all) {
    for (formIdx=0; formIdx<document.forms.length; formIdx++) {
      var theForm = document.forms[formIdx];
      for (elementIdx=0; elementIdx<theForm.elements.length; elementIdx++) {
        window.status += theForm[elementIdx].type;
        if(theForm[elementIdx].type == "select-one") {
          theForm[elementIdx].style.visibility = "hidden";
        }
      }
    }
  }
}
// Unhide all select boxes
function unhideSelect() {
  if (document.all) {
    for (formIdx=0; formIdx<document.forms.length; formIdx++) {
      var theForm = document.forms[formIdx];
        for(elementIdx=0; elementIdx<theForm.elements.length; elementIdx++) {
          if(theForm[elementIdx].type == "select-one") {
            theForm[elementIdx].style.visibility = "visible";
          }
         }
      }
  }
}




//For love window
//here you place the ids of every element you want.
var ids=new Array('a1','a2','a3','thiscanbeanything');

function switchid(id){	
	hideallids();
	showdiv(id);
}

function hideallids(){
	//loop through the array and hide each element by id
	for (var i=0;i<ids.length;i++){
		hidediv(ids[i]);
	}		  
}

function hidediv(id) {
	//safe function to hide an element with a specified id
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.visibility = 'hidden';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.visibility = 'hidden';
		}
		else { // IE 4
			document.all.id.style.visibility = 'hidden';
		}
	}
}

function showdiv(id) {
	//safe function to show an element with a specified id
		  
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.visibility = 'visible';
	}
	else {
		if (document.layers) { // Netscape 4
			document.id.visibility = 'visible';
		}
		else { // IE 4
			document.all.id.style.visibility = 'visible';
		}
	}
}


function toggleDiv(id,flagit) {

	if (flagit=="1"){

		if (document.layers) document.layers[''+id+''].visibility = "show"

		else if (document.all) document.all[''+id+''].style.visibility = "visible"

		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"

	}

	else

	if (flagit=="0"){

		if (document.layers) document.layers[''+id+''].visibility = "hide"

		else if (document.all) document.all[''+id+''].style.visibility = "hidden"

		else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"

	}

}

//screen size detection
	function detect(){
		if(screen.width<1024||screen.height<768){
			MM_showHideLayers('popLayer','','show');
			//alert("This web page is best viewed with a screen resolution of 1280 by 1024 or 
			//higher. Your current resolution is "+screen.width+" by "+screen.height+". If possible please 
			//change your resolution.")
		}
		else {
			//alert("Whoa, you have a high resolution. Nice Job!")
		}
	}

	//this part will call up detect if this is the first visit.
	var expDays = 1500; 
	
	// number of days the cookie should last
	function GetCookie (name) {
		var arg = name + "=";
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
		}
		return null;
	}

	function SetCookie (name, value) {
		var argv = SetCookie.arguments;
		var argc = SetCookie.arguments.length;
		var expires = (argc > 2) ? argv[2] : null;
		var path = (argc > 3) ? argv[3] : null;
		var domain = (argc > 4) ? argv[4] : null;
		var secure = (argc > 5) ? argv[5] : false;
		document.cookie = name + "=" + escape (value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
	}

	function DeleteCookie (name) {
		var exp = new Date();
		exp.setTime (exp.getTime() - 1);
		var cval = GetCookie (name);
		document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
	}

	var exp = new Date();
	exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
	function amt(){
		var count = GetCookie('count')
		if(count == null) {
		SetCookie('count','1')
		return 1
		}
		else {
		var newcount = parseInt(count) + 1;
		DeleteCookie('count')
		SetCookie('count',newcount,exp)
		return count
		}
	}

	function getCookieVal(offset) {
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1)
		endstr = document.cookie.length;
		return unescape(document.cookie.substring(offset, endstr));
	}

	function checkCount() {
		var count = GetCookie('count');
		if (count == null) {
		count=1;
		SetCookie('count', count, exp);
		detect();
		}

		else {
		count++;
		SetCookie('count', count, exp);
		}
	}

	function MM_changeProp(objName,x,theProp,theValue) { //v6.0
	  var obj = MM_findObj(objName);
	  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
		if (theValue == true || theValue == false)
		  eval("obj."+theProp+"="+theValue);
		else eval("obj."+theProp+"='"+theValue+"'");
	  }
	}
	
		function setOpacity(element, opacity) {
			// In NN / Moz, when opacity is 100, flickering occurs. If the opacity is reduced to 99.99, this does not happen.
			// This code will achieve this, if uncommented
			if (opacity == 100 && (navigator.userAgent.indexOf('Gecko') != -1 && navigator.userAgent.indexOf('Safari') == -1)) opacity = 99.99;

			// Set CSS 3, Moz, NN, FF, gecko, Konqueror, Safari
			element.style.opacity = element.style.MozOpacity = element.style.KhtmlOpacity = opacity / 100;

			// Set IE
			element.style.filter = 'alpha(opacity=' + opacity + ')';
		}



function HideContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.visibility = "hidden";

}
function ShowContent(d) {
if(d.length < 1) { return; }
document.getElementById(d).style.visibility = "visible";

}
function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
if(document.getElementById(d).style.visibility == "hidden") { document.getElementById(d).style.visibility = "visible"; }
else { hider(d); }
}

function hider(){
	HideContent('subNavigation');
	clearTimeout(this.timeout)
}
function stoper() {
	clearTimeout(hider);
	ShowContent('subNavigation');
}
  
function fileLinks() {
    var fileLink;
    if (document.getElementsByTagName('a')) {
        for (var i = 0; (fileLink = document.getElementsByTagName('a')[i]); i++) {
            if (fileLink.href.indexOf('.pdf') != -1) {
                fileLink.setAttribute('target', '_blank');
                fileLink.className = 'pdfLink';
            }
            if (fileLink.href.indexOf('.doc') != -1) {
                fileLink.setAttribute('target', '_blank');
                fileLink.className = 'docLink';
            }
           // if (fileLink.href.indexOf('.zip') != -1) {
            //    fileLink.setAttribute('target', '_blank');
            //    fileLink.className = 'zipLink';
            //}
        }
    }
}
//window.onload = function() {
//    fileLinks();
//}
