var bookmarkurl = window.location.href;
var bookmarktitle = document.title;
function addfav(){
    if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);
}


/*
var nw = '';

function newwindow(theURL) {
	if (!nw.closed && nw.location) {
		nw.location.href = theURL;
	}
	else {
		nw=window.open(theURL,'LargePicture','height=480,width=640,resizable=no,scrollbars=no');
		if (!nw.opener) nw.opener = self;
	}
	if (window.focus) {nw.focus()}
	//return false;
}
*/


function newwindow(sPicURL) {
	     window.open( "popup.htm?"+sPicURL, "",  
	     "resizable=0");
	   }
		
		function PopupHTML(sURL,sName,w,h,scroll){
			var winl = (screen.width-w)/2;
			var wint = (screen.height-h)/2;
			var settings ='height='+h+',';
			settings +='width='+w+',';
			settings +='top='+wint+',';
			settings +='left='+winl+',';
			settings +='scrollbars='+scroll+',';
			settings +='resizable=no';
			win=window.open(sURL,sName,settings);
			if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
		}
		
		



	
	function checkInquiry(){
		if (window.document.formEmail.txtInquiryName.value == "" || window.document.formEmail.txtInquiryEmail.value == "" || window.document.formEmail.txtInquiryComments.value == ""){
			if (window.document.formEmail.txtInquiryName.value == ""){
				window.document.formEmail.txtInquiryName.focus();
			}else if(window.document.formEmail.txtInquiryEmail.value == ""){
				window.document.formEmail.txtInquiryEmail.focus();
			}else if(window.document.formEmail.txtInquiryComments.value == ""){
				window.document.formEmail.txtInquiryComments.focus();
			}
			return false;
		}else{
			return true;
		}
	}
	
	function checkEmail(){
		if (window.document.formEmail.txtYourEmail.value == "" || window.document.formEmail.txtSendTo.value == ""){
			if (window.document.formEmail.txtYourEmail.value == ""){
				window.document.formEmail.txtYourEmail.focus();
			}else if(window.document.formEmail.txtSendTo.value == ""){
				window.document.formEmail.txtSendTo.focus();
			}
			return false;
		}else{
			return true;
		}
	}
	


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 ValidateForm(){
	var emailID=document.formENews.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		//alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	 Newsletter=window.open('', 'Newsletter', 'scrollbars=no,resizable=no,top=100,width=500,height=200');
	return true
 }
 
