//---------------Contact-------------------------------------------
// validation for contact us form
function Validatetcontact()

	{


	//---------- Name  ----------
		if ( document.frmContact.Name.value == ""  )
  		 {if (!(PrintMesg(document.frmContact.Name,"Please enter the Your Name.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmContact.Name))
   		 {if (!(PrintMesg(document.frmContact.Name,"Please enter Your Name other than space.")))
    		{return false;}}
		 }

		


			//---------- Telephone  ----------
		if (document.frmContact.Number.value == ""  )
  		 {if (!(PrintMesg(document.frmContact.Number,"Please enter Contact Number.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmContact.Number))
   		 {if (!(PrintMesg(document.frmContact.Number,"Please enter Contact Number other than space.")))
    		{return false;}}
		 }
		 
		 
		//--------e-mail
	mail = ""
	mail =document.frmContact.Email.value
 	if (mail  == "")
    {if (!(PrintMesg(document.frmContact.Email,"Please enter E-mail Address.")))
    {return false;}}
	 else { 
   	n = mail.indexOf("@")
   	if (n >= 0)
   	{ newstr = mail.substring(n)
	 n= newstr.indexOf(".")
	 if (n<0)
	    {if (!(PrintMesg(document.frmContact.Email,"Please enter a valid E-mail Address.")))
	    {return false;}}
   	} 
   	else
    {if (!(PrintMesg(document.frmContact.Email,"Please enter a valid E-mail Address.")))
    {return false;}}
 	}
		
		return true;
	}


//---------------End Contact-------------------------------------------

//---------------Try It-------------------------------------------

function Validatetryit()

	{


	//---------- Name  ----------
		if ( document.frmTryit.Name.value == ""  )
  		 {if (!(PrintMesg(document.frmTryit.Name,"Please enter the Name/Group name.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmTryit.Name))
   		 {if (!(PrintMesg(document.frmTryit.Name,"Please enter Name/Group name other than space.")))
    		{return false;}}
		 }

		//----------Person	  ----------
		if (document.frmTryit.Person.value == ""  )
  		 {if (!(PrintMesg(document.frmTryit.Person,"Please enter the Contact Person.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmTryit.Person))
   		 {if (!(PrintMesg(document.frmTryit.Person,"Please enter Contact Person other than space.")))
    		{return false;}}
		 }


			//---------- Telephone  ----------
		if (document.frmTryit.Number.value == ""  )
  		 {if (!(PrintMesg(document.frmTryit.Number,"Please enter Contact Number.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmTryit.Number))
   		 {if (!(PrintMesg(document.frmTryit.Number,"Please enter Contact Number other than space.")))
    		{return false;}}
		 }
	
		//----------Address	  ----------
		if (document.frmTryit.Address.value == ""  )
  		 {if (!(PrintMesg(document.frmTryit.Address,"Please enter the Practice address.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmTryit.Address))
   		 {if (!(PrintMesg(document.frmTryit.Address,"Please enter Practice address other than space.")))
    		{return false;}}
		 }



		 
		 
		//--------e-mail
	mail = ""
	mail =document.frmTryit.Email.value
 	if (mail  == "")
    {if (!(PrintMesg(document.frmTryit.Email,"Please enter E-mail Address.")))
    {return false;}}
	 else { 
   	n = mail.indexOf("@")
   	if (n >= 0)
   	{ newstr = mail.substring(n)
	 n= newstr.indexOf(".")
	 if (n<0)
	    {if (!(PrintMesg(document.frmTryit.Email,"Please enter a valid E-mail Address.")))
	    {return false;}}
   	} 
   	else
    {if (!(PrintMesg(document.frmTryit.Email,"Please enter a valid E-mail Address.")))
    {return false;}}
 	}
		
		return true;
	}


//---------------End Try It-------------------------------------------

//---------------Online-------------------------------------------

function Validatetonline()

	{


	//---------- Name  ----------
		if ( document.frmOnline.Name.value == ""  )
  		 {if (!(PrintMesg(document.frmOnline.Name,"Please enter the Name/Group name.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmOnline.Name))
   		 {if (!(PrintMesg(document.frmOnline.Name,"Please enter Name/Group name other than space.")))
    		{return false;}}
		 }

		//----------Person	  ----------
		if (document.frmOnline.Person.value == ""  )
  		 {if (!(PrintMesg(document.frmOnline.Person,"Please enter the Contact Person.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmOnline.Person))
   		 {if (!(PrintMesg(document.frmOnline.Person,"Please enter Contact Person other than space.")))
    		{return false;}}
		 }


			//---------- Telephone  ----------
		if (document.frmOnline.Number.value == ""  )
  		 {if (!(PrintMesg(document.frmOnline.Number,"Please enter Contact Number.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmOnline.Number))
   		 {if (!(PrintMesg(document.frmOnline.Number,"Please enter Contact Number other than space.")))
    		{return false;}}
		 }
	
		//----------Address	  ----------
		if (document.frmOnline.Address.value == ""  )
  		 {if (!(PrintMesg(document.frmOnline.Address,"Please enter the Practice address.")))
   			{return false;}}
		 else  { 
   		if (!SpaceChk(document.frmOnline.Address))
   		 {if (!(PrintMesg(document.frmOnline.Address,"Please enter Practice address other than space.")))
    		{return false;}}
		 }



		 
		 
		//--------e-mail
	mail = ""
	mail =document.frmOnline.Email.value
 	if (mail  == "")
    {if (!(PrintMesg(document.frmOnline.Email,"Please enter E-mail Address.")))
    {return false;}}
	 else { 
   	n = mail.indexOf("@")
   	if (n >= 0)
   	{ newstr = mail.substring(n)
	 n= newstr.indexOf(".")
	 if (n<0)
	    {if (!(PrintMesg(document.frmOnline.Email,"Please enter a valid E-mail Address.")))
	    {return false;}}
   	} 
   	else
    {if (!(PrintMesg(document.frmOnline.Email,"Please enter a valid E-mail Address.")))
    {return false;}}
 	}
		
		return true;
	}



// ----------End Online -------------------


//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 }
}


//open a new window for link
function showWindow(sUrl)
{
	window.open (sUrl);
}