function validation_free_user(doc)
{
     if((doc.log.value == "") || (doc.pass.value == ""))
     {
	 alert("Some fields are vacant");
	 return false;
     }
	
     if(doc.log.value != "")
     {
	   fsign = doc.log.value.indexOf("@");             
	   ssign = doc.log.value.indexOf(".");

	   if(fsign <= 0 || ssign <= 0)
	   {  
	     alert("Please enter login properly");
	     return false;
	   }
     }
}
function copypop()
{
         HM_NS4 = (document.layers) ? true : false;
	 HM_BrowserString1 = HM_NS4 ? "NS4" : "IE4";
	
	                
	                doc = "http://www.print-templates.com/termsofuse.htm";
	                if(HM_BrowserString1 == "NS4")
			 {
			  window.open (doc,"Copyright", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=625,height=350,screenX=0,screenY=0");
		         }
		        else
			 {
			  window.open (doc,"Copyright", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=625,height=350,left=0,top=0");
			 }
}
function thumb(pname,cid,mid,em)
{
         
         if(mid == '115129')
         {
         	window.parent.close();
	 }
         
         HM_NS4 = (document.layers) ? true : false;
	 HM_BrowserString1 = HM_NS4 ? "NS4" : "IE4";

	 doc = "display_prepress.php4"+"?cid="+cid+"&mid="+mid+"&em="+em+"&pName="+pname;
	 high = 400;
	    	    
	
	if(HM_BrowserString1 == "NS4")
	 {
		chartwin = window.open (doc,"lively2", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=689,height=525,screenX=50,screenY=40");

	 }
	else
	 {
	       chartwin = window.open (doc,"lively2", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=689,height=525,left=70,top=60");

	 }
}
function genesispop(ref,tef,ccd_f) 
{
         HM_NS4 = (document.layers) ? true : false;
	 HM_BrowserString1 = HM_NS4 ? "NS4" : "IE4";
	
	                
	doc = "downloadwin.php4"+"?def="+ref+"&lef="+tef+"&ccd="+ccd_f;
	if(HM_BrowserString1 == "NS4")
	 {
	  window.open (doc,"lively", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=no,resile=0,width=332,height=385,screenX=0,screenY=0");
	 }
	else
	 {
	  window.open (doc,"lively", "toolbar=0, location=0,directories=0,resizable=yes,status=0,menubar=0,scrollbars=no,resile=0,width=332,height=385,left=0,top=0");
	 }
}
function genesis(docc0,docc,docc1) 
{

        fullname = docc0+"/"+docc;
           
        doc11 = "tellurfriend.php4?lk="+fullname+"&lk1="+docc1;
        
         HM_NS4 = (document.layers) ? true : false;
	 HM_BrowserString1 = HM_NS4 ? "NS4" : "IE4";
	
	 if(HM_BrowserString1 == "NS4")
	 {
	    window.open (doc11,"lively", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=600,height=440,screenX=50,screenY=40");
	 }
	else
	 {
	   window.open (doc11,"lively", "toolbar=0, location=0,directories=0,resizable=yes,status=0,menubar=0,scrollbars=yes,resile=1,width=560,height=400,left=70,top=60");
	 }
}
function validation_free(doc)
{
	if((doc.name.value == "") || (doc.email.value == ""))
	{
		alert("Some fields are vacant");
		return false;
	}

	if(doc.email.value != "")
	{
	   fsign = doc.email.value.indexOf("@");             
	   ssign = doc.email.value.indexOf(".");

	   if(fsign <= 0 || ssign <= 0)
	   {  

	     alert("You should enter proper email ID");
	     return false;
	   }
	}
}

function val_aff(doc)
{
	if((doc.login.value == "") || (doc.password.value == ""))
	{
		alert("Some fields are vacant");
		return false;
	}
}

function register_check(doc)
{
		re4 = /\D+/;
		re2 = /\w*@\w*\.\w+/;
		r3 = /\d\d\d\d/;
		re5 = /\d+/;
		re6 = /\D+/;
		re7 = /\d{4}-\d{2}-\d{2}/;

		function clearb(doc)
		{
		     doc.loginname.value = "";
		     doc.name.value = "";
		     doc.regcode.value="";	 			     
		     doc.age.value = "";
		     doc.company.value = "";
		     doc.designation.value = "";
		     doc.address.value = "";
		     doc.state.value = "";
		     doc.city.value = "";
		     doc.postalcode.value = "";
		     doc.tel.value = "";
		     doc.email.value = "";
		     doc.fax.value = "";
		     return false;

	      }
	//	alert(doc.occupation.options[doc.occupation.selectedIndex].text);
	//	alert(doc.occupation.options[doc.occupation.selectedIndex].text != "Student");
		

		function blank(doc)
		   {

		     if((doc.loginname.value == "") || (doc.pass.value == "") || (doc.name.value == "") || (doc.occupation.value == "") || (doc.address.value == "")
			 || (doc.city.value == "") || (doc.state.value == "") || (doc.postalcode.value == "") || (doc.email.value == "") ||  (doc.tel.value == "") || (doc.regcode.value == ""))   
			{
			alert("Some Fields are Vacant");
			return false;
		       }
		      else
		       {
			 return true;
		       }
		   }


		function string_check(doc,fil)
		  {
			if(re5.test(doc.value))  
			{
			  alert("Please enter character where ever applicable");
			  return false
			}
		       else
			{
			 return true;
			}
		  }

		function pass_login(doc)
		  {
			 if(doc.loginname.value == doc.pass.value)  
			{
			  alert("Login name and password can not be same");
			  return false
			}
		       else
			{
			 return true;
			}
		  }  

		function check_tel(doc)
		 {
		     if(!re5.test(doc.tel.value))
		    {
		      alert("Please enter only digits for phone no.")
		      return false;
		    }
		   else
		    {
		      return true;
		    }
		 }

		function check_email(doc)
		{
		     if(doc.email.value != "")
		     {
			   fsign = doc.email.value.indexOf("@");             
			   ssign = doc.email.value.indexOf(".");

			   if(fsign <= 0 || ssign <= 0)
			   {

			      alert("Please enter proper email ID")
			       return false;
			   }
			   else
			   {
			      return true;
			   }
		     }
		     else
		     {
			     return true;
		     }
		} 

		 function check_fax(doc)
		  {

		  if(doc.fax.value != "")
		   {
		    if(re6.test(doc.fax.value))
		     {
		       alert("You should enter only digits for fax no.")
		       return false;
		     }
		    else
		     {
		       return true;
		     }
		  } 
		    return true; 
		 } 


		function other_check(doc)
		 {
		   //d = doc.occupation.selectedIndex;
		   d = doc.occupation.options[doc.occupation.selectedIndex].text

		   if((d == "Other") && (doc.otheroccup.value == ""))
		     {
		       alert("You should enter value for Other Occupation");
		       return false;
		     }
		   else
		     {
		       return true;
		     }
		 }


		 function company_check(doc)
		   {
		  	d = doc.occupation.options[doc.occupation.selectedIndex].text

		    if((d != "Student") && (doc.company.value == ""))
		      {
			alert("You should enter Company name");
			return false;
		      }
		    else
		      {
			return true;
		      }
		   }


		 function des_check(doc)
		   {
		    d = doc.occupation.options[doc.occupation.selectedIndex].text
		    if((d != "Student") && (doc.designation.value == ""))
		      {
			alert("You should enter Designation");
			return false;
		      }
		    else
		      {
			return true;
		      }
		   }
			if(!blank(doc))
			  {
			   return false;
			  } 

			if(!pass_login(doc))
			  {
			   return false;
			  }   

			if(!string_check(doc.name,"Name"))
			  {
			   return false;
			  }

			if(!string_check(doc.city,"City"))
			  {
			   return false;
			  }

		       if(!string_check(doc.state,"State"))
			  {
			   return false;
			  }

			if(!check_tel(doc))
			  {
			   return false;
			  }  

			if(!check_fax(doc))
			  {
			    return false;
			  }  

			if(!check_email(doc))
			  {
			    return false;
			  }    


			 if(!other_check(doc))
			   {
			     return false;
			   }  

			 if(!company_check(doc))
			   {
			     return false;
			   }    

			 if(!des_check(doc))
			   {
			     return false;
			   }  
			   
			   
}
function validate_purchase(doc)
{
          function blank(doc)
          {
	      if((doc.incost.value == "") || (doc.MC_name.value == "") || (doc.MC_address.value == "") ||  (doc.MC_email.value == "") || (doc.MC_tell.value == "") || (doc.MC_postecode.value == "") || (doc.MC_qunt.value == "") || (doc.MC_country.value == ""))
              {
                alert("Some Fields are Vacant");
                return false;
              }
             else
              {
                return true;
	      }
          }
          function check_country(doc)
          {
		   cnt = doc.MC_country.selectedIndex;  
		   cnt1 = doc.t.selectedIndex;  
		   cval = doc.MC_country.options[cnt].value;
		   cval1 = doc.t.options[cnt1].value;
		   if((cval == "IN1") && (cval1 == 2))
		   {
			alert("Credit Card Facility is available only for International Buyer. Buyers from India  please select Demand Draft,  alternatively you can deposit cash/cheque with branches of HDFC bank in your city for more information send an email at onsite@vsnl.in");
			return false;
		   }
		   else
		   {
			return true;
		   }
          } 
          function check_email(doc)
   	  {
  		  if(doc.MC_email.value != " ")
   		  {
       		      fsign = doc.MC_email.value.indexOf("@");             
       		      ssign = doc.MC_email.value.indexOf(".");
       	  
       		     if(fsign <= 0 || ssign <= 0)
       		     {
        	         alert("You should enter proper email ID")
        	         return false;
       		     }
       		     else
       		     {
        	         return true;
       		     }
    		 }
    		else
    		 {
    		        return true;
    		 }
        }
        function check_num(doc)
        {
            if(!((re3.test(doc.MC_postecode.value)) && (re3.test(doc.MC_qunt.value))&& (re3.test(doc.MC_isd.value)) && (re3.test(doc.MC_std.value)) && (re3.test(doc.MC_tel.value))))
              {
                alert("You should enter only numeric values for the fields ISD No.,STD No.,PHONE No., QUANTITY and Zip");
                return false;
              }
            else
              {
                return true;
              }
       }

      if(!check_country(doc))
      {
	    return false;
      } 		
      if(!check_email(doc))
      {
            return false;
      }
      if(!blank(doc))
      {
           return false;
      }
}
function set(doc)
{
    if((doc.logn.value == "") || (doc.pasn.value == ""))
    {
    	alert ("Please enter all the  fields");
    	return (false);
    }
}
function survey_check(doc)
{
    var check_var;
    var check_var1;
    var prd;
    var ste;
    var osys;
    var cst1;
    var cst2;
    
    for(a=1;a<=5;a++) 	
    {
       if(document.sur.elements["c"+a].checked == true)	
       {
    	   check_var = "yes";		   	
       }		
       if(document.sur.other_v.value != "")		
       {
       	  check_var = "yes";
       }
    }
    
    for(b=6;b<=11;b++) 	
    {
       if(document.sur.elements["c"+b].checked == true)	
       {
    	   check_var1 = "yes";		   	
       }		
       if(document.sur.other_s.value != "")		
       {
       	   check_var1 = "yes";
       }
    }    
    if((document.sur.product[0].checked == false) && (document.sur.product[1].checked == false))
    {
   	prd = "no"; 	
    }
    else
    {
    	prd = "yes"; 	
    }
    
    if((document.sur.site[0].checked == false) && (document.sur.site[1].checked == false))
    {
    	ste = "no"; 	
    }
    else
    {
    	ste = "yes"; 	
    }
    if((document.sur.custom[0].checked == false) && (document.sur.custom[1].checked == false))
    {
    	cst1 = "no";
    }    
    else
    {
    	cst1 = "yes";
    }
    
    if((document.sur.custom_i[0].checked == false) && (document.sur.custom_i[1].checked == false))
    {
    	cst2 = "no";
    }    
    else
    {
   	cst2 = "yes";    
    }
    if((document.sur.os[0].checked == false) && (document.sur.os.checked == false))
    {
    	osys = "no";
    }  
    else
    {
        osys = "yes";    
    }
   
    
    if((ste == "no") || (check_var1 != "yes") || (check_var != "yes") || (prd == "no") || (osys == "no") || (cst1 == "no") || (cst2 == "no"))
    {
    	alert ("Please fill all compulsory fields");
    	return false;
    }
    else
    {
  	return true;
    }
    
}

function feed_check()
{
    fcheck_var = "";
    for(a=1;a<=3;a++) 	
    {
       if(document.feed.elements["c"+a].checked == true)
       {
    	   fcheck_var = "yes";
       }		
       
       if(document.feed.other.value != "")
       {
       	  fcheck_var = "yes";
       }
    }    
    
    if((document.feed.name.value == "") || (document.feed.email.value == "") || (fcheck_var == ""))
    {
    	alert ("Please fill all compulsory fields");
    	return false;
    }
    else
    {
    	return true;
    }
}

function showdemo_html(dpath)
{
         HM_NS4 = (document.layers) ? true : false;
	 HM_BrowserString1 = HM_NS4 ? "NS4" : "IE4";
	
	                if(HM_BrowserString1 == "NS4")
			 {
			  window.open (dpath,"livelyfull", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=650,height=480,screenX=50,screenY=40");
		         }
		        else
			 {
                         window.open (dpath,"livelyfull", "toolbar=0, location=0,directories=0,resizable=yes,status=0,menubar=0,scrollbars=yes,resile=1,width=600,height=440,left=70,top=60");
			 }
}

function reregcheck()
{
   if((document.rereg.loginname.value == "") || (document.rereg.pass.value == "") || (document.rereg.regcode.value == ""))			
   {
	alert("Some fields are blank");
	return false;
   }
   return true;
}      			 

function feed_check()
{
    fcheck_var = "";
    for(a=1;a<=3;a++) 	
    {
       if(document.feed.elements["c"+a].checked == true)
       {
    	   fcheck_var = "yes";
       }		
       
       if(document.feed.other.value != "")
       {
       	  fcheck_var = "yes";
       }
    }    
    
    if((document.feed.name.value == "") || (document.feed.email.value == "") || (fcheck_var == ""))
    {
    	alert ("Please fill all compulsory fields");
    	return false;
    }
    else
    {
    	return true;
    }
}

function show_popup(doc)
{
         HM_NS4 = (document.layers) ? true : false;
	 HM_BrowserString1 = HM_NS4 ? "NS4" : "IE4";
	
	                if(HM_BrowserString1 == "NS4")
			 {
			  window.open (doc,"Legal", "toolbar=0, location=0,directories=0,resizable=no,status=0,menubar=0,scrollbars=yes,resile=0,width=650,height=350,screenX=50,screenY=40");
		         }
		        else
			 {
                         window.open (doc,"Legal", "toolbar=0, location=0,directories=0,resizable=yes,status=0,menubar=0,scrollbars=yes,resile=1,width=650,height=350,left=70,top=60");
			 }
}

