//      .::.  gyrewire.com JavaScript library  .::.


//    .::.  Browser check  .::.

IS_DOM = (document.getElementById) ? true : false;
IS_IE = (document.all) ? true : false;
IS_IE50 = (navigator.userAgent.indexOf("IE 5.0") != -1);
IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);
IS_IE5Mac = IS_IE && IS_Mac && IS_DOM;
var browserName = navigator.appName;


	
function getThis(sId){

		var oObject;
		oObject = false;
		
		if (IS_DOM) {
			if (document.getElementById(sId)) {
				oObject = document.getElementById(sId);
			}
		}
		else if (IS_IE)
		{
			if (document.all[sID]) {
				oObject = document.all[sID];
			}
		}
		return oObject;
}




function toggleDisplay(sDivID){
	
	clearLayerDisplay();
	
	var targetLayer = getThis(sDivID);

	if(targetLayer.style.display == 'none'){
		targetLayer.style.display = 'block';
	}else{
		targetLayer.style.display = 'none';
	}
	
}

function clearLayerDisplay(){
	
	for(i=1; i<=7; i++)
	{
		
		var targetLayer = getThis("lyr"+i);
		targetLayer.style.display = "none";
		
	}
	
}


function toggleZ(sDivID){

	
	var targetLayer = getThis(sDivID);

	if(targetLayer.style.zIndex != '100'){
		targetLayer.style.zIndex = '100';
	}else{
		targetLayer.style.zIndex = '1';
	}
	
}

//toggle admin/edit layers


function toggleLayerDisplay(sDivID){
					   
			var ndTargetLayer = getThis(sDivID);

			if(ndTargetLayer.style.display == 'none'){
				ndTargetLayer.style.display = 'block';
			}else{
				ndTargetLayer.style.display = 'none';
			}
			
}


//swap the source of an image

function swapImg(oldImg,newImg){

		var tL = getThis(oldImg);
		tL.src = 'projectImages/' + newImg;


}


//open new window with image, then resize
function openwindowlink(image) {
var photo=window.open('','', 'height=500, width=500, scrollbars=1, resizable');

photo.document.write("<html>");
photo.document.write("<head>");
photo.document.write("<title>Photos</title>");
photo.document.write("<Script Language=\"JavaScript\" type=\"text/JavaScript\">");
photo.document.write("var ns = (navigator.appname == \"Netscape\")? true:false;");
photo.document.write("function winsize(){");
photo.document.write("var width = (ns)? window.innerwidth:document.body.clientWidth;");
photo.document.write("var height = (ns)? window.innerheight:document.body.clientHeight;");
photo.document.write("width = document.images[0].width - width;");
photo.document.write("height = document.images[0].height - height;");
photo.document.write("self.resizeBy(width + 20, height + 50);");
photo.document.write("self.moveTo(0,0);");
photo.document.write("self.focus();");
photo.document.write("};");
photo.document.write("<\/Script>");
photo.document.write("<link href=\"folio.css\" rel=\"stylesheet\" type=\"text/css\">");
photo.document.write("</head>");
photo.document.write("<body align=\"center\" >");
photo.document.write("<div align=\"center\" class=\"photo_table\" >");
photo.document.write("<span class=\"header_smaller\" style=\"padding-bottom:10px;\">Click on the image below to close the window.....</span><br><br>");
photo.document.write("	<img src="+image+" onLoad='winsize();' onClick='javascript:window.close();'>");
photo.document.write("</div>");
photo.document.write("</body>");
photo.document.write("</html>");


return;
}


// .::.  Site Specific Functions  .::.


function init(){
	
	var contentLyr = getThis('contentHold');
	contentLyr.style.display = "block";
	var contentLyr = getThis('consoleBG');
	contentLyr.style.display = "block";	
	var footLyr = getThis('footer');
	footLyr.style.display = "block";	
	footLyr.style.zIndex = "300";	
	var commentLyr = getThis('comments');
	commentLyr.style.display = "block";	
	commentLyr.style.zIndex = "301";	

}




