/*
Function for displaying hidden elements
*/
function showCont(box) {
   	if (document.getElementById) {
   		document.getElementById(box).style.visibility="visible";
   	} else {
   		if (document.layers) { 
   			document.layers[box].visibility='show';	
   		} else { 
   			document.all[box].style.visibility='visible';
   		}
   	}
}	

/*
Function for hiding displayed elements
*/
function hideCont(box) {
   	if (document.getElementById) {
   		document.getElementById(box).style.visibility="hidden";
   	} else {
   		if (document.layers) { 
   			document.layers[box].visibility='invisible';	
   		} else { 
   			document.all[box].style.visibility='hidden';
   		}
   	}
}

/*
Function for displaying blow-ups of
drawing for featured products
*/

function dispDrawing(path,imgWidth,imgHeight) {
	var picCont=document.getElementById('picCont');
//Check height of browser content
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    	myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
  	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    	myWidth = document.documentElement.clientWidth;
	    myHeight = document.documentElement.clientHeight;
  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    	myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
  	}

//Check top coordinate of scrolled page	
  	var scrOfX = 0, scrOfY = 0;
  	if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    	scrOfY = window.pageYOffset;
	    scrOfX = window.pageXOffset;
  	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    	scrOfY = document.body.scrollTop;
    	scrOfX = document.body.scrollLeft;
  	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    	scrOfY = document.documentElement.scrollTop;
	    scrOfX = document.documentElement.scrollLeft;
  	}

//Check parameter for which picture to display and save height and width of image
	picCont.innerHTML="<img src=\"pics/jpclogo.gif\" style=\"position: absolute; top: 10px; left: 0px;\"><div style=\"position: absolute; top: 12px; left: 592px; width: 200px; text-align: right; font-family: arial; font-size: 10px; font-weight: bold; color: #23737a;\">Northern California: (530) 865-6045<br>Southern California: (909) 429-4112<br><a class=\"head\" href=\"mailto:k-rail@jensenprecast.com?Subject=K-Rail Inquiry\">k-rail@jensenprecast.com<a></div><img id=\"pic1\" src=\"" + path + "\" style=\"border-style: solid; border-color: #000000; border-width: 1px; z-index: 2;\" alt=\"\"/><div class=\"head\" style=\"position: absolute; top: 594px; left: 50px; width: 700px; text-align: center; font-size: 14px;\" onclick=\"hideCont('picCont');\">Close Window</div>";

//Calculation - (Height of screen / 2) + (Scrolled coordinate minus half of (img height + 6)) 	
	picPad=document.getElementById('picCont').style.padding
	formPad=Number(picPad.replace("px",""));
	finPad=formPad*2;
  	divTop=myHeight/2+scrOfY-(imgHeight+finPad)/2;
	divLeft=myWidth/2-(imgWidth+finPad)/2;

//Position Div	
	picCont.style.top=divTop + "px";	
	picCont.style.left=divLeft + "px";
	
//Make Div Visible	
	showCont('picCont');

		
}
