
/************************************************************** 
                  Validation Script Written by Emadullah Gawai
                          
                         http://www.gawai.8m.com
**************************************************************/

var strAlertMsg = ""
var focusField = ""


//========================================================================
//Begin Page Validation
function validMailFrm(){
strAlertMsg = ""
focusField = ""
x = document.forms[0];        
    isEmail1('fromEmail','Your Valid Email Address')
    //isEmail('toEmail','Friend Valid Email Address')    
    
   if(strAlertMsg !=""){
         alert("Please correct the following errors:\n___________________________\n\n" + strAlertMsg);
         //eval("x." + focusField + ".focus()");
       return false;
   }
   return true;
}

//================================================================


	function validCommentFrm() {
		    var strAuthor = document.commentForm.author.value;
		    strAuthor = strAuthor.split(" ").join("")
		    if(strAuthor.length<1){
			 alert('Please Enter your name');
		    	 document.commentForm.author.focus();
			 return false;
		    }

		    var strEmail = document.commentForm.email.value;
		    var bolValid = true;
			 if(strEmail.length < 7){
			 	alert('Please Enter your Email Address');
				document.commentForm.email.focus();
				return false;
			 }
			 if(strEmail.lastIndexOf(" ") >0){
			 	alert('Please Enter your Email Address');
				document.commentForm.email.focus();
				return false;
			 }
			 var intLastDot = strEmail.lastIndexOf(".")
			 if(intLastDot == -1 ||  strEmail.length - intLastDot >4){
			 	alert('Please Enter your Email Address');
				document.commentForm.email.focus();
				return false;
			 }
			 var intAt = strEmail.lastIndexOf("@")
			 if(intAt == -1 ||  strEmail.length - intAt < 5){
			 	alert('Please Enter your Email Address');
				document.commentForm.email.focus();
				return false;
			 }


		    var strComment = document.commentForm.comment.value;
		    strComment = strComment.split(" ").join("")
		    if(strComment.length<1){
			 alert('Please Enter your Comments');
		    	 document.commentForm.comment.focus();
		    	 return false;
		    }

		    var strCode = document.commentForm.security_code.value;
		    strCode = strCode.split(" ").join("")
		    if(strCode.length<1){
			 alert('Please Enter Security code');
		    	 document.commentForm.security_code.focus();
		    	 return false;
		    }



	  return true;
	}


        
//----------------------------------
//========================================================================
//Validate Us Phone. Ex. (999) 999-9999 or (999)999-9999
function isPhone(strFieldName,strMsg)     {
    var objFormField = document.forms[1].elements[strFieldName];
    var strValue = objFormField.value;
    var objRegExp  = /^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/;
     if(!objRegExp.test(strValue)){
         strAlertMsg += "- "+ strMsg +" is Required.\n    Example:\n(999)999-9999 or (999) 999-9999\n";
    if(!focusField) focusField=""+ strFieldName +"";
         return false;
         }
    return true;
}
//========================================================================
//Validate US zip code in 5 digit format or zip+4 format. 99999 or 99999-9999
function isZipCode(strFieldName,strMsg)     {
    var objFormField = document.forms[1].elements[strFieldName];
    var strValue = objFormField.value;
    var objRegExp  = /(^\d{5}$)|(^\d{5}-\d{4}$)/;
    if(!objRegExp.test(strValue)){
         strAlertMsg += "- "+ strMsg +" is Required.\n";
    if(!focusField) focusField =""+ strFieldName +"";
         return false;
         }
    return true;
}
//==========================================================================
//Validate the Select
function hasSelection(strFieldName,strMsg)     {
    var objFormField = document.forms[1].elements[strFieldName];
    if(objFormField.selectedIndex ==0)     {
         strAlertMsg += "- "+ strMsg +" is Required.\n";
          return false; 
           }
    return true; 
}
//========================================================================
//Validate Check Box
function isChecked(strFieldName,strMsg) {
    var objFormField= document.forms[1].elements[strFieldName];
    var strValue= objFormField.checked;
    if (!strValue) {
         //alert("The \""+ strMsg +"\" box is checked!")
         //} else {
         strAlertMsg += "- "+ strMsg +" is Required.\n";
    if(!focusField) focusField =""+ strFieldName +"";
         return false;
         }
    return true;
}
//========================================================================
//========================================================================
//Validate Radio Button
function checkRadioControl(strFieldName,strMsg){
         var objFormField = document.forms[1].elements[strFieldName]
         intControlLength = objFormField.length
         bolSelected = false;
         for (i=0;i<intControlLength;i++){
         if(objFormField[i].checked){
         bolSelected = true;
         break;
         }
    }     
     if(! bolSelected){
         strAlertMsg += "- "+ strMsg +" is Required.\n";
         return false;
         }
    return true;
}
//========================================================================
//Compare the Fields
function compareFields(strFieldName1,strFieldName2,strMsg){
         var objFormField1= document.forms[1].elements[strFieldName1];
         var objFormField2= document.forms[1].elements[strFieldName2];
         var strValue1= objFormField1.value;
         var strValue2= objFormField2.value;
    if(strValue1 != strValue2){
         strAlertMsg +="The "+ strMsg +" fields do not match, please try again.\n"; 
     if(!focusField) focusField =""+ strFieldName1 +"";
         return false; 
          }
    return true;
}
//========================================================================
//Format Phone Number 9999999999 = (999)999-9999
//Call the function like so onKeyPress="javascript:formatPhone(this);
function formatPhone(objFormField){
    intFieldLength = objFormField.value.length;
    if(intFieldLength == 3){
         objFormField.value = "(" + objFormField.value + ") ";
         return false;
         }
   if(intFieldLength >= 9 && intFieldLength <= 10){
       objFormField.value = objFormField.value + "-";
       return false;
       }
}
//========================================================================


/*****************************************************
%%%%%%%%%%%%******* Developed By :******%%%%%%%%%%%%%%
***************** Emadullah Gawai ********************
************ HTTP://WWW.GAWAI.8M.COM *****************
***************** Text Validator  *******************/

function isText(strFieldName,strMsg) {    
    var objFormField = document.forms[1].elements[strFieldName]
	var strText = objFormField.value;
	var bolValid = true;
	
	if ((strText == "")||(strText==" ")){
		bolValid = false;
	}	
	
	if((strText.substring(0,1)<"a" || strText.substring(0,1)>"z") && (strText.substring(0,1)<"A" || strText.substring(0,1)>"Z"))
		{
			bolValid = false;
		}
		for (var i = 1; i < strText.length; i++)
		{
			var ch = strText.substring(i, i + 1);
			if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != " "))
			{
				bolValid = false;
			}
		}
	if(!bolValid){
		strAlertMsg += "- "+ strMsg +" is Required.\n";
		if(!focusField) focusField =""+ strFieldName +"";
         }
	return bolValid;
}

/***************************************
************  Email Validator  ******** 
***************************************/
function isEmail(strFieldName,strMsg) {
	var objFormField = document.forms[1].elements[strFieldName]
	var strEmail = objFormField.value;
    	var bolValid = true;
    	
 	var strCount;
 	var noOfAt;
 	strCount = strEmail.split("@");
	noOfAt = strEmail.length - 1;
	
	if (strEmail<1){		
		bolValid = false;		
	}
	
	if (strEmail.indexOf("@")<3){
		bolValid = false;
	}
	
	else if ((strEmail.indexOf(".com")<5)&&(strEmail.indexOf(".org")<5)
		&&(strEmail.indexOf(".gov")<5)&&(strEmail.indexOf(".net")<5)
		&&(strEmail.indexOf(".co")<5)&&(strEmail.indexOf(".tv")<5)
		&&(strEmail.indexOf(".ws")<5)&&(strEmail.indexOf(".am")<5)
		&&(strEmail.indexOf(".nl")<5)&&(strEmail.indexOf(".ru")<5)
		&&(strEmail.indexOf(".in")<5)&&(strEmail.indexOf(".id")<5)
		&&(strEmail.indexOf(".ae")<5)&&(strEmail.indexOf(".de")<5)
		&&(strEmail.indexOf(".kw")<5)&&(strEmail.indexOf(".us")<5)
		&&(strEmail.indexOf(".ns")<5)&&(strEmail.indexOf(".uk")<5)
		&&(strEmail.indexOf(".om")<5)&&(strEmail.indexOf(".ae")<5)
		&&(strEmail.indexOf(".mil")<5)&&(strEmail.indexOf(".edu")<5)){
		bolValid = false;
	}
	
	if((strEmail.substring(0,1)<"a" || strEmail.substring(0,1)>"z") && (strEmail.substring(0,1)<"A" || strEmail.substring(0,1)>"Z"))
	{
		bolValid = false;
	}
	
	for (var i = 1; i < strEmail.length; i++)
	{
		var ch = strEmail.substring(i, i + 1);		
		if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch < "0" || "9" < ch)  && (ch != "@") && (ch != ".") && (ch != "_") && (ch != "-"))
		{
			bolValid = false;
		}
	}  

	
	if(!bolValid){
		strAlertMsg += "- "+ strMsg +" is Required.\n";
	    	if(!focusField) focusField =""+ strFieldName +"";
	}	
	return bolValid;
	}
	
//***************** Password Validator  *******************/

function isPwd(strFieldName,strMsg) {    
    var objFormField = document.forms[1].elements[strFieldName]
	var strPwd = objFormField.value;
	var bolValid = true;
	
	if ((strPwd == "")||(strPwd==" ")){
		bolValid = false;
	}	
	
	if((strPwd.substring(0,1)<"a" || strPwd.substring(0,1)>"z") && (strPwd.substring(0,1)<"A" || strPwd.substring(0,1)>"Z"))
		{
			bolValid = false;
		}
		for (var i = 1; i < strPwd.length; i++)
		{
			var ch = strPwd.substring(i, i + 1);
			if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch < "0" || "9" < ch) && (ch != " "))
			{
				bolValid = false;
			}
		}
	if(!bolValid){
		strAlertMsg += "- "+ strMsg +" is Required.\n";
		if(!focusField) focusField =""+ strFieldName +"";
         }
	return bolValid;
}


/*********************************
******   Reg Key Validation  *****
*********************************/
function validateKey(){
strAlertMsg = ""
focusField = ""
x = document.forms[1];    
    isEmail('ID','Valid Email Address')
    isNumerics('key','Authorisation Key [Numbers Only]')
    
   if(strAlertMsg !=""){
         alert("Please correct the following errors:\n___________________________\n\n" + strAlertMsg);
         eval("x." + focusField + ".focus()");
       return false;
   }
   return true;
}


/****************************
***    Numeric Validation ***
****************************/
function isNumerics(strFieldName,strMsg) {    
    var objFormField = document.forms[1].elements[strFieldName]
	var intText = objFormField.value;
	var bolValid = true;
	
	if ((intText == "")||(intText==" ")){
		bolValid = false;
	}	
	
	if((intText.substring(0,1)<"0" || intText.substring(0,1)>"9"))
		{
			bolValid = false;
		}
		for (var i = 1; i < intText.length; i++)
		{
			var ch = intText.substring(i, i + 1);
			if ((ch < "0" || "9" < ch))
			{
				bolValid = false;
			}
		}
	if(!bolValid){
		strAlertMsg += "- "+ strMsg +" is Required.\n";
		if(!focusField) focusField =""+ strFieldName +"";
         }
	return bolValid;
}



/**************************************
*********** Update Validation **********
**************************************/

function updatePassword(objFrm)
{
	var str = objFrm.newpass.value;
	var str2 = objFrm.oldpass.value;
	if ((str == "") ||(str2 == ""))
	{
		alert("\nThe PASSWORD field is blank.\nPlease enter.")		
		return false;
	}
	var str2 = objFrm.conpass.value;
	if (str != str2)
	{
		alert("\nPasswords typed do not match, please re-enter your passwords.\n\n");
		objFrm.conpass.select();
		return false;
	}
	return true;
}

//========================================================================
//Compare the Fields
function compareFields(strFieldName1,strFieldName2,strMsg){
         var objFormField1= document.forms[1].elements[strFieldName1];
         var objFormField2= document.forms[1].elements[strFieldName2];
         var strValue1= objFormField1.value;
         var strValue2= objFormField2.value;
    if(strValue2 != strValue1){
         strAlertMsg +="- "+ strMsg +" do not match with password"; 
     if(!focusField) focusField =""+ strFieldName1 +"";
         return false; 
          }
    return true;
}

/***************************
******* Lgin Validation ****
***************************/

function loginValidate(objFrm)
 {
  var sf=objFrm.username.value;
  var sp=objFrm.userpassword.value;
   if(sf=="") {
     alert("Please enter Login Id");
     objFrm.username.focus();
     return false;
   }
   if(sp=="") {
       alert("Please enter Password");
       objFrm.userpassword.focus();
       return false;
   }
 return true;
 }

//==========================================================

///========================================================================
function seperate() {
var seperateDomain = new RegExp("^.*@");
var strValue1 = document.forms[1].newEmail;
var strValue2 = document.forms[1].domain;
  if (strValue1.value.match(seperateDomain)) {
    strValue2.value = "http://www." + strValue1.value.replace(seperateDomain,'');
  } else {
    strValue2.value = '';
  }
}

//========================================================================
function mixFunction(){
	validMailFrm()
	seperate()
}

//=========================================================================

/*************************************
********* Show Flash Movie *********
*************************************/

function showFlash(strId, strMovie, strBgColor, numWidth, numHeight, getsURL, winTarget) {
	if ( plugin ) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" ');
		document.write('id="' + strId +'" width="' + numWidth + '" height="' + numHeight + '">');
		document.write('<param name="movie" value="' + strMovie + '.swf?clickTag=' + getsURL + '&OpenTag=' + winTarget +'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="' + strBgColor + '">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="wmode" value="transparent">');	
		document.write('<embed name="product" src="' + strMovie + '.swf?clickTag=' + getsURL + '&OpenTag=' + winTarget +'" quality="high" bgcolor="' + strBgColor + '" swLiveConnect="true" ');
		document.write('width="' + numWidth + '" height="' + numHeight + '" type="application/x-shockwave-flash" ');
		document.write('pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write('</embed>');
		document.write('</object>');
	}
	if (! plugin ) {
		//document.write('<a href="' + getsURL + '" target="' + winTarget + '">');
		//document.write('<img border="0" src="' + strMovie + '.gif" width="' + numWidth + '" height="' + numHeight + '">');
		//document.write('</a>');
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" ');
		document.write('id="' + strId +'" width="' + numWidth + '" height="' + numHeight + '">');
		document.write('<param name="movie" value="' + strMovie + '.swf?clickTag=' + getsURL + '&OpenTag=' + winTarget +'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="' + strBgColor + '">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="wmode" value="transparent">');	
		document.write('<embed name="product" src="' + strMovie + '.swf?clickTag=' + getsURL + '&OpenTag=' + winTarget +'" quality="high" bgcolor="' + strBgColor + '" swLiveConnect="true" ');
		document.write('width="' + numWidth + '" height="' + numHeight + '" type="application/x-shockwave-flash" ');
		document.write('pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write('</embed>');
		document.write('</object>');
		
	}
	
}

/*************************************
********* New Flash Movie *********
*************************************/
function showNewFlash(strId, strMovie, strBgColor, numWidth, numHeight, getsURL, winTarget) {
	if ( plugin ) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" ');
		document.write('id="' + strId +'" width="' + numWidth + '" height="' + numHeight + '">');
		document.write('<param name="movie" value="' + strMovie + '.swf?clickTag=' + getsURL + '&winTag=' + winTarget +'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="' + strBgColor + '">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="wmode" value="transparent">');	
		document.write('<embed name="product" src="' + strMovie + '.swf?clickTag=' + getsURL + '&winTag=' + winTarget +'" quality="high" bgcolor="' + strBgColor + '" swLiveConnect="true" ');
		document.write('width="' + numWidth + '" height="' + numHeight + '" type="application/x-shockwave-flash" ');
		document.write('pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write('</embed>');
		document.write('</object>');
	
	}
	if (! plugin ) {
		/*document.write('<a href="' + getsURL + '" target="' + winTarget + '">');
		document.write('<img border="0" src="' + strMovie + '.gif" width="' + numWidth + '" height="' + numHeight + '">');
		document.write('</a>');*/
		
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ');
		document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,42,0" ');
		document.write('id="' + strId +'" width="' + numWidth + '" height="' + numHeight + '">');
		document.write('<param name="movie" value="' + strMovie + '.swf?clickTag=' + getsURL + '&winTag=' + winTarget +'">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="bgcolor" value="' + strBgColor + '">');
		document.write('<param name="menu" value="false">');
		document.write('<param name="wmode" value="transparent">');	
		document.write('<embed name="product" src="' + strMovie + '.swf?clickTag=' + getsURL + '&winTag=' + winTarget +'" quality="high" bgcolor="' + strBgColor + '" swLiveConnect="true" ');
		document.write('width="' + numWidth + '" height="' + numHeight + '" type="application/x-shockwave-flash" ');
		document.write('pluginspage="http://www.macromedia.com/go/getflashplayer">');
		document.write('</embed>');
		document.write('</object>');
		
	}
	

}


////////////////////////////////////////////////////
function ValidateFrmData(objFrm) {
	if(objFrm.t[0].checked){
		if(isName(objFrm)){
			objFrm.submit();
			return true;
		}
	}
	else{
		if(objFrm.t[1].checked){
			if(isEmail3(objFrm)){
				objFrm.submit();
				return true;
			}
	        }
	else{
		if (objFrm.t[2].checked){
	                if(isMobile(objFrm)){
	                	objFrm.submit();
	                	return true;
	                }
	        }
	}
	}
	return false;
}


function isName(objFrm) {
    var sn = objFrm.q.value;
	if ((sn == "")||(sn==" ")){
		alert("Name Field is blank. Please enter.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
	}	
	
	if((sn.substring(0,1)<"a" || sn.substring(0,1)>"z") && (sn.substring(0,1)<"A" || sn.substring(0,1)>"Z"))
		{
			alert("Please enter valid Name.\n\n\tThank you.");
			objFrm.q.select();
			return false;
		}
		for (var i = 1; i < sn.length; i++)
		{
			var ch = sn.substring(i, i + 1);
			if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != " "))
			{
				alert("Please enter valid Name.\n\n\tThank you.");
				objFrm.q.select();
				return false;
			}
		}
		return true;
}
function isPlace(objFrm){
var sn = objFrm.q.value;
	if ((sn == "")||(sn==" ")){
		alert("Place Field is blank. Please enter.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
	}	
		
	if((sn.substring(0,1)<"a" || sn.substring(0,1)>"z") && (sn.substring(0,1)<"A" || sn.substring(0,1)>"Z"))
	{
		alert("\Please specify valid Place name.\n\n\tThank you.");
		objFrm.q.select();
		return false;
	}
	for (var i = 1; i < sn.length; i++)
	{
		var ch = sn.substring(i, i + 1);
		if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch != " "))
		{
			alert("\Please specify valid Place name.\n\n\tThank you.");
			objFrm.q.select();
			return false;
		}
	}
	return true;
}

//************ Pace Validator  
function isMobile(objFrm){
var sn = objFrm.q.value;
	if ((sn == "")||(sn==" ")){
		alert("Place Field is blank. Please enter.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
	}	
		
	if((sn.substring(0,1)<"0" || sn.substring(0,1)>"9"))
	{
		alert("\Please specify valid Mobile/Phone Numbers.\n\n\tThank you.");
		objFrm.q.select();
		return false;
	}
	for (var i = 1; i < sn.length; i++)
	{
		var ch = sn.substring(i, i + 1);
		if ((ch < "0" || "9" < ch) && (ch != " "))
		{
			alert("\Please specify valid Mobile/Phone Numbers.\n\n\tThank you.");
			objFrm.q.select();
			return false;
		}
	}
	return true;
}

function isEmail3(objFrm) {
	var strEmail = objFrm.q.value;
    	var strCount;
 	var noOfAt;
 	strCount = strEmail.split("@");
 	
	noOfAt = strEmail.length - 1;
	
	if (strEmail<1){		
		alert("Enter Email Address.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
	
	}
	
	if (strEmail.indexOf("@")<3){
		alert("Enter Valid Email Address.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
		
	}
	
	else if ((strEmail.indexOf(".com")<5)&&(strEmail.indexOf(".org")<5)
		&&(strEmail.indexOf(".gov")<5)&&(strEmail.indexOf(".net")<5)
		&&(strEmail.indexOf(".co")<5)&&(strEmail.indexOf(".tv")<5)
		&&(strEmail.indexOf(".ws")<5)&&(strEmail.indexOf(".am")<5)
		&&(strEmail.indexOf(".nl")<5)&&(strEmail.indexOf(".ru")<5)
		&&(strEmail.indexOf(".in")<5)&&(strEmail.indexOf(".id")<5)
		&&(strEmail.indexOf(".ae")<5)&&(strEmail.indexOf(".de")<5)
		&&(strEmail.indexOf(".kw")<5)&&(strEmail.indexOf(".us")<5)
		&&(strEmail.indexOf(".ns")<5)&&(strEmail.indexOf(".uk")<5)
		&&(strEmail.indexOf(".om")<5)&&(strEmail.indexOf(".ae")<5)
		&&(strEmail.indexOf(".mil")<5)&&(strEmail.indexOf(".edu")<5)){
		alert("Enter Valid Email Address.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
		
	}
	
	if((strEmail.substring(0,1)<"a" || strEmail.substring(0,1)>"z") && (strEmail.substring(0,1)<"A" || strEmail.substring(0,1)>"Z"))
	{
		alert("Enter Valid Email Address.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
		
	}
	
	for (var i = 1; i < strEmail.length; i++)
	{
		var ch = strEmail.substring(i, i + 1);		
		if ( ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && (ch < "0" || "9" < ch)  && (ch != "@") && (ch != ".") && (ch != "_") && (ch != "-"))
		{
		alert("Enter Valid Email Address.\n\n\tThank you.");		
		objFrm.q.focus();
		return false;
			
		}
	}  	
	
	return true;
	
}
	
function popupWin(url){		
	window.open(url,"sahilOnline","height=700,width=750,top=0,left=0,scrollbars=yes,resizable=yes,toolbar=no")
	
}

function TafWin(url){
	var myPopup = window.open(url,"sahilOnline1","height=400,width=640,top=5,left=5,scrollbars=no,resizable=no,toolbar=no,directory=no")
	myPopup.focus();

}

function printWin(url){
	var myPopup = window.open(url,"sahilOnline2","height=550,width=700,top=0,left=0,scrollbars=yes,resizable=no,toolbar=no,directory=no")
	myPopup.focus();

}

function report(url){
	var myPopup = window.open(url,"sahilOnline3","height=500,width=600,top=50,left=50,scrollbars=yes,resizable=no,toolbar=no,directory=no")
	myPopup.focus();

}

//**************** <    Flash Detector   > ***************
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 3;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && navigator.userAgent.indexOf("Windows")>=0) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
	document.write('if ( plugin <= 0 ) then plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
	document.write('<\/SCR' + 'IPT\> \n');
}

//**************** </   Flash Detector   > ***************

function isEmail1(strFieldName,strMsg){
    var objFormField = document.forms[0].elements[strFieldName]
    var strEmail = objFormField.value;
    var bolValid = true;
         if(strEmail.length < 7){
         bolValid = false;
         }
         if(strEmail.lastIndexOf(" ") >0){
         bolValid = false;
         }
         var intLastDot = strEmail.lastIndexOf(".")
         if(intLastDot == -1 ||  strEmail.length - intLastDot >4){
         bolValid = false;
         }
         var intAt = strEmail.lastIndexOf("@")
         if(intAt == -1 ||  strEmail.length - intAt < 5){
         bolValid = false;
         }
         if(!bolValid){
         strAlertMsg += "- "+ strMsg +" is Required.\n";
    if(!focusField) focusField =""+ strFieldName +"";
         }
    return bolValid;
}
