	// © Copy right United Airlines Inc.
	// Homepage Resource Control
	// S. Smull, S. Davis, N. Ziyad Phd.
	//update 10/30/2009 SHD for iframe pixels
	var selectedSection = "HP";
	var maImg="/ual/asset/hdg_UnitedNews.gif";
	//the var HR_ER_mode is set if the HP is delivered in ER mode. Used to turn off components
	if(typeof HP_ER_mode == 'undefined'){ var HP_ER_mode = false;}
	var writeSWNprotocol = (document.location.protocol == 'https:') ?'https' : 'http';
	
	// aff -->
	var affOn=true;
	var sbsTimes=true;
	var vsAffSwitch='F';
	var affType=1;
	//insert intl text here
	var affCtryCode='us';
	var affText1='Search flights';
	var affText2='Book with miles';
	var affAwardFare='Award travel fees up to USD 100.00';
	var affPass0Msg='Please review the number of passengers and revise the entry if necessary.';
	var affPass10Msg='The maximum passengers per itinerary is 9. Please revise your entry.';
	var affMore1='Upgrades, promotions, class, nonstops...';
	var affMore2='Service class, Maximum stops';
	var affTripType=2;
	// end aff -->
	
	String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/gi,"") };
	
	function ff30popup(wURL,varToPass) 
	{
		window.open(wURL+varToPass,"ff29","width=550,height=400,top=20,left=20,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes")
	}
	
	//Start DOM Ready Function
	$(document).ready(function(){ 
		
		//START - FSNE Part1 Auto-suggest && Calendar Changes
		try{																											
		// include AutoSuggets  && Calendar Files
		$.ajax({ type: "GET", 
				 url: "http://www.united.com/ual/asset/autoSuggest.js", 
				 dataType: "script",
				  success: function()
					{
					  $.ajax({ type: "GET",
					  url: "http://www.united.com/ual/asset/autoSuggestSuggestion.js", 
					  dataType: "script", 
					  cache: false, 
					  success: function(){  
							   readyAutosuggest(); // inpmenented in autoSuggestSuggestion.js
							   $.ajax({ type: "GET", 
								url: "http://www.united.com/ual/asset/date_bimonth.js", 
								dataType: "script",
								success: function()
								{
								  $.ajax({ type: "GET",
								  url: "http://www.united.com/ual/asset/populate_bimonthcal1.js", 
								  dataType: "script", 
								  cache: false, 
								  success: function(){  
								   calendarReady();
									}});
								} 
								});	
							}});
					}
				});
															
		}
		catch(exception)
		{
		}
		//END- FSNE Part1 Auto-suggest && Calendar Changes
		
		$('#swnquerytext')
		.bind("keydown keypress",function(e){
			if (window.quickUASearch){quickUASearch(event)};
		})
		.focus(function(){
			if ($(this).val() == 'Search site'){$(this).val('');}
			$(this).css('textAlign','left');
		})
		.blur(function(){
			if ($(this).val() == ''){$(this).val('Search site');}
			$(this).css('textAlign','center');
		});


		// Removed  for  FS7 update Nigel A. Ziyad, PhD  
		// OLD Randomly Select And Write The Center Tile
		//	var selPro=(Math.floor(Math.random()*fsas.length)); 
		//	var strHPcenterTile = '<a href="'+fsas[selPro][1]+'"><img src="'+fsas[selPro][0]+'" alt="'+fsas[selPro][2]+'" border="0" /></a>';
		//	$('.hpFSAbackground').css('background-color',fsas[selPro][3]);
		//	$('#hpCenterTile').append(strHPcenterTile); 
		//	$('#hpTile').attr('src',fsas[selPro][0]);
		//	$('#hpTileLink').attr('href',fsas[selPro][1]);
		//	$('#hpTile').attr('alt',fsas[selPro][2]);
		//End Center Tile
		
		//	Start HP News
			if (window.ualhpNews)
			{
				var newsReel = "";
				for(ij=0;ij<ualhpNews.length;ij++) {
					if(ualhpNews[ij].length>3) {
					  var ualColor = String(ualhpNews[ij][4]).trim();
						if(ualColor.length==7 || ualColor.substr(0,1)=="#") {
						  newsReel += '<li style="line-height: 1.6;"><a class="fs11 newsItem" href="'+ualhpNews[ij][3]+'" style="color: '+ualColor+' !IMPORTANT;">'+ualhpNews[ij][2]+'</a></li>';
						} else {
						  newsReel += '<li style="line-height: 1.6;"><a class="fs11 newsItem" href="'+ualhpNews[ij][3]+'">'+ualhpNews[ij][2]+'</a></li>';
						}
					} else {
						newsReel += '<li style="line-height: 1.6;"><a class="fs11 newsItem" href="'+ualhpNews[ij][3]+'">'+ualhpNews[ij][2]+'</a></li>';
					}
				}

				if($.browser.msie && parseInt($.browser.version.substr(0,1))<7) {
					$('#unitedNewsContent').append('<div class="carret" style="padding-left: 0px !IMPORTANT; padding-right: 4px !IMPORTANT; margin-left: 5px !IMPORTANT;"><ul>'+newsReel+'</ul></div>');
				} else {
					$('#unitedNewsContent').append('<div class="carret" style="padding-left: 0px !IMPORTANT; padding-right: 4px !IMPORTANT; margin-left: 10px !IMPORTANT;"><ul>'+newsReel+'</ul></div>');
				}
				

			

			}  // end If (window.ualhpNews)
				
// FS7 Delete NAZ			if (window.fsas) vsCustomItems[vsCustomItems.length] = new Array("v_fareSaleShown",escape(fsas[selPro][2])); // FSA Impressions Tracking
			if (window.ualhpNews) // news items impressions tracking
			{
				for (i=0;i<ualhpNews.length;i++)
				{
					vsCustomItems[vsCustomItems.length] = new Array("v_hpPromo",escape(ualhpNews[i][2]));	
				}
			}
		// End News
		
		// voTile tagged inside doc
		// joinmp and unitedbenefits tagged inside doc
		// modified hp30gll.js for gll tracking
		// ff29click travelSearch for click tracking
		// redirection file (http://www.united.com/ual/asset/vsRedirection.html)
		// init for tab click tracking
		vsCustomItems[vsCustomItems.length] = new Array("v_tab1",0);	
		vsCustomItems[vsCustomItems.length] = new Array("v_tab1sub1",0);
		vsCustomItems[vsCustomItems.length] = new Array("v_tab1sub2",0);	
		vsCustomItems[vsCustomItems.length] = new Array("v_tab1sub3",0);	
		vsCustomItems[vsCustomItems.length] = new Array("v_tab1sub4",0);	
		vsCustomItems[vsCustomItems.length] = new Array("v_tab2",0);	
		vsCustomItems[vsCustomItems.length] = new Array("v_tab3",0);	
		
		//determine login state
	
	if (isDefined(myCookies['rememberProfile'])&& isDefined(myCookies['isSecure']) && myCookies['isSecure']=="true") {
			var parsedValue=unescape(myCookies['rememberProfile']).split("||");
			
			var mpiNumber=parsedValue[0];
			var firstName=parsedValue[1];
			var lastName=parsedValue[2];
			var mpLevel=parsedValue[3];
			var mpBal=parsedValue[4];
			var homeArpt=parsedValue[5];
			
			if (isDefined(myCookies["mpInformation"])){
			
				var profile=myCookies["mpInformation"];
				profile = unescape(profile); 
				var parsedValue=profile.split("||");
				var prefix=parsedValue[0];
				var firstName=parsedValue[1];
				var middleinit=parsedValue[2];
				var lastName=parsedValue[3];
				var suffix= parsedValue[4];
//				var emlErrFlg = parsedValue[5];
//				var addrErrFlg = parsedValue[6];
			}


			var strFirstAndLastName=firstName+lastName;
			if(strFirstAndLastName != "")
				{
					if(document.getElementById("nameHold"))
						{
							if (strFirstAndLastName.length <= 30 && (firstName.length<=15 && lastName.length<=15))
								{
									// write both
									document.getElementById("nameHold").innerHTML = firstName+' '+lastName;
									document.getElementById("forHold").innerHTML = 'for ';
								}
							else
								{
									if (firstName.length<=15)
										{
											// write first
											document.getElementById("nameHold").innerHTML = firstName;
											document.getElementById("forHold").innerHTML = 'for ';
										}
								}
							if (firstName.length>15)
								{
									// remove "for"
									document.getElementById("nameHold").innerHTML = firstName;
								}
						}
				}
			if (mpLevel != "" && mpBal != "")
				{
					document.getElementById('mpLevelHold').innerHTML = '<nobr>'+mpLevel+' <span style="color:#999;"> | </span> </nobr><nobr>Miles: '+mpBal.commafy()+'</nobr>';
				}
			//hide the MP login and guest login divs
			document.getElementById("mileagePlus_login").style.display = "none";
			document.getElementById("joinMPcontainer").style.display="none";
			document.getElementById("mploggedin").style.display = "block";
			document.getElementById("mpLoggedinContainer").style.display="block";
	
			$('.cio_whichLogin').remove();
			$('#ci_logged').show();
			$('#myitins').attr("href","https://www.ua2go.com/ci/DoLogin.jsp?return_to=itins");
			$('#myitins2').attr("href","https://www.ua2go.com/ci/DoLogin.jsp?return_to=itins&navSource=HP07&linkTitle=a22myitineraries");
			$('#loginSwap1').attr("href","https://www.ua2go.com/ci/Login.jsp?return_to=itins&navSource=Dropdown07&linkTitle=itineraries");
			$('#loginSwap2').attr("href","https://travel.united.com/etc/webcheckin/listPnr.do?navSource=Dropdown07&linkTitle=checkin");
		var divHite = $('div.col3').height();
		if (divHite < 446) $('div.col3').height(446);
	} else {  //display  log in
			writeStartIn();//populate start in select
			document.getElementById("mploggedin").style.display = "none";
		$("#ci_cc").click(function() {
			$('#ci_tktNumber #label_searchValueId').html('Credit card #');
			$('#ci_searchValueId').attr('maxlength', 19)
			$('#ci_searchValueId').attr('value', '')
		});
		$("#ci_pnr").click(function() {
			$('#ci_tktNumber #label_searchValueId').html('Confirmation or e-ticket number');
			$('#ci_searchValueId').attr('maxlength', 14);
			$('#ci_searchValueId').attr('value', '')
		});
	if (isDefined(myCookies["rememberME"])) {	
		switch (myCookies["rememberME"]) {
			case "E":
				if (isDefined(myCookies["rememberEMAIL"])) {
					$('input.userId').val(myCookies["rememberEMAIL"]);
					$(".remMP").check();
					document.topLogin.userId.value=myCookies["rememberEMAIL"];
				}
			break;
		
			case "M":
				if	(isDefined(myCookies["getMP"])) rememberMP = myCookies["getMP"];// *.united.com
				else if	(isDefined(myCookies["rememberMP"])) rememberMP = myCookies["rememberMP"];// ua2go.com
				if (isDefined(rememberMP)) {
						$('input.userId').val(rememberMP);
						$(".remMP").check();
						document.topLogin.userId.value=rememberMP;
					}
				break;
			}	
		}
			$('#loggedout').show();
			document.getElementById("mpLoggedinContainer").style.display="none";
			document.getElementById("mileagePlus_login").style.display = "block";
			document.getElementById("joinMPcontainer").style.display = "block";
			$('#ci_logged').hide();
		}
		
		try { 
				$.getScript("/ual/asset/hpMenuArr.js", function() {
					writeSWNav2(0);
				});
			
				$.ajax({
					type: "GET", url: "/ual/asset/ff30FlightStatus.html", dataType: "html", cache: false,
					success: function(thePage){ 
					  $('#ff29pane3').append(thePage); 
						$('#ff29pane3').css('display','none');
						$('#flightStatusSelect').append(ff29FlightStatusOptions); 
						document.forms.FlightStatus.reset();
						if(ff29mode==3) { ff29click(3); }
					}
				});
				var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
				var ieOld = false;
				if($.browser.msie){ 
					if(parseInt($.browser.version.substr(0,1)) < 7) {
						ieOld = true;
						//alert("old browser detected"+ $.browser.version);
					}
				}
				
				
				//if(hasRightVersion && !ieOld) {  // if we've detected an acceptable version
				if (1 == 0) { //not for now
					$.getScript("/ual/asset/AC_RunActiveContent1.7.js", function() {
						AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','258','height','350','id','FS9slideshow_flash8_v3','align','middle','src','/ual/asset/FS9slideshow_flash8_v3','quality','high','bgcolor','#ffffff','name','FS9slideshow_flash8_v3','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','/ual/asset/FS9slideshow_flash8_v3','wmode','transparent','FlashVars', 'xmlsrc=/ual/asset/fs9.xml', 'AllowScriptAccess', 'always', 'content','true');   // embed the flash movie
					});
				} else {  // flash is too old or we can't detect the plugin
					$.ajax({ 
						type: "GET", 
						url: "/ual/asset/fs9.xml",  
						dataType: "xml",
						cache: false, 
						success: function(xml){
							NoFlashCenterTile(xml);
						},
						error: function(XMLHttpRequest, textStatus, errorThrown){
							$('#hpCenterTile').html('<a href="http://www.united.com/FS9alternate"><img src="http://www.united.com/ual/asset/FS9alternate.jpg" width="258" height"350" border="0"></a>');
							$('.hpDivsToFade').css('backgroundColor', "72a4d8");
						}
					});
				}
			  $.ajax({ type: "GET", url: "/ual/asset/ff30BookWithMiles.html", dataType: "html", cache: false, success: function(thePage){ $('#affAwdSrchOpts').append(thePage); $('#affAwdSrchOpts').css('display','none'); 
					$.ajax({ type: "GET", url: "/ual/asset/ff30BookFlightMoreSearchOptions.html", dataType: "html", cache: false, success: function(thePage){ $('#ff29upprclno').append(thePage); $('#ff29upprclno').css('display','none'); 
						$.ajax({ type: "GET", url: "/ual/asset/ff30HotelsTopHalf.html", dataType: "html", cache: false, success: function(thePage){ $('#ff29pane1sub2a').append(thePage); $('#ff29pane1sub2a').css('display','none'); 
							$.ajax({ type: "GET", url: "/ual/asset/ff30HotelsBottomHalf.html", dataType: "html", cache: false, success: function(thePage){ $('#ff29pane1sub2b').append(thePage); $('#ff29pane1sub2b').css('display','none'); 
								$.ajax({ type: "GET", url: "/ual/asset/ff30VacationsTopHalf.html", dataType: "html", cache: false, success: function(thePage){ $('#ff29pane1sub4a').append(thePage); $('#ff29pane1sub4a').css('display','none'); 
									$.ajax({ type: "GET", url: "/ual/asset/ff30VacationsBottomHalf.html", dataType: "html", cache: false, success: function(thePage){ $('#ff29pane1sub4b').append(thePage); $('#ff29pane1sub4b').css('display','none'); 
										$.ajax({ type: "GET", url: "/ual/asset/ff30CarSearch.html",	dataType: "html", cache: false, success: function(thePage){ $('#ff29pane1sub3a').append(thePage); $('#ff29pane1sub3a').css('display','none'); 
											$.ajax({ type: "GET", url: "/ual/asset/ualFooter.html", dataType: "html", cache: false, success: function(thePage){ $('#unitedFooter').append(thePage); } });

											//load vo tiles
											$.getScript("/ual/asset/vo_tiles.js", function(){
												$("#divVOtiles").show(); $('#topSlot').children().css('border','0px'); 
												if($.browser.msie) {
													if($.browser.version.substr(0,1) > 6) {
														$('.voCopy').css("padding-left","6px");
													}
												}
												tagLinks();
												
												
												if (getCookie("homeArpt")) 
												{ 
													document.getElementById('shop_from0').value=getCookie("homeArpt");
													document.getElementById("vacationO").value=getCookie("homeArpt");
												}
												//build the request for hp iframe for pixel tracking
												//pass required parameters to the iframe query string
													var uValue = escape(document.location);
													var rValue = escape(document.referrer);
													var iframeQstr = "?curLoc="+uValue+"&refLoc="+rValue;

													$(document.body).append('<IFRAME id="unitedMediaplex" name="mediaplexUnited" src="http://www.united.com/ual/asset/hp_mediaplexunited.html?'+iframeQstr+'" width="0" height="0" frameborder="0" ></iframe>');
														$('iframe#unitedMediaplex').load(function() {

														});
											});
											if(ff29mode==3) { ff29click(3); }
										} });
									} });
								} });
							} });
						} });
					} });
				} });
			
			$('#unitedBenefits').show(); 
		
			
			if (showToolTips==1) {
				$('#ci_gli a').Tooltip({ 
					track: true, 
					delay: 0, 
					showURL: false, 
					showBody: " - ", 
					opacity: 0.90 
				});
			}
		} catch(exception) {
			// Do Nothing for now on exceptions
			//alert("Caught an exception!\n\n"+exception);
		}
		
		// write timestamp @ footer
		var futdate = new Date();
		var expdate = futdate.getTime();
		$('footerTimestamp').append('<img src="http://www.united.com/ual/asset/vstesthp.gif?timestamp='+expdate+'" border="0" width="1" height="1">');
		
		$('div.col3').css('padding', 5);
		
		$('#myItinsEmplCheckin').addClass('dashTop');

		document.getElementById("flightSRC").selectedIndex = 0; // 229
		document.getElementById("flightCNN").selectedIndex = 0; // 229 

		ff29tabs[3].src = "http://content.united.com/ual/asset/hp30_tab_CI_off.gif";
		ff29tabs[4].src = "http://content.united.com/ual/asset/hp30_tab_CI_off.gif";
		ff29tabs[5].src = "http://content.united.com/ual/asset/hp30_tab_CI_off.gif";
		ff29tabs[6].src = "http://content.united.com/ual/asset/hp30_tab_CI_off_roll.gif";
		ff29tabs[7].src = "http://content.united.com/ual/asset/hp30_tab_CI_off_roll.gif";
	}); // End of DOM Ready Function
	
function chkBrs(sInp) {
	var sUA=navigator.userAgent.toLowerCase();
	var bFound=sUA.indexOf(sInp) +1;
	return bFound;
}

function chkBrows(sInp) {
	var sUA=navigator.userAgent.toLowerCase();
	var bFound=sUA.indexOf(sInp) +1;
	return bFound;
}
			
$.fn.check = function() {
	return this.each(function() {
		this.checked = true;
	});
};

function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}

// JavaScript Document
var environment = "PRODUCTION"; //change this when placing in PRODUCTION ENVIRONMENT
var currentUALsite = "US-EN";

StartinSelectLst = new Array();
StartinSelectLst[0] = new Array("My mileage summary","&return_to=mpsummary_us","SI~MP");
StartinSelectLst[1] = new Array("My itineraries","&return_to=newitin_us","IC");
StartinSelectLst[2] = new Array("-------------------","","");
StartinSelectLst[3] = new Array("Shop for flights","&return_to=booking_us","PB");
StartinSelectLst[4] = new Array("Book with miles","&return_to=awardShop_us","");
StartinSelectLst[5] = new Array("Red Carpet Club","&return_to=rcc&echoParam=rcchome","");
StartinSelectLst[6] = new Array("-------------------","","");
StartinSelectLst[7] = new Array("Check-in online","&return_to=easy_checkin","");
StartinSelectLst[8] = new Array("Change itineraries","&return_to=rax","");
StartinSelectLst[9] = new Array("Upgrades","&return_to=eug_sum","");
StartinSelectLst[10] = new Array("Ticket refunds","&return_to=refund","");
StartinSelectLst[11] = new Array("-------------------","","");
StartinSelectLst[12] = new Array("My profile","&whereto=UpdateProfile.jsp","");
StartinSelectLst[13] = new Array("Flight notification","&return_to=centerPost","");
StartinSelectLst[14] = new Array("My trip templates","&return_to=triptemplate","");

//update the dropdown list
//[0] = label, [1] = url, [2] = selected index
function writeStartIn() {
	selObj = document.topLogin.sel_return_to;
	selObj.length = 0;
	for (q=0;q<StartinSelectLst.length;q++)
		{
			selObj.options[q] = new Option (StartinSelectLst[q][0],StartinSelectLst[q][1]);
			if (StartinSelectLst[q][2].indexOf(selectedSection) > -1) selObj.options[q].selected = true
		}
}


// Randomly select image to display on center tile and set background
//    Nigel A. Ziyad PhD  &  Scott Davis
// Note: Opens the FS9 rotation xml  Orphan page
// Input: CMA --FS9 rotation xml  or /page/genericpage/1,,52964,00.html
// Output: alternateContent 
//            : color change to tagToFade1, tagToFade2 IDs
// Variables used: alternateContent,  selPro, ourbgcolor
//  ////////////////////////////////////////////////////
// START MediaPlex CacheBuster Code Addition - SMS - 11/04/09 - 9:58am
	var iMediaPlexCBRndNum = new Number();
	var dThisClientDate = new Date();
	var iMPCB_Year = new Number(2009);
	var iMPCB_Month = new Number(11);
	var iMPCB_DAY = new Number(9);
	var iMPCB_Hours = new Number(dThisClientDate.getHours());
	var iMPCB_Mins = new Number(dThisClientDate.getMinutes());
	var iMPCB_Seconds = new Number(dThisClientDate.getSeconds());
	var iMPCB_MilliSeconds = new Number(dThisClientDate.getMilliseconds());	
	var iMediaPlexCBRndNum;
	var sMPCB_ImpressionTrackerImg = new String();
	var domOBJMPImpressionImage = document.createElement('img');
	domOBJMPImpressionImage.setAttribute('width','1');
	domOBJMPImpressionImage.setAttribute('height','1');
	domOBJMPImpressionImage.setAttribute('border','0');
// END MediaPlex CacheBuster Code Addition - SMS - 11/04/09 - 10:51am

function NoFlashCenterTile(xml){ 
 var fatArray=new Array() //array to hold "weighted" ads
 fatArray.length=0;

	$('slide',xml).each(function(){
		var slide = $(this);
		for(var ii = 0; ii < slide.attr('wt'); ii++) {
			fatArray[fatArray.length] = slide.attr('id');
		}
	})
	var selPro=(Math.floor(Math.random()*fatArray.length));
	var selectedId = fatArray[selPro];
	//loop again for the match??
	$('slide',xml).each(function(){
		var slide = $(this);
		if (slide.attr('id') == selectedId) {
		// START code for MediaPlex CacheBuster Click & Impression Tracking
			// final image name to look for = FS9_holidaysale09v2_258x350.gif
			if(String(slide.attr('src')).indexOf("FS9_holidaysale09v2") > -1) {
				var iMediaPlexCBRndNum = Date.UTC(iMPCB_Year,iMPCB_Month,iMPCB_DAY,iMPCB_Hours,iMPCB_Mins,iMPCB_Seconds,iMPCB_MilliSeconds);
				var sMPCB_ClickTrackerURL = decodeURIComponent('http://adfarm.mediaplex.com/ad/ck/1091-90104-9024-6?mpt='+iMediaPlexCBRndNum);
				sMPCB_ImpressionTrackerImg = 'http://adfarm.mediaplex.com/ad/tr/1091-90104-9024-6?mpt='+iMediaPlexCBRndNum;
				
				// START - APPEND NATIVE ELEMENT TO BODY
					domOBJMPImpressionImage.setAttribute('src',sMPCB_ImpressionTrackerImg);
					document.body.appendChild(domOBJMPImpressionImage);
				// END - APPEND NATIVE ELEMENT TO BODY
				bSMS_MediaPlexEPlusIsDisplayed = true;
			} else {
				bSMS_MediaPlexEPlusIsDisplayed = false;
			}
			
			if(bSMS_MediaPlexEPlusIsDisplayed == true) {
				myHTMLOutput = '<a href="'+sMPCB_ClickTrackerURL+'"><img border="0" src="'+slide.attr('src')+'"></a>';
				$("#hpCenterTile").html(myHTMLOutput); //write the Center Tile with the selected static image
			} else {
				var decodedURI  = decodeURIComponent(slide.attr('url'));
				myHTMLOutput = '<a href="'+decodedURI+'"><img border="0" src="'+slide.attr('src')+'"></a>';
				$("#hpCenterTile").html(myHTMLOutput); //write the Center Tile with the selected static image
			}
		// END code for MediaPlex CacheBuster Click & Impression Tracking
			//apply the color to the Background of the two tiles
			$('.hpDivsToFade').css('background-color',slide.attr('rgb'));
			return false;
		}
	});
}

// FS7 CenterTile link extraction function  -- S. Smull 2-3-09   
function vsChangeFlashHrefToThis(sNewHref) {
	vsLinkClicked = sNewHref;
	window.location.assign(sNewHref); //.replace doesn't load in session history, assign does
}		

// FS7 CenterTile fading function  -- S. Smull 2-3-09
function doTheFade(sStartColor, sColor) {
	//append color string with #
	var reg= /^#/;
	if(!reg.test(sColor)) {sColor = "#" + sColor; }
	
	// Fade  "hpDivsToFade" class at 1 sec
	//$('.hpDivsToFade').highlightFade({start:sStartColor,end:sColor,speed:500,iterator:'linear',attr:'backgroundColor'});
	$('.hpDivsToFade').animate({ backgroundColor: sColor }, 1000);
}

//START- FSNE Part1 Auto-suggest && Calendar Changes
function calendarReady()	
{
	
	if($.browser.safari) { 
			$('.date_text').attr('size','12');
		}
	
	$(window).bind('resize', function(){ 	
		$('#dp-popup').css('display','none');	
		resizeAutosuggest(); // function inpmenented in autoSuggestSuggestion.js	
	});
	
	if(window.ualhpdate){
		todaysBimonthDate= new Date(ualhpdate);
	}
  shop_depart[0] = (new Date(todaysBimonthDate).zeroTime()).addDays(14);	
  shop_arrive0  = (new Date(todaysBimonthDate).zeroTime()).addDays(21);
  jspPage = false;
  roundTrip = true;
  homePageCheck = false;
  
	displayHPdefaultDates();
		
		$('.date-pick').bind('focus', function(e) {			
			onFocusCall(this,"homepage");
			
		});	
		$(document).bind( 'keydown', function(event) 
		{ 
			handleEscTab(event);
		}); 
		
		$('#dp-popup').bind('click', function(e) {textboxFocus = true;});
		
		$('.date-pick').bind('click', function(e) {
			onClickCal(this);
		});
		
		
		$('.date-pick').bind('keyup', function(e) { 	
			handleEditDate(this);
			
		});	
		
		$('#link_nav_prev').bind('click', function(e){
			displayPrevMonth();
		});
		$('#link_nav_next').bind('click', function(e){
			displayNextMonth();
		});
		
		$('#dp-link-close').bind('click', function(e){			
				closePopUp(dateId); 
		});
	}
//END- FSNE Part1 Auto-suggest && Calendar Changes	
