	function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
	}

	function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
	}

	function MM_findObj(n, d) { //v3.0
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
	}

	function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2]};
	}

	function PlaceFocus(fieldname)	{
		document.forms[0].elements[fieldname].focus();	
	}
	
	function Rcertify() 
	{
	popupWin = window.open('http://www.bbbonline.org/cks.asp?id=101031513237', 'Participant','location=yes,scrollbars=yes,width=450,height=300'); 
	window.name = 'opener';
	}

	function changeShipSelect(form,shipField,shipStateField,stateSelectBox){
		var objShippingFld;
		var objShippingStateFld;
		var idx;
		var shipIdx;
		var tmpStr;
		objShippingFld = document.forms[form].elements[shipField];
		objShippingStateFld = document.forms[form].elements[shipStateField];
		shipIdx = objShippingFld.selectedIndex;
				
		if (stateSelectBox == 1){
			idx = objShippingStateFld.selectedIndex;
			if  ((objShippingFld.selectedIndex == 0 )&& (objShippingStateFld.options[idx].value == "HI") && (objShippingFld[shipIdx].value !=12)){
				alert('Please note: Ground shipping is unavailable when the shipping address is in Hawaii.');
				objShippingFld.options[1].selected = "Selected";
			}
		}else {
			if  ((objShippingFld.selectedIndex == 0 )&& (objShippingStateFld.value == "HI") && (objShippingFld[shipIdx].value !=12)){
				alert('Please note: Ground shipping is unavailable when the shipping address is in Hawaii.');
				objShippingFld.options[1].selected = "Selected";
			}
		}	
	}

	function OpenPromoWindow(sURL, ww)
	{
	newwindow=open(sURL,"promo","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=no,status=yes,width=" + ww + ",height=240");
	}

	function OpenOCWindow(sURL, ww)
	{
	newwindow=open(sURL,"promo","scrollbars=yes,toolbar=no,directories=no,menubar=no,resizable=no,status=yes,width=" + ww + ",height=240");
	}
	function RedirectSelection()	{
	
	//for your list box to work, change these variables to suit your needs
	var formName = 'frmListBox'
	var listBoxName = 'cboListBox' 
	
	//end
	
	var ListBoxIndex = document.forms[formName].elements[listBoxName].selectedIndex
	var ListBoxValue = document.forms[formName].elements[listBoxName].options[ListBoxIndex].value
	document.location.href = ListBoxValue
	
	
	}
	// Function SearchListBox
	// Purpose: Highlight indexed value in select box by comparing search text to array values
	// Input:	
	//		SrchFeild	Search Text field object (form field has onkeyup eventhandler to call function)
	//		ArrayObj	JS Array set up while creating list box
	//		LstBoxName	Name of form object for the list box
	// Use: The following is added to the field containing the text to use for searching
	//			onkeyup="SearchListBox(this,arrAgents,document.f_other.agent_select);"
	// Output: None
	// Author: BFreedman
	// Created 9/3/2003
	//
	function SearchListBox(SrchField, ArrayObj, LstBoxName){
		var SearchText = SrchField.value;
		var pattern =  new RegExp("^" + SearchText, "i");
		for (var i = 1; i < ArrayObj.length; i++){
			var tmp = ArrayObj[i].search(pattern);
			if (tmp > -1){ 
//				alert ("Serach Text: " + AgentSrch.value + " " + document.f_other.agent_select.options[i+1].value);
				LstBoxName.options[i+1].selected =true;
				return;
			}
		}
	}
	
	
	
	
	// Function ChangeDisplayByID
	// Purpose: Changes the css display attribute of the given id to spec'd value
	// Input:	
	//		elmID	Id of an html object we want to change the display value for
	//		value	value we want to change the display style to: probably either 'none' or 'block'
	// Output: None
	// Author: GSF
	// Created 9/10/2004
	function ChangeDisplayByID( elmID, value )
	{
		var node = document.getElementById( elmID );

		if( node )
		{
		//	alert("Found 1: " + elmID + " with right class changing to:|" + value +"|" );
			
			node.style.display = value;
		}
		
		return;
	}
	
	// Function: SetAccessoriesCheckBoxCookies
	// Purpose: Set a cookie indicating whether the user selected the accessorries checkbox
	// so we can persist the checkbox throught out the user experience. Use only on specialoffer
	// input: 
	// output none
	// Created by: lz 2/15/2005
	function SetAccessoriesCheckBoxCookies()
	{
		if(document.frmSpecialOffer.Accessories.checked)
		{
			document.cookie = "AccessoriesChecked=True" ;
		}
		else
		{
			document.cookie = "AccessoriesChecked=False" ;
		}
	}
	
	function AutoTab(original, len, destination, e)
	{
		var d;
		d = document.getElementsByName(destination);
		
		if ( e.keyCode != 9 && e.keyCode != 16 )
		{
			if ( original.value.length == len )
			{
				d[0].focus();
				d[0].select();
			}
		}
	}
	
	var req;

	// loadXMLDoc() from developer.apple.com
	function loadXMLDoc(url, func) 
	{
		// branch for native XMLHttpRequest object
		if ( window.XMLHttpRequest ) 
		{
			//alert("firefox");
			req = new XMLHttpRequest();
			req.onreadystatechange = func;
			req.open("GET", url, true);
			req.send(null);
		// branch for IE/Windows ActiveX version
		} 
		else if ( window.ActiveXObject ) 
		{
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if ( req ) 
			{
				req.onreadystatechange = func;
				req.open("GET", url, true);
				req.send();
			}
		}
	}
	
	function PopItUp()
	{	
		if ( req.readyState == 4 ) 
		{		
			if ( req.status == 200 ) 
			{	
				var response = req.responseXML;
				var resultNode = response.getElementsByTagName("result")[0];
				var isDuplicate;
				var isPartiallyDuplicate;
				var cid;
				var bundleid;
				var sharedFlag;
				var r;
				
				if (document.all) 
				{
					var blnNodes = resultNode.getElementsByTagName("IsDuplicateBundle");
					var partDupNodes = resultNode.getElementsByTagName("IsPartiallyDuplicateBundle");
					var cids = resultNode.getElementsByTagName("cid");
					var bundleids = resultNode.getElementsByTagName("bundleid");
					var sharedFlags = resultNode.getElementsByTagName("shared");
					var rUrls = resultNode.getElementsByTagName("r");
					
					isDuplicate = blnNodes[0].firstChild.data;
					isPartiallyDuplicate = partDupNodes[0].firstChild.data;
					cid = cids[0].firstChild.data;
					bundleid = bundleids[0].firstChild.data;
					sharedFlag = sharedFlags[0].firstChild.data; 
					r = rUrls[0].firstChild.data; 
				} 
				else 
				{
					var blnNodes = resultNode.childNodes;	
					
					for ( i=0; i < blnNodes.length; i++ ) 
					{
						currNode = blnNodes[i];
						
						switch(currNode.localName)
						{
							case "IsDuplicateBundle":
								isDuplicate = currNode.firstChild.data;
								break;
								
							case "IsPartiallyDuplicateBundle":
								isPartiallyDuplicate = currNode.firstChild.data;
								break;
								
							case "cid":
								cid = currNode.firstChild.data;
								break;
							
							case "bundleid":
								bundleid = currNode.firstChild.data;
								break;
								
							case "shared":
								sharedFlag = currNode.firstChild.data;
								break;
								
							case "r":
								r = currNode.firstChild.data;
								break;
							
							default:	
						}
					}
				}
				
				var continueButton;
				
				//Start code added by VL for PRN 23574 on 30/8/2007
				if(navigator.userAgent.indexOf("MSIE")!=-1)
				{
		            var temp=navigator.userAgent.split("MSIE");
                    var version=parseFloat(temp[1]);
		        }
					
				if ( isDuplicate == "yes" ) //when both plan and phone are same
				{
				   if(version ==6) //Check if the browser is MS IE6.0
		           {
		                //Start Code Added by VL for PRN 23574 on 16/08/2007 
				        DisplayBlock("blockUI_ie6");
				        //End Code Added by VL for PRN 23574 on 16/08/2007 
					    DisplayBlock("DuplicateDialog_ie6");        
					    if ( sharedFlag == '1' )
					    {
					        continueButton = document.getElementById("ContinueButtonDuplicate_ie6");
						    //Start code Added by VL for PRN 23574 on 20/08/2007
						    document.getElementById("ContinueButtonDuplicate_ie6").focus();					
						    //End code Added by VL for PRN 23574 on 20/08/2007
					    }
					    else
					    {
						    continueButton = document.getElementById("ContinueButtonDuplicateSingle_ie6");		
						    //Start code Added by VL for PRN 23574 on 20/08/2007				
						    document.getElementById("ContinueButtonDuplicateSingle_ie6").focus();
						    //End code Added by VL for PRN 23574 on 20/08/2007
					    }          
		           }
		           else
		           {
		                //Start Code Added by VL for PRN 23574 on 16/08/2007 
				        DisplayBlock("blockUI");
				        //End Code Added by VL for PRN 23574 on 16/08/2007 
					    DisplayBlock("DuplicateDialog");
					if ( sharedFlag == '1' )
					{
						continueButton = document.getElementById("ContinueButtonDuplicate");
						    //Start code Added by VL for PRN 23574 on 20/08/2007
						    document.getElementById("ContinueButtonDuplicate").focus();					
						    //End code Added by VL for PRN 23574 on 20/08/2007
					}
					else
					{
						continueButton = document.getElementById("ContinueButtonDuplicateSingle");
						    //Start code Added by VL for PRN 23574 on 20/08/2007				
						    document.getElementById("ContinueButtonDuplicateSingle").focus();
						    //End code Added by VL for PRN 23574 on 20/08/2007
					    }   
					
		           }
					//End code added by VL for PRN 23574 on 30/8/2007
					
					//Start code changes by VL for PRN 23574  on 21/08/2007
					var protocolName=document.URL.split("//");
					var strTemp = protocolName[0];
					var strlength = strTemp.length
					if (strlength == 5)
					{
					    var protocolString = document.URL.substring(0,7);							    		    
					}
					else
					{
					    var protocolString = document.URL.substring(0,8);							    
					}
					
					continueButton.href = protocolString + document.domain + "/updatecart.aspx?dest=options&journey=sotoop&cid=" + cid + "&bundleid=" + bundleid + "&r=" + r;
					//End code changes by VL for PRN 23574  on 21/08/2007                   
				}
				else if ( isPartiallyDuplicate == "yes" ) //when both plan is same but phone is different
				{
				     //Start Code Added by VL for PRN 23574 on 16/08/2007 
				    if(version ==6) //Check if the browser is MS IE6.0
				    {
				        //Start Code Added by VL for PRN 23574 on 16/08/2007 
				        DisplayBlock("blockUI_ie6");				        
					    DisplayBlock("PartiallyDuplicateDialog_ie6");
					    //End Code Added by VL for PRN 23574 on 16/08/2007 
					    
					   	if ( sharedFlag == '1' )
					    {
						    continueButton = document.getElementById("PartiallyDuplicateContinue_ie6");
						    //Start code Added by VL for PRN 23574 on 20/08/2007
						    document.getElementById("PartiallyDuplicateContinue_ie6").focus();
						    //End code Added by VL for PRN 23574 on 20/08/2007
					    }
					    else
					    {
						    continueButton = document.getElementById("PartiallyDuplicateContinueSingle_ie6");
						    //Start code Added by VL for PRN 23574 on 20/08/2007
						    document.getElementById("PartiallyDuplicateContinueSingle_ie6").focus();
						    //End code Added by VL for PRN 23574 on 20/08/2007
					    }					    
				    }
				    else 
				    {
				        //Start Code Added by VL for PRN 23574 on 16/08/2007 
				        DisplayBlock("blockUI");
				        //End Code Added by VL for PRN 23574 on 16/08/2007 
					DisplayBlock("PartiallyDuplicateDialog");
					
					if ( sharedFlag == '1' )
					{
						continueButton = document.getElementById("PartiallyDuplicateContinue");
						    //Start code Added by VL for PRN 23574 on 20/08/2007
						    document.getElementById("PartiallyDuplicateContinue").focus();
						    //End code Added by VL for PRN 23574 on 20/08/2007
					}
					else
					{
						continueButton = document.getElementById("PartiallyDuplicateContinueSingle");
						    //Start code Added by VL for PRN 23574 on 20/08/2007
						    document.getElementById("PartiallyDuplicateContinueSingle").focus();
						    //End code Added by VL for PRN 23574 on 20/08/2007
    					}					
					}
					 //End Code Added by VL for PRN 23574 on 16/08/2007 
					
					
					//Start code changes by VL for PRN 23574  on 21/08/2007
					var protocolName=document.URL.split("//");
					var strTemp = protocolName[0];
					var strlength = strTemp.length
					if (strlength == 5)
					{
					    var protocolString = document.URL.substring(0,7);							    		    
					}
					else
					{
					    var protocolString = document.URL.substring(0,8);							    
					}
					
					continueButton.href = protocolString + document.domain + "/updatecart.aspx?dest=options&journey=sotoop&cid=" + cid + "&bundleid=" + bundleid + "&r=" + r;
					//End code changes by VL for PRN 23574  on 21/08/2007
				}
				else if ( isDuplicate == "no" )
				{
					DisplayBlock("CartProcessing");
					//Start Code changes by VL for PRN 23574 on 24/10/2007
					ReturnURL(cid,bundleid,r);
					//End Code changes by VL for PRN 23574 on 24/10/2007
				}
			}
			else
			{
				alert("There was a problem retrieving the XML data:\n" + req.statusText);
			}
		}
	}
	
	function DisplayBlock(BlockId)
	{
		var im = document.getElementById(BlockId);
		
		if (im.style.display=="none")
		{
			im.style.display="block";
		}
	}
	
	function HideBlock(BlockId)
	{
		var im = document.getElementById(BlockId);
		im.style.display = "none";
	}

    //Start code added by VL for PRN 23574 on 22/08/2007
	function DisplayControl(ControlID)
	{
	    var im = document.getElementById(ControlID);
	    im.style.visibility = "visible";	    
	}
	//End code added by VL for PRN 23574 on 22/08/2007
	
	//Start code added by VL for PRN 23574 on 22/08/2007
	function DisableControl(ControlID)
	{
	    var im = document.getElementById(ControlID);	    
	    im.onclick=controlclick;
	}
	function controlclick(){}
	//End code added by VL for PRN 23574 on 22/08/2007
	
	//start code changes by VL for PRN 23574 on 24/10/2007
	function ReturnURL(cID, bundleID, r)
	{	    
	    var protocolName=document.URL.split("//");
		var strTemp = protocolName[0];
		var strlength = strTemp.length
		if (strlength == 5)
		{
			var protocolString = document.URL.substring(0,7);							    		    
		}
		else
		{
			var protocolString = document.URL.substring(0,8);							    
		}
	    var strlocation = protocolString + document.domain + "/updatecart.aspx?dest=options&journey=sotoop&cid=" + cID + "&bundleid=" + bundleID + "&r=" + r;
	    document.location.href = strlocation;
	}
	//End code changes by VL for PRN 23574 on 24/10/2007
	
function getElementsByName_iefix(tag, name) 
{
	var elem = parent.document.getElementsByTagName(tag);
	var arr = new Array();

	for(i = 0,iarr = 0; i < elem.length; i++) 
	{
		att = elem[i].getAttribute("name");
		
		if ( att == name ) 
		{
			arr[iarr] = elem[i];
			iarr++;
		}
	}
	
	return arr;
}

function IsDomainSame(theURL)
{
	var dm;
	dm = document.domain;
	
	theURL = theURL.toLowerCase();
	
	var urlParts = new Array();
	var parsedDomain;
	
	if ( theURL.substr(0, 4) != 'http' )
	{
		retVal = 'True';	
	}
	else
	{
		urlParts = theURL.split('/');
		parsedDomain = urlParts[2];
		
		var retVal;
		
		if ( dm == parsedDomain || parsedDomain == null )
		{
			retVal = 'True';
		}
		else
		{
			retVal = 'False';
		}
	}
	
	if ( theURL.indexOf("orderstatus.asp") >= 0 )
	{
		retVal = 'False';
	}
	
	return retVal;
}

function WindowHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myHeight = window.innerHeight;
  } 
  else if( document.documentElement && document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } 
  else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  
  var scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && document.body.scrollTop ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && document.documentElement.scrollTop ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
  }
  
  return myHeight+scrOfY*2;
}

function WindowWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) 
  {
    //Non-IE
    myWidth = window.innerWidth;
  } 
  else if( document.documentElement && document.documentElement.clientWidth ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } 
  else if( document.body && document.body.clientWidth ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  
  var scrOfX = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfX = window.pageXOffset;
  } else if( document.body && document.body.scrollLeft ) {
    //DOM compliant
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && document.documentElement.scrollLeft ) {
    //IE6 standards compliant mode
    scrOfX = document.documentElement.scrollLeft;
  }
  
  return myWidth+scrOfX*2;
}

function ClosePopup()
{
	var boxes = new Array();
	var i;
	
	boxes = parent.document.getElementsByName("popupbox");
	
	if ( document.all )
	{
		boxes = getElementsByName_iefix("div", "popupbox");
	}
	
	if ( boxes.length > 0 )
	{
		for (i=0; i < boxes.length; i++)
		{
			if ( boxes[i].style.display == 'none' )
			{
			    // this will give close alert box in IE, so commented
				//window.close();
			}
			else
			{	
				boxes[i].style.display='none';
			}
		}
	}
	else
	{
		window.close();
	}
	
	return false;
}


var IsFauxEligible;
window.onFocus = WindowFocus();
var req;

function WindowFocus()
{	
	//loadXMLPopupDoc('/FauxEligible.aspx' + window.location.search, showPopup);		
}

function loadXMLPopupDoc(url, func) 
{
	if ( window.XMLHttpRequest ) 
	{
		req = new XMLHttpRequest();
		req.onreadystatechange = function() { showPopup(); };
		req.open("GET", url, true);
		req.send(null);
	} 
	else if ( window.ActiveXObject ) 
	{
		req = new ActiveXObject("Microsoft.XMLHTTP");
		if ( req ) 
		{
			req.onreadystatechange = function() { showPopup(); };
			req.open("GET", url, true);
			req.send();
		}
	}
}

function showPopup()
{	
	if ( req.readyState == 4 ) 
	{		
		if ( req.status == 200 ) 
		{		
		
			try
			{
				var response = req.responseXML;
				var resultNode = response.getElementsByTagName("popup")[0];
				
				if ( document.all ) 
				{
					var blnNodes = resultNode.getElementsByTagName("FauxEligible");
					IsFauxEligible = blnNodes[0].firstChild.data;
				} 
				else 
				{
					var blnNodes = resultNode.childNodes;	
					
					for ( i=0; i < blnNodes.length; i++ ) 
					{
						currNode = blnNodes[i];
						
						switch(currNode.localName)
						{
							case "FauxEligible":
								IsFauxEligible = currNode.firstChild.data;
								break;
							
							default:	
						}
					}
				}
			}
			catch (e)
			{
				IsFauxEligible = 'False';
			}
		}
		else
		{
			IsFauxEligible = 'False';
		}
	}
}

function createPopup(urlLink, title, features)
{
	counter = Math.floor(Math.random()*10000);
	
	var featureArray = new Array();
	featureArray = features.split(',');
	
	var i;
	var popupWidth;
	var popupHeight;
	var resizable = true;
	
	urlLink = urlLink.toLowerCase();
	
	for ( i = 0; i <= featureArray.length; i++ )
	{
		var featureNameValue = new Array();
		featureNameValueString = "" + featureArray[i];
		
		featureNameValue = featureNameValueString.split('=');
		
		switch ( featureNameValue[0].toLowerCase() )
		{
			case "width":
				if ( urlLink.indexOf("additionaldetailsdisplay.aspx") >= 0 )
				{
					popupWidth = "605";
				}
				else
				{
					popupWidth = 30+parseInt(featureNameValue[1]);
					
					if ( WindowWidth() <= popupWidth )
					{
						popupWidth = WindowWidth() - 50;
					}
				}
				break;
				
			case "height":
				if ( urlLink.indexOf("additionaldetailsdisplay.aspx") >= 0 )
				{
					popupHeight = "420";
				}
				else
				{
					popupHeight = parseInt(featureNameValue[1]);
			
					if ( WindowHeight() <= popupHeight )
					{
						popupHeight = WindowHeight() - 50;
					}
				}
				break;
			
			case "resizable":
				if ( featureNameValue[1] == "no" )
				{
					resizable = false;
				}
				break;
				
			default:
		}
	}
	
	var boxes = new Array();
	
	boxes = parent.document.getElementsByName("popupbox");
	
	if ( document.all )
	{
		boxes = getElementsByName_iefix("div", "popupbox");
	}
	
	var showpop;
	showpop = true;
	
	if ( boxes.length > 0 )
	{
		for (i=0; i < boxes.length; i++)
		{
			if ( showpop && boxes[i].style.display != 'none' )
			{
				showpop = false;
			}
		}
	}
	
	if ( showpop )
	{
		new popUp((WindowWidth()/2)-(popupWidth/2), (WindowHeight()/2)-(popupHeight/2), popupWidth, popupHeight, 'faux'+counter, urlLink, "white", "#00385c", "16pt serif", title, "#00385c", "white", "lightgrey", "#00568c", "", true, true, resizable, true, true, true,'','','/_images/closebutton.gif','/_images/resize.gif');
		showbox('faux'+counter);	
	}
	
	var divlayer;
	if ( ie5 )
	{
		divlayer = new subBox(0,0,document.body.scrollWidth,document.body.scrollHeight,'#666666','layerbox');
		divlayer.style.filter="alpha(opacity=25)";
	}
	else
	{
		divlayer = new subBox(0,0,d.width,d.height,'#666666','layerbox');
		divlayer.style.MozOpacity=.25;
	}
	
	d.body.appendChild(divlayer);
}

function MM_openBrWindowLE(theURL, winName, features, PageEvent) 
{	
    
	if (PageEvent != null) {
		LoadPageEventImage(PageEvent);
	}
	
	MM_openBrWindow(theURL, winName, features);	
}

// As LoadPageEventImage function was not here so the above function was throwing error
function LoadPageEventImage(PageEvent){ }

function MM_openBrWindow(theURL, winName, features) 
{ 
	var urlString = new Array();
	var qryString;
	
	urlString = theURL.split('?');
	qryString = urlString[1];
	
	if ( qryString == null ) 
	{
		theURL = theURL + "?";
	}
	
	var withinDomain;
	withinDomain = IsDomainSame(theURL);

	if ( IsFauxEligible == 'True' && withinDomain == 'True' && self.name != "popiframe" )
	{
		theURL = theURL.replace("http://", "");
		theURL = theURL.replace("https://", "");
		theURL = theURL.replace(document.location.host, "");
		theURL = theURL.replace("//", "/");
		
		try
		{
			createPopup(theURL+"&viewmode=2&counter=1", "", features);
		}
		catch (e)
		{
			window.open(theURL+"&viewmode=1", winName, features);
		}
	}
	else
	{
		window.open(theURL+"&viewmode=1", winName, features);
	}
}

function ShowHideAddressInfo(chkboxid, elementprefix) 
{
    var blnchkbox = document.getElementById(chkboxid)
    if(blnchkbox.checked)
    {										
        var x = 1
        var max = 9
        for(x;x<max;x++)	
	    { 
            document.getElementById(elementprefix+ x).style.display = 'none';
        }
        blnchkbox.value = true
    }
    else
    {
        var x = 1
        var max = 9
        for(x;x<max;x++)
        { 
            document.getElementById(elementprefix+ x).style.display = '';
        }
     }
}

	

/*********************************************************************************************************************************/
	
/********************************************************************

Popup Windows - V 4.5
Author: Brian Gosselin
Site URL: http://scriptasylum.com
Read the "releasenotes.txt" for supported features and release notes.

************** EDIT THE LINES BELOW AT YOUR OWN RISK ****************/

var w3c=(document.getElementById)? true: false;
var ns4=(document.layers)?true:false;
var ie5=(w3c && document.all)? true : false;
var ns6=(w3c && !document.all)? true: false;
var d=document;
currIDb=null; xoff=0; yoff=0;
currRS=null; rsxoff=0; rsyoff=0;
oldac=null; newac=null; zdx=1; mx=0; my=0;
var currFb=null; var currFs=null; var currFID=0; var currFcnt=0;
var cidlist=new Array();
var counter=0;

//******* START OF EXPOSED FUNCTIONS. THESE CAN BE USED IN HYPERLINKS. *******\\

function fadeboxin(id){
if((currFb==null) && w3c){
clearInterval(currFID);
currFb=d.getElementById(id+'_b');
currFs=d.getElementById(id+'_s');
if(currFb.style.display=='none'){
currFcnt=0;
if(ie5)currFb.style.filter=currFs.style.filter="alpha(opacity=0)";
else currFb.style.MozOpacity=currFs.style.MozOpacity=0;
setAllScrollbars(true);
currFb.style.display=currFs.style.display='block';
changez(currFb);
currFID=setInterval('sub_fadein()',20);
}else currFb=null;
}}

function fadeboxout(id){
if((currFb==null) && w3c){
clearInterval(currFID);
currFb=d.getElementById(id+'_b');
currFs=d.getElementById(id+'_s');
if(currFb.style.display=='block'){
currFcnt=100;
if(ie5){
currFb.style.filter="alpha(opacity=100)";
currFs.style.filter="alpha(opacity=50)";
}else{
currFb.style.MozOpacity=1;
currFs.style.MozOpacity=.5;
}
setAllScrollbars(true);
currFb.style.display=currFs.style.display='block';
changez(currFb);
currFID=setInterval('sub_fadeout()',20);
}else currFb=null;
}}

function hideboxipc(id)
{
	if(w3c)
	{
		parent.document.getElementById(id+'_rs').style.display='none';
		d.getElementById(id+'_b').style.display='none';
		d.getElementById(id+'_s').style.display='none';
		
		var boxes = new Array();

		boxes = parent.document.getElementsByName("popupbox");
	
		if ( document.all )
		{
			boxes = getElementsByName_iefix("div", "popupbox");
		}

		var i;

		if ( boxes.length > 0 )
		{
			for (i=0; i < boxes.length; i++)
			{
				boxes[i].style.display='none';
			}
		}
	}
}

function showbox(id){
if(w3c){
var bx=d.getElementById(id+'_b');
var sh=d.getElementById(id+'_s');
bx.style.display='block';
sh.style.display='block';
sh.style.zIndex=1000000;
bx.style.zIndex=1000000;
if(ns6){
bx.style.MozOpacity=1;
sh.style.MozOpacity=.5;
}else{
bx.style.filter="alpha(opacity=100)";
sh.style.filter="alpha(opacity=50)";
}
changez(bx);
}}

function changecontent(id,text){
if(!document.getElementById(id+'_b').isExt){
var d=document.getElementById(id+'_c');
if(ns6)d.style.overflow="hidden";
d.innerHTML=text;
if(ns6)d.style.overflow="block";
}else document.getElementById(id+'_ifrm').src=text;
}

function movePopup(ids,x,y){
if(w3c){
var idb=document.getElementById(ids+'_b');
var ids=document.getElementById(ids+'_s');
idb.style.left=x+'px';
ids.style.left=x+8+'px';
idb.style.top=y+'px';
ids.style.top=y+8+'px';
}}

function resizePopup(ids,rx,ry){
if(w3c){
if(d.getElementById(ids+'_rs').rsEnable){
d.gEl=d.getElementById;
d.gEl(ids+"_extWA").style.display="block";
d.gEl(ids+"_rs").style.left=Math.max(rx,((ie5)?88:92))+'px';
d.gEl(ids+"_rs").style.top=Math.max(ry,((ie5)?68:72))+'px';
d.gEl(ids+"_b").style.width=Math.max(rx+((ie5)?12:8),100)+'px';
d.gEl(ids+"_b").style.height=Math.max(ry+((ie5)?12:8),80)+'px';
d.gEl(ids+"_t").style.width=Math.max(rx+((ie5)?4:3),((ns6)?95:92))+'px';
d.gEl(ids+"_btt").style.left=parseInt(d.gEl(ids+"_t").style.width)-48+'px';
d.gEl(ids+"_s").style.width=Math.max(rx+12,((ie5)?100:104))+'px';
d.gEl(ids+"_s").style.height=Math.max(ry+((ie5)?12:13),((ie5)?80:86))+'px';
d.gEl(ids+"_c").style.width=Math.max(rx-((ie5)?-5:5),((ie5)?92:87))+'px';
d.gEl(ids+"_c").style.height=Math.max(ry-((ie5)?24:28),44)+'px';
d.gEl(ids+"_max").h=parseInt(d.gEl(ids+"_b").style.height);
}}}

//******* END OF EXPOSED FUNCTIONS *******\\

function setAllScrollbars(ishide){
if(document.all){
var id;
for(i=0;i<cidlist.length;i++){
id=cidlist[i];
if(!document.getElementById(id+'_b').isExt)document.getElementById(id+'_c').style.overflow=(ishide)?"hidden":"auto";
}}}

function sub_fadein(){
currFcnt+=4;
if(ie5){
currFb.style.filter="alpha(opacity="+currFcnt+")";
currFs.style.filter="alpha(opacity="+(currFcnt/2)+")";
}else{
currFb.style.MozOpacity=currFcnt/100;
currFs.style.MozOpacity=(currFcnt/2)/100;
}
if(currFcnt>=99){
currFb.style.display=currFs.style.display='block';
setAllScrollbars(false)
currFb=null;
clearInterval(currFID);
}}

function sub_fadeout(){
currFcnt=currFcnt-4;
if(ie5){
currFb.style.filter="alpha(opacity="+currFcnt+")";
currFs.style.filter="alpha(opacity="+(currFcnt/2)+")";
}else{
currFb.style.MozOpacity=currFcnt/100;
currFs.style.MozOpacity=(currFcnt/2)/100;
}
if(currFcnt<=0){
currFb.style.display=currFs.style.display='none';
setAllScrollbars(false)
currFb=null;
clearInterval(currFID);
}}



function minimize(){}

function restore(){}

function ns6bugfix(){
if(navigator.userAgent.indexOf("Netscape/6")>0)setTimeout('self.resizeBy(0,1); self.resizeBy(0,-1);', 100);
}

function trackmouse(evt)
{
	try
	{
		mx=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
		my=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
		if(!ns6)movepopup();
		if((currIDb!=null)||(currRS!=null))return false;
	}
	catch (e){}
}

function movepopup(){
if((currIDb!=null)&&w3c)movePopup(currIDb.cid,mx+xoff,my+yoff);
if((currRS!=null)&&w3c)resizePopup(currRS.cid,mx+rsxoff,my+rsyoff);
return false;
}

function stopRS(){
d.getElementById(this.cid+"_extWA").style.display="none";
currRS=null;
}

function startRS(evt)
{
	try
	{
	var ex=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
	var ey=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
	rsxoff=parseInt(this.style.left)-ex;
	rsyoff=parseInt(this.style.top)-ey;
	currRS=this;
	if(ns6)d.getElementById(this.cid+"_c").style.overflow='hidden';
	return false;
	}
	catch (e) {}
}

function changez(v){
var th=(v!=null)?v:this;
if(oldac!=null)d.getElementById(oldac.cid+"_t").style.backgroundColor=oldac.inactivecolor;
//if(ns6)d.getElementById(th.cid+"_c").style.overflow='auto'; //Commenting this line out removes the scrollbars in firefox
oldac=th;
d.getElementById(th.cid+"_t").style.backgroundColor=th.activecolor;
d.getElementById(th.cid+"_s").style.zIndex=1000000;
th.style.zIndex=1000000;
d.getElementById(th.cid+"_rs").style.zIndex=1000000;
}

function stopdrag(){
currIDb=null;
document.getElementById(this.cid+"_extWA").style.display="none";
ns6bugfix();
}

function grab_id(evt)
{
	try
	{
		var ex=(ie5)?event.clientX+d.body.scrollLeft:evt.pageX;
		var ey=(ie5)?event.clientY+d.body.scrollTop:evt.pageY;
		xoff=parseInt(d.getElementById(this.cid+"_b").style.left)-ex;
		yoff=parseInt(d.getElementById(this.cid+"_b").style.top)-ey;
		currIDb=d.getElementById(this.cid+"_b");
		currIDs=d.getElementById(this.cid+"_s");
		d.getElementById(this.cid+"_extWA").style.display="block";
		return false;
	}
	catch (e) {}
}

function subBox(x,y,w,h,bgc,id)
{
    var v=d.createElement('div');
    v.setAttribute('id',id);
    v.setAttribute('name','popupbox');
    v.style.position='absolute';
    v.style.left=x+'px';
    v.style.top=y+'px';
    v.style.width=w+'px';
    v.style.height=h+'px';
    if(bgc!='')v.style.backgroundColor=bgc;
    v.style.visibility='visible';
    v.style.padding='0px';
    return v;
}

function get_cookie(Name) {
    var search=Name+"=";
    var returnvalue="";
    if(d.cookie.length>0)
    {
        offset=d.cookie.indexOf(search);
        if(offset!=-1)
        {
            offset+=search.length;
            end=d.cookie.indexOf(";",offset);
            if(end==-1)end=d.cookie.length;
            returnvalue=unescape(d.cookie.substring(offset,end));
        }
    }
    return returnvalue;
}

function popUp(x,y,w,h,cid,text,bgcolor,textcolor,fontstyleset,title,titlecolor,titletextcolor,bordercolor,scrollcolor,shadowcolor,showonstart,isdrag,isresize,oldOK,isExt,popOnce,minImg,maxImg,clsImg,rsImg)
{
	var okPopUp=false;
	
	if (popOnce)
	{
		if (get_cookie(cid)=="")
		{
			okPopUp=true;
			d.cookie=cid+"=yes"
		}
	}
	else okPopUp=true;

	if(okPopUp)
	{
		if(w3c)
		{
			cidlist[cidlist.length]=cid;
			w=Math.max(w,100);
			h=Math.max(h,80);
			var rdiv=new subBox(w-((ie5)?12:8),h-((ie5)?12:8),7,7,'',cid+'_rs');

			if(isresize)
			{
				rdiv.innerHTML='<img src="'+rsImg+'" width="7" height="7">';
				rdiv.style.cursor='move';
			}
			rdiv.rsEnable=isresize;
			var tw=(ie5)?w:w+4;
			var th=(ie5)?h:h+6;
			var shadow=new subBox(x+8,y+8,tw,th,shadowcolor,cid+'_s');
			
			if(ie5)shadow.style.filter="alpha(opacity=50)";
			else shadow.style.MozOpacity=.5;
			shadow.style.zIndex=1000000;

			var outerdiv=new subBox(x,y,w,h,bordercolor,cid+'_b');
			outerdiv.style.display="block";
			outerdiv.style.borderStyle="outset";
			outerdiv.style.borderWidth="2px";
			outerdiv.style.borderColor=bordercolor;
			outerdiv.style.zIndex=1000000;
			tw=(ie5)?w-8:w-5;
			th=(ie5)?h+4:h-4;
			
			var titlebar=new subBox(2,2,tw,20,titlecolor,cid+'_t');
			titlebar.style.overflow="hidden";
			titlebar.style.cursor="default";
			
			var tmp=(isresize)?'<img src="/images/spacer.gif" width="16" height="16" id="'+cid+'_min"><img src="/images/spacer.gif" width="16" height="16"  id="'+cid+'_max">':'';
			//titlebar.innerHTML='<span style="position:absolute; left:3px; top:1px; font:bold 10pt sans-serif; color:'+titletextcolor+'; height:18px; overflow:hidden; clip-height:16px;">'+title+'</span><div id="'+cid+'_btt" style="position:absolute; width:48px; height:16px; left:'+(tw-48)+'px; top:2px; text-align:right">'+tmp+'<a href="#" onclick="ClosePopup(); return false;"><img name="clsbtn" src="'+clsImg+'" width="16" height="16" id="'+cid+'_cls" /></a></div>';
            titlebar.innerHTML='<div id="'+cid+'_btt" style="position:absolute; width:48px; height:16px; left:'+(tw-48)+'px; top:2px; text-align:right"><a href="#" onclick="ClosePopup(); return false;"><img name="clsbtn" src="'+clsImg+'" width="16" height="16" id="'+cid+'_cls" /></a></div>';
            			
			tw=(ie5)?w-7:w-13;
			var content=new subBox(2,24,tw,h-36,bgcolor,cid+'_c');
			content.style.borderColor=bordercolor;
			content.style.borderWidth="2px";

			if(isExt)
			{
				content.innerHTML='<iframe name="popiframe" id="'+cid+'_ifrm" scrolling="yes" src="'+text+'" width="100%" height="100%"></iframe>';
				content.style.overflow="hidden";
			}
			else
			{
				if(ie5)content.style.scrollbarBaseColor=scrollcolor;
				content.style.borderStyle="inset";
				content.style.overflow="auto";
				content.style.padding="0px 2px 0px 4px";
				content.innerHTML=text;
				content.style.font=fontstyleset;
				content.style.color=textcolor;
			}
			
			var extWA=new subBox(2,24,0,0,'',cid+'_extWA');
			extWA.style.display="none";
			extWA.style.width='100%';
			extWA.style.height='100%';
			outerdiv.appendChild(titlebar);
			outerdiv.appendChild(content);
			outerdiv.appendChild(extWA);
			outerdiv.appendChild(rdiv);
			d.body.appendChild(shadow);
			d.body.appendChild(outerdiv);
			d.gEl=d.getElementById;
			
		    if(!showonstart)hideboxipc(cid);
			
		    try
		    {						
	            var wB=d.gEl(cid+'_b');
	            wB.cid=cid;
	            wB.isExt=(isExt)?true:false;
	            var wT=d.gEl(cid+'_t');
	            wT.cid=cid;
	            if(isresize)
	            {
	                var wRS=d.gEl(cid+'_rs');
	                wRS.cid=cid;
	                var wMIN=d.gEl(cid+'_min');
	                wMIN.cid=cid;
	                var wMAX=d.gEl(cid+'_max');
	                wMAX.h=h;
	                wMAX.cid=cid;
	                wMIN.onclick=minimize;
	                wMAX.onclick=restore;
	                wRS.onmousedown=startRS;
	                wRS.onmouseup=stopRS;
	            }

	            var wCLS=d.gEl(cid+'_cls');
	            var wEXTWA=d.gEl(cid+'_extWA');
	            wB.activecolor=titlecolor;
	            wB.inactivecolor=scrollcolor;
	            if(oldac!=null)d.gEl(oldac.cid+"_t").style.backgroundColor=oldac.inactivecolor;
	            oldac=wB;
	            wCLS.onclick= new Function("hideboxipc('"+cid+"');");
	            wB.onmousedown=function(){ changez(this) }
	            if(isdrag)
	            {
	                wT.onmousedown=grab_id;
	                wT.onmouseup=stopdrag;
                }	
                }
		        catch(e)
		        {
		            // do nothing, if there is any problem in minimize or these activities
		        }
            }
            else // w3c
            {
                if(oldOK)
                {
	                var ctr=new Date();
	                ctr=ctr.getTime();
	                var t=(isExt)?text:'';
	                var posn=(ns4)? 'screenX='+x+',screenY='+y: 'left='+x+',top='+y;
	                var win=MM_openBrWindow(t+"&viewmode=3" , "abc"+ctr , "status=no,menubar=no,width="+w+",height="+h+",resizable="+((isresize)?"yes":"no")+",scrollbars=yes,"+posn);
            		
	                if(!isExt)
	                {
		                t='<html><head><title>'+title+'</title></head><body bgcolor="'+bgcolor+'"><font style="font:'+fontstyleset+'; color:'+textcolor+'">'+text+'</font></body></html>';
		                win.document.write(t);
		                win.document.close();
	                }
                }
            }
        }
    }

if(ns6)setInterval('movepopup()',40);

if(w3c){
d.onmousemove=trackmouse;
d.onmouseup=new Function("currRS=null");
}

function CloseAndRedirect(theURL)
{
	if ( theURL.indexOf("viewmode=2") > 0 )
	{
		parent.location.href = theURL;
		ClosePopup();
	}
	else
	{
		parent.opener.location = theURL;
		ClosePopup();
	}
}
    
// Start Code added for PRN:29458 by VL
    function GetCookie() 
	{
	
		var strName = "varCook";
		if (document.cookie.indexOf(strName) == -1)
		{   			
   			return false;
		}
		else
		{
		    cookieStart = document.cookie.indexOf(strName);		
		    cookieValStart = (document.cookie.indexOf("=", cookieStart) + 1);		
		    cookieValEnd = document.cookie.indexOf(";", cookieStart);		
		        if (cookieValEnd == -1)
			    {
			        cookieValEnd = document.cookie.length;
			    }
		    cookieValue = document.cookie.substring(cookieValStart, cookieValEnd);	
		}
		if (cookieValue = "True")
		{
			return true;
		}
	}

	function SetCookie(name,value,expires,path,domain,secure)
	{		
		
	    	document.cookie = name + "=" +escape(value) +
	        ( (expires) ? ";expires=" + expires.toGMTString() + 1000*60*20 : "") +
        	( (path) ? ";path=" + path : "") +
	        //( (domain) ? ";domain=" + domain : "") +
        	( (domain) ? ";domain=" + document.location.hostname : "") +
	        ( (secure) ? ";secure" : "");	        
		    return true;
	}

    function CheckBrowserCookies()        
    {	
        
        var browser = navigator.appName;        
        var b_version = navigator.appVersion;        
        var version = parseFloat(b_version);          
        SetCookie('varCook','True','','/','','');        
        if(GetCookie() != true)
         {   
              if(( browser == "Microsoft Internet Explorer" ) && ( version >= 4))
              {	                
                  alert("You currently have cookies disabled. In order to continue with the Online shopping experience please enable cookies. Go to Tools->Internet Options->Privacy->Advanced->Check Override automatic cookie Handling->Select Accept. If you would prefer to Order By Phone, please click on the Contact Us link in the footer below or the Order By Phone Button on this page");
              }
              else if(( browser == "Netscape" ) && ( version >= 5 ))
              {
                  alert("You currently have cookies disabled. In order to continue with the Online shopping experience please enable cookies. Go to Tools->Options->Privacy->Check Accept Cookies from sites \nIf you would prefer to Order By Phone, please click on the Contact Us link in the footer below or the Order By Phone Button on this page");
              }
	        return false;	
         }
         else
        {       
            DeleteCookie('varCook');       
            return true;
        }
	
}   

function DeleteCookie ( cookie_name )
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}
//End Code added for PRN:29458 by VL

  
function OnCompare(qstrings)
		{					
			var checkBoxes = null;
			var productIDs = null;
			var theURL = null;
			if (qstrings != null && qstrings.length > 0)
			{			
				if (qstrings.indexOf('ShowPhonesLink')==-1)
				{						
					qstrings = qstrings + "&ShowPhonesLink=false";				
				}
								
				if (qstrings.indexOf('DisplayCarrierLogo')==-1)
				{
					qstrings = qstrings + "&DisplayCarrierLogo=false";
				}
				if (qstrings.indexOf('ShowSelectButton')==-1)
				{
					qstrings = qstrings + "&ShowSelectButton=true";
				}
			}			
			
			// Attempt to get the CheckBoxes array.
			if (document.getElementsByName)
			{
				checkBoxes = document.getElementsByName('productCheckBox');				
			}			
			
			//Loop through the array and see which ones are checked			
			if (checkBoxes) 
			{
				var numCheckBoxes = checkBoxes.length;
			
				for (var i = 0; i < numCheckBoxes; ++i)
				{
					if (checkBoxes[i].checked)
					{
						if (productIDs != null)
						{
							productIDs = productIDs + checkBoxes[i].value + ",";
						}
						else
						{	
							productIDs = checkBoxes[i].value + ",";
						}						
					}					
				}
				theURL = "/PhoneCompare.aspx" + qstrings + "&strProductCompare=" + productIDs.substr(0, productIDs.length - 1);
				MM_openBrWindowLE(theURL, "", null, null);				
			}
		}
