// JavaScript Document
function getcert(value){
	var product = document.getElementById('getcert_p').value
	var date = document.getElementById('getcert_d').value
	if(product>'' && date>''){
		document.getElementById('getcert_s').disabled = false;
	}else{
		document.getElementById('getcert_s').disabled = true;
	}
}
function viewReport(){
	var we = document.getElementById('getcert_d').value;
	var product = document.getElementById('getcert_p').value;
	
	if(we>'' && product>''){
		window.popupWindow('../../LafargeCBase/product_cert.asp?p='+product+'&wed='+we,'productCertificate',600,600,'directories=yes,status=yes,resizable=yes,scrollbars=yes,location=1,menubar=yes,left=0,top=0') ;
	}else{
		document.getElementById('getcert_error').innerHTML = '<p>You must select a product, plant and a week ending date.</p>';
	}
}
function popupWindow(url, windowName, width, height, customparameters)
{
	//Determine the browser if positioning of pop-up window is supported
	theversion=navigator.appVersion.substring(0,3);
	
	if (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) == '4')
	{
		X = screenX + myscreen(outerWidth-width)/2;
		myscreenY = screenY + (outerHeight-height)/2;
	}
	else
	{
		//IE & Nav3 don't do positioning, variables just have to exist...
		myscreenX = 0;
		myscreenY = 0;
	}
	
	if (customparameters)
	{
		windowparams = customparameters
	}
	else
	{
		windowparams = "directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no"
	}
	
	//Default window name if not passed to function
	if (!windowName)
	{
		windowName = "popup_window";
	}
	
	popupWindowObj = window.open(url, windowName, "toolbar=no,width=" + width + ",height=" + height + ",screenX=" + myscreenX + ",screenY=" + myscreenY + "'," + windowparams) ;
	popupWindowObj.focus() ;
}