// if expand quick view cookie does not exist then send image request
// and set the cookie so that no other image request is sent for the site section
// per user session
// param siteSection - searchResults, hws
// param MARSHA - MARSHA Code
// param RoomPool - hws RoomPool Code
function sendExpandQuickView(siteSection, MARSHA, roomPool) {
	
	var sendRequestFlag = "omniEQV" + siteSection;
	var omniCookie = "";
	omniCookie = getOmniCookie();
			
	if(omniCookie.match(sendRequestFlag) == null)
	{	
		if(MARSHA.match("-")) {
			MARSHA = MARSHA.replace(/-/g,"");
		}
		if(roomPool.match("-")) {
			roomPool = roomPool.replace(/-/g,"");
		}
		
		var s = s_gi(s_account);
		if(siteSection.match("searchResults")) {		
			s.linkTrackEvents = "prodView,event24";
		   	s.linkTrackVars = "prop7,prop29,products,events";
		   	s.events = "prodView,event24";
		   	s.products = ";" + MARSHA;
		   	s.prop7 = MARSHA;
		   	s.prop29 = "Search: Expand Photos & Highlights";
		} else if(siteSection.match("hws")) {
			s.linkTrackEvents = "prodView,event24";
		   	s.linkTrackVars = "prop29,eVar37,products,events";
		   	s.events = "prodView,event24";
		   	s.products = ";" + MARSHA;
		   	s.eVar37 = roomPool;
		   	s.prop29 = "HWS: Expand Room Details";
		}
		// send image request
		void(s.tl(this, "o"));
		
		// set cookie
		omniCookie += sendRequestFlag + "*";
		document.cookie = "omniData=" + omniCookie + ";path=/";
	}	
}
		
// if quick view photo cookie does not exist then send image request
// and set the cookie so that no other image request is sent for the site section
// per user session
// param siteSection - searchResults, hws
// param MARSHA - MARSHA Code
// param RoomPool - hws RoomPool Code
function sendQuickViewPhoto(siteSection, MARSHA, roomPool) {
	
	var sendRequestFlag = "omniQVP" + siteSection;
	var omniCookie = "";
	omniCookie = getOmniCookie();
	
	if(omniCookie.match(sendRequestFlag) == null)
	{	
		if(MARSHA.match("-")) {
			MARSHA = MARSHA.replace(/-/g,"");
		}
		if(roomPool.match("-")) {
			roomPool = roomPool.replace(/-/g,"");
		}
	
		var s = s_gi(s_account);
		if(siteSection.match("searchResults")) {
			s.linkTrackEvents = "prodView,event25";
	    	s.linkTrackVars = "prop7,prop29,products,events";
	    	s.events = "prodView,event25";
	    	s.products = ";" + MARSHA;
	    	s.prop7 = MARSHA;
	    	s.prop29 = "Search: Click Photo Carousel";
	    } else if(siteSection.match("hws")) {
	    	s.linkTrackEvents = "prodView,event25";
	    	s.linkTrackVars = "prop29,eVar37,products,events";
	    	s.events = "prodView,event25";
	    	s.products = ";" + MARSHA; 	
		   	s.eVar37 = roomPool;  	
	    	s.prop29 = "HWS: Click Photo Carousel";
	    }	    
	    // send image request
	    void(s.tl(this, "o"));
		
	    // set cookie
	   	omniCookie += sendRequestFlag + "*";
	    document.cookie = "omniData=" + omniCookie + ";path=/";
	}			
}

// send onClick image request for Flash impression hot spots
function omniFlashLinkTrack(flashName) {
		
	    // send image request
		var s = s_gi(s_account);
		s.linkTrackEvents = "event2";
	   	s.linkTrackVars = "eVar1,events";
	   	s.eVar1 = flashName;
	   	s.events = "event2";
	   	void(s.tl(this, "o"));
}
		
// get cookie omniData
function getOmniCookie() {
	if (document.cookie.length > 0) {
		var name = "omniData";
		var beginCookie = document.cookie.indexOf(name + "=");
		if (beginCookie != -1) {
   			beginCookie += (name.length + 1);
			var endCookie = document.cookie.indexOf(";",beginCookie);
			if (endCookie == -1) endCookie = document.cookie.length;
			return unescape(document.cookie.substring(beginCookie,endCookie));
		}
	}
	return "";
}