function submitForm(){
	var errorMsg = "";
	if (document.contactUs.message.value=="") errorMsg +="Message\n";
	if (document.contactUs.firstName.value=="") errorMsg +="First Name\n";
	if (document.contactUs.lastName.value=="") errorMsg +="Last Name\n";
	if (document.contactUs.phone.value=="" && document.contactUs.email.value=="") errorMsg +="Telephone or Email\n";

	if (errorMsg=="")
		document.contactUs.submit();
	else 
		alert("The following fields are required :\n" + errorMsg);
}
function illustrationPopup(imageUrl) {
	//alert("test3");
	var image = new Image();
	image.src=imageUrl;
	
	var w= 700;
	var h = 700;
	var top = 'top';
	var left = 'left';
	
       var NS = (navigator.appName=="Netscape")?true:false;
       iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
       iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
       iWidth = image.width - iWidth; 
       iHeight = image.height - iHeight; 
       iWidth = image.width;
       iHeight = image.height;
       //alert(iHeight+' -- '+iWidth);
       //w = iWidth;
       //h = iHeight;

///////////////////////////////////////////////////////////////	
//       popup = window.open('/image.jsp?image='+imageUrl,
//       'ImagePopup',
//       ',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,height=700,width=700');
//       popup.focus();


//////////////////////////////////////////////////////////////////       
//        var largePic = window.open('','ImagePopup','status=yes,width='+w+',height='+h+',top='+((screen.height-h)/5)+',left='+((screen.width-w)/2.1));
//	var markup = ('<html>\n<head>\n<title>largePic<\/title>\n<script type="text\/javascript">\n<!--\n\nx = 0;\ndoc = document;\n\nfunction getCnt(){\nif(doc.images[0].complete){\nclearInterval(setInv);\ndoc.title = "Download Complete!";\n}else{\ndoc.title = "Loading: [" + x + "]";\nx++;\n}\n}\nvar setInv = setInterval(getCnt,10);\n\n\/\/-->\n<\/script>\n<\/head>\n<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="javascript:self.focus()">\n<img src="'+imageUrl+'" border="0" width="'+w+'" height="'+h+'" alt="ImagePopup" onclick="javascript:self.close();" style="cursor:pointer;" />\n<\/body>\n<\/html>');
//	largePic.document.open();
//	largePic.document.write(markup);
//	largePic.document.close();

///////////////////////////////////////////

which = imageUrl;
var theImg = new Image();
theImg.src = which;
var imgw = theImg.width;
var imgh = theImg.height;
//alert(imgw + " FRST-- "+imgh);
if(imgw<100){imgw = 700};
if(imgh<100){imgh = 700};
//alert(imgw + " -- "+imgh);
var ImgWin = window.open('','imgwin',config='height='+imgh+',width='+imgw+',top=0,left=0,scrollbars=yes')
with(ImgWin.document){
writeln('<html><head><title>Gurhan</title></head>');
writeln('<body onload="self.focus()" onblur="self.close()">');
writeln('<div style="text-align:center">');
writeln('<img src='+which+'></div>');
//writeln('<div style="text-align:center;font-size:9px">');
//writeln('<a href="#" onClick="self.close()">Close Me</a>');
writeln('</div></body></html>');
close();
}




}

function productPopup(popupUrl) {
	popup = window.open(popupUrl,
	'productPopup',
	',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes,height=470,width=408');
	popup.focus();	
}


function contactPopup(popupUrl) {
	//var prodId = document.getElementById('leftAnchorId').name;
	//var popupUrl = "/contact.jsp?product="+prodId +"&login=${param.login}&comp=${param.comp}";
	popWidth = 334;
	popHeight = 475;
	popLeft = (screen.width - popWidth) / 4;
	popTop = (screen.height - popHeight) / 4;
	popup = window.open(popupUrl,
						'contactPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
}

function printPopup(popupUrl) {
	//var prodId = document.getElementById('leftAnchorId').name;
	//var popupUrl = "/print.jsp?content=print&product="+prodId+"&login=${param.login}&comp=${param.comp}";
	popWidth = 900;
	popHeight = 473;
	popLeft = (screen.width - popWidth) / 4;
	popTop = (screen.height - popHeight) / 4;
	popup = window.open(popupUrl,
						'printPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
}

function emailPopup(popupUrl) {
	//var prodId = document.getElementById('leftAnchorId').name;
	//var popupUrl = "/email.jsp?version=print&product="+prodId+"&login=${param.login}&comp=${param.comp}";
	popWidth = 433;
	popHeight = 428;
	popLeft = (screen.width - popWidth) / 3;
	popTop = (screen.height - popHeight) / 3;
	popup = window.open(popupUrl,
						'emailPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
}


function productPopup2(leftAnchor) {
	//alert('Anchor : '+leftAnchor.name);
	var prodId = leftAnchor.name;
	var popupUrl = "/popup.jsp?content=cat2Popup&comp=33&product="+prodId;
//	alert(popupUrl);
	//popup = window.open(popupUrl,
	//					'productPopup',
	//					',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	//popup.focus();
	advancedPopup(popupUrl, 408, 497);
}

function productPopup3(leftAnchor) {
	//alert('Anchor : '+leftAnchor.name);
	var prodId = leftAnchor.name;
	var popupUrl = "/popup.jsp?content=cat2Popup&comp=33&product="+prodId;
//	alert(popupUrl);
	popup = window.open(popupUrl,
						'productPopup',
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes,height=497,width=408');
	popup.focus();
//	advancedPopup(popupUrl, 408, 497);
}

function emailPopup6(popupUrl) {
	//var popupUrl = "/email.jsp?version=print&product="+prodId+"&login=${param.login}&comp=${param.comp}";
	popWidth = 433;
	popHeight = 428;
	popLeft = (screen.width - popWidth) / 3;
	popTop = (screen.height - popHeight) / 3;
	popup = window.open(popupUrl,
						'emailPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
}

function contactPopup6(popupUrl) {
	//var popupUrl = "/contact.jsp?product="+prodId+"&login=${param.login}&comp=${param.comp}";
	popWidth = 334;
	popHeight = 475;
	popLeft = (screen.width - popWidth) / 4;
	popTop = (screen.height - popHeight) / 4;
	popup = window.open(popupUrl,
						'contactPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
}

function printPopup6(popupUrl) {
	//var popupUrl = "/print.jsp?content=print&product="+prodId+"&login=${param.login}&comp=${param.comp}";
	popWidth = 900;
	popHeight = 473;
	popLeft = (screen.width - popWidth) / 4;
	popTop = (screen.height - popHeight) / 4;
	popup = window.open(popupUrl,
						'printPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
} 

function productPopup6(popupUrl) {
	//var popupUrl = "/popup.jsp?content=cat1Popup&comp=${param.comp}&product="+prodId;
	popWidth = 574;
	popHeight = 436;
	popLeft = (screen.width - popWidth) / 3;
	popTop = (screen.height - popHeight) / 3;
	popup = window.open(popupUrl,
						'emailPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=no,resizable=yes');
	popup.focus();
}



function isEmail(who) {
	var email=/^[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}$/i;
	return(email.test(who));
}

function ccPopup(val) {
	var popupUrl = "/constantContact.jsp?email="+val;
//	alert(popupUrl);
	popWidth = 870;
	popHeight = 533;
	popLeft = (screen.width - popWidth) / 3;
	popTop = (screen.height - popHeight) / 3;
	popup = window.open(popupUrl,
						'ccPopup',
						'width=' + popWidth +
						',height=' + popHeight +
						',left=' + popLeft +
						',top=' + popTop +
						',menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=yes,resizable=yes');
	ccWindow=popup.focus();
}  

