function showPic (curPrdID){
	linkUrl="showPic.php?prdID="+curPrdID;
	var pWidth=750;
	var pHeight=750;
	curY=(screen.height/2)-(parseFloat(pHeight)/2);
	curX=(screen.width/2)-(parseFloat(pWidth)/2);
	attributes="width="+pWidth+", height="+pHeight+", top="+curY+", left="+curX+", resizable=yes, location=no, menubar=no, toolsbar=no, directories=no";
	window.open(linkUrl, 'prdPic', attributes);	
}

function showMap (mapPic){
	linkUrl="showMap.php?mapPic="+mapPic;
	var pWidth=600;
	var pHeight=600;
	curY=(screen.height/2)-(parseFloat(pHeight)/2);
	curX=(screen.width/2)-(parseFloat(pWidth)/2);
	attributes="width="+pWidth+", height="+pHeight+", top="+curY+", left="+curX+", resizable=yes, location=no, menubar=no, toolsbar=no, directories=no";
	window.open(linkUrl, 'mapPic', attributes);	
}


function checkEmail(str) {
///// function for validating email address
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		    return false
		} else if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		    return false
		} else 	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		} else  if (str.indexOf(at,(lat+1))!=-1){
		    return false
		} else 	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   return false
		} else  if (str.indexOf(dot,(lat+2))==-1){
		    return false
		} else if (str.indexOf(" ")!=-1){
		     return false
		} else {
 		 	return true					
 		}
}

function checkContactSub(){
	if (document.contactForm.contact_fullName.value=="" ||
		document.contactForm.contact_email.value==""){
			alert ("Please enter your full name & E-mail address");
			return false;
	 } else if (!checkEmail(document.contactForm.contact_email.value)){
	 	alert ("Your E-mail address is not valid");
	 	return false;
	} else if (document.contactForm.contact_body.value==""){
		alert ("Please enter E-mail message");
		return false;
	} else {
		return confirm ("Send E-mail?");
	}
}