	// ------------------------------------------------------------------
	// Constants
	// ------------------------------------------------------------------
	
	//var LANDING_PAGE_URL = "http://localhost/QwestOE/1-landing-page.html";
	var CHANGE_STATE_URL = "http://pcat.qwest.com/pcat/profile.do?lastUri=" + window.document.location;
    var OOR_STATE_URL = "http://www.qwest.com/smallbusiness/products/ld/index_oor.html";
     
	var GLOBAL_COOKIE_NAME = "QWST";
	var COOKIE_SEPARATOR = "|";
	var EQUALS_SEPARATOR = "^";
	var COOKIE_EXPIRATION = (3600 * 24 * 30 * 1000);  //30 days (in milliseconds)	

	function Get_Cookie(name) 
	{
		name = name.toUpperCase();
		var rawCookieString = Get_Global_Cookie();	
	
		var lookForThis =name+EQUALS_SEPARATOR;
		var start = rawCookieString.indexOf(lookForThis); 

		var len = start+name.length+1; 
		if ((!start) && (name != rawCookieString.substring(0,name.length))) return null; 
		if (start == -1) return null; 
		var end = rawCookieString.indexOf(COOKIE_SEPARATOR,len); 
		if (end == -1) end = rawCookieString.length; 
		return unescape(rawCookieString.substring(len,end)); 
	} 
	
	function Set_Cookie(name,value,expires,path,domain,secure) 
	{ 

 		var date = new Date();
		var defaultExpirationDate = new Date(date.setTime(date.getTime()+ Number(COOKIE_EXPIRATION)));

		var valueString = GetNewValueString(name,value);
		Set_Global_Cookie(valueString,defaultExpirationDate,path,domain,secure);
	} 

	
	function replace(sString, sReplaceThis, sWithThis) 
	{ 
		if (sReplaceThis != "" && sReplaceThis != sWithThis) 
		{ 
			var counter = 0; 
			var start = 0; 
			var before = ""; 
			var after = ""; 
			while (counter<sString.length) 
			{ 
				start = sString.indexOf(sReplaceThis, counter); 
				if (start == -1) 
				{ 
					break; 
				} 
				else 
				{ 
					before = sString.substr(0, start); 
					after = sString.substr(start + sReplaceThis.length, sString.length); 
					sString = before + sWithThis + after; 
					counter = before.length + sWithThis.length; 
				} 
			} 
		} 
		return sString; 
	} 
	



	function GetNewValueString(name,value) 
	{
		var rawCookieValue = Get_Global_Cookie();
		var booFoundName = false;
		
		var newvalue = replace(value,EQUALS_SEPARATOR," ");
		newvalue = replace(newvalue,COOKIE_SEPARATOR," ");
		
		value = newvalue;

     	var pairsSplit = rawCookieValue.split(COOKIE_SEPARATOR);
     	
     	if (pairsSplit[0] == "NOT POPULATED") 
     	{
     		var vstring = name.toUpperCase() + EQUALS_SEPARATOR + value;
     		return vstring;
     	}
     	
		var elementsSplit;
		var cookieline = "";

     	for ( count=0 ; ( pairsSplit[count] != undefined ) ; count++ ) 
		{
	     	elementsSplit = pairsSplit[count].split(EQUALS_SEPARATOR);
	     	finalName = Trim(elementsSplit[0]);
	     	finalValue = Trim(elementsSplit[1]);
	     	
	     	var boo1 = finalName != null;
	     	
	     	if (finalName != null && finalName != undefined && finalName.toLowerCase() == name.toLowerCase()) 
	     	{
	     		booFoundName = true;
	     		cookieline = Trim(finalName) + EQUALS_SEPARATOR + Trim(value);
	     		pairsSplit[count] = cookieline;
	     	}
		}
	

		if (booFoundName == false) {
			cookieline = Trim(name) + EQUALS_SEPARATOR + Trim(value);
     		pairsSplit[count] = cookieline;
		}

			return pairsSplit.join(COOKIE_SEPARATOR)

	}


	

	function Delete_Cookie(name,path,domain) { 
	   if (Get_Cookie(name)) document.cookie = name + '=' + 
	      ( ';path=/') +
	      ( (domain) ? ';domain=' + domain : '') + 
	      ';expires=Thu, 01-Jan-70 00:00:01 GMT'; 
	} 

	

	function Get_Global_Cookie() {

	   var name = GLOBAL_COOKIE_NAME; 

	   var start = document.cookie.indexOf(name+"="); 
	   var len = start+name.length+1; 
	   if ((!start) && (name != document.cookie.substring(0,name.length))) return null; 
	   if (start == -1) {
	   

			var value = '';
			var expires ='';
			var path ='';
			var domain ='';
			var secure ='';

		    var cookieString = GLOBAL_COOKIE_NAME + '=' +escape('NOT POPULATED') + 
	       ( (expires) ? ';expires=' + expires.toGMTString() : '') + 
	       ( ';path=/') +
	       ( (domain) ? ';domain=' + domain : '') + 
	       ( (secure) ? ';secure' : ''); 
		    document.cookie = cookieString; 

	   		return Get_Global_Cookie();
	   		// return null; 
	   
	   }
	   var end = document.cookie.indexOf(';',len); 
	   if (end == -1) end = document.cookie.length; 
	   return unescape(document.cookie.substring(len,end)); 
	} 
	
	function Set_Global_Cookie(value,expires,path,domain,secure) {
		
		var name = GLOBAL_COOKIE_NAME;	

	    var cookieString = name + '=' +escape(value) + 
	       ( (expires) ? ';expires=' + expires.toGMTString() : '') + 
	       ( ';path=/') + 
	       ( (domain) ? ';domain=' + domain : '') + 
	       ( (secure) ? ';secure' : ''); 
	    document.cookie = cookieString; 
	} 
	

	function DeleteAllCookies() 
	{
		return;
		cookies = document.cookie.split(";");

		for (i=0; i<cookies.length; i++) {

			indCookie = cookies[i].indexOf("=");
			cName = cookies[i].substring(0,indCookie);

				// alert("deleting cookie " + cName);
				Set_Global_Cookie(cName, ''); //function to set cookies
		}
		
		Set_Global_Cookie('');
	}









	var today = new Date(); 
	var zero_date = new Date(0,0,0); 
	today.setTime(today.getTime() - zero_date.getTime()); 
	
	var cookie_expire_date = new Date(today.getTime() + (8 * 7 * 86400000)); 
	
	function setVisitorID() { 
	   if (Get_Cookie('VisitorID')) { 
	       var VisitorID = Get_Cookie('VisitorID'); 
	   }else{ 
	       Set_Cookie('VisitorID',Math.random(),cookie_expire_date); 
	   } 
	} 
	
	function setSessionID() { 
	   if (!Get_Cookie('SessionID')) 
	       Set_Cookie('SessionID',Math.random()); 
	} 
	
	var loaded_script = true; 
	
	
	
	//This line is used to set a visitor ID, which is easier 
	//setVisitorID(); 

	//Be sure the user fills out a required field
    function IsNotEmpty(strFieldValue, strAlert)

    {

      if(strFieldValue == ""){

	  if(strAlert != "")alert(strAlert);

	  return false;

	}

        return true;

     }
    
   
   function DisplayStateName() 
   {
		document.write(GetStateName());
   }
   
   function GetState() 
   {
		return String(GetStateName());
   }

   function GetStateName() 
   {
		var stateName = parseQwestProfileToken("state");

		if (stateName == null || stateName == "") 
		{
			window.location = CHANGE_STATE_URL;
			return stateName;
		}

		stateName = stateName.toUpperCase();
		if(stateName == "AZ")
			stateName = "ARIZONA";
		else if(stateName == "CO")
			stateName = "COLORADO";
		else if(stateName == "IA")
			stateName = "IOWA";
		else if(stateName == "ID")
			stateName = "IDAHO";
		else if(stateName == "MN")
			stateName = "MINNESOTA";
		else if(stateName == "MT") 
			stateName = "MONTANA";
		else if(stateName == "NE") 
			stateName = "NEBRASKA";
		else if(stateName == "ND") 
			stateName = "NORTH DAKOTA";
		else if(stateName == "NM") 
			stateName = "NEW MEXICO";
		else if(stateName == "OR") 
			stateName = "OREGON";
		else if(stateName == "SD") 
			stateName = "SOUTH DAKOTA";
		else if(stateName == "UT") 
			stateName = "UTAH";
		else if(stateName == "WA") 
			stateName = "WASHINGTON";
		else if(stateName == "WY") 
			stateName = "WYOMING";
		else
        {
		    window.location = OOR_STATE_URL;
        }   
		return stateName;
   }
 
   function DisplayHiSpeedInternetAddress() 
   {
		var add1 = Get_Cookie('HSI_ADD1');
		var add2 = Get_Cookie('HSI_ADD2');
		var city = Get_Cookie('HSI_CITY');
		var state = Get_Cookie('HSI_ST');
		var zipcode = Get_Cookie('HSI_ZIP');


		var addressdisplay = add1 + "<br>";

		if (add2 != null) 
		{
			addressdisplay = addressdisplay + add2 + "<br>";
		}
			addressdisplay = addressdisplay + city + ", " + state + " " + zipcode + "<br>";
		
		document.write(addressdisplay);
   }
   
   //This function should only be called from the 1-landing-page only.
   function InitializeOrder() 
   {
//		alert("qwestfunctions: InitialzeOrder() called.");
		//DeleteAllCookiesExceptState();
		InitializeOrderCookies();
		InitializeHighSpeedCookies();
		InitializeWirelessCookies();
		InitializePhoneCookies();
		InitializeCustomerCookies();
	    //ShowCookie();
   		// Set_Cookie('ST', 'ARIZONA');
   }

   function InitializeOrderCookies()
   {
   		//
   		// ORDER SETTINGS
		//
		InitializeOrderState();
		
   		Set_Cookie('O_BND', 'false');  	
   		Set_Cookie('O_BND_NM', '');  	

   		Set_Cookie('O_TTL_M' , '0.00');
   		Set_Cookie('O_TTL_OT' , '0.00');
   		Set_Cookie('O_TTL' , '0.00');
   }
   
   function InitializeHighSpeedCookies() 
   {
		//
		// HIGH-SPEED INTERNET SETTINGS
		//
   		Set_Cookie( 'HSI_PLN' , '');
   		Set_Cookie( 'HSI_PLN_TYPE', '');
   		Set_Cookie( 'HSI_SPD' , '');
   		Set_Cookie( 'HSI_CMT' , '');
   		Set_Cookie( 'HSI_MDM_OWN' , '');
   		Set_Cookie( 'HSI_MDM_TYPE' , '');
   		Set_Cookie( 'HSI_MDM_M' , '');
   		Set_Cookie( 'HSI_MDM_OT' , '');

   		Set_Cookie( 'HSI_USB_QTY' , '0');
   		Set_Cookie( 'HSI_CRD_QTY' , '0');
   		Set_Cookie( 'HSI_USB_UCST' , '');
   		Set_Cookie( 'HSI_CRD_UCST' , '');
   		Set_Cookie( 'HSI_USB_TTL_CST' , '0.00');
   		Set_Cookie( 'HSI_CRD_TTL_CST' , '0.00');
   		Set_Cookie( 'HSI_HW_TTL_CST' , '0.00');

   		Set_Cookie( 'HSI_BASE_M' , '0.00');
   		Set_Cookie( 'HSI_TTL_M' , '0.00');
   		Set_Cookie( 'HSI_TTL_OT' , '0.00');
   }
   
   function InitializeWirelessCookies() 
   {
		//
		// WIRELESS INTERNET SETTINGS
		//
   		Set_Cookie( 'WLS_MB_PLN' , '');
   		Set_Cookie( 'WLS_MB_CMT' , '');
   		Set_Cookie( 'WLS_MB_TTL_M' , '0.00');
   		Set_Cookie( 'WLS_MB_TTL_OT' , '0.00');
		Set_Cookie( 'WLS_CELL_MDL' , '');
		Set_Cookie( 'WLS_CELL_SVC_UCST' , '0.00'); 
		Set_Cookie( 'WLS_CELL_ACC' , ''); 
		Set_Cookie( 'WLS_CELL_SVC_CF_TTL_M', '');
   		Set_Cookie( 'WLS_CELL_PLN' , '');
   		Set_Cookie( 'WLS_CELL_CMT' , '');
   		Set_Cookie( 'WLS_CELL_TTL_M' , '0.00');
   		Set_Cookie( 'WLS_CELL_TTL_OT' , '0.00');
		Set_Cookie( 'WLS_CELL_SVC_CF' , '');
   }
   
	function InitializePhoneCookies() 
	{
		//
		// LOCAL PHONE SETTINGS
		//

   		Set_Cookie('LCL_TTL_M' , '0.00');
   		Set_Cookie('LCL_TTL_OT' , '0.00');
		Set_Cookie('LCL_PLN', '');
		Set_Cookie('LCL_LN_QTY', '0');
		Set_Cookie('LCL_PLN_CMT', '');
		Set_Cookie('LCL_PLN_UCST', '');
		Set_Cookie('LCL_FT', '');

		Set_Cookie('LCL_AL_QTY', '0');
		Set_Cookie('LCL_AL_UCST', '0.00');
		Set_Cookie('LCL_AL_TTL_CST', '0.00');
			   //ShowCookie();
		Set_Cookie('LCL_VM_REQ', '');
		Set_Cookie('LCL_VM_UCST', '');

   		Set_Cookie('LD_TTL_M' , '0.00');
		Set_Cookie('LD_PLN', '');
		Set_Cookie('LD_LN_QTY', '0');
		Set_Cookie('LD_PLN_CMT', '');
		Set_Cookie('LD_PLN_UCST', '');
		Set_Cookie('LD_FT', '');
		Set_Cookie('LD_AL_QTY', '');
		Set_Cookie('LD_AL_UCST', '');
		Set_Cookie('LD_VM_REQ', '');
		Set_Cookie('LD_VM_UCST', '');
	}

	function InitializeCustomerCookies()
	{
        Set_Cookie('S_COMPANYNAME' ,'');
        Set_Cookie('S_ADDRESS1', '');
		Set_Cookie('S_ADDRESS2', '');
		Set_Cookie('S_CITY', '');
		Set_Cookie('S_STATE', '');
		Set_Cookie('S_ZIP', '');
		Set_Cookie('S_QWEST_CUST','');
		Set_Cookie('S_BUS_TYPE','');
        Set_Cookie('BLG_CONTACT', '');
		Set_Cookie('BLG_TITLE', '');
		Set_Cookie('BLG_CN', '');
		Set_Cookie('BLG_AD1', '');
		Set_Cookie('BLG_AD2', '');
		Set_Cookie('BLG_CITY', '');
		Set_Cookie('BLG_STATE', '');
		Set_Cookie('BLG_ZIP', '');
		Set_Cookie('BLG_ARECODE', '');
		Set_Cookie('BLG_PHONEPART1','');
		Set_Cookie('BLG_PHONEPART2', '');
		Set_Cookie('BLG_ALTACODE', '');
		Set_Cookie('BLG_ALTPHPART1','');
		Set_Cookie('BLG_ALTPHPART2', '');
		Set_Cookie('BLG_CURACODE', '');
		Set_Cookie('BLG_CURPHPART1','');
		Set_Cookie('BLG_CURPHPART2', '');
		Set_Cookie('BLG_EMAIL', '');
        Set_Cookie('BLG_OWNER', '');
		Set_Cookie('BLG_TAXID', '');
		Set_Cookie('BLG_SNN1', '');
		Set_Cookie('BLG_SNN2', '');
		Set_Cookie('BLG_SNN3', '');
//		Set_Cookie('BLG_CONTACTDATE', '');  //not used anymore  4/3/2008 (Eric)
		Set_Cookie('BLG_TIMEOFDAY', '');
	}

   function ShowCookie() 
   {
     var everycookievalue  = document.cookie;
     var pairsSplit = everycookievalue.split(";");
     var elementsSplit;
     var patternNospace = /[^\s]+/;
     var finalName;
     var finalValue;
     var cookieDisplayText = "";
     for ( count=0 ; ( pairsSplit[count] != undefined ) ; count++ ) 
     {
         cookieDisplayText = cookieDisplayText + LTrim(pairsSplit[count]) + "\n";
     }
	 alert(cookieDisplayText);
   }
   
	function DeleteAllCookiesExceptState() 
	{
		return;
		cookies = document.cookie.split(";");

		for (i=0; i<cookies.length; i++) {

			indCookie = cookies[i].indexOf("=");
			cName = cookies[i].substring(0,indCookie);

			if (Trim(cName) == "ST") 
			{
				// alert("NOT deleting cookie " + cName);
			}
			else {
		
				// alert("deleting cookie " + cName);
				Set_Cookie(cName, ''); //function to set cookies

			}
		}
	}

   

	function IsBundle() 
	{
		var bundle = Get_Cookie('O_BND');
		return bundle;
	}
   
	function IsBusinessVoiceMailIncluded(plan)
	{
		//business voice mail not included for plans A or D
		if (plan == "A" || plan == "D") 
		{			
			return true;
		}
		else
			return false;
	}


	

	
	function HideElement(elementID)
	{
	    document.getElementById(elementID).style.display = 'none';
	}

	function ShowElement(elementID)
	{
	    document.getElementById(elementID).style.display = 'block';
	}

	function HidePhoneCart() 
	{
		HideElement("LocalPhoneTitleRow");
		HideElement("LocalPhoneLine1");
		HideElement("LocalPhoneLine2");
		HideElement("LongDistancePhoneTitleRow");
		HideElement("LongDistancePhoneLine1");
	}
	
	function ShowPhoneCart() 
	{
		ShowElement("LocalPhoneTitleRow");
		ShowElement("LocalPhoneLine1");
		ShowElement("LocalPhoneLine2");
		ShowElement("LongDistancePhoneTitleRow");
		ShowElement("LongDistancePhoneLine1");
	}
	
	function HideHiSpeed() {
		HideElement("HispeedLine1");
		HideElement("HispeedLine2");
		HideElement("HispeedLine3");
	}
	
	function ShowHiSpeed() {
		ShowElement("HispeedLine1");
		ShowElement("HispeedLine2");
		ShowElement("HispeedLine3");
	}


	function ToggleViewMore() 
	{
		var elementID = "ViewMoreSection";
		if (document.getElementById("ViewMoreBar").className == 'b-grey') 
		{
		    document.getElementById(elementID).style.display = 'block';
		    document.getElementById("ViewMoreBar").className = 'b-grey-minus';
		}
		else 
		{
		    document.getElementById(elementID).style.display = 'none';
		    document.getElementById("ViewMoreBar").className = 'b-grey';
		}
	}

	function DisplayChangeStateLink() 
	{
		var url = "(<a href='" + CHANGE_STATE_URL + "'>change</a>)";
		document.write(url);
	}


	function NumberOfLocalPhoneLinesOrdered() 
	{
		var isPhone = IsPhoneSelected();

		if (isPhone == null || isPhone == "false" || isPhone == "") 
		{
			return 0;
		}
	
		var linesOrdered = Get_Cookie('LCL_LN_QTY');
		if (linesOrdered == null || linesOrdered == "") 
		{
			return 0;
		}
		else 
		{
			return Number(linesOrdered);
		}
	}

	function NumberOfLocalPhoneAdditionalLinesOrdered() 
	{
		var isPhone = IsPhoneSelected();

		if (isPhone == null || isPhone == "false" || isPhone == "") 
		{
			return 0;
		}
	
		var addlLinesOrdered = Get_Cookie('LCL_AL_QTY');
		if (addlLinesOrdered == null || addlLinesOrdered == "") 
		{
			return 0;
		}
		else 
		{
			return Number(addlLinesOrdered);
		}
	}

	function lightboxPop(url) 
	{
		newSurveyWindow = window.open(url, "lightboxWindow", "directories=no,menubar=no,status=no,titlebar=no,toolbar=no,height=500,width=400");
	}


	function BundleComplete() 
	{
//alert("BundleComplete()");
//alert("Bundle=" + Get_Cookie('O_BND'));
//alert("Wirels=" + Get_Cookie('O_WLS'));
//alert("HighSp=" + Get_Cookie('O_HI'));
//alert("Phone=" + Get_Cookie('O_PH'));

		if (IsBundle() == "false") 
		{
//alert("Not Bundle");
			return true;
		}
		else {
			
			// It's a bundle .. now, are all paths complete?

			if (IsHighSpeedInternetOrderInProgress() == "true") 
			{
				return false;
			}
			else if (IsWirelessOrderInProgress() == "true") 
			{
				return false;
			}
			else if (IsLocalPhoneOrderInProgress() == "true") 
			{
				return false;
			}
			else if (IsLongDistanceOrderInProgress() == "true") 	
			{
				return false;
			}
		}
		
		return true;
	
	}
	
	
	function GetLocalPhonePlanName()
	{
		var plan = Get_Cookie('LCL_PLN');
		var planName = "";
		
		switch(plan)
		{
			case "A":
				planName = "Qwest Choice&trade; Business Plus";
				break;
			case "B":	
				planName = "Qwest Choice&trade; Business";
				break;
			case "C":
				planName = "Qwest Choice&reg; Business Prime";
				break;
			case "D":
				planName = "Qwest Flat Rate Business Line";
				break;
			default:
				planName = "";
				break;
		}

		return(planName);	
	}
	
	function GetLongDistancePlanName()
	{
		var plan = Get_Cookie('LD_PLN');
		var planName = "";
		
		switch(plan)
		{
			case "A":
				planName = "Qwest Choice&reg; Unlimited";
				break;
			case "C":	
				planName = "Qwest Choice&trade; Long Distance Plus";
				break;
			case "B":
				planName = "Qwest Choice&trade; Long Distance Basic";
				break;
			default:
				planName = "";
				break;
		}

		return(planName);	
	}
	
	function GetMobileBroadbandPlanName()
	{
		var plan = Get_Cookie('WLS_MB_PLN');
		var planName = "";
		
		switch(plan)
		{
			case "A":
				planName = "Mobile Laptop Data Plan";
				break;
			case "B":	
				planName = "Mobile Broadband 600MB";
				break;
			case "C":
				planName = "Mobile Broadband 500MB";
				break;
			default:
				planName = "";
				break;
		}

		return(planName);	
	}

	function GetHighSpeedPlanName()
	{
		var plan = Get_Cookie('HSI_PLN');
		var planName = "";
		
		switch(plan)
		{
			case "A":
				planName = "Qwest High-Speed Internet&trade; with Office Plus";
				break;
			case "B":	
				planName = "Qwest High-Speed Internet&trade; with Office Plus";
				break;
			case "C":
				planName = "Qwest High-Speed Internet&trade; with Office Basic";
				break;
			default:
				planName = "Qwest High-Speed Internet&trade; with Office Basic";
				break;
		}

		return(planName);	
	}
	
	function GetCellPhonePlanName()
	{
		var plan = Get_Cookie('WLS_CELL_PLN');
		var planName = "";
		
		switch(plan)
		{
			case "A":
				planName = "Qwest Wireless® National 1000 Plan";
				break;
			case "B":	
				planName = "Qwest Wireless® National 500 Plan";
				break;
			case "C":
				planName = "Qwest Wireless® National 2500 Plan";
				break;
			default:
				planName = "";
				break;
		}

		return(planName);	
	}

	
	function GetCellPhoneName()
	{
		var phoneModel = Get_Cookie('WLS_CELL_MDL');
		var phoneName = "";

		if(phoneModel == "Moto_Q_Smart_Phone" ||phoneModel == "moto_q_smart_phone")
		{
			phoneName = "Moto Q&trade; Smart Phone";
		}
		else if(phoneModel == "Mogul_by_HTC_Smart_Phone" || phoneModel == "mogul_by_htc_smart_phone")
		{
			phoneName = "Mogul&trade; by HTC Smart Phone";
		}
		else if(phoneModel == "Sanyo_Katana_II_Pink" || phoneModel == "sanyo_katana_ii_pink")
		{
			phoneName = "Sanyo Katana&reg; II Pink";
		}
		else if(phoneModel == "Sanyo_Katana_II_Black" || phoneModel == "sanyo_katana_ii_black")
		{
			phoneName = "Sanyo Katana&reg; II Blackk";
		}
		else if(phoneModel == "Sanyo_7050" || phoneModel == "sanyo_7050")
		{
			phoneName = "Sanyo&reg; 7050";	
		}
		else if(phoneModel == "Kyocera_K132" || phoneModel == "kyocera_k132")
		{
			phoneName = "Kyocera&reg; K132";
		}
			
		else if(phoneModel == "Qwest_Fusion_HTC_5800" || phoneModel == "qwest_fusion_htc_5800") 
		{
		    phoneName = "Qwest Fusion&trade; HTC 5800";
		}	
		
		return(phoneName);	
	}
	
	function SetPhoneChargerSelected(selected)
	{
	    if(selected == true)
	    {
	        Set_Cookie( 'WLS_CELL_ACC' , 'x'); 
	    }
	    else
	    {
	        Set_Cookie( 'WLS_CELL_ACC' , '');
	    }
	}
	
    function IsPhoneChargerSelected()
    {
	    var chargerSelected = Get_Cookie( 'WLS_CELL_ACC');

	    if(chargerSelected == "x") 
	        return("true");
	    else
	        return("false");
    }
/*

	function CheckCookieWork() {
	
	
	   		var str = "";
   		
   		
   		str = str + "O_BND = " + Get_Cookie('O_BND') + "\n";  	
   		str = str + "O_BND_NM = " + Get_Cookie('O_BND_NM') + "\n";  	
   		str = str + "O_HSI = " + Get_Cookie('O_HSI') + "\n";  	
		str = str + "O_HSI_ST = " + Get_Cookie('O_HSI_ST') + "\n";
   		str = str + "O_WLS = " + Get_Cookie('O_WLS') + "\n";	
   		str = str + "O_WLS_ST = " + Get_Cookie('O_WLS_ST') + "\n";	
   		str = str + "O_PH = " + Get_Cookie('O_PH') + "\n";			
   		str = str + "O_PH_ST = " + Get_Cookie('O_PH_ST') + "\n";
   		str = str + "O_PH_LCL_ONLY = " + Get_Cookie('O_PH_LCL_ONLY') + "\n";
		str = str + "WLS_MB_ORD_ST = " + Get_Cookie('WLS_MB_ORD_ST') + "\n";
		str = str + "WLS_CELL_ORD_ST = " + Get_Cookie('WLS_CELL_ORD_ST') + "\n";
		alert(str);
	}
*/   

	function GetNextProductUrl() 
	{
		var url_debug = "no";
		
		if (IsBundle() == "false") 
		{
			if (url_debug == "yes") alert("IsBundle() = false");
			return "1-landing-page.html";
		}
		else 
		{
			if (url_debug == "yes") alert("IsBundle() = true");
			// It's a bundle .. now, are all paths complete?		
			if((IsHighSpeedInternetSelected() == "true") && (IsHighSpeedInternetOrderInProgress() == "true"))
			{
				if (url_debug == "yes") alert("HSI Selected, in progress");
				return "8-hsi-service.html";
			}
			else if ((IsWirelessOrderInProgress() == "true") && (IsWirelessSelected() == "true"))
			{
				if (url_debug == "yes") alert("WlsOrder Selected, in progress");
				var mbComplete = IsMobileBroadbandOrderComplete();
				var cellComplete = IsCellPhoneOrderComplete();
			
				//if Mobile BB is selected but incomplete, then redirect there
				if((IsMobileBroadbandSelected() == "true") && (String(mbComplete) != "true"))
				{
					if (url_debug == "yes") alert("MBB Selected, in progress");				
					return "w4-wireless-mobile-broadband-plan.html";
				}
				//else if Mobile BB is selected but incomplete, then redirect there
				else if((IsCellPhoneSelected() == "true") && (String(cellComplete) != "true"))
				{
					if (url_debug == "yes") alert("CellPhone Selected, in progress");				
					return "w3-wireless-choose-phone.html";
				}
				//Otherwise go to the selection page.				
				else 
				{
					if (url_debug == "yes") alert("Wls selected, no service selected");				
					return "w1-wireless-landing-page.html";
				}
			}
			else if ((IsPhoneSelected() == "true") && (IsLocalPhoneOrderInProgress() == "true"))
			{
				if (url_debug == "yes") alert("Phone selected, in progress");				
				return "4-local-phone-service.html";
			
			}
			else if ((IsLongDistanceOrderSelected() == "true") && (IsLongDistanceOrderInProgress() == "true"))
			{
				if (url_debug == "yes") alert("LD selected, in progress");				
				return "5-long-distance-service.html";
			}							
		}
		if (url_debug == "yes") alert("No services selected, in progress.");	
		return "1-landing-page.html";
	}

    function GetOneTimeChargeDisclaimerText()
    {
        return "* Plus taxes, surcharges and other fees.  Estimated charges do not include jack installations and high-speed internet fees.  Other charges may apply.";
    }

	function ShowSummary()
	{
//alert("Test");
		var localPhoneMonthly = 0.00;
		var localPhoneOneTime = 0.00;	
		var longDistancePhoneMonthly = 0.00;
		var longDistancePhoneOneTime = 0.00;
		var wirelessMonthly = 0.00;
		var wirelessOneTime = 0.00;
		var hiSpeedMonthly = 0.00;
		var hiSpeedOneTime = 0.00;

		var localLineNum = 0;
		var localALineNum = 0;
		var lDistLineNum = 0;
		var localATCost = 0;

		var MobileBBsMonthly = 0.00;
		var MobileBBOneTime = 0.00;

		var isWireless = IsWirelessSelected();
		var isPhone = IsPhoneSelected();
		var isBundle = IsBundle();
		var isHiSpeed = IsHighSpeedInternetSelected();
		var strHtml;
		var strTable;

		var CellPhonePlan = Get_Cookie('WLS_CELL_PLN');
		var CellBBPlan = Get_Cookie('WLS_MB_PLN');

		var LclPhonePlan = Get_Cookie('LCL_PLN');
		var LdPhonePlan = Get_Cookie('LD_PLN');

		Set_Cookie('GOFORTH' , 'false');

		//localPhoneMonthly = Get_Cookie('LCL_TTL_M');
		//localPhoneMonthly = Get_Cookie('LCL_PLN_UCST');
		localPhoneMonthly = Get_Cookie('LCL_PLN_TTL_CST');
		localPhoneOneTime = Get_Cookie('LCL_TTL_OT');	
		longDistancePhoneMonthly = Get_Cookie('LD_TTL_M');
		wirelessMonthly = Get_Cookie('WLS_CELL_TTL_M');
		wirelessOneTime = Get_Cookie('WLS_CELL_TTL_OT');

		hiSpeedMonthly = Get_Cookie('HSI_TTL_M');
		hiSpeedOneTime = Get_Cookie('HSI_TTL_OT');

		MobileBBsMonthly = Get_Cookie('WLS_MB_TTL_M');
		MobileBBOneTime = Get_Cookie('WLS_MB_TTL_OT');

		localLineNum = Get_Cookie('LCL_LN_QTY');
		localALineNum = Get_Cookie('LCL_AL_QTY');
		lDistLineNum = Get_Cookie('LD_LN_QTY');
		localATCost = Get_Cookie('LCL_AL_TTL_CST');

		var comprehensiveMonthly = Number(hiSpeedMonthly) + Number(localPhoneMonthly) + Number(longDistancePhoneMonthly) + Number(wirelessMonthly) + Number(MobileBBsMonthly) + Number(localATCost);
		var comprehensiveOneTime = Number(hiSpeedOneTime) + Number(localPhoneOneTime) + Number(longDistancePhoneOneTime) + Number(wirelessOneTime) + Number(MobileBBOneTime);
		var comprehensiveTotal = comprehensiveMonthly + comprehensiveOneTime;

//alert("HS:" + hiSpeedMonthly);
//alert("LP:" + localPhoneMonthly);
//alert("LD:" + longDistancePhoneMonthly);
//alert("WLS:" + wirelessMonthly);
//alert("MBB:" + MobileBBsMonthly);
//alert("LCA:" + localATCost);
//alert("C:" + comprehensiveMonthly);

   		Set_Cookie('O_TTL_M' , comprehensiveMonthly);
   		Set_Cookie('O_TTL_OT' , comprehensiveOneTime);
   		Set_Cookie('O_TTL' , '0.00');

		var monthlyText = formatCurrency(hiSpeedMonthly);
		var oneTimeText = formatCurrency(hiSpeedOneTime);

		var comprehensiveMonthlyText = formatCurrency(comprehensiveMonthly);
		var comprehensiveOneTimeText = formatCurrency(comprehensiveOneTime);

        var oneTimeChargeDisclaimerText = GetOneTimeChargeDisclaimerText();

		strTable = "<table style='width: 100%;' class='smaller' id='table1'>";
		if (isWireless == "true") 
		{
			if(CellPhonePlan != null && CellPhonePlan != "")
			{
				strTable += "<tr>";
				strTable += "  <td colspan='2'><strong>Wireless Phone Service</strong></td>";
				strTable += "</tr>";
				strTable += "<tr>";
				strTable += "  <td valign='bottom'>Monthly charges:</td>";
				strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(wirelessMonthly) + "</td>";
				strTable += "</tr>";
				strTable += "<tr>";
				strTable += "  <td valign='bottom'>One-time charges:</td>";
				strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(wirelessOneTime) + "</td>";
				strTable += "</tr>";
			}

			if(CellBBPlan != null && CellBBPlan != "")
			{
				strTable += "<tr>";
				strTable += "  <td colspan='2'><strong>Mobile Broadband Service</strong></td>";
				strTable += "</tr>";
				strTable += "<tr>";
				strTable += "  <td valign='bottom'>Monthly charges:</td>";
				strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(MobileBBsMonthly) + "</td>";
				strTable += "</tr>";
				strTable += "<tr>";
				strTable += "  <td valign='bottom'>One-time charges:</td>";
				strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(MobileBBOneTime) + "</td>";
				strTable += "</tr>";
			}
		}
		
		if (isPhone == "true") 
		{
			if(LclPhonePlan != null && LclPhonePlan != "")
			{
				strTable += "<tr>";
				strTable += "  <td colspan='2'><strong>Local Phone Service</strong></td>";
				strTable += "</tr>";
//alert(localLineNum);
				strTable += "<tr>";
				strTable += "  <td valign='bottom'>Primary line (" + localLineNum + "): </td>";
				strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(localPhoneMonthly) + "</td>";
				strTable += "</tr>";
//alert(localALineNum);
				if(localALineNum > 0)
				{
//alert("X:" + localALineNum);
					strTable += "<tr>";
					strTable += "  <td valign='bottom'>Additional line (" + localALineNum + "): </td>";
					strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(localATCost) + "</td>";
					strTable += "</tr>";
				}
				if(Number(localPhoneOneTime) > 0.0)
				{
					strTable += "<tr>";
					strTable += "  <td valign='bottom'>One-time charges:</td>";
					strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(localPhoneOneTime) + "</td>";
					strTable += "</tr>";
				}
			}

			if(LdPhonePlan  != null && LdPhonePlan  != "")
			{
				strTable += "<tr>";
				strTable += "  <td colspan='2'><strong>Long Distance Service</strong></td>";
				strTable += "</tr>";
				if(lDistLineNum > 0)
				{
					strTable += "<tr>";
					strTable += "  <td valign='bottom'>Plans Selected (" + lDistLineNum + "): </td>";
					strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(longDistancePhoneMonthly) + "</td>";
					strTable += "</tr>";
				}
			}
		}
		
		if (isHiSpeed == "true") 
		{
			strTable += "<tr>";
			strTable += "  <td colspan='2'><strong>High-Speed Internet</strong></td>";
			strTable += "</tr>";
			strTable += "<tr>";
			strTable += "  <td valign='bottom'>Monthly charges:</td>";
			strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(hiSpeedMonthly) + "</td>";
			strTable += "</tr>";
			strTable += "<tr>";
			strTable += "  <td valign='bottom'>One-time charges:</td>";
			strTable += "  <td valign='bottom' class='textalignright'>" + formatCurrency(hiSpeedOneTime) + "</td>";
			strTable += "</tr>";
		}
		strTable += "</table>";

		document.getElementById('RightChart').innerHTML = strTable;

		document.getElementById('CartComprehensiveMonthlyTotal').innerHTML = comprehensiveMonthlyText + '/mo.';
		document.getElementById('CartComprehensiveOneTimeTotal').innerHTML = comprehensiveOneTimeText + '*';
        document.getElementById('OneTimeChargeDisclaimer').innerHTML = oneTimeChargeDisclaimerText;
	}


	function PrintCallFeatures()
	{
		var msg = "";
		var feature = Get_Cookie('LCL_FT');
		var lclPhonePlan = Get_Cookie('LCL_PLN');

		if (feature.indexOf("01") > -1 && lclPhonePlan != "D")
		{
			if(lclPhonePlan == "C")
				msg += "Business Voice Mail                           $" + Trim(ConvertNull(Get_Cookie('LCL_VM_UCST'))) + " \n";
			else
				msg += "Business Voice Mail                           Included \n";
		}
		if (feature.indexOf("02") > -1 && lclPhonePlan != "D")
		{
			msg += "Caller ID                                     Included \n";
		}
		if (feature.indexOf("03") > -1 && lclPhonePlan != "D")
		{
			msg += "Call Forwarding                               Included \n";
		}
		if (feature.indexOf("04") > -1 && lclPhonePlan != "D")
		{
			msg += "Remote Access Forwarding                      Included \n";
		}
		if (feature.indexOf("05") > -1 && lclPhonePlan != "D")
		{
			msg += "3-Way Calling                                 Included \n";
		}
		if (feature.indexOf("06") > -1 && lclPhonePlan != "D")
		{
			msg += "Call Transfer                                 Included \n";
		}
		if (feature.indexOf("07") > -1 && lclPhonePlan != "D")
		{
			msg += "Unistar Wire Maintenance                      Included \n";
		}
		if (feature.indexOf("08") > -1 && lclPhonePlan != "D")
		{
			msg += "Hunting                                       Included \n";
		}
		if (feature.indexOf("09") > -1 && lclPhonePlan != "D")
		{
			msg += "Caller ID                                     Included \n";
		}
		if (feature.indexOf("10") > -1 && lclPhonePlan != "D")
		{
			msg += "Call Waiting                                  Included \n";
		}
		if (feature.indexOf("11") > -1 && lclPhonePlan != "D")
		{
			msg += "Call Waiting ID                               Included \n";
		}
		if (feature.indexOf("12") > -1 && lclPhonePlan != "D")
		{
			msg += "Qwest 411 Directory Assistance Call Allowance Included \n";
		}
		if (feature.indexOf("13") > -1 && lclPhonePlan != "D")
		{
			msg += "Custom Ringing                                Included \n";
		}
		if (feature.indexOf("14") > -1 && lclPhonePlan != "D")
		{
			msg += "Last Call Return                              Included \n";
		}
		if (feature.indexOf("15") > -1 && lclPhonePlan != "D")
		{
			msg += "Dial Lock                                     Included \n";
		}

		return msg;
	}

var bChargerIncludes = false;
var chargerCost = 0.00;

	function PrintGetLocalPhone()
	{
		var msg = "";

		if(IsPhoneSelected() == "true")
		{
			msg += "===========================================================\n";
			msg += "LOCAL PHONE SERVICE\n";
			msg += "===========================================================\n";
			//msg += Trim(ConvertNull(Get_Cookie('LCL_PLN')));
//alert("Plane:" + Get_Cookie('LCL_PLN') +":");

			if(Get_Cookie('LCL_PLN') == "A")
 				msg += "Qwest Choice™ Business Plus";
			else if(Get_Cookie('LCL_PLN') == "B")
 				msg += "Qwest Choice™ Business";
			else if(Get_Cookie('LCL_PLN') == "C")
 				msg += "Qwest Choice™ Business Prime";
			else if(Get_Cookie('LCL_PLN') == "D")
 				msg += "Qwest Flat Rate Business Line";
 
			msg += " - $" + Trim(ConvertNull(Get_Cookie('LCL_PLN_UCST'))) + "/month \n\n";


			if(Get_Cookie('LCL_PLN') == "A")
			{
				msg += "Includes unlimited local calls and your choice of our most\n";
				msg += "popular calling features. Choose up to 15 features if you\n";
				msg += "like! Plus, enjoy the flexibility to change them at any\n";
				msg += "time, at no additional cost.\n";
			}
			else if(Get_Cookie('LCL_PLN') == "B")
			{
				msg += "Includes unlimited local calls and your choice of up to three calling \n";
				msg += "features, including Voice Mail. Plus, enjoy the flexibility to change them  \n";
				msg += "at any time, at no additional cost. \n";
			}
			else if(Get_Cookie('LCL_PLN') == "C")
			{
				msg += "Includes unlimited local calls and your choice of up to three calling \n";
				msg += "features (Voice Mail is an additional $9.95 a month). Plus, enjoy the \n";
				msg += "flexibility to change them at any time, at no additional cost. SAVE when \n";
				msg += "you choose a service commitment..\n";
			}
			else if(Get_Cookie('LCL_PLN') == "D")
			{
				msg += "Unlimited local calls on one phone line, calling features not included \n";
				msg += "but may be purchased separately.\n";
			}

			msg += "\n";
			msg += PrintCallFeatures();

			//msg += "Calling feature 1                    $xx.xx" + "\n";
			//if(Get_Cookie('LCL_VM_REQ') == "true")
			//{
			//	msg += "Voice Mail                           $" + Trim(ConvertNull(Get_Cookie('LCL_VM_UCST'))) + " \n";
			//}
            
			if(Number(Get_Cookie('LCL_PLN_CMT')) == 0)
				msg += "Service Agreement: Month-to-month:         " + formatCurrency(Trim(ConvertNull(Get_Cookie('LCL_PLN_UCST')))) + " \n";
			else if(Number(Get_Cookie('LCL_PLN_CMT')) == 1)            
    				msg += "Service Agreement: " + Trim(ConvertNull(Get_Cookie('LCL_PLN_CMT'))) + " year           " + formatCurrency(Trim(ConvertNull(Get_Cookie('LCL_PLN_UCST')))) + " \n";
			else
				msg += "Service Agreement: " + Trim(ConvertNull(Get_Cookie('LCL_PLN_CMT'))) + " years          " + formatCurrency(Trim(ConvertNull(Get_Cookie('LCL_PLN_UCST')))) + " \n";

			msg += "Number of lines: " + Trim(ConvertNull(Get_Cookie('LCL_LN_QTY'))) + "                   x" + Trim(ConvertNull(Get_Cookie('LCL_LN_QTY'))) + " \n";
			msg += "Total cost of Local Phone Service:   " + formatCurrency(Trim(Get_Cookie('LCL_TTL_M'))) + "/mo. \n";
			msg += "\n";

			if(Number(Get_Cookie('LCL_AL_QTY')) > 0)
			{
				msg += "Cost of Additional Lines of Service:         " + formatCurrency(Trim(ConvertNull(Get_Cookie('LCL_AL_UCST')))) + " \n";
				msg += "Number of Fax/Credit Card lines: " + Trim(ConvertNull(Get_Cookie('LCL_AL_QTY'))) + "               x" + Trim(ConvertNull(Get_Cookie('LCL_AL_QTY'))) + " \n";
				msg += "Total cost of Local Phone Service:   " + formatCurrency(Trim(Get_Cookie('LCL_AL_TTL_CST'))) + "/mo. \n";
				msg += "\n";
			}
			

		}

		return msg;

	}

	function PrintGetLongDistance()
	{
		var msg = "";

		if(IsPhoneSelected() == "true")
		{
			msg += "===========================================================\n";
			msg += "LONG DISTANCE SERVICE\n";
			msg += "===========================================================\n";
			//msg += Trim(ConvertNull(Get_Cookie('LD_PLN')));

			if(Get_Cookie('LD_PLN') == "A")
 				msg += "Qwest Choice™ Unlimited";
			else if(Get_Cookie('LD_PLN') == "B")
 				msg += "Qwest® Long Distance Plus";
			else if(Get_Cookie('LD_PLN') == "C")
 				msg += "Qwest® Long Distance Basic";

			msg += " - $" + Trim(ConvertNull(Get_Cookie('LD_PLN_UCST'))) + "/month \n\n";

			if(Get_Cookie('LD_PLN') == "A")
			{
				msg += "Extend the reach of your business and call all you want to\n";
				msg += "anywhere in the United States. For one low monthly fee\n";
				msg += "you'll enjoy the convenience of no calling-time\n";
				msg += "restrictions on all your domestic long-distance calls.\n";
				msg += "Best for businesses that want a predictable, reliable rate.\n";
				msg += "Get a $5 monthly discount off your first line when bundled\n";
				msg += "with Qwest Choice™ Business phone package!\n";
			}
			else if(Get_Cookie('LD_PLN') == "B")
			{
				msg += "Make all the domestic long-distance calls you want for a low, flat \n";
				msg += "per minute rate. Enjoy the convenience of no calling-time \n";
				msg += "restrictions for a low monthly fee of $2.99 (plus taxes and \n";
				msg += "surcharges).\n";
			}
			else if(Get_Cookie('LD_PLN') == "C")
			{
				msg += "Make all the domestic long-distance calls you want for a low, flat \n";
				msg += "per minute rate. Enjoy the convenience of no calling-time \n";
				msg += "restrictions and no monthly fee. Best for businesses that average \n";
				msg += "$15-$20 in long-distance charges.\n";
			}

			msg += "\n";

			msg += "Service Agreement: " + Trim(ConvertNull(Get_Cookie('LD_PLN_CMT'))) + " years           $" + Trim(ConvertNull(Get_Cookie('LD_PLN_UCST'))) + " \n";
			msg += "Number of lines: " + Trim(ConvertNull(Get_Cookie('LD_LN_QTY'))) + "                   x" + Trim(ConvertNull(Get_Cookie('LD_LN_QTY'))) + " \n";
			msg += "Total cost of Long Distance Service: $" + Trim(ConvertNull(Get_Cookie('LD_TTL_M'))) + "/mo. \n";
			msg += "\n";
		}

		return msg;

	}

	function PrintGetHighSpeed()
	{
		var msg = "";

		if(IsHighSpeedInternetSelected() == "true")
		{
			msg += "===========================================================\n";
			msg += "HIGH SPEED INTERNET\n";
			msg += "===========================================================\n";
			msg += "\n";

			//msg += Trim(ConvertNull(Get_Cookie('HSI_PLN')));
			if(Get_Cookie('HSI_PLN') == "A")
 				msg += "Qwest High-Speed Internet™ with Office Plus";
			else if(Get_Cookie('HSI_PLN') == "B")
 				msg += "Qwest High-Speed Internet™ with Office Plus";
			else if(Get_Cookie('HSI_PLN') == "C")
 				msg += "Qwest High-Speed Internet™ with Office Basic";

			msg += " - $" +  Trim(ConvertNull(Get_Cookie('HSI_BASE_M'))) + "/month \n\n";

			if(Get_Cookie('HSI_PLN') == "A")
			{
 				msg += "* 10 qwestoffice.net e-mail accounts \n";
 				msg += "* Security features such as antivirus protection, \n";
				msg += "content filtering, internet controls, firewall protection, \n";
				msg += "spyware and pop-up blocking  \n";
 				msg += "* 24/7 priority technical support \n";
 				msg += "* 25MB Web hosting \n";
 				msg += "* Search engine registration \n";
 				msg += "* National dial-in access \n";
			}
			else if(Get_Cookie('HSI_PLN') == "B")
			{
 				msg += "Includes 10 e-mail accounts, security features, 24/7 priority technical  \n";
 				msg += "support, Web hosting, National dial-in access, and search engine  \n";
				msg += "content filtering, internet controls, firewall protection, \n";
				msg += "registration.  \n";
			}
			else if(Get_Cookie('HSI_PLN') == "C")
			{
 				msg += "Reliable Internet access only - no e-mail accounts or other services. \n";
			}
			

			msg += "Service Agreement: " + Trim(ConvertNull(Get_Cookie('HSI_CMT'))) + " years               $" + Trim(Get_Cookie('HSI_BASE_M')) + " \n";
			if(Get_Cookie('HSI_MDM_OWN') == "purchase")
			{
				msg += "Purchase Modem: Advanced Networking      $" + Trim(ConvertNull(Get_Cookie('HSI_MDM_OT'))) + " \n";
			} else if(Get_Cookie('HSI_MDM_OWN') == "rent")
			{
				msg += "Rent Modem: Advanced Networking          $" + Trim(ConvertNull(Get_Cookie('HSI_MDM_M'))) + " \n";
			}
			msg += "\n";

			msg += "Wireless Adapters \n";

			msg += "- " + Trim(ConvertNull(Get_Cookie('HSI_CRD_QTY'))) + " Laptop cards                         $" + Trim(ConvertNull(Get_Cookie('HSI_CRD_TTL_CST'))) + " \n";
			msg += "- " + Trim(ConvertNull(Get_Cookie('HSI_USB_QTY'))) + " USB Adapters                         $" + Trim(ConvertNull(Get_Cookie('HSI_USB_TTL_CST'))) + " \n";

			msg += "Total cost of Internet Service:          $" + Trim(ConvertNull(Get_Cookie('HSI_TTL_M'))) + "/mo. \n";
			msg += "Total one-time charges:                  $" + Trim(ConvertNull(Get_Cookie('HSI_TTL_OT'))) + "\n";
			msg += "\n";
		}

		return msg;
	}

	function PrintGetCellPhone()
	{
		var phoneModel = Get_Cookie('WLS_CELL_MDL');
		var phonePlan = Get_Cookie('WLS_CELL_PLN');
		var phoneCommitment = Get_Cookie('WLS_CELL_CMT');
        phoneModel = phoneModel.toLowerCase();
        
		var phoneCost = GetWirelessMobilePhoneActualCost(phoneModel,phonePlan,phoneCommitment);
		var msg = "";

        phoneCost = SetCostText(phoneCost, "FREE");
        bChargerIncludes = GetWirelessMobilePhoneChargerIncluded(phoneModel);
        chargerCost = GetWirelessMobilePhoneChargerActualCost(phoneModel,IsPhoneChargerSelected())
        
		if(phoneModel == "Moto_Q_Smart_Phone" ||phoneModel == "moto_q_smart_phone")
		{
			msg += "Moto Q™ Smart Phone - " + phoneCost + "\n";
			msg += "\n";
			msg += "* Ultra-thin design\n";
			msg += "* Fast Internet access*\n";
			msg += "* E-mail access *\n";
			msg += "* QWERTY keyboard\n";
			msg += "* 1.3 megapixel camera\n";
			msg += "* Bluetooth wireless technology\n";
		}
		else if(phoneModel == "Mogul_by_HTC_Smart_Phone" || phoneModel == "mogul_by_htc_smart_phone")
		{
			msg += "Mogul™ by HTC Smart Phone - " + phoneCost + "\n";
			msg += "\n";
			msg += "* 2.0 megapixel camera \n";
			msg += "* Built-in camcorder *\n";
			msg += "* Sliding QWERTY keyboard \n";
			msg += "* Microsoft® Windows Mobile® 6\n";
			msg += "* Bluetooth® wireless technology \n";
		}
		else if(phoneModel == "Sanyo_Katana_II_Pink" || phoneModel == "sanyo_katana_ii_pink")
		{
			msg += "Sanyo Katana® II Pink - " + phoneCost + "\n";
			msg += "\n";
			msg += "* Digital camera \n";
			msg += "* Internet-ready*\n";
			msg += "* Bluetooth® wireless technology \n";
			msg += "* Global Positioning System (GPS) navigation-capable* \n";
		}
		else if(phoneModel == "Sanyo_Katana_II_Black" || phoneModel == "sanyo_katana_ii_black")
		{
			msg += "Sanyo Katana® II Black - " + phoneCost +  "\n";
			msg += "\n";
			msg += "* Digital camera \n";
			msg += "* Internet-ready*\n";
			msg += "* Bluetooth® wireless technology \n";
			msg += "* Global Positioning System (GPS) navigation-capable* \n";
		}
		else if(phoneModel == "Sanyo_7050" || phoneModel == "sanyo_7050")
		{
			msg += "Sanyo® 7050 - " + phoneCost + "\n";
			msg += "\n";
			msg += "* Ultra-thin design\n";
			msg += "* Bluetooth® wireless technology \n";
			msg += "* Global Positioning System (GPS) navigation-capable* \n";
		}
		else if(phoneModel == "Kyocera_K132" || phoneModel == "kyocera_k132")
		{
			msg += "Kyocera K132 - " + phoneCost + "\n";
			msg += "\n";
			msg += "* Sleek design \n";
			msg += "* Soft-feel finish \n";
			msg += "* 65K-color internal display \n";
			msg += "* Voice-activated dialing \n";
		}
		else if(phoneModel == "Qwest_Fusion_HTC_5800" || phoneModel == "qwest_fusion_htc_5800")
		{
		    msg += "Qwest Fusion™ HTC 5800 - " + phoneCost + "\n";
			msg += "\n";
			msg += "* 2 megapixel camera \n";
			msg += "* 12-key numeric dial pad \n";
			msg += "* Sliding QWERTY keyboard \n";
			msg += "* Bluetooth® wireless technology \n";
        }
        
		return msg;
	}

	function PrintGetCellPlan()
	{
		var msg = "";
		var phonePlan = Get_Cookie('WLS_CELL_PLN');

		if(phonePlan == "A")
		{
			msg += "Qwest Wireless® National 1000 Plan" + "   $" +  Trim(ConvertNull(Get_Cookie('WLS_CELL_SVC_UCST'))) + "/month \n";;
			msg += "\n";
			msg += "* One phone - 1000 anytime nationwide minutes" + "\n";
			msg += "* " + Trim(ConvertNull(Get_Cookie('WIRELESS_SVC_CELL_COMMITMENT'))) + "-year service agreement\n";
			msg += "\n";
		}
		else if(phonePlan == "B")
		{
			msg += "Qwest Wireless® National 500 Plan" + "   $" +  Trim(ConvertNull(Get_Cookie('WLS_CELL_SVC_UCST'))) + "/month \n";;
			msg += "\n";
			msg += "* One phone - 500 anytime nationwide" + "\n";
			msg += "* " + Trim(ConvertNull(Get_Cookie('WIRELESS_SVC_CELL_COMMITMENT'))) + "-year service agreement\n";
			msg += "\n";
		}
		else if(phonePlan == "C")
		{
			msg += "Qwest Wireless® National 2500 Plan" + "   $" +  Trim(ConvertNull(Get_Cookie('WLS_CELL_SVC_UCST'))) + "/month \n";;
			msg += "\n";
			msg += "* One phone - 2500 anytime nationwide" + "\n";
			msg += "* " + Trim(ConvertNull(Get_Cookie('WIRELESS_SVC_CELL_COMMITMENT'))) + "-year service agreement\n";
			msg += "\n";
		}

		return msg;
	}

	function PrintGetWireless()
	{
		var msg = "";
		var feature = Get_Cookie('WLS_CELL_SVC_CF');

		if(Get_Cookie('O_WLS') == "true" && Get_Cookie('WLS_CELL_PLN') != "")
		{
			msg += "===========================================================\n";
			msg += "WIRELESS PHONE SERVICE\n";
			msg += "===========================================================\n";
			msg += "\n";
			msg += PrintGetCellPhone();
			msg += "\n";
			msg += PrintGetCellPlan();
			msg += "-----------------------------------------------------------\n";
			msg += "Features\n";
			msg += "-----------------------------------------------------------\n";
			msg += "* Caller ID                         Included" + "\n";
			msg += "* Domestic Long Distance            Included" + "\n";
			msg += "* Three-Way Calling                 Included" + "\n";
			msg += "* Call Waiting                      Included" + "\n";
			msg += "* One Number                        Included" + "\n";
			msg += "* Voice Messaging Link              Included" + "\n";
			if (feature.indexOf("07") > -1)
				msg += "* Two-Way Text Messaging            $.05/message" + "\n";
			if (feature.indexOf("08") > -1)
				msg += "* Roadside Assistance               $3.99/mo." + "\n";
			if (feature.indexOf("09") > -1)
				msg += "* Sprint Power VisionSM (data plan) $10.00/mo." + "\n";
			if (feature.indexOf("10") > -1)
			{
				msg += "* Unlimited Nights and Weekends     $10.00/mo." + "\n";
				msg += "   Starting at 7 p.m.\n";
			}
			if (feature.indexOf("11") > -1)
				msg += "* Handset Insurance                 $4.99/mo." + "\n";

			msg += "-----------------------------------------------------------\n";
			msg += "Phone accessories\n";
			msg += "-----------------------------------------------------------\n";
			msg += "Starter Kit                            Included\n";
			msg += "Vehicle Power Charger                  ";
			if(!bChargerIncludes && Get_Cookie('WLS_CELL_ACC') == "x")
				msg += formatCurrency(chargerCost);
			else if(bChargerIncludes)
				msg += "Included\n";
			else
				msg += "Not Included\n";

			msg += "\n";

			msg += "Wireless phone service monthly total:  $" +  Trim(ConvertNull(Get_Cookie('WLS_CELL_TTL_M'))) + "/mo. \n";
			msg += "Wireless phone one-time charges:       $" +  Trim(ConvertNull(Get_Cookie('WLS_CELL_TTL_OT'))) + " \n";
			msg += "\n";
		}

		return msg;

	}

	function PrintGetMobilBroadband()
	{
		var msg = "";

		if(Get_Cookie('O_WLS') == "true" && Get_Cookie('WLS_MB_PLN') != "")
		{
			msg += "===========================================================\n";
			msg += "MOBILE BROADBAND SERVICE\n";
			msg += "===========================================================\n";
			msg += "\n";
			//msg += Trim(ConvertNull(Get_Cookie('WLS_MB_PLN')));
			if(Get_Cookie('WLS_MB_PLN') == "A")
 				msg += "Mobile Laptop Data Plan";
			else if(Get_Cookie('WLS_MB_PLN') == "B")
 				msg += "Mobile Broadband 600MB";
			else if(Get_Cookie('WLS_MB_PLN') == "C")
 				msg += "Mobile Broadband 500MB";
 
			msg += " - " +  formatCurrency(Trim(ConvertNull(Get_Cookie('WLS_MB_TTL_M')))) + "/month \n\n";

			if(Get_Cookie('WLS_MB_PLN') == "A")
			{
				msg += "Unlimited nationwide Internet access with download speeds"  + "\n";
				msg += "up to eight times faster than 56Kbps dial-up!\n";
			}
			else if(Get_Cookie('WLS_MB_PLN') == "B")
			{
				msg += "Use up to 600MB per month. Overage charge of $5 applies for each "  + "\n";
				msg += "5MB over limit.\n";
			}
			else if(Get_Cookie('WLS_MB_PLN') == "C")
			{
				msg += "Use up to 500MB per month. Overage charge of $3 applies for each "  + "\n";
				msg += "5MB over limit,\n";
			}
			msg += "\n";
			msg += "* " + Trim(ConvertNull(Get_Cookie('WLS_MB_CMT'))) + "-year service agreement\n";

			msg += "\n";
			msg += "Qwest&reg; Mobile Laptop Card                   " + formatCurrency(Trim(ConvertNull(Get_Cookie('WLS_MB_TTL_OT')))) + "\n";

			msg += "Mobile broadband service monthly total: " +  formatCurrency(Trim(ConvertNull(Get_Cookie('WLS_MB_TTL_M')))) + "/mo. \n";
			msg += "Mobile broadband one-time charges:      " +  formatCurrency(Trim(ConvertNull(Get_Cookie('WLS_MB_TTL_OT')))) + " \n";
			msg += "\n";

		}

		return msg;

	}

	function PrintGetMiscWireless()
	{
		var msg = "";

		if(Get_Cookie('O_WLS') == "true")
		{
			msg += "===========================================================\n";
			msg += "MISCELLANEOUS WIRELESS SERVICE FEES\n";
			msg += "===========================================================\n";
			msg += "\n";

			msg += "Activation fee                      $35.00" + "\n";
			msg += "Shipping fee                        $0.00" + "\n";
			msg += "Miscellaneous total:                $35.00" + "\n\n\n";
		}

		return msg;

	}

	function PrintGetTotal()
	{
		var msg = "";
		msg += "***********************************************************\n";
		msg += "***********************************************************\n";
		msg += "\n";
		msg += "TOTAL MONTHLY CHARGES FOR ALL SERVICES:    " +  formatCurrency(Trim(ConvertNull(Get_Cookie('O_TTL_M')))) + "/month \n";
		msg += "Total one-time charges for all services:   " +  formatCurrency(Trim(ConvertNull(Get_Cookie('O_TTL_OT')))) + " \n";
		msg += "\n";

		return msg;
	}

	function PrintGetCustomerInfo()
	{
		var msg = "";
		var isQwestCustomer = "No";
		
		if(Trim(Get_Cookie("S_QWEST_CUST")) == "true") isQwestCustomer = "Yes";
		
		msg += "---------------------------------------------------------------\n";
		msg += "IMPORTANT\n";
		msg += "The following customer has completed an online order.\n";
		msg += "Please take the time to quickly respond to their email below.\n";
		msg += "---------------------------------------------------------------\n";
		msg += "\n";
		msg += "\n";
		msg += "--------------\n";
		msg += "Customer Info:\n";
		msg += "--------------\n";
		msg += "Prefix: xx\n";
		msg += "First Name:     \n";
		msg += "Last Name:      \n";
		msg += "Company:        " + Get_Cookie("S_COMPANYNAME") + "\n";
		msg += "Title:   \n";
		msg += "Porting Existing Number: " + Get_Cookie('S_PORT_NUM') + "\n";
		msg += "Current Qwest Customer: " + isQwestCustomer + "\n";
        msg += "Business Type:  " + Get_Cookie("S_BUS_TYPE") + "\n";
		msg += "\n";
		msg += "SERVICE ADDRESS:\n";
		msg += "Address:        " + Trim(Get_Cookie("S_ADDRESS1")) + "\n";
		msg += "Address 2:      " + Trim(Get_Cookie("S_ADDRESS2")) + "\n";
		msg += "City:           " + Trim(Get_Cookie("S_CITY")) + "\n";
		msg += "State:  " + Trim(Get_Cookie("S_STATE")) + "\n";
		msg += "Zip:            " + Trim(Get_Cookie("S_ZIP")) + "\n";
		msg += "Phone:  (xxx) xxx-xxxx\n";
		msg += "\n";
		msg += "BILLING ADDRESS:\n";
		msg += "Billing Contact: " + Trim(Get_Cookie("BLG_CONTACT")) + "\n";
		msg += "Title:		" + Trim(Get_Cookie("BLG_TITLE")) + "\n";
		msg += "Business Name:	" + Trim(Get_Cookie("BLG_CN")) + "\n";
		msg += "Address:        " + Trim(Get_Cookie("BLG_AD1")) + "\n";
		msg += "Address 2:      " + Trim(Get_Cookie("BLG_AD2")) + "\n";
		msg += "City:           " + Trim(Get_Cookie("BLG_CITY")) + "\n";
		msg += "State:  " + Trim(Get_Cookie("BLG_STATE")) + "\n";
		msg += "Zip:            " + Trim(Get_Cookie("BLG_ZIP")) + "\n";
        if(isQwestCustomer == "Yes")
        {
		    msg += "Current Billing Phone:  (" + Trim(Get_Cookie("BLG_CURACODE")) + ") " + Trim(Get_Cookie("BLG_CURPHPART1")) + "-" + Trim(Get_Cookie("BLG_CURPHPART2")) + "\n";
        }
		msg += "Phone:  (" + Trim(Get_Cookie("BLG_ARECODE")) + ") " + Trim(Get_Cookie("BLG_PHONEPART1")) + "-" + Trim(Get_Cookie("BLG_PHONEPART2")) + "\n";
		msg += "Alt Phone:  (" + Trim(Get_Cookie("BLG_ALTACODE")) + ") " + Trim(Get_Cookie("BLG_ALTPHPART1")) + "-" + Trim(Get_Cookie("BLG_ALTPHPART2")) + "\n";
        
		msg += "E-mail: " + Trim(Get_Cookie("BLG_EMAIL")) + "\n";
		msg += "\n";
		msg += "-------------------\n";
		msg += "Credit Information:\n";
		msg += "-------------------\n";
		msg += "Type of Ownership: " + Get_Cookie("BLG_OWNER") + "\n";
		msg += "Tax ID:		" + Trim(Get_Cookie("BLG_TAXID")) + "\n";
		msg += "SSN:		" + Trim(Get_Cookie("BLG_SNN1")) + Trim(Get_Cookie("BLG_SNN2")) + Trim(Get_Cookie("BLG_SNN3")) + "\n";
		msg += "\n";
		msg += "-------------------\n";
		msg += "Contact Time of Day:\n";
		msg += "-------------------\n";
		msg += "\n";
//		msg += Trim(Get_Cookie("BLG_CONTACTDATE")) + "\n";
		msg += Trim(Get_Cookie("BLG_TIMEOFDAY")) + "\n";
		msg += "\n";

		return msg;
	}


	function PrintOrder()
	{
		var msg = "SUBJECT: New Small Business Service Order - Priority Please Read\n\n";

		msg += PrintGetCustomerInfo();
		msg += "***********************************************************\n";
		msg += "                ORDER SUMMARY AND REVIEW\n";
		msg += "***********************************************************\n";
		msg += "\n";
		msg += PrintGetLocalPhone();
		msg += PrintGetLongDistance();
		msg += PrintGetHighSpeed();
		msg += PrintGetWireless();
		msg += PrintGetMobilBroadband();
		//msg += PrintGetMiscWireless();
		msg += PrintGetTotal();

		if(IsWirelessSelected() == "true" || IsPhoneSelected() == "true")
		{
			msg += "Prices exclude taxes, surcharges, $1.75 monthly cost" + "\n";
			msg += "recovery fees per phone.\n";
		}

		msg += "***********************************************************\n";
		msg += "***********************************************************\n";
		msg += "\n\n\n";
		msg += "CONFIDENTIALITY CLAUSE\n";
		msg += "This communication is the property of Qwest and may contain\n";
		msg += "confidential or privileged information. Unauthorized use of\n";
		msg += "this communication is strictly prohibited and may be\n";
		msg += "unlawful. If you have received this communication in error\n";
		msg += "please immediately notify the sender by reply e-mail and\n";
		msg += "destroy all copies of the communication and any attachments.\n";

		return msg;
	}

function ShowOrderSummaryPage() {
	var orderSummaryPage = Get_Cookie('ORD_SUM') + "";
	
	if(orderSummaryPage != "") {
		document.write('<br /><a href="' + orderSummaryPage + '">Back to Order Summary</a> &rarr;');
	}
}

