<!--

ns4 = (document.layers)? true:false
ie4 = (document.all)? true:false

// Show/Hide functions for non-pointer layer/objects
function show(id) {
     if (ns4) document.layers[id].visibility = "show"
     else if (ie4) document.all[id].style.visibility = "visible"
}

function hide(id) {
     if (ns4) document.layers[id].visibility = "hide"
     else if (ie4) document.all[id].style.visibility = "hidden"
}

//-->
<!--
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 3;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function provjeri2()
{
	if (document.form2.fname.value=='') {
		alert('Please enter your first name');
		document.form2.fname.focus();
		return false;
	}
	if (document.form2.lname.value=='') {
		alert('Please enter your last name');
		document.form2.lname.focus();
		return false;
	}
	if (document.form2.company_name.value=='') {
		alert('Please enter your company name');
		document.form2.company_name.focus();
		return false;
	}


		if (document.form2.address_number.value=='') {
		alert('Please enter your street number');
		document.form2.address_number.focus();
		return false;
	}
			if (document.form2.address.value=='') {
		alert('Please enter your street name');
		document.form2.address.focus();
		return false;
	}

		if (document.form2.city.value=='') {
		alert('Please enter your city');
		document.form2.city.focus();
		return false;
	}
		if (document.form2.state.value=='') {
		alert('Please enter your state');
		document.form2.state.focus();
		return false;

	}
		if (document.form2.zip.value=='') {
		alert('Please enter your zip');
		document.form2.zip.focus();
		return false;

	}
		if (document.form2.service_phone1.value=='') {
		alert('Please enter your service telephone number');
		document.form2.service_phone1.focus();
		return false;
	}
		if (document.form2.service_phone2.value=='') {
		alert('Please enter your service telephone number');
		document.form2.service_phone2.focus();
		return false;
	}
		if (document.form2.service_phone3.value=='') {
		alert('Please enter your service telephone number');
		document.form2.service_phone3.focus();
		return false;
	}

	var num1,newTerm1
	if (parseInt(document.form2.service_phone1.value) !=
            document.form2.service_phone1.value) {
            num1 = document.form2.service_phone3.value;
            while (num1.charAt(0) == "0") {
	    newTerm1 = num1.substring(1, num1.length);
	    num1 = newTerm1;
	    }
		if (parseInt(num1) != num1) {
		alert('Please enter a service telephone number, numbers only');
		return false;            
            }		
	}
	var num2,newTerm2
	if (parseInt(document.form2.service_phone2.value) !=
            document.form2.service_phone2.value) {
            num2 = document.form2.service_phone3.value;
            while (num2.charAt(0) == "0") {
	    newTerm2 = num2.substring(1, num2.length);
	    num2 = newTerm2;
	    }
		if (parseInt(num2) != num2) {
		alert('Please enter a service telephone number, numbers only');
		return false;            
            }		
	}
	var num3,newTerm3
	if (parseInt(document.form2.service_phone3.value) !=
            document.form2.service_phone3.value) {
            num3 = document.form2.service_phone3.value;
            while (num3.charAt(0) == "0") {
	    newTerm3 = num3.substring(1, num3.length);
	    num3 = newTerm3;
	    }
		if (parseInt(num3) != num3) {
		alert('Please enter a service telephone number, numbers only');
		return false;            
            }		
	}

	if (checkInternationalPhone(document.form2.service_phone1.value)==false){
		alert("Please enter your valid 3 digit service telephone area code")
		document.form2.service_phone1.focus();
		return false;
	}
	if (checkInternationalPhone(document.form2.service_phone2.value)==false){
		alert("Please enter your valid 3 digit service telephone prefix")
		document.form2.service_phone2.focus();
		return false;
	}
	if (checkInternationalPhone(document.form2.service_phone3.value)==false){
		alert("Please enter your valid 4 digit service telephone extension")
		document.form2.service_phone3.focus();
		return false;
	}
	document.form2.service_phone.value = document.form2.service_phone1.value + document.form2.service_phone2.value + document.form2.service_phone3.value;
	document.form2.contact_phone.value = document.form2.contact_phone1.value + document.form2.contact_phone2.value + document.form2.contact_phone3.value;

	if (document.form2.email.value=='' || document.form2.email.value.indexOf('@')==-1 || document.form2.email.value.indexOf('.')==-1) {
		alert('Please enter a valid e-mail address so you will receive confirmation of your registration.  E-Mail addresses must be in a valid e-mail format (e.g. yourname@domain.com');
		document.form2.email.focus();
		return false;
	}
}
////**********************************************************************************************************
////* Author		 :	S.M.P.Gokulnath
////* Start Date	 :	September ,9, 2004
////* Last Modified  :	 
////* Project Name	 :	BBN
////* File Name	     :	validation.js
////* LOC			 :	
////* Version No.	 :	1.0.0	
////* Developed By   :	S.M.P.Gokulnath
////* purpose / Functionality       : This File contains general common functions 
////    1. TimedPopup 		- To show a popup window for specified number of seconds
////    2. IsNumeric(sText) - Checks whether passed value is Numeric - returns true if all are numeric and false if any character is found in 					 
////						  passed parameter

var TimeOut = 1;    // Initial time to Close window after __ number of seconds?
var TimeRemain = 0;  // Remaining time to Close window after __ number of seconds?
var RefreshRate = 0; // Check to close window every __ number of seconds?
var ChildWin = null;
// function  TimedPopup takes 4 parameter
/// 1. url = physical files to be displayed in the popup window /  constructed html string content can also be passed that is to be displayed 
/// 2. w   = width of popup window
/// 3. h   = height of popup window 
/// 4.intsec = number of secs the window needs to be displayed 
//// Note : Though the window is displayed excatly for number of secs specified , the processing time for the page which shows results is
////        dynamic hence in body on unload of the calling page the opened popup window is made to close 
//Description     : displays popup window for specified number of secs
//Author          : S.M.P.Gokulnath
//Created Date    :  Sep -09- 2004   

function TimedPopup(url,w,h,intsec)
{ 
TimeOut = intsec
//var winl = (screen.width)/4;
//var wint = (screen.height)/4;
var winl = 200;
var wint = 200;
var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top='+winl+',';
      settings +='left='+wint+',';
      settings +='scrollbars=No,resizable=No,toolbar=no, location=no, directories=no';

 windowprops = settings; // May be adjusted according to your needs
 if (ChildWin)
     return false;
 ChildWin = window.open(url, "ChildWin", windowprops);
  if(parseInt(navigator.appVersion) >= 4){ChildWin.window.focus();}
 ResetTimer();
 if (TimeOut && RefreshRate)
    setTimeout("CheckClose();",RefreshRate * 1);
}
function ResetTimer()
{
 TimeRemain = TimeOut;
}
function CheckClose()
{
 TimeRemain -= (RefreshRate);
 if (TimeRemain > 0)
    {
    if (ChildWin && ChildWin.closed)
       {
 
	ChildWin = null;
       }
    else
    if (ChildWin)
       { 
	setTimeout("CheckClose();",RefreshRate * 1);
       }
    }
 else
 if (ChildWin)
    {
 
     if (ChildWin.closed)
	 ChildWin = null;
     else
	{
         ChildWin.close();
	 ChildWin = null;
        }
    }
}

// function  IsNumeric takes 1 parameter
/// 1. sText = value that is to be checked whether it contains all numeriuc characters
//Description     : returns true if valid numeric values are entered and false if wrong values are entered
//Author          : S.M.P.Gokulnath
//Created Date    :  Sep -09- 2004   
 function IsNumeric(sText)
{
   var ValidChars = "0123456789.-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;   
   }
   
   // function  IsAlphabets takes 1 parameter
/// 1. sText = value that is to be checked whether it contains only Characters
//Description     : returns true if valid Characters are entered and false if wrong values are entered
//Author          : S.M.P.Gokulnath
//Created Date    :  Jan-11-2005 
 function IsAlphabets(sText)
{
   var ValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
   var IsAlpha=true;
   var Char;
   sText=sText.replace(/^\s*(.*)/, "$1");
   sText=sText.replace(/(.*?)\s*$/, "$1");
	if (sText.length==0 )
	{
	IsAlpha = false;
	}
	else
	{
  	 for (i = 0; i < sText.length && IsAlpha == true; i++) 
      { 
    	  Char = sText.charAt(i); 
	      if (ValidChars.indexOf(Char) == -1) 
    	     {
        	 IsAlpha = false;
	         }
      }
	}
   return IsAlpha;   
  }
  
 // Function Name  : checkNumbersonly
// Description    : This function checks whether numbers alone is entered into service and contact phone numbers
//Author          : S.M.P.Gokulnath
//Created Date    :  Jan-11-2004
function checkNumbersonly(thob)
{
	if (IsNumeric(thob.value)==false)
	{
	alert('Please enter numeric value');
	thob.value="";
	thob.focus();
	}
}
 // allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
function isValidName(str)
{	
   var ValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_ ";
   var Isok=true;
   var Char;
	str=str.replace(/^\s*(.*)/, "$1");
	str=str.replace(/(.*?)\s*$/, "$1");
	if (str.length==0 )
	{
	Isok = false;
	}
	else
	{
	   for (i = 0; i < str.length && Isok == true; i++) 
    	  { 
	      Char = str.charAt(i); 
    	  if (ValidChars.indexOf(Char) == -1) 
        	 {
	         Isok = false;
    	     }
	      }
	}
   return Isok;   
   }

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
function isValidEmailChar(str)
{	
   var ValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@_.- ";
   var Isok=true;
   var Char;
	str=str.replace(/^\s*(.*)/, "$1");
	str=str.replace(/(.*?)\s*$/, "$1");
	if (str.length==0 )
	{
	Isok = false;
	}
	else
	{
	   for (i = 0; i < str.length && Isok == true; i++) 
    	  { 
	      Char = str.charAt(i); 
    	  if (ValidChars.indexOf(Char) == -1) 
        	 {
	         Isok = false;
    	     }
	      }
	}
   return Isok;   
   }

// allow ONLY alphanumeric keys, no symbols or punctuation
// this can be altered for any "checkOK" string you desire
function isValidServiceAddress(str)
{	
   var ValidChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_., ";
   var Isok=true;
   var Char;
	str=str.replace(/^\s*(.*)/, "$1");
	str=str.replace(/(.*?)\s*$/, "$1");
	if (str.length==0 )
	{
	Isok = false;
	}
	else
	{
	   for (i = 0; i < str.length && Isok == true; i++) 
    	  { 
	      Char = str.charAt(i); 
    	  if (ValidChars.indexOf(Char) == -1) 
        	 {
	         Isok = false;
    	     }
	      }
	}
   return Isok;   
   }
// function  isValidEmail takes 1 parameter
/// 1. str = value that is to be checked for email address
//Description     : returns true if valid email values is enteres and false if wrong values are entered
function isValidEmail(emailAddress)
{
   /* Check for empty address or invalid characters */
   if (hasInvalidChar(emailAddress))//emailAddress == "" ||
   {
      return false;
   }
   /* Check for invalid characters */
   if (isValidEmailChar(emailAddress)==false)//emailAddress == "" ||
   {
      return false;
   }

   /* check for presence of the @ character */
   var atPos = emailAddress.indexOf("@", 1)
   if (atPos == -1)
   {
      return false;
   }

   /* Check that there are no more @ characters */
   if (emailAddress.indexOf("@", atPos + 1) > -1)
   {
      return false;
   }

   /* Check for the presence of a dot somewhere after @ */
   var dotPos = emailAddress.indexOf(".", atPos + 1);
   if (dotPos == -1)
   {
      return false;
   }

   /* Check for presence of two or more characters after last dot */
   var lastDotPos = emailAddress.lastIndexOf(".");
   if (lastDotPos + 3 >  emailAddress.length)
   {
      return false;
   }

   return true;
}

// function  isValidEmailAddress takes 1 parameter
/// 1. str = value that is to be checked for email address
//Description     : returns true if valid email values is enteres and false if wrong values are entered
function isValidEmailAddress(emailAddress)
{
   /* Check for empty address or invalid characters */
   if (hasInvalidChar(emailAddress))//emailAddress == "" ||
   {
      return false;
   }
   /* Check for invalid characters */
   if (isValidEmailChar(emailAddress)==false)//emailAddress == "" ||
   {
      return false;
   }

   /* check for presence of the @ character */
   var atPos = emailAddress.indexOf("@", 1)
   if (atPos == -1)
   {
      return false;
   }

   /* Check that there are no more @ characters */
   if (emailAddress.indexOf("@", atPos + 1) > -1)
   {
      return false;
   }

   /* Check for the presence of a dot somewhere after @ */
   var dotPos = emailAddress.indexOf(".", atPos + 1);
   if (dotPos == -1)
   {
      return false;
   }

   /* Check for presence of two or more characters after last dot */
   var lastDotPos = emailAddress.lastIndexOf(".");
   if (lastDotPos + 3 >  emailAddress.length)
   {
      return false;
   }

   return true;
}

/*
   Return true if the given email address has an invalid character
   in it, else return false.
*/
function hasInvalidChar(emailAddress)
{
   var invalidChars = "/;:,"; // this list is not complete
   for (var k = 0; k < invalidChars.length; k++)
   {
      var ch = invalidChars.charAt(k);
      if (emailAddress.indexOf(ch) > -1)
      {
         return true;
      }
   }
   return false;
}

	



// function  checkHomePageInputValues  
///  Note : This Function is called from two pages
///           1. homepage.asp
///           2. input.asp
///      since the control name and validation are same
/// this is done to avoid code repetation and for ease of maintanence      
// Description    : This function checks whether the form values entered are proper 
//					and gives appropriate error message if any value is found invalid or left blank
//                  The function returns true if all values are found correct and false if any value is found invalid or left blank
//Author          : S.M.P.Gokulnath
//Created Date    :  Sep -09- 2004   
function checkHomePageInputValues()
{


strSec = "Business";

/////// ///   Name   ////////////////////////
	if((strSec.toLowerCase()=="either_home"))
	{
		if(document.IndexForm.name.value!='')
		{
				if(isValidName(document.IndexForm.name.value)==false)
				{
					alert('Please do not enter special characters with your name');
					document.IndexForm.name.focus();
					return false;
				}
		}
			
	}
	else
	{
		if(document.IndexForm.name.value=='')
		{
			alert('Please enter your Full Name ');
			document.IndexForm.name.focus();
			return false;
		}
				  
		if(isValidName(document.IndexForm.name.value)==false)
		{
			alert('Please do not enter special characters with your name');
			document.IndexForm.name.focus();
			return false;
		}	
	} 

	/// ///   Service Phone    ////////////////////////
	if (document.IndexForm.DSLPhoneAreaCode.value=='')  
	{
		alert('Please enter your Service telephone number');
		document.IndexForm.DSLPhoneAreaCode.focus();
		return false;
	}
	var num1,newTerm1
	if (parseInt(document.IndexForm.DSLPhoneAreaCode.value) != document.IndexForm.DSLPhoneAreaCode.value) 
	{
            num1 = document.IndexForm.DSLPhoneAreaCode.value;
            while (num1.charAt(0) == "0") 
	    {
	    	newTerm1 = num1.substring(1, num1.length);
		    num1 = newTerm1;
	    }
	    if (parseInt(num1) != num1)
	    {
		alert('Please enter a Service telephone number, numbers only');
		document.IndexForm.DSLPhoneAreaCode.focus();
		return false;
            }
	}

	if (document.IndexForm.DSLPhoneAreaCode.value.length < 3 || document.IndexForm.DSLPhoneAreaCode.value.length > 3 )  
	{
		alert('Please enter your Service telephone Area Code  3 digits number Eg(123) ');
		document.IndexForm.DSLPhoneAreaCode.focus();
		return false;
	}
	
	if  (document.IndexForm.DSLPhoneFirst.value=='')  
	{
		alert('Please enter your Service telephone number');
		document.IndexForm.DSLPhoneFirst.focus();
		return false;
	}
	var num2,newTerm2
	if (parseInt(document.IndexForm.DSLPhoneFirst.value) != document.IndexForm.DSLPhoneFirst.value)
	{
            num2 = document.IndexForm.DSLPhoneFirst.value;
            while (num2.charAt(0) == "0") 
	    {
	    	newTerm2 = num2.substring(1, num2.length);
		num2 = newTerm2;
	    }
	    if (parseInt(num2) != num2) 
	    {
		alert('Please enter a Service telephone number, numbers only');
		document.IndexForm.DSLPhoneFirst.focus();
		return false;
	    }
	}

	if (document.IndexForm.DSLPhoneFirst.value.length < 3 || document.IndexForm.DSLPhoneFirst.value.length > 3 )
	{
		alert('Please enter your Service telephone first 3 digits number Eg(123) ');
		document.IndexForm.DSLPhoneFirst.focus();
		return false;
	}
	
	if (document.IndexForm.DSLPhoneLast.value=='') 
	{
		alert('Please enter your Service telephone number');
		document.IndexForm.DSLPhoneLast.focus();
		return false;
	}
 
 	var num3,newTerm3
	if (parseInt(document.IndexForm.DSLPhoneLast.value) != document.IndexForm.DSLPhoneLast.value) 
	{
            num3 = document.IndexForm.DSLPhoneLast.value;
            while (num3.charAt(0) == "0") 
	    {
	    	newTerm3 = num3.substring(1, num3.length);
 	    	num3 = newTerm3;
	    }
	    if (parseInt(num3) != num3) 
	    {
		alert('Please enter a Service telephone number, numbers only');
		document.IndexForm.DSLPhoneLast.focus();
		return false;
	    }									
	}
			
	if (document.IndexForm.DSLPhoneLast.value.length < 4 || document.IndexForm.DSLPhoneLast.value.length > 4 )
	{
		alert('Please enter your Service telephone last 4 digits number Eg(1234) ');
		document.IndexForm.DSLPhoneLast.focus();
		return false;
	}
 
	/// ///   Mail Check Code ////////////////////////
	if (document.IndexForm.shopper_email.value=='' ||  (! isValidEmailAddress(document.IndexForm.shopper_email.value) ) ) {
		alert('Please enter a valid e-mail address so you will receive confirmation of your registration.  E-Mail addresses must be in a valid e-mail format (e.g. yourname@domain.com)');
		document.IndexForm.shopper_email.focus();
		return false;
	}
	 
	if((strSec.toLowerCase()=="home"))
	{
	}
	else
	{
		/// ///   Contact Phone  ////////////////////////
		if(document.IndexForm.DSLPhoneAreaCode2.value=='') 
		{
			alert('Please enter your Contact telephone number;  It is required for Business Service');
			document.IndexForm.DSLPhoneAreaCode2.focus();
			return false;
		}
		
		var num1,newTerm1
		if (parseInt(document.IndexForm.DSLPhoneAreaCode2.value) != document.IndexForm.DSLPhoneAreaCode2.value) 
		{
            num1 = document.IndexForm.DSLPhoneAreaCode2.value;
            while (num1.charAt(0) == "0") 
		    {
		    	newTerm1 = num1.substring(1, num1.length);
			    num1 = newTerm1;
	    	}
		    if (parseInt(num1) != num1)
		    {
				alert('Please enter a Contact telephone number, numbers only');
				document.IndexForm.DSLPhoneAreaCode2.focus();
				return false;
	       }
		}

		if(document.IndexForm.DSLPhoneAreaCode2.value.length < 3 || document.IndexForm.DSLPhoneAreaCode2.value.length > 3 ) 
		{
		alert('Please enter your Contact telephone Area Code  3 digits number Eg(123) ');
			document.IndexForm.DSLPhoneAreaCode2.focus();
			return false;
		}


		if (document.IndexForm.DSLPhoneFirst2.value=='') 
		{
			alert('Please enter your Contact telephone number');
			document.IndexForm.DSLPhoneFirst2.focus();
			return false;
		}

		var num2,newTerm2
		if (parseInt(document.IndexForm.DSLPhoneFirst2.value) != document.IndexForm.DSLPhoneFirst2.value)
		{
            num2 = document.IndexForm.DSLPhoneFirst2.value;
            while (num2.charAt(0) == "0") 
		    {
		    	newTerm2 = num2.substring(1, num2.length);
				num2 = newTerm2;
		    }
		    if (parseInt(num2) != num2) 
		    {
			alert('Please enter a Contact  telephone number, numbers only');
			document.IndexForm.DSLPhoneFirst2.focus();
			return false;
		    }
		}

		if (document.IndexForm.DSLPhoneFirst2.value.length < 3 || document.IndexForm.DSLPhoneFirst2.value.length > 3 ) 
		{
		alert('Please enter your Contact telephone First 3 digits number Eg(123) ');
			document.IndexForm.DSLPhoneFirst2.focus();
			return false;
		}
		
		if (document.IndexForm.DSLPhoneLast2.value=='')  
		{
			alert('Please enter your Contact telephone number');
			document.IndexForm.DSLPhoneLast2.focus();
			return false;
		}

		var num3,newTerm3
		if (parseInt(document.IndexForm.DSLPhoneLast2.value) != document.IndexForm.DSLPhoneLast2.value) 
		{
	        num3 = document.IndexForm.DSLPhoneLast2.value;
	        while (num3.charAt(0) == "0") 
		    {
		    	newTerm3 = num3.substring(1, num3.length);
	 	    	num3 = newTerm3;
		    }
		    if (parseInt(num3) != num3) 
		    {
			alert('Please enter a Contact telephone number, numbers only');
			document.IndexForm.DSLPhoneLast2.focus();
			return false;
		    }									
		}
		if (document.IndexForm.DSLPhoneLast2.value.length < 4 || document.IndexForm.DSLPhoneLast2.value.length > 4 )  
		{
		alert('Please enter your Contact telephone Last 4 digits number Eg(1234) ');
			document.IndexForm.DSLPhoneLast2.focus();
			return false;
		}
		
		
	}
	
		 var sFullName="";
		var sFirstName="";
		var sLastName="";
		var ss="";
		sFullName= document.IndexForm.name.value
		if(sFullName.length>0)
		{
			sFullName=sFullName.replace(/^\s*(.*)/, "$1");
			sFullName=sFullName.replace(/(.*?)\s*$/, "$1");
			arr1=sFullName.split(" ");
			count=1;
			sFirstName=arr1[0];	 
			while(count < arr1.length)
			{
				ss=ss + " " + arr1[count];
				count = count+1;
			}
			 sLastName=ss;
		}
		 	strRedirURL="targus.asp";
	 		strRedirURL=strRedirURL + "&yourname=" + document.IndexForm.name.value;
			strRedirURL=strRedirURL + "&ServicePhone=" + document.IndexForm.DSLPhoneAreaCode.value + document.IndexForm.DSLPhoneFirst.value +document.IndexForm.DSLPhoneLast.value;
			strRedirURL=strRedirURL + "&Email=" + document.IndexForm.shopper_email.value;
			strRedirURL=strRedirURL + "&ContactPhone=" + document.IndexForm.DSLPhoneAreaCode2.value + document.IndexForm.DSLPhoneFirst2.value +document.IndexForm.DSLPhoneLast2.value;
			strRedirURL=strRedirURL + "&RecentMove=";
			strRedirURL=strRedirURL + "&Type=" + strSec;
			strRedirURL=strRedirURL + "&fname=" +sFirstName;
	 		strRedirURL=strRedirURL + "&lname=" + sLastName;
			strRedirURL=strRedirURL + "&referring_partner=" +"bbbroker";
			strRedirURL=strRedirURL + "&targusflag=yes";
			strRedirURL=strRedirURL + "&autophoneflag=no";	
			strRedirURL=strRedirURL + "&Optin="+ document.IndexForm.OptIn.checked;


	var url1;
	url1 = "http://www.broadbandnational.com/winpopup.asp?Redirfile="+strRedirURL;
	location.href = url1;
	return false;
}
// This is part of code for auto tab in phone number fields
var isNN = (navigator.appName.indexOf("Netscape")!=-1);
function autoTab(input,len, e) {
var keyCode = (isNN) ? e.which : e.keyCode; 
var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
if(input.value.length >= len && !containsElement(filter,keyCode)) {
input.value = input.value.slice(0, len);
input.form[(getIndex(input)+1) % input.form.length].focus();
}
function containsElement(arr, ele) {
var found = false, index = 0;
while(!found && index < arr.length)
if(arr[index] == ele)
found = true;
else
index++;
return found;
}
function getIndex(input) {
var index = -1, i = 0, found = false;
while (i < input.form.length && index == -1)
if (input.form[i] == input)index = i;
else i++;
return index;
}
return true;
}
var strSec="";
strSec='';
////// Targus.asp?ContactName=test&ServicePhone=1234567890&Email=test@test.com&ContactPhone=1234567890&Type=home&referring_partner=dslcity 
///// General Note 
///// 1. The controls in input.asp  and HomePage.asp are with same name hence 
/////    a single function in validation.js  "checkHomePageInputValues()" is used

// Function Name  : CallTargus  
// Description    : This function constructs a url for redirection with relevent form values after checking the validations
//Parameter       : this takes transactu\ion type as parameter 
//Author          : S.M.P.Gokulnath
//Created Date    :  Sep -09- 2004
function CallTargus()
{
//  checkHomePageInputValues validation function is called 	  from validation.js  file //////////  
	if(document.IndexForm.RecentMove.checked==true)
	{
		var sFullName="";
		var sFirstName="";
		var sLastName="";
		var ss="";
		sFullName= document.IndexForm.name.value
		if(sFullName.length>0)
		{
			sFullName=sFullName.replace(/^\s*(.*)/, "$1");
			sFullName=sFullName.replace(/(.*?)\s*$/, "$1");
			arr1=sFullName.split(" ");
			count=1;
			sFirstName=arr1[0];	 
			while(count < arr1.length)
			{
				ss=ss + " " + arr1[count];
				count = count+1;
			}
			 sLastName=ss;
		}
		if (strType.toLowerCase()=="home")
		{	
			strRedirURL="index.asp?section=home&layout=long&file=homeindex"		
	 		strRedirURL=strRedirURL + "&yourname=" + document.IndexForm.name.value
	 		strRedirURL=strRedirURL + "&fname=" +sFirstName
	 		strRedirURL=strRedirURL + "&lname=" + sLastName			
			strRedirURL=strRedirURL + "&ServicePhone=" + document.IndexForm.DSLPhoneAreaCode.value + document.IndexForm.DSLPhoneFirst.value +document.IndexForm.DSLPhoneLast.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode=" + document.IndexForm.DSLPhoneAreaCode.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&Email=" + document.IndexForm.shopper_email.value
			strRedirURL=strRedirURL + "&ContactPhone=" + document.IndexForm.DSLPhoneAreaCode2.value + document.IndexForm.DSLPhoneFirst2.value +document.IndexForm.DSLPhoneLast2.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast2=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&RecentMove=yes" 
			strRedirURL=strRedirURL + "&Type=" + strType
			strRedirURL=strRedirURL + "&referring_partner="+"BBN"
			strRedirURL=strRedirURL +"&targusflag=no"
			strRedirURL=strRedirURL +"&autophoneflag=no"
			strRedirURL=strRedirURL +"&Optin="+ document.IndexForm.OptIn.checked
			
				location.href=strRedirURL
		
		}
		if (strType.toLowerCase()=="business")
		{	 
			strRedirURL="index.asp?section=business&layout=long&file=businessindex"		
	 		strRedirURL=strRedirURL + "&yourname=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&ServicePhone=" + document.IndexForm.DSLPhoneAreaCode.value + document.IndexForm.DSLPhoneFirst.value +document.IndexForm.DSLPhoneLast.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode=" + document.IndexForm.DSLPhoneAreaCode.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&Email=" + document.IndexForm.shopper_email.value
			strRedirURL=strRedirURL + "&ContactPhone=" + document.IndexForm.DSLPhoneAreaCode2.value + document.IndexForm.DSLPhoneFirst2.value +document.IndexForm.DSLPhoneLast2.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast2=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&RecentMove=yes" 
			strRedirURL=strRedirURL + "&fname=" +sFirstName
	 		strRedirURL=strRedirURL + "&lname=" + sLastName
			strRedirURL=strRedirURL + "&Type=" + strType
			strRedirURL=strRedirURL + "&referring_partner=" +"bbbroker"
			strRedirURL=strRedirURL +"&targusflag=no"
			strRedirURL=strRedirURL +"&autophoneflag=no"
			strRedirURL=strRedirURL +"&Optin="+ document.IndexForm.OptIn.checked
			
				location.href=strRedirURL	
		}
	}
	else
	{	
	 	 if(checkHomePageInputValues(strType))
		 {
		 var sFullName="";
		var sFirstName="";
		var sLastName="";
		var ss="";
		sFullName= document.IndexForm.name.value
		if(sFullName.length>0)
		{
			sFullName=sFullName.replace(/^\s*(.*)/, "$1");
			sFullName=sFullName.replace(/(.*?)\s*$/, "$1");
			arr1=sFullName.split(" ");
			count=1;
			sFirstName=arr1[0];	 
			while(count < arr1.length)
			{
				ss=ss + " " + arr1[count];
				count = count+1;
			}
			 sLastName=ss;
		}
		 	strRedirURL="targus.asp"
	 		strRedirURL=strRedirURL + "&yourname=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&ServicePhone=" + document.IndexForm.DSLPhoneAreaCode.value + document.IndexForm.DSLPhoneFirst.value +document.IndexForm.DSLPhoneLast.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode=" + document.IndexForm.DSLPhoneAreaCode.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&Email=" + document.IndexForm.shopper_email.value
			strRedirURL=strRedirURL + "&ContactPhone=" + document.IndexForm.DSLPhoneAreaCode2.value + document.IndexForm.DSLPhoneFirst2.value +document.IndexForm.DSLPhoneLast2.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast2=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&RecentMove=" + document.IndexForm.RecentMove.value
			strRedirURL=strRedirURL + "&Type=" + strType
			strRedirURL=strRedirURL + "&fname=" +sFirstName
	 		strRedirURL=strRedirURL + "&lname=" + sLastName
			strRedirURL=strRedirURL + "&referring_partner=" +"bbbroker"
			strRedirURL=strRedirURL +"&targusflag=yes"
			strRedirURL=strRedirURL +"&autophoneflag=no"
			strRedirURL=strRedirURL +"&Optin="+ document.IndexForm.OptIn.checked
			
			
// function called to show popup window  url,w,h,sec
	   //TimedPopup("winpopup.asp",400,300,10);	   
		   location.href="winpopup.asp?Redirfile="+strRedirURL;		 
	  	}
	}
 }

function NoServicePhone()
{
		var sFullName="";
		var sFirstName="";
		var sLastName="";
		var ss="";
		sFullName= document.IndexForm.name.value
		if(sFullName.length>0)
		{
			sFullName=sFullName.replace(/^\s*(.*)/, "$1");
			sFullName=sFullName.replace(/(.*?)\s*$/, "$1");
			arr1=sFullName.split(" ");
			count=1;
			sFirstName=arr1[0];	 
			while(count < arr1.length)
			{
				ss=ss + " " + arr1[count];
				count = count+1;
			}
			 sLastName=ss;
		}

			strRedirURL=" index.asp?section=home&layout=long&file=homeindex&hideflag=yes"		
	 		strRedirURL=strRedirURL + "&yourname=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&fname=" +sFirstName
	 		strRedirURL=strRedirURL + "&lname=" + sLastName
			strRedirURL=strRedirURL + "&ServicePhone=" + document.IndexForm.DSLPhoneAreaCode.value + document.IndexForm.DSLPhoneFirst.value +document.IndexForm.DSLPhoneLast.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode=" + document.IndexForm.DSLPhoneAreaCode.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&Email=" + document.IndexForm.shopper_email.value
			strRedirURL=strRedirURL + "&ContactPhone=" + document.IndexForm.DSLPhoneAreaCode2.value + document.IndexForm.DSLPhoneFirst2.value +document.IndexForm.DSLPhoneLast2.value
		//strRedirURL=strRedirURL + "DSLPhoneAreaCode2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneFirst2=" + document.IndexForm.name.value
		//strRedirURL=strRedirURL + "DSLPhoneLast2=" + document.IndexForm.name.value
			strRedirURL=strRedirURL + "&RecentMove=yes" 
			strRedirURL=strRedirURL + "&Type=Home"
			strRedirURL=strRedirURL + "&referring_partner=" +"bbbroker"
			strRedirURL=strRedirURL +"&targusflag=no"
			strRedirURL=strRedirURL +"&autophoneflag=no"	
			strRedirURL=strRedirURL +"&Optin="+ document.IndexForm.OptIn.checked
			
			
				location.href=strRedirURL
		
}
//-->
