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=" +"BBN"
			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=" +"BBN"
			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=" +"BBN"
			strRedirURL=strRedirURL +"&targusflag=no"
			strRedirURL=strRedirURL +"&autophoneflag=no"	
			strRedirURL=strRedirURL +"&Optin="+ document.IndexForm.OptIn.checked
			
			
				location.href=strRedirURL
		
}