///////////////////////////////////////////////// view the caption image /////////////////////////////////////////////////////
function openCenteredWindow(url) {
	
    var width = 365;
    var height = 500;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "subWind", windowFeatures);

}

function echeck(str) 
{

	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   //alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	  // alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	   // alert("Invalid E-mail ID")
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
	   // alert("Invalid E-mail ID")
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		//alert("Invalid E-mail ID")
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
	   // alert("Invalid E-mail ID")
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		//alert("Invalid E-mail ID")
		return false
	 }
	 return true					
}

function feedbackJ(frmm)
{
	msg = "";
	if(frmm.fd_name.value=="")
	{
		msg += "- Please type the Name.\n";
	}
	if(frmm.email.value=="")
	{
		msg += "- Please type the email address.\n";
	}
	if (echeck(frmm.email.value)==false)
	{
		//form.email.value=""
		frmm.email.focus()
		msg+= "- Invalid Email Address.\n";
	}
	if(frmm.address.value=="")
	{
		msg += "- Please type the address.\n";
	}
	if(frmm.country.value=="")
	{
		msg += "- Please select one of the country.\n";
	}
	if(frmm.feedback.value=="")
	{
		msg += "- Please type the feedback message.\n";
	}
	if(msg!="")
	{
		alert(msg);
		msg="";
		return false;
	}
	else
	{
		return true;
	}	
}
function newsLetter(form)
{
	
	msg = "";
	if(form.email.value=="")
	{
		msg += "- Please type the email address.\n";
	}
	if (echeck(form.email.value)==false)
	{
		//form.email.value=""
		form.email.focus()
		msg+= "- Invalid Email Address.\n";
	}
	if(msg!="")
	{
		alert(msg);
		msg="";
		return false;
	}
	else
	{
		return true;
	}
}