var ispopUpBlocked = false;
var ispopUpBlockerCalled=false;
/**
 * The Away global namespace object
 * @class Away
 * @static
 */
 
 /**
 * This line is to include the combined yahoo javascripts into global.js
 */

if (typeof Away == "undefined") {
    var Away = {};
}

/**
 * This function was stolen from Yahoo's lib since they haven't altered
 * their function.  (it is currently a CR for their lib, no delivery date)
 * For best practice, declare the required namespace at the beginning of 
 * every js "package". 
 *
 * Returns the namespace specified and creates it if it doesn't exist
 * <pre>
 * YAHOO.namespace("property.package");
 * YAHOO.namespace("YAHOO.property.package");
 * </pre>
 * Either of the above would create YAHOO.property, then
 * YAHOO.property.package
 *
 * Be careful when naming packages. Reserved words may work in some browsers
 * and not others. For instance, the following will fail in Safari:
 * <pre>
 * YAHOO.namespace("really.long.nested.namespace");
 * </pre>
 * This fails because "long" is a future reserved word in ECMAScript
 *
 * @method namespace
 * @static
 * @param  {String*} arguments 1-n namespaces to create 
 * @return {Object}  A reference to the last namespace object created
 */

Away.namespace = function() {
    var a=arguments, o=null, i, j, d;
    for (i=0; i<a.length; ++i) {
        d=a[i].split(".");
        o=Away;

        // Away is implied, so it is ignored if it is included
        for (j=(d[0] == "Away") ? 1 : 0; j<d.length; ++j) {
            o[d[j]]=o[d[j]] || {};
            o=o[d[j]];
        }
    }

    return o;
};

function swapDisplay (id, state) {
	document.getElementById(id).style.display = state;
}

function showPage(){
	var divElement = document.getElementById('stellentarticlecontent');
	var msg = divElement.innerHTML;
	return msg;
}


function ShowListings() {
	try{
		if (zSr == null || typeof(zSr) == "undefined" || zSr.length == 6) {		
			return;
		}
	}catch(err){
		//variable zSr is not available if exteranl site doesn't support;		
		return;
	}
	var i=6;
	document.write ('<ul class="no-formatting">');
	while (i < zSr.length) {
		var descr = zSr[i++]; // listing description
		var unused1 = zSr[i++]; // (ignore)
		var clickURL = zSr[i++]; // listing link
		var title = zSr[i++]; // listing title
		var sitehost = zSr[i++]; // advertiser?s domain name
		var unused2 = zSr[i++]; // (ignore)
		document.write('<li>');
		document.write('<a target="_blank" href="' + clickURL + '">');
		document.write(title + '</a>');
		document.write('<p><a target="_blank" href="' + clickURL + '">' + descr + '</a></p>');
		document.write('<a target="_blank" href="' + clickURL + '" class="sitehost">' + sitehost + '</a></li>');
	}
	document.write ('</ul>');
}


function openNewWindow (url) {
	//simple function, mimmicks opening window using target = _blank, but places a sized window in upper left corner
	window.open (url, '', 'left=50,top=50,location=yes,scrollbars=yes,width=600,height=500,menubar=yes,status=yes,resizable=yes,toolbar=yes');
}

function openVirtualTour (url) {
	var win = window.open (url, 'virtual_tour_window', 'left=50,top=50,scrollbars=yes,width=800,height=650');
	win.focus();
}

function openSmallPopup (url, winName) {
	var w=window.open(url, winName, 'left=50,top=50,width=435,height=325,scrollbars=auto'); 
	w.focus();
}

function openQuickCheck (url) {
	var w = window.open (url, 'quickcheck', 'width=260,height=440,top=20,left=20,scrollbars=yes,resizable=0')
	w.focus();
}
function openPopUp (url) {
	var w = window.open (url, 'quickcheck', 'width=500,height=500,top=20,left=20,scrollbars=yes,resizable=yes')
	w.focus();
}

function openPopUp2 (msg) {
	var w = window.open (msg);
	w.focus();
}

function openCompareRatesAirportCodes () {
    window.open('/plan-a-trip/airportcodes.html', 'airportcodes', 'width=600,height=600,resizable=yes,scrollbars=yes,left=50,top=50');
}

function IsPopupBlocker() {
	var objWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");
	if (objWin == null || typeof(objWin) == "undefined") {
		return true;
	} else {
		objWin.close();
		return false;
	}
}	
	
function IsPopupBlockerUserClick () {
	for (var i=0; i<2; i++ ) {
		var objWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");
		if (objWin == null || typeof(objWin) == "undefined") {
			return true;
		} else {
			objWin.close();
		}
	}
	return false;
}	
	
//open travel photo galleries
function openTPG (url, type) {
		var windowName = "";
		switch (type) {
			case "screensaver":
				windowName = "screensaver_preview";
				break;
			case "gallery":
				windowName = "photo_gallery";
				break;
			case "slideshow":
				windowName = "slideshow";
				break;
			default:
				break;
		}
		window.open (url, windowName, 'width=792,height=700,scrollbars=yes,resizable=yes,left=50,top=50');
	}
	
function getPFUrl(requestUrl){
	requestUrl = requestUrl.replace("-do-","-pf-");
	requestUrl = requestUrl.replace("-ga-","-pf-");
	requestUrl = requestUrl.replace("-ta-","-pf-");
	return requestUrl;
}

var map;
var marker ='';
function loadMap() {
	loadMap(null);
}
function loadMap(googleDivId) {
	var varSuffix = "";
	if(googleDivId != null) {
		varSuffix = googleDivId; 
	}
	
	loadGoogleMap(varSuffix);
}
function loadGoogleMap(varSuffix) {
	var latLongCountVar = "latLongCount"+varSuffix;
	var zoomLevelVar = "zoomLevel"+varSuffix;
	var googleMapDivNameVar = "google-map"+varSuffix;
	var mapcobrandIDVar = "mapcobrandID"+varSuffix;
	var latLongTypeVar = "latLongType"+varSuffix;
	var catTypeNameVar = "catTypeName"+varSuffix;
	var latLongTypeCountVar = "latLongTypeCount"+varSuffix;
	var polygonLatVar = "polygon_lat"+varSuffix+"_";	
	var polygonLongVar = "polygon_long"+varSuffix+"_";
	var totalCountChildrenVar = "totalCountChildren"+varSuffix;
	var latLongTypeChildVar = "latLongTypeChild"+varSuffix+"_";
	var catIdChildVar = "catIdChild"+varSuffix+"_";	
	var finalcountVar = "_finalcount"+varSuffix;
	var latVar = "_lat"+varSuffix+"_";
	var longVar = "_long"+varSuffix+"_";
	var googleMapLatVar = "googleMapLat"+varSuffix+"_";
	var googleMapLonVar = "googleMapLon"+varSuffix+"_";
	var googleObjectNameVar = "googleObjectName"+varSuffix+"_";
	var googleDestnUrlVar = "googleDestnUrl"+varSuffix+"_";
	var googleUrlVar = "googleUrl"+varSuffix+"_";
	var resortLocationVar = "resortLocation"+varSuffix+"_";
	var acreageVar = "acreage"+varSuffix+"_";
	var verticalRiseVar = "verticalRise"+varSuffix+"_";
	var recentSnowFallVar = "recentSnowFall"+varSuffix+"_";
	var centerLatitudeVar = "centerLatitude"+varSuffix;
	var centerLongitudeVar = "centerLongitude"+varSuffix;
	var cityTemplateVar = "cityTemplate"+varSuffix;
	var inAndAroundDestnVar = "inAndAroundDestn"+varSuffix;
	var isDayTripsDestnVar = "isDayTripsDestn"+varSuffix;
	var isOverNightsDestnVar = "isOverNightsDestn"+varSuffix;
	var templateIdVar = "templateId"+varSuffix;
	var hideMarkerVar = "hideMarker"+varSuffix;
	var enableResortUrlVar = "enableResortUrl"+varSuffix;
	var hotelImage = "googleHotelImage"+varSuffix+"_";
	
	
  	var latLongCount = '';
	if( document.getElementById(latLongCountVar) != null && 
		typeof(document.getElementById(latLongCountVar)) != 'undefined') {
		latLongCount = document.getElementById(latLongCountVar).value;
	} 
	
	var zoomLevel = '';
	if( document.getElementById(zoomLevelVar) != null && 
		typeof(document.getElementById(zoomLevelVar)) != 'undefined') {
		zoomLevel = document.getElementById(zoomLevelVar).value;
	} 
	
     if (GBrowserIsCompatible() && zoomLevel!=null && zoomLevel!='') {
     	var allDivs = document.getElementsByTagName("div");
     	//alert("allDivs.length : "+allDivs.length);
     	/*for (var i = 0; i < allDivs.length; i++) {
     		if (allDivs[i].getAttribute('id') != null && allDivs[i].getAttribute('id') == "google-map") {
     		}
     	}*/
     	map = new GMap2(document.getElementById(googleMapDivNameVar));
        map.addControl(new GLargeMapControl());
		map.addControl(new GMapTypeControl());
		gmarkers = new Array();
		
		// Create our "tiny" marker icon
		 var googleCobrand=document.getElementById(mapcobrandIDVar).value;
			var icon = new GIcon();
		 	icon.image = mediaDomainPath+"/away/images/google-maps/"+googleCobrand+"-icon.png";
       		icon.shadow = mediaDomainPath+"/away/images/google-maps/"+googleCobrand+"-icon-shadow.png";
       		if(googleCobrand=="blue"){
       			icon.iconSize = new GSize(29, 29);
       		}else{
            	icon.iconSize = new GSize(19, 26);
            }
            icon.shadowSize = new GSize(45, 26);
            icon.iconAnchor = new GPoint(6, 20);
            icon.infoWindowAnchor = new GPoint(5, 1);
		
		//Adding highlights for polygon, strict polygon, trail - REC1790
		var colorArray = ['#FFFF00', '#FF9900','#00CC00','#000099','#000000','#660000','#989898', '#990099'];
		var glatLongArray=[];
		var latLongType = '';
		var latLongTypeCount='';
		if( document.getElementById(latLongTypeVar) != null && 
		typeof(document.getElementById(latLongTypeVar)) != 'undefined') {
			latLongType = document.getElementById(latLongTypeVar).value;
			if(document.getElementById(catTypeNameVar)!=null && 
				typeof(document.getElementById(catTypeNameVar)) !='undefined') {
				var catTypeName = document.getElementById(catTypeNameVar).value;
			}
			if(document.getElementById(latLongTypeCountVar)!=null && 
				typeof(document.getElementById(latLongTypeCountVar)) !='undefined') {
				latLongTypeCount = document.getElementById(latLongTypeCountVar).value;
				for(i=1;i<=latLongTypeCount;i++) {
					var latElementPoly = polygonLatVar+ i;
					var lonElementPoly = polygonLongVar+ i;
					var latValPoly = document.getElementById(latElementPoly).value;
					var lonValPoly = document.getElementById(lonElementPoly).value;
					var polylatlong = new GLatLng(latValPoly/10000, lonValPoly/10000);
					if(i==1) {
						var firstlatlong = polylatlong;
					}	
					glatLongArray[i-1]=	polylatlong;
						
				}
				if((latLongType == 'POLYGON' || latLongType == 'STRICT POLYGON') && catTypeName=='Travel Area') {
					glatLongArray[i]=	firstlatlong; 
					var polygon = new GPolygon(glatLongArray, "#FF9900", 3, 1, "#FF9900", 0.2);
					map.addOverlay(polygon); 
				}
				else if(latLongType == 'PATH'){
					var polygon = new GPolyline(glatLongArray, "#FF9900", 3, 1); 
					map.addOverlay(polygon); 
				}
			}	
		} 
		
		//Adding highlights for parent destinations
		var latLongTypeChild = '';
		var latLongTypeCountChild='';
		if( document.getElementById(totalCountChildrenVar) != null && 
		typeof(document.getElementById(totalCountChildrenVar)) != 'undefined') {
			var totalCountChildren = document.getElementById(totalCountChildrenVar).value;
			for(i=1;i<=totalCountChildren;i++){
		 var glatLongArrayChild=[];
			var latLongTypeChild = document.getElementById(latLongTypeChildVar+i).value;
					var catIdChild = document.getElementById(catIdChildVar+i).value;
					var countPerChild = document.getElementById(catIdChild+finalcountVar).value;
					for(j=1;j<=countPerChild;j++){
						var latitudeChild = document.getElementById(catIdChild+latVar+j).value;
						var longitudeChild = document.getElementById(catIdChild+longVar+j).value;
						childlatlong = new GLatLng(latitudeChild/10000, longitudeChild/10000);
						if(j==1) {
							var firstlatlongChild = childlatlong;
						}
						glatLongArrayChild[j-1] = childlatlong;
					}
					if(latLongTypeChild.indexOf("POLYGON")!=-1) {
						glatLongArrayChild[j]=	firstlatlongChild; 
						var childPolygon = new GPolygon(glatLongArrayChild, colorArray[i%8], 3, 1, colorArray[i%8], 0.2);
						map.addOverlay(childPolygon); 
					}
					else if(latLongTypeChild=="PATH") {
						var childPolygon = new GPolyline(glatLongArrayChild, colorArray[i%8], 3, 1); 
						map.addOverlay(childPolygon); 
					}
			}
		}
		
		var i = 1;
		var temp=0;
		var desturl=[];
		for (i=1;i<=latLongCount;i++){
			var latElement = googleMapLatVar + i;
			var lonElement = googleMapLonVar + i;
			var objectNameElement= googleObjectNameVar + i;
			var destnUrlement= googleDestnUrlVar + i;
			var urlElement= googleUrlVar + i;
			var locationElement= resortLocationVar+i;
			var acreageElement = acreageVar + i;
			var verticalRiseElement = verticalRiseVar+i;
			var recentSnowFallElement = recentSnowFallVar+i;
			var localHotelImageElement = hotelImage+i;
			var centerLatVal='';
			var centerLonVal='';
			var latVal = document.getElementById(latElement).value;
			var lonVal = document.getElementById(lonElement).value;
			var acreageVal = $("#"+acreageElement).val();
			var verticalRiseVal = $("#"+verticalRiseElement).val();
			var recentSnowFallVal = $("#"+recentSnowFallElement).val();
			if(document.getElementById(centerLatitudeVar)!=null){
				centerLatVal = document.getElementById(centerLatitudeVar).value;
			}
			if(document.getElementById(centerLongitudeVar)!=null){
				centerLonVal = document.getElementById(centerLongitudeVar).value;
			}
			var objectName=document.getElementById(objectNameElement).value;
			
			var latlong = new GLatLng(latVal, lonVal);
			var outermsg = "150-300 Miles";
			var middlemsg = "25-150 Miles";
			var innermsg = "0-25 Miles";
			if( i == 1 ) {
				if(centerLatVal !='' && centerLatVal!=0 && centerLonVal !='' && centerLonVal!=0){
					var centerlatlong = new GLatLng(centerLatVal, centerLonVal);
					map.setCenter(centerlatlong , parseInt(zoomLevel));
				}else{
					map.setCenter(latlong , parseInt(zoomLevel));
				}
			}		
			
			if(document.getElementById(urlElement)!=null && document.getElementById(locationElement) != null){
				marker = new GMarker(latlong, {icon:icon});
				var url=document.getElementById(urlElement).value;
				var location=document.getElementById(locationElement).value;
				var localHotelImage = document.getElementById(localHotelImageElement).value; 
				marker.bindInfoWindowHtml('<img align="top" width="100" height="80" src="'+localHotelImage+'"></img>'+'<br/>'+'<a href="'+url+'">'+objectName+'</a>'+'<br/>'+location);
			}
			else if(document.getElementById(destnUrlement)!=null){
				var destnUrl=document.getElementById(destnUrlement).value;
				var options = null;
				if(googleCobrand == "ski") {
					options = {icon:icon,title: objectName};
				} else {
					options = {Icon:icon,title: objectName};
				}
				marker = new GMarker(latlong, options);
				map.disableDoubleClickZoom();
				if(document.getElementById(cityTemplateVar)!=null){
					//map.addOverlay(marker);
		        	if(document.getElementById(inAndAroundDestnVar)!=null){
		        		drawCircle(map, latlong, 150, 40, outermsg);
	    	    	}if(document.getElementById(isDayTripsDestnVar)!=null){
	    	    		drawCircle(map, latlong, 100, 40, middlemsg);
					}if(document.getElementById(isOverNightsDestnVar)!=null){
		        		drawCircle(map, latlong, 50, 40, innermsg);
		           	}
		           	GEvent.addListener(map,"click", function(overlay,clicklatlang,clickpoint) {     
					 if (clickpoint) {   
			          	var clickedlatlng = new GLatLng(clickpoint.lat(),clickpoint.lng());
						var num = latlong.distanceFrom(clickedlatlng);
						var distance = Math.round(num*0.000621371192);
						if(document.getElementById(inAndAroundDestnVar)!=null && distance <= 50){
							window.open(document.getElementById('seeAllGorpLinks_1').value,'_self');
						}if(document.getElementById(isDayTripsDestnVar)!=null && distance > 50 && distance <= 100){
							window.open(document.getElementById('seeAllGorpLinks_2').value,'_self');
						}if(document.getElementById(isOverNightsDestnVar)!=null && distance > 100 && distance <= 150){
							window.open(document.getElementById('seeAllGorpLinks_3').value,'_self');
						}
			          }
			        });
		        		
				}else if(document.getElementById(templateIdVar)!=null && 
						(document.getElementById(templateIdVar).value=='WeekenderSectionFront'||
								document.getElementById(templateIdVar).value=='ParkSectionFront' )){
								var destinationUrl=document.getElementById(destnUrlement).value;
								desturl[marker.getTitle()]= destinationUrl;
						GEvent.addListener(marker,"click", function() {   		
							window.open(desturl[this.getTitle()],'_self');
						});
				}else{
					var windowInfo = new String('<strong>'+objectName+'</strong><br/>');					
					if(acreageVal != null && acreageVal != '')
					{
						windowInfo = windowInfo.concat('&rsaquo; Skiable Acreage: <strong>'+acreageVal+'</strong><br/>');
					}
					if(verticalRiseVal != null && verticalRiseVal != '')
					{
						windowInfo = windowInfo.concat('&rsaquo; Vertical Rise: <strong>'+verticalRiseVal+'</strong> feet<br/>');
					}
					if(recentSnowFallVal != null && recentSnowFallVal != '')
					{
						windowInfo = windowInfo.concat('&rsaquo; Recent Snowfall: <strong>'+recentSnowFallVal+' inches</strong> in last 24 hours<br/>');
					}
					if(document.getElementById(enableResortUrlVar) != null && document.getElementById(enableResortUrlVar).value == 'true') {
						windowInfo = windowInfo.concat('<a href="'+destnUrl+'">More details &raquo;</a>');
					}
					marker.bindInfoWindowHtml(windowInfo);
			}

		}	
		else{
			marker = new GMarker(latlong, {icon:icon});
			marker.bindInfoWindowHtml(objectName);
		}
		gmarkers[temp]= marker;
		temp ++;
		if(document.getElementById(hideMarkerVar) == null)
	       	map.addOverlay(marker);
		}
    } 
}

var poly = [] ; 
var line = null;

function drawCircle(map, center, radius, numPoints, msg)
{
    poly = [] ; 
    var lat = center.lat() ;
    var lng = center.lng() ;
    var d2r = Math.PI/180 ;               // degrees to radians
    var r2d = 180/Math.PI ;               // radians to degrees
    var Clat = (radius/3963) * r2d ;      //  using 3963 as earth's radius
    var Clng = Clat/Math.cos(lat*d2r);
    //Add each point in the circle
    for (var i = 0 ; i < numPoints ; i++)
    {
        var theta = Math.PI * (i / (numPoints / 2)) ;
        Cx = lng + (Clng * Math.cos(theta)) ;
        Cy = lat + (Clat * Math.sin(theta)) ;
        poly.push(new GLatLng(Cy,Cx)) ;
    }
    //Add the first point to complete the circle
    poly.push(poly[0]) ;
    //Create a line with the points from poly, white, 2 pixels wide, 80% opaque
    var gpopt;
    gpopt = {};
    gpopt.clickable = true;
    line = new GPolygon(poly,'#fff', 2, 0.8, '#004341', 0.2, gpopt) ;
   // var tooltip = new Tooltip(marker, msg , 4 , poly[0]); 
   // line.tooltip = tooltip; 
    map.addOverlay(line) ;
   // map.addOverlay(tooltip); 
   	GEvent.addListener(line,'mouseover',function(){ tooltip(msg); });
	GEvent.addListener(line,'mouseout',function(){ exit(); });
	GEvent.addListener(map,'mouseout',function(){ exit(); });
}
		
function highlightMarker(lat,long,objectName,url,location){
	var latitude=lat/10000;
	var longitude=long/10000;
	var targetPoint = new GLatLng(latitude,longitude);
	for (var i=0; i<gmarkers.length; i++) { 
  	if (gmarkers[i].getPoint().equals(targetPoint)) {
	  	gmarkers[i].bindInfoWindowHtml('<a href="'+url+'">'+objectName+'</a><br/>'+location);
		 GEvent.trigger(gmarkers[i],'click');
	 } 
   } 
}

function highlightMarker(lat,long,objectName,url,location,imageUrl){
	var latitude=lat/10000;
	var longitude=long/10000;
	var targetPoint = new GLatLng(latitude,longitude);
	for (var i=0; i<gmarkers.length; i++) { 
  	if (gmarkers[i].getPoint().equals(targetPoint)) {
	  	gmarkers[i].bindInfoWindowHtml('<img align="top" width="100" height="80" src="'+imageUrl+'"></img>'+'<br/>'+'<a href="'+url+'">'+objectName+'</a><br/>'+location);
		 GEvent.trigger(gmarkers[i],'click');
	 } 
   } 
}

function highlightResortMarker(lat,long,resortName,url,acerage,verticalRise,recentSnowFall){
	var targetPoint = new GLatLng(lat,long);
	for (var i=0; i<gmarkers.length; i++) { 
  	if (gmarkers[i].getPoint().equals(targetPoint)) {
  		var windowInfo = new String('<strong>'+resortName+'</strong><br/>');					
		if(acerage != null && acerage != '')
		{
			windowInfo = windowInfo.concat('&rsaquo; Skiable Acreage: <strong>'+acerage+'</strong><br/>');
		}
		if(verticalRise != null && verticalRise != '')
		{
			windowInfo = windowInfo.concat('&rsaquo; Vertical Rise: <strong>'+verticalRise+'</strong> feet<br/>');
		}
		if(recentSnowFall != null && recentSnowFall != '')
		{
			windowInfo = windowInfo.concat('&rsaquo; Recent Snowfall: <strong>'+recentSnowFall+' inches</strong> in last 24 hours<br/>');
		}
		windowInfo = windowInfo.concat('<a href="'+url+'">More details &raquo;</a>');
		
	  	gmarkers[i].bindInfoWindowHtml(windowInfo);
		GEvent.trigger(gmarkers[i],'click');
	 } 
   } 
}

function highlightGorpdestn(lat,long){
	var latitude=lat/10000;
	var longitude=long/10000;
	var targetPoint = new GLatLng(latitude,longitude);
	for (var i=0; i<gmarkers.length; i++) { 
  	if (gmarkers[i].getPoint().equals(targetPoint)) {
  		var index =i+1;
  		var objectNameElement= "googleObjectName_" + index;
		var destnUrlement= "googleDestnUrl_" + index;
	  	var objectName=document.getElementById(objectNameElement).value;
		var destnUrl=document.getElementById(destnUrlement).value;
		gmarkers[i].bindInfoWindowHtml('<a href="'+destnUrl+'">'+objectName+'</a>');
	    GEvent.trigger(gmarkers[i],'click');
	 } 
   }
}

function userReviewFeedBack(reviewIdInput,userResponseInput){					
	var url = "/userReviewHelpful.ajax?"
				+"moduleId=UserReviewHelpful"
				+"&productType=hotels"
				+"&reviewId=" +escape(reviewIdInput)
				+"&isHelpful=" +escape(userResponseInput);
	if (window.XMLHttpRequest) {
    	xmlHttpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    	xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlHttpRequest.open("GET", url, true);
    xmlHttpRequest.onreadystatechange = userReviewHelpfulResponse;
    xmlHttpRequest.send(null);
}

function userReviewHelpfulResponse() {	
	if (xmlHttpRequest.readyState == 4) {
        if (xmlHttpRequest.status == 200) {						
	        updateUserReviewHelpfulResponse();
        }
    }
}

function updateUserReviewHelpfulResponse() {	
	var xmlMessage = xmlHttpRequest.responseXML;
    var reviewHelpful = xmlMessage.getElementsByTagName("com.away.product.user.dto.UserReviewHelpfulDTO")[0];
    if (null == reviewHelpful || "undefined" == typeof(reviewHelpful) ) {
		alert("We are facing technical problems\n Please try after sometime");
		return false;
	}
    var reviewId = reviewHelpful.getElementsByTagName("reviewId")[0].childNodes[0].nodeValue;
    var userResponse = reviewHelpful.getElementsByTagName("userResponse")[0].childNodes[0].nodeValue;
    var yesCount = reviewHelpful.getElementsByTagName("helpfulCount")[0].childNodes[0].nodeValue;
    var totalCount = reviewHelpful.getElementsByTagName("userVotedCount")[0].childNodes[0].nodeValue;
    
    var paraId = "p_hotel_user_review_" +escape(reviewId);
    var spanId = "sp_hotel_user_review_" +escape(reviewId);
    var paraBlock = document.getElementById(paraId);
	var spanBlock = document.getElementById(spanId);

	var messageUserResponseText;
	if(userResponse == 'yes') {
		messageUserResponseText = "You have found this review helpful.";
	} else {
		messageUserResponseText = "You have not found this review helpful.";
	}
	
	var messageResponseCount = "(" +escape(yesCount) + " out of " 
					+escape(totalCount) +" users found this review helpful.)";
		
    var updateSpanElement = document.createElement("span");
    var updateSpanId = "sp_hotel_user_reviewUpdate_" +escape(reviewId)
    updateSpanElement.setAttribute("id", updateSpanId);
    updateSpanElement.appendChild(document.createTextNode(messageUserResponseText));    
    
    var updateParaElement = document.createElement("p");
    var updateParaId = "p_hotel_user_reviewUpdate_" +escape(reviewId)
    var updateParaClass = "helpful";
    updateParaElement.setAttribute("id", updateParaId);
    updateParaElement.setAttribute("class", updateParaClass);
    updateParaElement.appendChild(document.createTextNode(messageResponseCount));   
    
    var divBlock = spanBlock.parentNode;
    divBlock.replaceChild(updateSpanElement,spanBlock);     
    var paraParentBlock = paraBlock.parentNode;
    paraParentBlock.replaceChild(updateParaElement,paraBlock);
}

function generateCSDB(){					
	var url = "/RefreshCSDB.ajax?"
				+"moduleId=GenerateCSDB";
	if (window.XMLHttpRequest) {
    	xmlHttpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    	xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlHttpRequest.open("GET", url, true);
    xmlHttpRequest.onreadystatechange = cSDBRefreshResponse;
    xmlHttpRequest.send(null);
}

function awayCSDBRefresh(){					
	var url = "/RefreshCSDB.ajax?"
				+"moduleId=RefreshCSDB";
	if (window.XMLHttpRequest) {
    	xmlHttpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    	xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlHttpRequest.open("GET", url, true);
    xmlHttpRequest.onreadystatechange = cSDBRefreshResponse;
    xmlHttpRequest.send(null);
}

function cSDBRefreshResponse() {	
	if (xmlHttpRequest.readyState == 4) {
        if (xmlHttpRequest.status == 200) {
			var moduleStatus = xmlHttpRequest.responseXML.getElementsByTagName("string")[0].childNodes[0].nodeValue;
	        if (null == moduleStatus || "undefined" == typeof(moduleStatus) ) {
				alert("We are facing technical problems\n Please try after sometime");
				return false;
			}
	        alert(moduleStatus);
        }
    }
}

function lodgingDetailResizeDiv () {

	var img = $("#indexImage");
	var h = img.offsetHeight;
	if (h  < 328) {
        	$("#hotel-image #indeximagecontainer").css('height', h+"px")
        }
}       


 


 //wrapper/convenience function for the Google Analytics call.
//add dcl links across site should call this function instead of directly invoking urchinTracker
function awayUrchinWrapper (str) {
	//alert ("about to track");
	//cheaptickets should use orbitz
	if (str.toLowerCase() == "cheaptickets") str = "Orbitz";
	str = formatWithUnderscores (str);
	str = "/outgoing/" + str;
	//alert (str);
	pageTracker._trackPageview(str);
	//alert ("tracked");
}

function formatWithUnderscores (str) {
	str = str.replace(/\./g,"_");
        str = str.replace(/ /g,"_");
        str = str.toLowerCase();
	return str;
}

function isNonNumberKey(evt){
     var charCode = (evt.which) ? evt.which : event.keyCode
     if (charCode < 48 || charCode > 57)
        return true;
     return false;
}

function toggleCheckBox(elementId) {
	if(document.getElementById(elementId).checked == true ) {
		document.getElementById(elementId).checked = false;
	} else {
		document.getElementById(elementId).checked = true;
	}
}

function toggleCrCheckBox(elementId) {
    if(elementId != null) {   
		if(elementId.checked == true ) {
			elementId.checked = false;
		} else {
			elementId.checked = true;
		}
	}
}

function retainChecked(linkId) {
    if(document.getElementById(linkId) != null) { 
		if(document.getElementById(linkId).checked == true ) {
			return true;
		}else{
			return false;
		}
	}
	return true;
}	

function trim(inputString) {
	return inputString.replace(/^\s*(\b.*\b|)\s*$/, "$1");	   
}

/* This can be used to write a general tree for Away applications */
AwayTree = function() {
	
	var tree;
	
	function loadNodeData(node, fnLoadComplete) {
		var urlValue = node.data.urlRef;
		if(urlValue != '') {
			var urlObjs = new Array();
	   		var childNodes = new Array();
	   		var secLinks =AwayTreeHelper.secondaryLinks[urlValue];
	   		var secLinkTxt =AwayTreeHelper.secondarylinkText[urlValue];
	   		if(secLinks==null){
	   		}else{		   				
		   		for(var i=1;i<secLinks.length;i++){
					linkText = secLinkTxt[i];
					urlObjs[i] = { label: linkText, urlRef:'', href:secLinks[i]}; 
					childNodes[i] = new YAHOO.widget.TextNode(urlObjs[i], node, true);
				}
			}
			fnLoadComplete();
		} else {
			fnLoadComplete();
		}
	}
	
	function loadNodeData1(node, fnLoadComplete) {
		var urlValue = node.data.urlRef;
		if(urlValue != '') {
			var urlObjs = new Array();
	   		var childNodes = new Array();
	   		var secLinks =AwayTreeHelper.secondary1Links[urlValue];
	   		var secLinkTxt =AwayTreeHelper.secondary1linkText[urlValue];
	   		if(secLinks==null){
	   		}else{		   				
		   		for(var i=1;i<secLinks.length;i++){
					linkText = secLinkTxt[i];
					urlObjs[i] = { label: linkText, urlRef:'', href:secLinks[i]}; 
					childNodes[i] = new YAHOO.widget.TextNode(urlObjs[i], node, true);
				}
			}
			fnLoadComplete();
		} else {
			fnLoadComplete();
		}
	}
	

	function buildTree() {
		if(AwayTreeHelper.writeRootNodes != null) {
			//create a new tree:
			tree = new YAHOO.widget.TreeView("AwayTreeContainer");		   
			//turn dynamic loading on for entire tree:
			tree.setDynamicLoad(loadNodeData,1);		   
			//get root node for tree:
			var root = tree.getRoot();
			AwayTreeHelper.writeRootNodes(root);		
			tree.draw();
		}
		//create another tree
		if(AwayTreeHelper.writeSubTree1Nodes != null) {
			//create a new tree:
			subTree = new YAHOO.widget.TreeView("AwayTreeSubContainer1");		   
			//turn dynamic loading on for entire tree:
			subTree.setDynamicLoad(loadNodeData1,1);		   
			//get root node for tree:
			var subRoot = subTree.getRoot();
			AwayTreeHelper.writeSubTree1Nodes(subRoot);		
			subTree.draw();
		}
	}

	return {
		init: function() {	            
            buildTree();
        }
	}
} ();

var AwayTreeHelper = 
{	
	secondaryLinks:new Array(),
	secondarylinkText:new Array(),
	writeRootNodes:null,
	writeSubTree1Nodes:null,		
	secondary1Links:new Array(),
	secondary1linkText:new Array()
}

function ispopUpBlockerEnabled()
{
	var browsertype=navigator.appName;
	if(!ispopUpBlockerCalled && browsertype !="Netscape"){
		ispopUpBlocked=IsPopupBlockerUserClick();
		ispopUpBlockerCalled=true;
	}
	return ispopUpBlocked;
}

function properYearFormat(stringDate){
	var today=new Date();
	var temp= new Array();
	temp = stringDate.split('/');
	var months = temp[0];
	var days = temp[1];
	var years = temp[2];
	if(years.length == 2){
		var	decade='';	
		if(years < today.getFullYear()%100){
			decade = Math.round(today.getFullYear()/100)+1;
		}else{
			decade = Math.round(today.getFullYear()/100);
		}
		years=decade+years;
	}
    stringDate=months+'/'+days+'/'+years;
    return stringDate;
}

function selectProviders(flightProviders,curentProvider){
	for (i = 0; i < document.getElementsByName(flightProviders).length; i++){		
		document.getElementsByName(flightProviders)[i].checked = false ;		
	}
	document.getElementById(curentProvider).checked=true;	
}

function attrFilter(){
	window.open(document.getElementById('attrFilterMap').value,'_self');
}

// Added fro thumb it 
function trim(inputString) {
	return inputString.replace(/^\s*(\b.*\b|)\s*$/, "$1");	   
}
	
function xmlAjaxRequest(url){
	if (window.XMLHttpRequest){
          // code for IE7+, Firefox, Chrome, Opera, Safari
          xmlhttp=new XMLHttpRequest();
          xmlhttp.open("GET",url,false);
          xmlhttp.send(null);
    }else {
    	  // code for IE6, IE5
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          xmlhttp.open("GET",url,false);
          // Do not send null for ActiveX
          xmlhttp.send();
     }
     return trim(xmlhttp.responseText);
}


function voteThumbIt(url,idPrefix,thumbsUp,isListPage){
    var xmlobject = doThumbitAjaxCall(url);       
    if(thumbsUp){
	pageTracker._trackPageview('thumbit/thumbsup');
    } else {
	pageTracker._trackPageview('thumbit/thumbsdown');
    }
    setThumbitHTML(xmlobject,0,'NA',idPrefix,isListPage,thumbsUp);  // NA (not applicable) is the object type since it's only needed when the resulting thumbit html may be enabled after invoking setThumbitHTML() here, which isn't possible just after invoking voteThumbIt()
}



function doLoadThumbIt(theIds,count,objectType,idPrefix,isListPage){
	var url ='/loadthumbit.ajax?ajaxCall=true&moduleId=thumbit&object-type='+objectType+'&ids='+theIds+'&action=load';
	var xmlobject = doThumbitAjaxCall(url);		
	for(i=0;i<count;i++){
		setThumbitHTML(xmlobject,i,objectType,idPrefix,isListPage,'unknown');
	}
}



function setThumbitHTML(xmlobject,i,objectType,idPrefix,isListPage,thumbsUp){
        var objectId = xmlobject.getElementsByTagName('objectId')[i].childNodes[0].nodeValue;
        var up = xmlobject.getElementsByTagName('upCount')[i].childNodes[0].nodeValue;
        var isVoted = xmlobject.getElementsByTagName('isVoted')[i].childNodes[0].nodeValue;
        var total = xmlobject.getElementsByTagName('totalCount')[i].childNodes[0].nodeValue;
        var thresholdReached = xmlobject.getElementsByTagName('thresholdReached')[i].childNodes[0].nodeValue;
        var percentage = xmlobject.getElementsByTagName('percentage')[i].childNodes[0].nodeValue;
        percentage=percentage+"%";
        var likeThis="";
	var statsText="";
	var detailPageMessageText="";
	var listPageMessageText="";
        if(thresholdReached !=null && thresholdReached == 'true'){
                likeThis="like this";
		statsText=up+" of "+total;
		detailPageMessageText=detailPageMessageText+"<span class='thumbitdetail-percent'>"+percentage+"</span>";
                detailPageMessageText=detailPageMessageText+"<span>"+likeThis+"</span>";
                detailPageMessageText=detailPageMessageText+"<span class='thumbitdetail-stats'>"+statsText+"</span>";     

		listPageMessageText=listPageMessageText+"<span class='thumbit-percent'>"+percentage+"</span>";
		listPageMessageText=listPageMessageText+"<span>"+likeThis+"</span>";         
        } else {
                percentage="";
                detailPageMessageText=detailPageMessageText+"<span class='thumbitdetail-vote'>Vote!</span>";

		listPageMessageText=listPageMessageText+"<span class='thumbit-vote'>Vote!</span>";
        }
        var jsUpSource="";
        var jsDownSource="";
        var imageHtml="";
        
        // Images filenames
        
        // Base image
        var thums_up = mediaDomainPath+"away/images/thumb-it/thumb-up.png";
        var thumbs_down = mediaDomainPath+"away/images/thumb-it/thumb-down.png";
        
        // When selected and not available
        var thumbs_up_check = mediaDomainPath+"away/images/thumb-it/thumb-up-check.jpg";
        var thumbs_down_check = mediaDomainPath+"away/images/thumb-it/thumb-down-check.jpg";
        
        // When are not available
        var thumbs_up_gray = mediaDomainPath+"away/images/thumb-it/thumb-up-gray.png";
        var thumbs_down_gray = mediaDomainPath+"away/images/thumb-it/thumb-down-gray.png";
        
        // When the thumbIt is refered to gears use gear prefix;

        var prefix = "";
        // Use the idPrefix for determining which thumb images need to be displayed.
        if(idPrefix == 'G')
        {

            thums_up = mediaDomainPath+"outside/images/gear/gear-thumb-up.png";
            thumbs_down = mediaDomainPath+"outside/images/gear/gear-thumb-down.png";
            
            // When selected and not available
            thumbs_up_check = mediaDomainPath+"outside/images/gear/gear-thumb-up-check.png";
            thumbs_down_check = mediaDomainPath+"outside/images/gear/gear-thumb-down-check.png";
            
            // When are not available
            thumbs_up_gray =mediaDomainPath+"outside/images/gear/gear-thumb-up-gray.png";
            thumbs_down_gray = mediaDomainPath+"outside/images/gear/gear-thumb-down-gray.png";
            
            prefix = "gear-";
        }
        
        if(isVoted == 'false'){
                jsUpSource ="javascript:voteThumbIt('/loadthumbit.ajax?moduleId=thumbit&object-type="+objectType+"&ids="+objectId+"&thumbsUp=true&action=vote','"+idPrefix+"',true,"+isListPage+");"
                jsDownSource ="javascript:voteThumbIt('/loadthumbit.ajax?moduleId=thumbit&object-type="+objectType+"&ids="+objectId+"&thumbsUp=false&action=vote','"+idPrefix+"',false,"+isListPage+");"
                imageHtml="<a href="+jsUpSource+" class='" + prefix + "thumbit-thumb'><img src='" + thums_up + "'></a><a href="+jsDownSource+"  class='" + prefix + "thumbit-thumb'><img src=' " + thumbs_down + " '></a>";
        } else {


		if(thumbsUp == 'unknown')
		{
			imageHtml="<img src='" + thumbs_up_gray + "' class='thumbit-thumb'><img src='" + thumbs_down_gray + "' class='thumbit-thumb'>"; 
		} 
		else if(thumbsUp)
		{
			imageHtml="<img src='" + thumbs_up_check + "' class='thumbit-thumb'><img src='" + thumbs_down_gray + "' class='thumbit-thumb'>";
		} 
		else 
		{
			imageHtml="<img src='" + thumbs_up_gray + "' class='thumbit-thumb'><img src='" + thumbs_down_check + "' class='thumbit-thumb'>";
		}
	}

        var innerHtml = "";

        if(isListPage){
	        innerHtml=innerHtml+"<div class='thubmit-percentcontainer'>";
	        innerHtml=innerHtml+listPageMessageText;
	        innerHtml=innerHtml+"</div>";
	        innerHtml=innerHtml+"<div class='thumbit-thumbscontainer'>";
	        innerHtml=innerHtml+imageHtml;
	        innerHtml=innerHtml+"</div>";
	} else { 
	        innerHtml=innerHtml+"<div class='thubmitdetail-percentcontainer'>";
               	innerHtml=innerHtml+detailPageMessageText;
        	innerHtml=innerHtml+"</div>";
       		innerHtml=innerHtml+"<div class='" + prefix + "thumbitdetail-thumbscontainer'>";
               	innerHtml=innerHtml+"How about you? ";
        	innerHtml=innerHtml+imageHtml;
        	innerHtml=innerHtml+"</div>";
	}

        document.getElementById(idPrefix+objectId+"thumb").innerHTML = innerHtml;        
}
	

function doThumbitAjaxCall(url){
        var  xmlMessage =  xmlAjaxRequest(url);
	if (window.DOMParser)
	  {
	    return (new DOMParser()).parseFromString(xmlMessage, "text/xml");
	  }
	else // Internet Explorer
	  {
	    xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	    xmlDoc.async="false";
	    xmlDoc.loadXML(xmlMessage);
	    return xmlDoc;
	  }         
}

var windowprops = "width=600,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,alwaysraised=true";

function submitDeal(cpc,id,url,partnerName){
	var winname = id;
	if(partnerName=='Orbitz'){
		id='OrbitzDeal'
	}
	var left = 50;
	var top = 50;  
	var s=s_gi(s_account);
  	s.events = "purchase";
  	s.products=";"+'D'+id+";1;0";
  	s.linkTrackVars= "events,products";
  	s.linkTrackEvents="purchase";
  	s.tl(true,"c","Submit Deal");
  	window.open(url,winname,windowprops + ",left=" + left + ",top=" + top);
}
function getCookie(name) {

        //document.cookie=name;
        var a=document.cookie;
        var begin = a.indexOf(name + "=");

        // var end = (a.indexOf(";", begin) == -1) ? a.length : a.indexOf(";", begin);
        var end=(begin==-1)? "":a.indexOf(";",begin);
        if(end==""){
        return "";
        }
        return unescape(a.substring((begin + (name.length + 1)), end));
}

function setCookieInto(name, value ) {
		var maxCount=$("#pageMaxCount").val();
        if($("#loggedInUser").val()=="false"){
                if (!name || !value) {
                        document.cookie = name + "=" + 1+"; path=/";
                }else{
                        ++value;
                        document.cookie = name + "=" + value+"; path=/"   ;
                        if (value>maxCount ) {
                                redirectTo(name,value);
                        }
                }
        }
}
function redirectTo(name,value) {
	 document.cookie = name + "=" + value+"; path=/";
	 window.location="/useraccount/login?parameter=login";
}

function resetToZero(){
 		 document.cookie = "byPassCookie" + "=" + 0+"; path=/";
         var chkIfLoggedOut=true;
         return chkIfLoggedOut;
}
function submitFlightDeal(){
	$(".dealswrappertable tr").each(function(index){
		$(this).click(function(){
	  			var urlPre = "http://ad.doubleclick.net/clk;133374671;19782377;s?";
	  			var flightUrl = $(this).find("td:first input#flightUrl").val();
	  			var urlPost = "&WT.mc_id=o_away_air&WT.mc_ev=click&DCSext.mc_kw=";
	  			var completeFltUrl = urlPre+flightUrl+urlPost;
	  			//alert(completeFltUrl);  
	  			var winname = "window"+index
	  			var windowprops = "width=600,height=500,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,resizable=yes,alwaysraised=true";
	  			var left = 50;
				var top = 50;		
	  			window.open(completeFltUrl,winname,windowprops + ",left=" + left + ",top=" + top);
	  			awayUrchinWrapper('Orbitz');
	  			return false;
	  		
	  		});
	  	});
}

function submitHotelDeal(){
	$(".dealswrappertable tr.odd, .dealswrappertable tr.even, .untardealswrappertable tr.odd, .untardealswrappertable tr.even").each(function(){
  		$(this).click(function(){
  			var url = $(this).find("td:first input#linkUrl").val();
  			var dealId = $(this).find("td:first input#dealId").val();
  			var partnerName = $(this).find("td:first input#partnerName").val();
  			var cpcVal = $(this).find("td:first input#cpcVal").val();
  			submitDeal(cpcVal,dealId,url,partnerName);
  			return false;
  		});
  	});	
}

function changeStyles(){
	$(".dealswrappertable tbody tr, .untardealswrappertable tbody tr").each(function(index){
		$(this).mouseover(function(){
			//highlightHotelMarker($("#googleMapLat_"+index).val(), $("#googleMapLon_"+index).val(), $("#googleObjectName_"+index).val() )
	  		$("span.dealsgreysubmit").each(function(){	  			
  				$("span.dealsgreysubmit").removeClass("dealsgreysubmit-mo");
	  		})
			$(this).find("span.dealsgreysubmit").addClass("dealsgreysubmit-mo");	
		});
		$(this).mouseout(function(){
			//clearHotelOverLays();
	  		$("span.dealsgreysubmit").each(function(){	  			
  				$("span.dealsgreysubmit").removeClass("dealsgreysubmit-mo");
	  		})	
		});
	});
}  	
function highlighDealsTab(){
	$("#botnav_deals").parent().removeClass('taboff').addClass('tabon');
	$("#botnav_deals").parent().html('<div><span><a id="botnav_deals" href="/trip-planning/deals.html">Deals</a></span></div>');
	$(".tabmiscon").html('<a href="/trip-planning/index.html">Trip Guides</a>');	
	$(".tablast").removeClass('tablast').addClass("tablastlanding");
	$(".tabmiscon").removeClass('tabmiscon').addClass("tabmiscoff");
}

//-----------------------------------------------------------------------------------------
//Google map v3 methods start.
//-----------------------------------------------------------------------------------------

//------------------------------------------------------------------------------------------
//Common Load Script method which takes in the call back method as parameter and initializes
//the map. It can be used in any other case just by defining the necessary call back methods
//------------------------------------------------------------------------------------------
function loadScript(callBackMethod) {
	  var script = document.createElement("script");
	  script.type = "text/javascript";
	  script.src = "http://maps.google.com/maps/api/js?sensor=false&callback="+callBackMethod;
	  document.body.appendChild(script);
	}

var v3map ='';  var v3markers=[];
//------------------------------------------------------------------------------------------
//This is the callback method to create the markers on page load
//------------------------------------------------------------------------------------------
function initializeV3GMap() {
var centerlat=$("#centerLatitude").val();
var centerlong=$("#centerLongitude").val();
var zoomlevel=parseInt($("#zoomLevel").val(),10);
var latlongquality=$("#latLonQuality").val();
var centerLatlng = new google.maps.LatLng(centerlat, centerlong);
 var myOptions = {
    zoom:zoomlevel,
    center: centerLatlng,
    mapTypeId: google.maps.MapTypeId.TERRAIN 
  }
  v3map = new google.maps.Map(document.getElementById("google-map"), myOptions);
  createmarkers('toplist','','')
 }
//------------------------------------------------------------------------------------------
//This is to create markers on user click
//------------------------------------------------------------------------------------------
 function createmarkers(markertype,seeAllLabel,seeAllUrl){
	 var latitude='';
	 var longitude='';
	 var latlng='';
	 var marker='';
	 var objectName='';
	 var objectUrl='';
	 var contentString='';
	 var infowindow='';
	 for(i=0;i<v3markers.length;i++){
		v3markers[i].setMap(null);
	 }
	 var allLinkPresent=false;
	 $("."+markertype).each(function (i){
        if(i>14){
                allLinkPresent=true;
                return false;
        }
        var googleCatId=this.id;
        if(googleCatId.indexOf('top_')>=0){
                googleCatId=googleCatId.replace('top_','');
        }
        latitude=$("#googleMapLat_"+googleCatId).val()/10000;
        longitude=$("#googleMapLon_"+googleCatId).val()/10000;
        objectName=$("#googleObjectName_"+googleCatId).val();
        objectUrl=$("#googleDestnUrl_"+googleCatId).val();
        contentString='<a href="'+objectUrl+'">'+objectName+'</a>';
        if(latitude != 0 && longitude != 0){
        	infowindow = new google.maps.InfoWindow();
        	latlng=new google.maps.LatLng(latitude, longitude);
	        marker = new google.maps.Marker({
		      position: latlng,
		      map: v3map,
		      draggable: false,
		      title: objectName,
		      html:contentString,
		      parkUrl:objectUrl
		      //animation: google.maps.Animation.BOUNCE
		    });
	        google.maps.event.addListener(marker, 'click', function() {
                window.open(this.parkUrl,'_blank');
	        });
	        google.maps.event.addListener(marker, 'mouseover', function() {
	        		infowindow.setContent(this.html);
	                infowindow.open(v3map,this);
	        });
	        v3markers.push(marker);
        }
	  });
	  if(allLinkPresent && seeAllLabel!=''){
	          $('#seeallLinkMap').hide();
	          $('#seeallLinkMap').html('<a href="'+seeAllUrl+'" id="a_'+markertype+'"'+' >'+'See All '+seeAllLabel+'</a>').show('slow');
	  }else{
	          $("#seeallLinkMap").hide();
	  }

}


function initializeWeekenderMap() {
var centerlat=$("#centerLatitude").val();
var centerlong=$("#centerLongitude").val();
var zoomlevel=parseInt($("#zoomLevel").val(),10);
var latlongquality=$("#latLonQuality").val();
var centerLatlng = new google.maps.LatLng(centerlat, centerlong);
 var myOptions = {
    zoom:zoomlevel,
    center: centerLatlng,
    mapTypeId: google.maps.MapTypeId.TERRAIN 
  }
  v3map = new google.maps.Map(document.getElementById("google-map"), myOptions);
  createmarkers('topweekenderCities','','')

 }
 
//-----------------------------------------------------------------------------------------
//Google map v3 methods end.
//-----------------------------------------------------------------------------------------  


