function resizeText(multiplier) {
  for(var i=0; i<10;i++){
    var blog_title = document.getElementById('blog_title'+i);
		var blog_stamp = document.getElementById('blog_stamp'+i);
		var blog_quote = document.getElementById('blog_quote'+i);
    if(blog_title){
      if (blog_title.style.fontSize == "") {
        blog_title.style.fontSize = "1.0em";
      }
			if (blog_stamp.style.fontSize == "") {
        blog_stamp.style.fontSize = "1.0em";
      }
			if (blog_quote.style.fontSize == "") {
        blog_quote.style.fontSize = "1.0em";
      }
      blog_title.style.fontSize = parseFloat(blog_title.style.fontSize) + (multiplier * 0.2) + "em";
			blog_stamp.style.fontSize = parseFloat(blog_stamp.style.fontSize) + (multiplier * 0.2) + "em";
			blog_quote.style.fontSize = parseFloat(blog_quote.style.fontSize) + (multiplier * 0.2) + "em";
    }
  }
}

function resizeQandAText(multiplier) {
  for(var i=0; i<2;i++){
    var qa_title = document.getElementById('qa_title'+i);
		var qa_askedby = document.getElementById('qa_askedby'+i);
		/*var qa_slabel = document.getElementById('qa_slabel_'+i);
    var qa_llabel = document.getElementById('qa_llabel_'+i);*/
    var qa_sdes = document.getElementById('qa_sdes_'+i);
    var qa_ldes = document.getElementById('qa_ldes_'+i);
    //var ans_label = document.getElementById('ans_label_'+i);
    var ans_des = document.getElementById('ans_des_'+i);
    if(qa_title){
      if (qa_title.style.fontSize == "") {
        qa_title.style.fontSize = "1.0em";
      }
      qa_title.style.fontSize = parseFloat(qa_title.style.fontSize) + (multiplier * 0.2) + "em";
    }
    if(qa_askedby){
			if (qa_askedby.style.fontSize == "") {
        qa_askedby.style.fontSize = "1.0em";
      }
      qa_askedby.style.fontSize = parseFloat(qa_askedby.style.fontSize) + (multiplier * 0.2) + "em";
    }
    /*if(qa_slabel){
			if (qa_slabel.style.fontSize == "") {
        qa_slabel.style.fontSize = "1.0em";
      }
      qa_slabel.style.fontSize = parseFloat(qa_slabel.style.fontSize) + (multiplier * 0.2) + "em";
    }
    if(qa_llabel){
			if (qa_llabel.style.fontSize == "") {
        qa_llabel.style.fontSize = "1.0em";
      }
      qa_llabel.style.fontSize = parseFloat(qa_llabel.style.fontSize) + (multiplier * 0.2) + "em";
    }*/
    if(ans_des){
      if (ans_des.style.fontSize == "") {
        ans_des.style.fontSize = "1.0em";
      }
			ans_des.style.fontSize = parseFloat(ans_des.style.fontSize) + (multiplier * 0.2) + "em";
    }
    if(qa_sdes){
      if (qa_sdes.style.fontSize == "") {
        qa_sdes.style.fontSize = "1.0em";
      }
      qa_sdes.style.fontSize = parseFloat(qa_sdes.style.fontSize) + (multiplier * 0.2) + "em";
    }
    if(qa_ldes){
      if (qa_ldes.style.fontSize == "") {
        qa_ldes.style.fontSize = "1.0em";
      }
      qa_ldes.style.fontSize = parseFloat(qa_ldes.style.fontSize) + (multiplier * 0.2) + "em";
    }
    /*if(ans_label){
      if (ans_label.style.fontSize == "") {
        ans_label.style.fontSize = "1.0em";
      }
      ans_label.style.fontSize = parseFloat(ans_label.style.fontSize) + (multiplier * 0.2) + "em";
    }*/
  }
}
function openWin(theURL,winName,features) {
	window.open(theURL,winName,features);
}


function openShowDealOnMap(deal_id)
{
	openWin("/modules/deals/view_on_map.php?deal_id="+deal_id+"","View","scrollbars=yes,width=550px,height=550px");
}

function openShowGolfDealOnMap(deal_id)
{
	openWin("/modules/deals/view_on_map.php?link_from=golf&deal_id="+deal_id+"","View","scrollbars=yes,width=550px,height=550px");
}

function openShowGolfEventOnMap(event_id)
{
	openWin("/modules/events/view_on_map.php?link_from=golf&event_id="+event_id+"","View","scrollbars=yes,width=550px,height=550px");
}

function openShowEventOnMap(event_id)
{
	openWin("/modules/events/view_on_map.php?event_id="+event_id+"","View","scrollbars=yes,width=550px,height=550px");
}

function openRadarMap(param)
{
	openWin("/modules/weather/radar_pop.php?param="+param+"","View","scrollbars=yes,width=600px,height=550px");
}

function openPropertyVideo(width,height,file)
{
	openWin("/modules/listings/property_video.php?width="+width+"&height="+height+"&file="+file+"","ViewVideo","resizable=yes,scrollbars=yes,width="+(width+30)+",height="+(height+30)+"");
}



function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function showTags(element)
{
	searchedElement = document.getElementById("bundle_"+element);
	position = new String(findPos(searchedElement));
	var coords = new Array();
	coords = position.split(',');
	posX = parseInt(parseInt(coords[0])+50);
	posY = parseInt(parseInt(coords[1])+10);

	document.getElementById("infoDiv").style.left = posX+"px";
	document.getElementById("infoDiv").style.top = posY+"px";
	document.getElementById("infoDiv").innerHTML = "TEST";
	document.getElementById("infoDiv").style.width = "100px";
	document.getElementById("infoDiv").style.height = "100px";
	document.getElementById("infoDiv").style.position = "absolute";
	document.getElementById("infoDiv").style.visibility = "visible";

	return false;
}

/////////////////////////////////////////////////////
/// functions for the front page budles handling

var currentElement = "";

function expandBundle(element,BundleID)
{
	currentElement = element;

	if(document.getElementById("testDiv"+element).style.display == "block")
	{
		//document.getElementById("testDiv"+element).style.height="0px";
		//document.getElementById("testDiv"+element).style.width="0px";
		document.getElementById("testDiv"+element).style.display="none";
		document.getElementById("link_"+element).innerHTML = "+";
	}
	else
	{
		document.getElementById("testDiv"+currentElement).innerHTML = " loading ..... ";
		showBundleTags(BundleID);
		//document.getElementById("testDiv"+element).style.height="200px";
		document.getElementById("testDiv"+element).style.visibility= "visible";
		document.getElementById("testDiv"+element).style.display = "block";
		document.getElementById("link_"+element).innerHTML = "-";
	}
}

function showBundleTags(BundleID)
{
	x_getBundleTags(BundleID,displayBundleTags);
}

function displayBundleTags(z)
{
	document.getElementById("testDiv"+currentElement).innerHTML = z;
}
///////////////////////////////////////////////////////////
/// functions for the Related Tags Tool

function loadTagFinder()
{
	document.getElementById("processDiv").innerHTML = "<input type='text' size='30' id='search' onkeyup='get_words(event);' onKeyDown='if(event.keyCode==13) { findRelatedTags(); }' autocomplete='off'><input type='button' name='submit' value='search related tags' onClick='findRelatedTags();'><br /><div id='words_div' style='width: 350px; overflow:auto; visibility:hidden;z-index: 1000;position: absolute;'></div>";
}

function findRelatedTags()
{
	searchedTag = document.getElementById("related_tag").value;
	//document.getElementById("processDiv").innerHTML = "Searching Related Tags ....";
	x_findRelatedTags(searchedTag,showRelatedTags);
}

function showRelatedTags(result)
{
	if(result == "false")
	{
		document.getElementById("processDiv").innerHTML = "<input type='text' size='30' id='search' onkeyup='get_words(event);' onKeyDown='if(event.keyCode==13) { findRelatedTags(); }' autocomplete='off'><input type='button' name='submit' value='search related tags' onClick='findRelatedTags();'><br /><div id='words_div' style='width: 350px; overflow:auto; visibility:hidden;z-index: 1000;position: absolute;'></div>";
		document.getElementById("processDiv").innerHTML += "<br />Can't find related tags";
	}
	else
	{
		document.getElementById("processDiv").innerHTML = "<input type='text' size='30' id='search' onkeyup='get_words(event);' onKeyDown='if(event.keyCode==13) { findRelatedTags(); }' autocomplete='off'><input type='button' name='submit' value='search related tags' onClick='findRelatedTags();'><br /><div id='words_div' style='width: 350px; overflow:auto; visibility:hidden;z-index: 1000;position: absolute;'></div>";
		document.getElementById("processDiv").innerHTML += result;
	}
}


function showTagInfo(tagName,tagElement)
{

	element = document.getElementById(tagElement);
	position = new String(findPos(element));
	var coords = new Array();
	coords = position.split(',');
	posX = parseInt(parseInt(coords[0])+10);
	posY = parseInt(parseInt(coords[1])+20);

	document.getElementById('tagInfoDiv').style.position = "absolute";
	document.getElementById('tagInfoDiv').style.left = posX+"px";
	document.getElementById('tagInfoDiv').style.top = posY+"px";
	document.getElementById('tagInfoDiv').style.zIndex = "10000";
	document.getElementById('tagInfoDiv').style.backgroundColor = "#FFF";
	document.getElementById('tagInfoDiv').style.border = "1px black solid";
	document.getElementById('tagInfoDiv').innerHTML = "<table boder=0 cellpadding='0' cellspacing='0'><tr><td align='right'>Loading...</td></tr></table>";
	document.getElementById('tagInfoDiv').style.visibility = "visible";

	x_showTagInfo(tagName,showTagInfoCallback);
}

function showTagInfoCallback(result)
{

	document.getElementById('tagInfoDiv').innerHTML = result;
}

function makeRelative(word)
{
	document.getElementById('search').value  = word;
	document.getElementById('tagInfoDiv').style.visibility = "hidden";
}


function closeTagWin()
{
	document.getElementById('tagInfoDiv').style.visibility = "hidden";
}


function loadBundlesPHP()
{
	document.getElementById('processDiv').innerHTML = "loading ...";
	x_TagBrowserBundles(loadBundles);
}


function loadBundles(result)
{
	if(result != "undefined")
	{
		document.getElementById('processDiv').innerHTML = result;
	}
	else
	{
		document.getElementById('processDiv').innerHTML = "loading ...";
	}
}


function loadAllTagsPHP()
{
	x_LoadAllTags(loadAllTags);
}

function loadAllTags(allTags)
{
	if(allTags != "undefined")
	{
		document.getElementById('processDiv').innerHTML = allTags;
	}
	else
	{
		document.getElementById('processDiv').innerHTML = "loading ...";
	}
}

function loadPopular()
{
	x_LoadPopularTags(loadAllPopularTags);
}

function loadAllPopularTags(allPopularTags)
{
	if(allPopularTags != "undefined")
	{
		document.getElementById('processDiv').innerHTML = allPopularTags;
	}
	else
	{
		document.getElementById('processDiv').innerHTML = "loading ...";
	}
}

function doSoundObj()
{
	document.write("<embed src=\"/images/droplet.wav\" autostart=\"false\" width=\"0\" height=\"0\" id=\"sound1\" enablejavascript=\"true\">");
}

// helper function for adding comments
// builds the form

function showCommentsForm(resourceID)
{
	if(!document.getElementById("commentsTbl"))
	{
		document.getElementById("commentsFormContainer").innerHTML = "";

		var newTbl = document.createElement("table");
		var newTbody = document.createElement("tbody");

		var newTr = document.createElement("tr");
		var newTd = document.createElement("td");

		var newTr2 = document.createElement("tr");
		var newTd2 = document.createElement("td");

		var newTr3 = document.createElement("tr");
		var newTd3 = document.createElement("td");

		var newTr4 = document.createElement("tr");
		var newTd4 = document.createElement("td");
		newTd4.setAttribute("id","msg");

		var newInput = document.createElement("input");
		newInput.setAttribute("id","postedBy");

		var newTextArea = document.createElement("textarea");
		newTextArea.setAttribute("id","userComment");

		var newButton = document.createElement("input");

		newButton.setAttribute("type","button");
		newButton.setAttribute("value","Send My Comments");
		newButton.onclick = new Function("saveUserComment("+resourceID+")");


		newInput.setAttribute("size","40");
		newInput.setAttribute("type","text");
		newInput.setAttribute("id","postedBy");

		newTextArea.setAttribute("id","userComment");
		newTextArea.setAttribute("rows","20");
		newTextArea.setAttribute("cols","30");

		newTd.appendChild(newInput);
		newTr.appendChild(newTd);

		newTd2.appendChild(newTextArea);
		newTr2.appendChild(newTd2);

		newTd3.appendChild(newButton);
		newTr3.appendChild(newTd3);

		newTr4.appendChild(newTd4);

		newTbody.appendChild(newTr4);
		newTbody.appendChild(newTr);
		newTbody.appendChild(newTr2);
		newTbody.appendChild(newTr3);


		newTbl.appendChild(newTbody);
		newTbl.setAttribute("id","commentsTbl");

		document.getElementById("commentsFormContainer").appendChild(newTbl);
		//document.getElementById("commentsFormContainer").innerHTML = "<form>"+document.getElementById("commentsFormContainer").innerHTML+"</form>";
	}
}

function saveUserComment(resourceID)
{
	if(document.getElementById("postedBy").value == "")
	{
		document.getElementById("msg").innerHTML = "Please Enter your Name";
	}
	else if(document.getElementById("userComment").value == "")
	{
		document.getElementById("msg").innerHTML = "Please Enter your Comments";
	}
	else
	{
		x_saveUserComment(resourceID,document.getElementById("postedBy").value,document.getElementById("userComment").value,commentsSent);
	}
}

function commentsSent()
{
	document.getElementById("commentsTbl").parentNode.removeChild(document.getElementById("commentsTbl"));
	document.getElementById("commentsFormContainer").innerHTML = "Thank you! Your comments have been submitted";
}

/******************************************/
/* ACCOLADES */

function addAccolade(resource_id,resource_type)
{
	x_addAccoladePHP(resource_id,resource_type,AccoladeStatus);
}

function AccoladeStatus(result)
{
	var returnRes = result.split("//");
	//alert(returnRes[2]);


	if(returnRes[1] == "listing")
	{
		if(returnRes[0] == 1)
		{
			document.getElementById(returnRes[1]+"_"+returnRes[2]+"_voting").innerHTML = "You liked this "+returnRes[1]+"!";
		}
		else
		{
			document.getElementById(returnRes[1]+"_"+returnRes[2]+"_voting").innerHTML = "You liked this "+returnRes[1]+" already!";
		}
	}
	else if(returnRes[1] == "photo")
	{
		if(returnRes[0] == 1)
		{
			document.getElementById("photo_link_accolade").innerHTML = "You liked this photo!";
		}
		/*else
		{
		document.getElementById("photo_link_accolade").onclick = new Function("addAccolade("+returnRes[2]+",'photo')");
		document.getElementById("photo_link_accolade").innerHTML = "I like this photo!";
		}
		*/
	}

	else
	{
		if(returnRes[0] == 1)
		{
			document.getElementById(returnRes[1]+"_"+returnRes[2]).innerHTML = "You liked this "+returnRes[1]+"!";
		}
		else
		{
			document.getElementById(returnRes[1]+"_"+returnRes[2]).innerHTML = "You liked this "+returnRes[1]+" already!";
		}
	}
}

/*********************************************************/
/* FUNCTIONS FOR SEARCHING INTERACTIVE GOOGLE MAP */
/* type = filtergroup (3 = hotels & places to stay, etc); city = city tag, filter1 2 3 vary based onsearch but most are type, designation (holes, par, etc), rates... */
function searchGoogleMap(type,city,filter1,filter2,filter3)
{
	//loading image
	document.getElementById("map").innerHTML = "<img src='/images/shell/gmap/loading_gmap.gif' border='0' />";
	//this calls the PHP function to run sql and get markers to pass back to the map
	//all searches offer city, most also offer type, then the filter options change
	x_searchGoogleMapPHP(type,city,filter1,filter2,filter3,interactiveMap);
}

function checkStr(strs)
{
  var strn;
  result = strn.indexOf("There are no");
}

function interactiveMap(results)
{

	spResults = results.split("///");

	//0=latitude, 1 = longitdue, 2 = markers, 3 = iconstyle,4 = icon width, 5= iconheight,6=icon shadow width, 7= icon shadow height		, 8 = photos, 9 deals, 10 videos
	aLatitude = spResults[0].split(",");
	aLongitude = spResults[1].split(",");
	aMarkers = spResults[2].split("|");
	iconStyle = spResults[3];
	iconWidth = spResults[4];
	iconHeight = spResults[5];
	iconShadowW = spResults[6];
	iconShadowH = spResults[7];
	aPhotos = spResults[8].split("|");
	aDeals = spResults[9].split("|");
	aVideos = spResults[10].split("|");
	nResultCount = spResults[11].split("|");

	function addMarker(point,tablabel,tablabel2,tablabel3,tablabel4,html,html2,html3,html4,iconStyle,iconWidth,iconHeight,iconShadowW,iconShadowH) {

		var icon = new GIcon();
		icon.image = "/images/shell/gmap/"+iconStyle+"Icon.png";
		icon.shadow = "/images/shell/gmap/shadow-"+iconStyle+"Icon.png";
		icon.iconSize = new GSize(iconWidth, iconHeight);
		icon.shadowSize = new GSize(iconShadowW, iconShadowH);
		icon.iconAnchor = new GPoint(16,16);
		icon.infoWindowAnchor = new GPoint(16, 16);

		var marker = new GMarker(point,icon);

		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowTabsHtml([new GInfoWindowTab(tablabel,html),new GInfoWindowTab(tablabel2,html2),new GInfoWindowTab(tablabel3,html3),new GInfoWindowTab(tablabel4,html4)]);
		});
		map.addOverlay(marker);
		if (nResultCount == 0)
		{
			GEvent.trigger(marker,'click', function() {
			marker.openInfoWindowTabsHtml([new GInfoWindowTab(tablabel,html),new GInfoWindowTab(tablabel2,html2),new GInfoWindowTab(tablabel3,html3),new GInfoWindowTab(tablabel4,html4)]);
		});
		}
	}

  function addGmapMarker(point,tablabel,tablabel2,tablabel3,tablabel4,html,html2,html3,html4,iconStyle,iconWidth,iconHeight,iconShadowW,iconShadowH) {

		var icon = new GIcon();
		icon.image = "/images/shell/gmap/"+iconStyle+"Icon.png";
		icon.shadow = "/images/shell/gmap/shadow-"+iconStyle+"Icon.png";
		icon.iconSize = new GSize(iconWidth, iconHeight);
		icon.shadowSize = new GSize(iconShadowW, iconShadowH);
		icon.iconAnchor = new GPoint(16,16);
		icon.infoWindowAnchor = new GPoint(16, 16);

    var tabs = [];
    tabs.push(new GInfoWindowTab(tablabel,html));

    if(html2!="")
    {
      tabs.push(new GInfoWindowTab(tablabel2, html2));
    }
    if(html3!="")
    {
      tabs.push(new GInfoWindowTab(tablabel3, html3));
    }
    if(html4!="")
    {
      tabs.push(new GInfoWindowTab(tablabel4, html4));
    }

		var marker = new GMarker(point,icon);

    GEvent.addListener(marker, "click", function() {
   marker.openInfoWindowTabsHtml(tabs);
    });

		map.addOverlay(marker);
		if (nResultCount == 0)
		{
			GEvent.trigger(marker,'click', function() {
			marker.openInfoWindowTabsHtml([new GInfoWindowTab(tablabel,html),new GInfoWindowTab(tablabel2,html2),new GInfoWindowTab(tablabel3,html3),new GInfoWindowTab(tablabel4,html4)]);
		});
		}
	}

	function addPVMarker(point,html,iconStyle,iconWidth,iconHeight,iconShadowW,iconShadowH) {

		var icon = new GIcon();
		icon.image = "/images/shell/gmap/"+iconStyle+"Icon.png";
		icon.shadow = "/images/shell/gmap/shadow-"+iconStyle+"Icon.png";
		icon.iconSize = new GSize(iconWidth, iconHeight);
		icon.shadowSize = new GSize(iconShadowW, iconShadowH);
		icon.iconAnchor = new GPoint(16,16);
		icon.infoWindowAnchor = new GPoint(16, 16);

		var marker = new GMarker(point,icon);

		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(html);
		});
		map.addOverlay(marker);
		if (nResultCount == 0)
		{
			GEvent.trigger(marker,'click', function() {
			marker.openInfoWindowTabsHtml([new GInfoWindowTab(tablabel,html),new GInfoWindowTab(tablabel2,html2),new GInfoWindowTab(tablabel3,html3),new GInfoWindowTab(tablabel4,html4)]);
		});
		}
	}
	// Display the map, with some controls and set the initial location
	var map = new GMap2(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	//map.setCenter(new GLatLng(43.907787,-79.359741),8);
	var maxLat = -999.0;
	var maxLong = -999.0;
	var minLat = 999.0;
	var minLong = 999.0;

	for(i=0;i<aLatitude.length;i++)
	{
		if(parseFloat(aLatitude[i]) < minLat )
		{
			minLat = parseFloat(aLatitude[i]);
		}
		if(parseFloat(aLatitude[i]) > maxLat)
		{
			maxLat = parseFloat(aLatitude[i]);
		}
	}
	for(i=0;i<aLongitude.length;i++)
	{
		if(parseFloat(aLongitude[i]) < minLong )
		{
			minLong = parseFloat(aLongitude[i]);
		}
		if(parseFloat(aLongitude[i]) > parseFloat(maxLong))
		{
			maxLong = parseFloat(aLongitude[i]);
		}
	}
	var lat_dif = ((maxLat - minLat) * 0.1) + 0.0001;
	var lng_dif = ((maxLong - minLong) * 0.1) + 0.0001;
	var sw = new GLatLng((minLat-lat_dif),(minLong-lng_dif));
	var ne = new GLatLng((maxLat+lat_dif),(maxLong+lng_dif));
	var bounds = new GLatLngBounds(sw, ne);
	//map.setCenter(bounds.getCenter(), map.getBoundsZoomLevel(bounds));
	map.setCenter(new GLatLng(aLatitude[0],aLongitude[0]),10);
	map.setZoom(10);


	// Set up three markers with info windows
	if (iconStyle == "photo" || iconStyle == "video")
	{
		for(i=0;i<aLatitude.length;i++)
		{

			var point = new GLatLng(aLatitude[i],aLongitude[i]);
			var marker = addPVMarker(point,'<div style="width:200px;height:200px;font-family:tahoma,arial,helvetica;font-size:13px;text-align:left;overflow:auto;">'+aMarkers[i]+'</div>',iconStyle,iconWidth,iconHeight,iconShadowW,iconShadowH);
		}
	}else{
		for(i=0;i<aLatitude.length;i++)
		{
			var point = new GLatLng(aLatitude[i],aLongitude[i]);
      if(aVideos[i]=='There are no videos at this time.')
      {
        aVideos[i]="";
      }
      else
      {
        aVideos[i]='<div style="width:400px;height:300px;font-family:tahoma,arial,helvetica;font-size:13px;text-align:left;overflow:auto;">'+aVideos[i]+'</div>';
      }

      if(aPhotos[i]=='There are no photos at this time.')
      {
        aPhotos[i]="";
      }
      else
      {
        aPhotos[i]='<div style="width:400px;height:300px;font-family:tahoma,arial,helvetica;font-size:13px;text-align:left;overflow:auto;">'+aPhotos[i]+'</div>';
      }
      if(aDeals[i]=='There are no deals at this time.')
      {
        aDeals[i]="";
      }
      else
      {
        aDeals[i]='<div style="width:380px;height:300px;font-family:tahoma,arial,helvetica;font-size:13px;text-align:left;overflow:auto;">'+aDeals[i]+'</div>';
      }

      var marker = addGmapMarker(point,'Details','Videos','Photos','Deals','<div style="margin-top:5px;width:400px;height:300px;font-family:tahoma,arial,helvetica;font-size:13px;text-align:left;overflow:auto;">'+aMarkers[i]+'</div>',aVideos[i],aPhotos[i],aDeals[i],iconStyle,iconWidth,iconHeight,iconShadowW,iconShadowH);
		}
	}
}

function clearGoogleMap()
{
	x_clearGoogleMapPHP(clearedGoogleMap);
}

function clearedGoogleMap(results)
{
	spResults = results.split("///");
	aLatitude = spResults[0].split(",");
	aLongitude = spResults[1].split(",");
	// Display the map, with some controls and set the initial location
	var map = new GMap2(document.getElementById("map"));
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(aLatitude[0],aLongitude[0]),6);
	map.setZoom(6);
}

/*********************************************************/
/* FUNCTIONS FOR ADDING/REMOVING THINGS TO MYPAGE */

function addToMyPage(resource_id,resource_type)
{

	x_addToMyPagePHP(resource_id,resource_type,MyPageRemoveStatus);
}

function MyPageRemoveStatus(result)
{

	var SpResult = result.split(",");

	if(SpResult[1] == "photo")
	{
		var photoIDs = new Array();
		photoIDs[SpResult[0]] = 1;

		document.getElementById("my_page_link_photo").innerHTML = "<a href=\"javascript:void(0);\" class=\"propertyInfo\" onClick=\"removeFromMyPage('"+SpResult[0]+"','"+SpResult[1]+"',false,false);\">Remove From My Page</a>";
	}
	else if(SpResult[1] == "video")
	{
		var videoIDs = new Array();
		videoIDs[SpResult[0]] = 1;

		document.getElementById("my_page_link").innerHTML = "<a href=\"javascript:void(0);\" class=\"propertyInfo\" onClick=\"removeFromMyPage('"+SpResult[0]+"','"+SpResult[1]+"','"+SpResult[2]+"','"+SpResult[3]+"');\">Remove From My Page</a>";
	}
	else if(SpResult[1] == "article")
	{
		document.getElementById("my_page_link_article").innerHTML = "<a href=\"javascript:void(0);\" class=\"regularGrayBold\" onClick=\"removeFromMyPage('"+SpResult[0]+"','"+SpResult[1]+"');\">Remove From My Travel Page</a>";
	}
	else if(SpResult[1] == "listing")
	{
		document.getElementById(SpResult[1]+"_"+SpResult[0]).innerHTML = "<a href=\"javascript:void(0);\" class=\"regularGrayBold\" onClick=\"removeFromMyPage('"+SpResult[0]+"','"+SpResult[1]+"');\">Remove From My Travel Page</a>";
	}
}

function removeFromMyPage(resource_id,resource_type,bUserResource,nPosition)
{
	x_removeFromMyPagePHP(resource_id,resource_type,bUserResource,nPosition,MyPageAddStatus);
}

function MyPageAddStatus(result)
{

	var SpResult = result.split(",");

	if(SpResult[1] == "photo")
	{
		var photoIDs = new Array();
		photoIDs[SpResult[0]] = 0;

		document.getElementById("my_page_link_photo").innerHTML = "<a href=\"javascript:void(0);\"  class=\"propertyInfo\" onClick=\"addToMyPage('"+SpResult[0]+"','"+SpResult[1]+"',false,false);\">Add To My Travel Page</a>";
	}
	else if(SpResult[1] == "video")
	{
		var videoIDs = new Array();
		videoIDs[SpResult[0]] = 0;

		document.getElementById("my_page_link").innerHTML = "<a href=\"javascript:void(0);\"  class=\"propertyInfo\" onClick=\"addToMyPage('"+SpResult[0]+"','"+SpResult[1]+"','"+SpResult[2]+"','"+SpResult[3]+"');\">Add To My Travel Page</a>";
	}

	else if(SpResult[1] == "article")
	{

		document.getElementById("my_page_link_article").innerHTML = "<a href=\"javascript:void(0);\" class=\"propertyInfo\" onClick=\"addToMyPage('"+SpResult[0]+"','"+SpResult[1]+"',false,false);\">Add To My Travel Page</a>";
	}
	else if(SpResult[1] == "listing")
	{
		document.getElementById(SpResult[1]+"_"+SpResult[0]).innerHTML = "<a href=\"javascript:void(0);\" class=\"regularGrayBold\" onClick=\"removeFromMyPage('"+SpResult[0]+"','"+SpResult[1]+"');\">Add To My Travel Page</a>";
	}

}


// these functions are double for the link under the
// big photo into the article page

function addToMyPageArticle(resource_id,resource_type,user_id)
{
	x_addToMyPagePHP(resource_id,resource_type,user_id,MyPageRemoveStatusArticle);
}

function MyPageRemoveStatusArticle(result)
{
	var SpResult = result.split(",");
	document.getElementById("my_page_link").innerHTML = "<a href=\"javascript:void(0);\"  class=\"photoStripLink\" onClick=\"removeFromMyPageArticle('"+SpResult[0]+"','"+SpResult[1]+"','"+SpResult[2]+"');\">Remove From My Travel Page</a>";
	photoIDs[SpResult[0]] = 1;

}

function removeFromMyPageArticle(resource_id,resource_type,user_id)
{
	x_removeFromMyPagePHP(resource_id,resource_type,user_id,MyPageAddStatusArticle);
}

function MyPageAddStatusArticle(result)
{
	var SpResult = result.split(",");
	document.getElementById("my_page_link").innerHTML = "<a href=\"javascript:void(0);\"  class=\"photoStripLink\" onClick=\"addToMyPageArticle('"+SpResult[0]+"','"+SpResult[1]+"','"+SpResult[2]+"');\">Add To My Travel Page</a>";
	photoIDs[SpResult[0]] = 0;

}


function checkMyPageStatus(resource_id,resource_type,bUserPhoto)
{
	if(resource_type == "photo")
	{
		x_checkMyPageStatus(resource_id,resource_type,bUserPhoto,setPageLink);
	}
}


function setPageLink(results)
{
	var spRes = results.split("//");

	if(spRes[1] == "photo")
	{
		if(spRes[2] == 1)
		{
			document.getElementById("my_page_link_photo").innerHTML = "<a href=\"javascript:void(0);\" class=\"regularGrayBold\" onClick=\"removeFromMyPage('"+spRes[0]+"','"+spRes[1]+"');\">Remove From My Travel Page</a>";
		}
		else
		{
			document.getElementById("my_page_link_photo").innerHTML = "<a href=\"javascript:void(0);\" class=\"regularGrayBold\" onClick=\"addToMyPage('"+spRes[0]+"','"+spRes[1]+"');\">Add to My Travel Page</a>";
		}
	}


}


// calendar loading

function LoadCalendar()
{
	x_LoadCalendar(returnCal);
}

function returnCal(result)
{
	//document.getElementById("calendar").innerHTML = result;
}

function moveCalendar(cMonth,cYear)
{
	document.getElementById("feat_event").innerHTML = "<img src='/images/shell/loading_transparent.gif' border='0' hspace='15' />";
	x_moveCalendar(cMonth,cYear,returnCal);
	x_showFeaturedEvent(cMonth,cYear,featuredEvent);
}

function featuredEvent(eventId)
{
	document.getElementById("feat_event").innerHTML = "<img src='/images/shell/loading_transparent.gif' border='0' hspace='15' />";
	x_showFeaturedEvent(eventId);
}


// editor / most popular preloading

function showMostPopular()
{
	document.getElementById("editor_picks").src = "/images/shell/edpicks_off.gif";
	document.getElementById("most_popular").src = "/images/shell/most_pop_on.gif";
	document.getElementById("most_pop_bar").style.display = "";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showMostPopularPHP(most_popular);
}

function most_popular(results)
{
	document.getElementById("picks").innerHTML = results;
}


function showEditorPicks()
{
	document.getElementById("editor_picks").src = "/images/shell/edpicks_on.gif";
	document.getElementById("most_popular").src = "/images/shell/most_pop_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "";
	x_showEditorPicksPHP(editor_picks);
}

function editor_picks(results)
{
	document.getElementById("picks").innerHTML = results;
}
// THESE ARE FOR THE HOME PAGE
function showTopVideos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_on.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopVideosPHP(top_videos);
}

function top_videos(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopArticles()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_on.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopArticlesPHP(top_articles);
}

function top_articles(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopPhotos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_on.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopPhotosPHP(top_photos);
}

function top_photos(results)
{
	document.getElementById("picks").innerHTML = results;
}
//THESE ARE FOR THE BEACHES LANDING 'HOME' PAGE
function showTopBeachesVideos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_on.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopBeachesVideosPHP(top_beachesvideos);
}

function top_beachesvideos(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopBeachesArticles()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_on.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopBeachesArticlesPHP(top_beachesarticles);
}

function top_beachesarticles(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopBeachesPhotos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_on.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopBeachesPhotosPHP(top_beachesphotos);
}

function top_beachesphotos(results)
{
	document.getElementById("picks").innerHTML = results;
}
//THESE ARE FOR THE FAMLY LANDING 'HOME' PAGE
function showTopFamilyVideos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_on.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopFamilyVideosPHP(top_familyvideos);
}

function top_familyvideos(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopFamilyArticles()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_on.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopFamilyArticlesPHP(top_familyarticles);
}

function top_familyarticles(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopFamilyPhotos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_on.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopFamilyPhotosPHP(top_familyphotos);
}

function top_familyphotos(results)
{
	document.getElementById("picks").innerHTML = results;
}

//THESE ARE FOR THE HONEYMOON LANDING 'HOME' PAGE
function showTopHoneymoonVideos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_on.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopHoneymoonVideosPHP(top_honeymoonvideos);
}

function top_honeymoonvideos(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopHoneymoonArticles()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_on.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopHoneymoonArticlesPHP(top_honeymoonarticles);
}

function top_honeymoonarticles(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopHoneymoonPhotos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_on.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopHoneymoonPhotosPHP(top_honeymoonphotos);
}

function top_honeymoonphotos(results)
{
	document.getElementById("picks").innerHTML = results;
}


//THESE ARE FOR THE canada LANDING 'HOME' PAGE
function showTopCanadaVideos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_on.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopCanadaVideosPHP(top_canadavideos);
}

function top_canadavideos(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopCanadaArticles()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_on.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_off.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopCanadaArticlesPHP(top_canadaarticles);
}

function top_canadaarticles(results)
{
	document.getElementById("picks").innerHTML = results;
}

function showTopCanadaPhotos()
{
	document.getElementById("top_videos").src = "/images/shell/top_videos_off.gif";
	document.getElementById("top_articles").src = "/images/shell/top_articles_off.gif";
	document.getElementById("top_photos").src = "/images/shell/top_photos_on.gif";
	document.getElementById("most_pop_bar").style.display = "none";
	document.getElementById("edpicks_bar").style.display = "none";
	x_showTopCanadaPhotosPHP(top_canadaphotos);
}

function top_canadaphotos(results)
{
	document.getElementById("picks").innerHTML = results;
}

//SWAP BETWEEN SEARCH HOTELS AND SEARCH DEALS TABS ON HOME PAGE
function showHotelSearch()
{
	document.getElementById("hotel_search").src = "/images/shell/hm_newsearchhotels_on.gif";
	document.getElementById("deals_search").src = "/images/shell/hm_deals_off.gif";
	document.getElementById("hotel_search_form").style.display = "inline";
	document.getElementById("deal_search_form").style.display = "none";
}

function showDealSearch()
{
	document.getElementById("hotel_search").src = "/images/shell/hm_searchhotels_off.gif";
	document.getElementById("deals_search").src = "/images/shell/hm_newdeals_on.gif";
	document.getElementById("hotel_search_form").style.display = "none";
	document.getElementById("deal_search_form").style.display = "inline";
}

//SWAP FILTER SEARCHING DIVS ON INTERACTIVE MAP PAGE /interactive_map
function showIMapFilter(filter)
{
	//HIDE THEM ALL
	document.getElementById('accomsearch').style.display='none';
	document.getElementById('attrsearch').style.display='none';
	//document.getElementById('beachsearch').style.display='none';
	document.getElementById('outdoorsearch').style.display='none';
	document.getElementById('sightssearch').style.display='none';
	document.getElementById('golfsearch').style.display='none';
	document.getElementById('entertainsearch').style.display='none';
	document.getElementById('campsearch').style.display='none';
	document.getElementById('shopsearch').style.display='none';
	document.getElementById('artsearch').style.display='none';
	document.getElementById('transportsearch').style.display='none';
	document.getElementById('dinesearch').style.display='none';
	document.getElementById('vssearch').style.display='none';
	document.getElementById('photosearch').style.display='none';
	document.getElementById('videosearch').style.display='none';

	//SHOW THE ONE WE WANT & SHOW IT IN ITS ON STATE
	document.getElementById('filter_searches').style.display='inline';
	document.getElementById(filter).style.display='inline';
}
//SHOW THE 'ON' STATE OF THE FILTER WE'RE ON for INTERACTIVE MAP PAGE
function showIMapHighlight(filter)
{
	//SHOW OFF STATES OF ALL
	document.getElementById('accom').src ='/images/shell/gmap/gmap_accom.gif';
	document.getElementById('attr').src ='/images/shell/gmap/gmap_attr.gif';
	//document.getElementById('beaches').src ='/images/shell/gmap/gmap_beaches.gif';
	document.getElementById('outdoors').src ='/images/shell/gmap/gmap_outdoors.gif';
	document.getElementById('sights').src ='/images/shell/gmap/gmap_sights.gif';
	document.getElementById('golf').src ='/images/shell/gmap/gmap_golf.gif';
	document.getElementById('entertain').src ='/images/shell/gmap/gmap_entertain.gif';
	document.getElementById('camp').src ='/images/shell/gmap/gmap_camp.gif';
	document.getElementById('shop').src ='/images/shell/gmap/gmap_shop.gif';
	document.getElementById('camp2').src ='/images/shell/gmap/gmap_camp.gif';
	document.getElementById('shop2').src ='/images/shell/gmap/gmap_shop.gif';
	document.getElementById('arthistory').src ='/images/shell/gmap/gmap_arthistory.gif';
	document.getElementById('transport').src ='/images/shell/gmap/gmap_transport.gif';
	document.getElementById('dining').src ='/images/shell/gmap/gmap_dining.gif';
	document.getElementById('vs').src ='/images/shell/gmap/gmap_vs.gif';
	document.getElementById('photos').src ='/images/shell/gmap/gmap_photos.gif';
	document.getElementById('videos').src ='/images/shell/gmap/gmap_videos.gif';

	//RESET THE ONMOUSEOVER AND ONMOUSEOUT STATES OF UNSELECTED TABS
	document.getElementById('accom').onmouseover ="document.getElementById('accom').src='/images/shell/gmap/gmap_accom_over.gif'";
	document.getElementById('attr').onmouseover ="document.getElementById('attr').src='/images/shell/gmap/gmap_attr_over.gif'";
	document.getElementById('outdoors').onmouseover ="document.getElementById('outdoors').src='/images/shell/gmap/gmap_outdoors_over.gif'";
	document.getElementById('sights').onmouseover ="document.getElementById('sights').src='/images/shell/gmap/gmap_sights_over.gif'";
	document.getElementById('golf').onmouseover ="document.getElementById('golf').src='/images/shell/gmap/gmap_golf_over.gif'";
	document.getElementById('entertain').onmouseover ="document.getElementById('entertain').src='/images/shell/gmap/gmap_entertain_over.gif'";
	document.getElementById('camp').onmouseover ="document.getElementById('camp').src='/images/shell/gmap/gmap_camp_over.gif'";
	document.getElementById('shop').onmouseover ="document.getElementById('shop').src='/images/shell/gmap/gmap_shop_over.gif'";
	document.getElementById('camp2').onmouseover ="document.getElementById('camp2').src='/images/shell/gmap/gmap_camp_over.gif'";
	document.getElementById('shop2').onmouseover ="document.getElementById('shop2').src='/images/shell/gmap/gmap_shop_over.gif'";
	document.getElementById('arthistory').onmouseover ="document.getElementById('arthistory').src='/images/shell/gmap/gmap_arthistory_over.gif'";
	document.getElementById('transport').onmouseover ="document.getElementById('transport').src='/images/shell/gmap/gmap_transport_over.gif'";
	document.getElementById('dining').onmouseover ="document.getElementById('dining').src='/images/shell/gmap/gmap_dining_over.gif'";
	document.getElementById('vs').onmouseover ="document.getElementById('vs').src='/images/shell/gmap/gmap_vs_over.gif'";
	document.getElementById('photos').onmouseover ="document.getElementById('photos').src='/images/shell/gmap/gmap_photos_over.gif'";
	document.getElementById('videos').onmouseover ="document.getElementById('videos').src='/images/shell/gmap/gmap_videos_over.gif'";

	document.getElementById('accom').onmouseout ="document.getElementById('accom').src='/images/shell/gmap/gmap_accom.gif'";
	document.getElementById('attr').onmouseout ="document.getElementById('attr').src='/images/shell/gmap/gmap_attr.gif'";
	document.getElementById('outdoors').onmouseout ="document.getElementById('outdoors').src='/images/shell/gmap/gmap_outdoors.gif'";
	document.getElementById('sights').onmouseout ="document.getElementById('sights').src='/images/shell/gmap/gmap_sights.gif'";
	document.getElementById('golf').onmouseout ="document.getElementById('golf').src='/images/shell/gmap/gmap_golf.gif'";
	document.getElementById('entertain').onmouseout ="document.getElementById('entertain').src='/images/shell/gmap/gmap_entertain.gif'";
	document.getElementById('camp').onmouseout ="document.getElementById('camp').src='/images/shell/gmap/gmap_camp.gif'";
	document.getElementById('shop').onmouseout ="document.getElementById('shop').src='/images/shell/gmap/gmap_shop.gif'";
	document.getElementById('camp2').onmouseout ="document.getElementById('camp2').src='/images/shell/gmap/gmap_camp.gif'";
	document.getElementById('shop2').onmouseout ="document.getElementById('shop2').src='/images/shell/gmap/gmap_shop.gif'";
	document.getElementById('arthistory').onmouseout ="document.getElementById('arthistory').src='/images/shell/gmap/gmap_arthistory.gif'";
	document.getElementById('transport').onmouseout ="document.getElementById('transport').src='/images/shell/gmap/gmap_transport.gif'";
	document.getElementById('dining').onmouseout ="document.getElementById('dining').src='/images/shell/gmap/gmap_dining.gif'";
	document.getElementById('vs').onmouseout ="document.getElementById('vs').src='/images/shell/gmap/gmap_vs.gif'";
	document.getElementById('photos').onmouseout ="document.getElementById('photos').src='/images/shell/gmap/gmap_photos.gif'";
	document.getElementById('videos').onmouseout ="document.getElementById('videos').src='/images/shell/gmap/gmap_videos.gif'";

	//SHOW ON STATE OF THE ONE WE WANT
	document.getElementById(filter).src = "/images/shell/gmap/gmap_"+filter+"_on.gif";
	//DISABLE ONMOUSEOVER AND ONMOUSEOUT OPTIONS ON SELECTED TAB
	document.getElementById(filter).onmouseover = null;
	document.getElementById(filter).onmouseout = null;
}
/* ?
function travelPoll()
{
x_travelPollPHP(top_photos);
}
*/

// SHOWS THE LOGIN BOX IN THE HEADER
// This just replaces the login box with the input fields
// the next set of ajax functions is inlcuded with myPage -> loginModule function
// (look in myPage/functions.php
// after that the module will take care of the processing of the login info

function showLoginBox(moduleRelatedPath)
{
	/* Added this block to load proper css & images related to module like golfing - 03-11-08*/

	if(moduleRelatedPath == "golfing/" ){
		loginButtonPath = "/images/shell/"+moduleRelatedPath+"login_btn.gif";
		style = "font-family: Tahoma, Arial, Georgia;font-size: 11px;padding-left: 2px;width: 93px; border: 1px #cc3300 solid;";
		golfing_vf_links = "_blank";
	}
	else{
		// alert(moduleRelatedPath);
		loginButtonPath = "/images/shell/login_btn.gif";
		style = "font-family: Tahoma, Arial, Georgia;font-size: 11px;padding-left: 2px;width: 93px; border: 1px #f26f18 solid;";
		golfing_vf_links = "_self";
	}

	document.getElementById("login_table").style.paddingBottom = "3px";

	var sHTML;
	sHTML = "<table border='0' cellpadding='0' cellspacing='0'>";
	sHTML += "<tr><td align=\"left\"><input id=\"mypage_username\" type=\"text\" style=\""+style+"\"></td>";
	sHTML += "<td width=\"10\"></td>";
	sHTML += "<td align=\"left\"><input type=\"password\" id=\"mypage_pass\" style=\""+style+"\"></td>";
	sHTML += "<td width=\"8\"></td>";
	sHTML += "<td align=\"left\"><img src=\""+loginButtonPath+"\" border=\"0\" width=\"76\" height=\"27\" style=\"cursor: pointer;width:76px;height:27px;\" onclick=\"mypageUserLogin(document.getElementById('mypage_username').value,document.getElementById('mypage_pass').value);\" /></td></tr>";
	sHTML += "<tr><td colspan=\"5\" id=\"statusMsg\" style='font-size: 11px;text-decoration: none;'><a href=\"/forgot_your_password\" class=\"fpass\" target=\""+golfing_vf_links+"\">Forgot Your Password?</a></td></tr></table>";
	//sHTML += "<tr><td colspan=\"5\"><a href=\"/forgot_your_password\" class=\"fpass\">Forgot Your Password?</a></td></tr>";

	document.getElementById("login_container").innerHTML = sHTML;
}


//FEATURED EVENTS

function showFeaturedEvent(nStartDay,totalEvents)
{
	for(i=0;i<totalEvents;i++)
	{
		if(i == nStartDay)
		{
			//alert("showing:"+i);
			document.getElementById("event_"+i).style.display = "";
		}
		else
		{
			//alert("hiding:"+i);
			document.getElementById("event_"+i).style.display = "none";
		}
	}
}

//data Tracking

function dataTracking(sType,nListingID)
{
	x_dataTracking(sType,nListingID,callBackDataTracking);
}

function callBackDataTracking()
{

}

function flagComment(sType,nCommentID)
{
	x_flagComment(sType,nCommentID,commentCallBack);
}

function commentCallBack(nID)
{
	document.getElementById("flag_comment_"+nID).innerHTML = "You have flagged this comment as inappropriate. It will be reviewed by the VISITFLORIDA.com editorial staff.";
}
