
//---------------popup 04-06-2008

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=635,height=530,scrollbars=Yes');
return false;
}


//---------------

function tellpopup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=600,height=600,scrollbars=No');
return false;
}


function popimage(mylink, windowname)
{
var arrTemp=self.location.href.split("?");
   var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
   var NS = (navigator.appName=="Netscape")?true:false;
   
   iWidth = (NS)?window.innerWidth:document.body.clientWidth;
       iHeight = (NS)?window.innerHeight:document.body.clientHeight;
       iWidth = document.images[0].width - iWidth;
       iHeight = document.images[0].height - iHeight;
	   //alert(iHeight);
	   
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;

window.open(href, windowname, 'width=700,height=600,scrollbars=Yes');
return false;
}

//---- Join Mailing List 
function validForm()
{
	//---------- First Name  ----------
		if ( document.frmInterest.first_name.value == ""  )
  		 {if (!(PrintMesg(document.frmInterest.first_name,"Please enter the First Name.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmInterest.first_name))
   		 {if (!(PrintMesg(document.frmInterest.first_name,"Please enter First Name other than space.")))
    		{return false;}}
		 }
	
	//---------- Last Name  ----------
		if ( document.frmInterest.last_name.value == ""  )
  		 {if (!(PrintMesg(document.frmInterest.last_name,"Please enter the Last Name.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmInterest.last_name))
   		 {if (!(PrintMesg(document.frmInterest.last_name,"Please enter Last Name other than space.")))
    		{return false;}}
		 }

/*	
	//----------  tel Phone  ----------	
	if (! document.frmInterest.telno.value == ""  )
  		 {if (isNaN(document.frmInterest.telno.value))
   			{
				alert("Please enter your phone number");
				document.frmInterest.telno.focus()
				return false;
		}}	
	
*/

	//----------  Email  ----------
		
	mail = document.frmInterest.submit_by.value
 	if (mail  == "")
    {if (!(PrintMesg(document.frmInterest.submit_by,"Please enter Email address")))
    {return false;}}
 	else 
	{ 

  		 n = mail.indexOf("@")
   		if (n >= 0)
   		{ newstr = mail.substring(n)
	 	  n= newstr.indexOf(".")
	 	  if (n<0)
	    	{if (!(PrintMesg(document.frmInterest.submit_by,"Please Enter a valid E-mail Address")))
	    	{return false;}}
   		} 
   		else
    	{if (!(PrintMesg(document.frmInterest.submit_by,"Please Enter a valid E-mail Address")))
    	{return false;}}}	
	
	//---------- Post Code  ----------
		if ( document.frmInterest.postcode.value == ""  )
  		 {if (!(PrintMesg(document.frmInterest.postcode,"Please enter the Post Code.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmInterest.postcode))
   		 {if (!(PrintMesg(document.frmInterest.postcode,"Please enter Post Code other than space.")))
    		{return false;}}
		 }
		return true;
}
//------- Here ends



//prints messages
function PrintMesg(ctrlvar,mesg)
{ alert(mesg); ctrlvar.focus(); return false }

// function to check spaces
function SpaceChk(ctrlvar)
{
   chkstr     = ctrlvar.value
   stlength   = chkstr.length
   spacecount = 0
   if (stlength >0)  {
    for(i=0;i<=stlength;i++)
     if ( chkstr.charAt(i)==" ") { spacecount=spacecount+1  }
    if (stlength == spacecount) { return false }
   return true }
}
