/*
 * Pete's ToggleTab function for Member view
 *
 *
 *
*/

function MVToggleTab(num) {
	var whichdiv='tabContent'+num;
	var whichtab='tab'+num;
	
	$("#tabul").children().each(function(){
		var child=$(this);
		if(child.attr('id')==whichtab){
			child.children().filter('a').addClass('current');
		} else {
			child.children().filter('a').removeClass('current');
		}
	});

	$("#tabscontent").children().each(function(){
		var child=$(this);
		if(child.attr('id')==whichdiv){
			child.css('display','block');
		} else {
			child.css('display','none');
		}
	});
			if(typeof map != "undefined"){
				if(map!=null){
					map.checkResize();
					map.setCenter(center);
				}
			}
			if(typeof mapsmall != "undefined"){
				if(mapsmall!=null){
					mapsmall.checkResize();
					mapsmall.setCenter(center);
				}
			}
}

function MVToggleTab2(num) {
	var whichdiv='tab2Content'+num;
	var whichtab='tab2-'+num;
	
	$("#tabul2").children().each(function(){
		var child=$(this);
		if(child.attr('id')==whichtab){
			child.children().filter('a').addClass('current');
		} else {
			child.children().filter('a').removeClass('current');
		}
	});

	$("#tabscontent2").children().each(function(){
		var child=$(this);
		if(child.attr('id')==whichdiv){
			child.css('display','block');
		} else {
			child.css('display','none');
		}
	});
			if(typeof map != "undefined"){
				if(map!=null){
					map.checkResize();
					map.setCenter(center);
				}
			}
			if(typeof mapsmall != "undefined"){
				if(mapsmall!=null){
					mapsmall.checkResize();
					mapsmall.setCenter(center);
				}
			}
}

/* 
 * Description:
 *     This function is needed for our dropdown menu to work in IE6
 * 
 */
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

function ScrollToElement(theElement){

  var selectedPosX = 0;
  var selectedPosY = 0;
              
  while(theElement != null){
    selectedPosX += theElement.offsetLeft;
    selectedPosY += theElement.offsetTop;
    theElement = theElement.offsetParent;
  }
                        		      
 window.scrollTo(selectedPosX,selectedPosY);

}


/*
 *
 * Description:
 *     Show/hide ammenities
 *
 */
 $(document).ready(function(){
 	$('#show_ammenities').click(function(){
		$("#ammenities_container").toggle();
 	});
// 	$('#accordionfrm').unCheckCheckBoxes();
	
	/*
	*
	* David's Add To Travel Planner Event
	*
	*/
	$('a.add_accommodation').click(function(e){
		var id = $(this).parent().get(0).id;
		add_to_planner('accommodation', id, e, false);
	});
	$('a.add_thingstodo').click(function(e){
		var id = $(this).parent().get(0).id;
		add_to_planner('things', id, e, false);
	});
	$('a.add_dining').click(function(e){
		var id = $(this).parent().get(0).id;
		add_to_planner('dining', id, e, false);
	});
	$('a.add_event').click(function(e){
		var id = $(this).parent().get(0).id;
		add_to_planner('event', id, e, false);
	});
	$('a.add_service').click(function(e){
		var id=$(this).parent().get(0).id;
		add_to_planner('service', id, e, false);
	});
//	$('*').click(function(){ $(this).css('border','1px solid red'); alert('id: ' + $(this).attr('id') + '\nclass: ' + $(this).attr('class'))+'\nz-index: '+$(this).css('z-index'); });
// 
	$('.upcomingevent').hover(
	function(e){
		$(this).addClass('upcomingevent_hover');
	},
	function(e){
		$(this).removeClass('upcomingevent_hover');
	});
	
	$('.toggle_upcomingevent').click(function(e){
		$(this).parent().parent().children().filter('.eventdescription').toggle(500);
	});
	
	$('.toggle_reply').click(function(e){
		$(this).parent().parent().parent().parent().children().filter('.hidden_reply').toggle(500);
	});
	
	/*
	$('.details').click(function(e){
		$(this).next('eventdescription').addClass('boo');
	});
	*/

	$('#anchor_a').each(function(e){
		ScrollToElement(this);
	});
//
   $("a[rel*='external']").click(function(){

      pageTracker._trackPageview('/outgoing/'+ $(this).attr('href'));

   });

 }); 	



/*
 *
 * Description:
 *     Featured events ajax event
 *
 */
 
 function events(value){
	var eid = value;
	$(".result").load('http://ococean.com/assets/js/z_test.php?event='+value);
 }
 
 
 function getcatmap(catname, theid){
	var onoroff=0;
//	var chkbox='#'+catname+'-'+theid;
//	alert(chkbox);
 	if(document.getElementById(catname+'-'+theid).checked){
		onoroff=0;
	} else {
		onoroff=1;
	}
	$('#loader_container').css('visibility','visible');
	$.getScript("/assets/ajax/getcatmap.php?cat="+catname+"&theid="+theid+"&onoroff="+onoroff, function(){  });
 }
 
 function getcatmap_beta(catname, theid){
	var onoroff=0;
//	var chkbox='#'+catname+'-'+theid;
//	alert(chkbox);
 	if(document.getElementById(catname+'-'+theid).checked){
		onoroff=0;
	} else {
		onoroff=1;
	}
	$('#loader_container').css('visibility','visible');
	$.getScript("/assets/ajax/getcatmap_beta.php?cat="+catname+"&theid="+theid+"&onoroff="+onoroff, function(){  });
 }
 
 function searchlocations(searchcat){
 	var txtval='searchtxt_'+searchcat;
	var term=document.getElementById(txtval).value;
	if(term.length>3){
		$('#loader_container').css('visibility','visible');
		$.getScript("/assets/ajax/getcatmap.php?cat="+searchcat+"&searching=1&onoroff=0&term="+term, function(){  });
	} else {
		alert('Please enter a search term of 3 or more characters.');
	}
 }
 
 function searchlocations_beta(){
	var term=document.getElementById('searchtxt').value;
	if(term.length>3){
	$('#loader_container').css('visibility','visible');
		$.getScript("/assets/ajax/getcatmap_search.php?cat=search&onoroff=0&term="+term, function(){  });
	} else {
		alert('Please enter a search term of 3 or more characters.');
	}
 }
 
 function cleartxt(){
	if($('#addresssrch').value=="Example: 401 Light Street Baltimore, MD 21202"){
		$('#addresssrch').value='';
	}
 }
 
 function specificaddress(){
 	var theaddress=document.getElementById('addresssrch').value;
		geocoder.getLatLng(
			  theaddress,
			  function(point) {
				if (!point) {
					alert('Address could not be found!');
				} else {
					map.panTo(point);
					usermarker=new GMarker(point);
					map.addOverlay(usermarker); 
				}
			});
}
 function visitorscenter(){
	map.panTo(new GLatLng(38.39782, -75.06235));
 }
 
 function centerneighborhood(){
	var whichone=document.getElementById('neighborhoodselect').options[document.getElementById('neighborhoodselect').selectedIndex].value;
	if(whichone=='boardwalkinlet'){
		map.panTo(new GLatLng(38.34415, -75.07941));
	}
	if(whichone=='midtown'){
		map.panTo(new GLatLng(38.38342, -75.06686));
	}
	if(whichone=='northoc'){
		map.panTo(new GLatLng(38.42434, -75.05590));
	}
	if(whichone=='westoc'){
		map.panTo(new GLatLng(38.34197, -75.21943));
	}
 }
 
 function conventionrecenter(){
	var icon = new GIcon(G_DEFAULT_ICON);
	icon.image = '/assets/images/mapimages/marker_landmarks.png';
	icon.iconSize = new GSize(22, 27);
	icon.shadow = null;
	icon.infoWindowAnchor = new GPoint(17, 2);
	icon.imageMap = Array(0, 0, 34, 0, 34, 34, 0, 34);
	if(!markerarray['convention']){
		center=new GLatLng(38.36737, -75.07163);
		map.panTo(center);
		markerarray['convention'] = new GMarker(center, icon); 
		markerarray['convention'].tooltip='test!';
		GEvent.addListener(markerarray['convention'], "click", function() {
			var info='<div style="width: 250px"><b>Convention Center</b><br />Convention Center Description<br /><br />Convenction Center Address<br />Ocean City, MD 21842</div>';
			 markerarray['convention'].openInfoWindowHtml(info);
		});
		map.addOverlay(markerarray['convention']); 
		document.getElementById('conventionbox').src='/assets/images/mapimages/map_check_on.png';
		
	} else {
		if(markerarray['convention']){
			if(markerarray['convention']!=''){
				map.removeOverlay(markerarray['convention']); 
				markerarray['convention'] = ''; 
				document.getElementById('conventionbox').src='/assets/images/mapimages/map_check_off.png';
			}
		}
	}
 }
 
 function mapscheckall(whichcat){
	$('#loader_container').css('visibility','visible');
	if(whichcat=="dining"){
		$("*[id^=dining-]").each(function(){
			this.checked=true;
		});			
	}
	if(whichcat=="nightlife"){
		$('*[id^=nightlife-]').each(function(){
			this.checked=true;
		});			
	}
	$('#'+whichcat+'ul').find('li').each(function(){
		$(this).find('.checkbox').each(function(){
			this.checked=true;
		});
	});
	$.getScript("/assets/ajax/getcatmap.php?cat="+whichcat+"&all=1&onoroff=0", function(){  });
 }
  function mapsuncheckall(whichcat){
	$('#loader_container').css('visibility','visible');
	if(whichcat=="dining"){
		$("*[id^=dining-]").each(function(){
			this.checked=false;
		});			
	}
	if(whichcat=="nightlife"){
		$('*[id^=nightlife-]').each(function(){
			this.checked=false;
		});			
	}
	$('#'+whichcat+'ul').find('li').each(function(){
		$(this).find('.checkbox').each(function(){
			this.checked=false;
		});
	});
	$.getScript("/assets/ajax/getcatmap.php?cat="+whichcat+"&all=1&onoroff=1", function(){  });
 }
 function plusminus(whichcat){
	if(document.getElementById(whichcat+'box').src=='/assets/images/mapimages/plus.png'){
		document.getElementById(whichcat+'box').src='/assets/images/mapimages/minus.png';
	} else {
		document.getElementById(whichcat+'box').src='/assets/images/mapimages/plus.png';
	}
 }
 
 function enterkeyyn(thecat, event){
	var txtbox='searchtxt_'+thecat;
	var submitbox='submitmapsearch_'+thecat;
	if(event.keyCode==13){
		document.getElementById(submitbox).click();
	} else {
		if(document.getElementById(txtbox).value=="Search Locations"){
			document.getElementById(txtbox).value='';
		}
	}
 }
 
 function enterkeyynaddress(event){
	if(event.keyCode==13){
		document.getElementById('submitaddresssearch').click();
	} else {
		if(document.getElementById('addresssrch').value=="Search by Address"){
			document.getElementById('addresssrch').value='';
		}
	}
 }

function clearallmaps(){
	map.clearOverlays();
	$("INPUT[type='checkbox']").each(function(){
		this.checked=false;
	});
}
 
 function loadeventdetails(obj, theid){
	$('#target').html('<img src="/assets/images/icons/ajax/21-0.gif" width="20" height="20"  />');
	  map=null;
	  center='';
	  markerarray=Array();
	  mapsmall=null;
	$('.jcdiv').css('background-color','#2AA7C8');
	if($(obj).hasClass('top')){
		$(obj).css('background-color','#F47920');
	} else {
		$(obj).parent().parent().css('background-color','#F47920');
	}
	$("#target").load("/assets/ajax/geteventmain.php?id="+theid);

 }
 
 function recenterhere(lat, lng){
	center=new GLatLng(lat, lng);
	map.setCenter(center);
 }
 
 function emailitmapsjs(getcat, itemid){
	document.getElementById('catselval').value=getcat;
	document.getElementById('whichitem').value=itemid;

/*	document.getElementById('emailitdiv').display="block";
	document.getElementById('emailitdiv').visibility="visible";*/
	if(document.getElementById('emailitdiv').style.display=="block"){
		document.getElementById('emailitdiv').style.display="none";
		document.getElementById('emailitdiv').style.visibility="hidden";
	} else {
		if(document.getElementById('target')){
			document.getElementById('emailitdiv').style.left="200px";
			document.getElementById('emailitdiv').style.top="900px";
		} else {
			document.getElementById('emailitdiv').style.left="500px";
			document.getElementById('emailitdiv').style.top="500px";
		}		
		document.getElementById('emailitdiv').style.display="block";
		document.getElementById('emailitdiv').style.visibility="visible";
	}
 }

 
 /*
 *	David's travel_planner functions
 */
 function add_to_planner(type, id, e, selected)
 {	
 	
 	if ($(e.currentTarget).hasClass('added'))
 	{
 	
 	} else {
	 	$('div.add_planner_window').hide('slow');
	 	if (!selected)
	 	{
	 		selected = 'none';
	 	}
	 	$.ajax({
			url: 'http://ococean.com/travel-tools/travel-planner/add',
			type: 'POST',
			dataType: 'json',
			data: 'id='+id+'&type='+type+'&selected='+selected,
			success: function(response){
				if (response.status == 'true')
				{
					var add_planner_popup = $(e.currentTarget).next('div.add_planner_window');
					if (response.logged_in == 'true' && response.multiple_list == 'true')
					{
						add_planner_popup.html(response.content);
						add_planner_popup.show('slow');
						$('input.save_selected_list').click(function(){
							var selectedVal = $('select.selected_list').val();
							add_planner_popup.hide('slow');
							add_planner_popup.html('');
							add_to_planner(type, id, e, selectedVal);
						});
						$('h2.close_selected_list').click(function(){
							add_planner_popup.hide('slow');
							add_planner_popup.html('');
						});
					} else {
						$(e.currentTarget).addClass('added');
					}
				}	
			}
		});
	}
 }
 

function browsercheck(){
var browserName = "";

var ua = navigator.userAgent.toLowerCase();
if ( ua.indexOf( "opera" ) != -1 ) {
browserName = "opera";
} else if ( ua.indexOf( "msie" ) != -1 ) {
browserName = "msie";
} else if ( ua.indexOf( "safari" ) != -1 ) {
browserName = "safari";
} else if ( ua.indexOf( "mozilla" ) != -1 ) {
if ( ua.indexOf( "firefox" ) != -1 ) {
browserName = "firefox";
} else {
browserName = "mozilla";
}
}

return browserName;
}; 
 function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

 /*
 * end of travel planner stuff
 */
 function mapswapcat(whichid){
	var pos = $("#tabholder").offset();
//	alert(pos.top);
	var width = $("#tabholder").width();
  var ver = getInternetExplorerVersion();
	for(r=1;r<=6;r++){
		tabid='tabs-'+r;
		if(r!=whichid){
			document.getElementById(tabid).style.left="-9000px";
			document.getElementById(tabid).style.top="0px";
		} else {
			document.getElementById(tabid).style.left='40px';
			if(browsercheck()=='msie'&&ver<8){
				document.getElementById(tabid).style.top='364px';
			} else {
				document.getElementById(tabid).style.top='594px';
			}
		}
	}
 }
 
 function mapswapcat_events(whichid){
	var pos = $("#tabholder").offset();
//	alert(pos.top);
	var width = $("#tabholder").width();
  var ver = getInternetExplorerVersion();
	for(r=1;r<=6;r++){
		tabid='tabs-'+r;
		if(r!=whichid){
			document.getElementById(tabid).style.left="-9000px";
			document.getElementById(tabid).style.top="0px";
		} else {
			if(browsercheck()=='msie'&&ver<8){
				document.getElementById(tabid).style.top='74px';
				document.getElementById(tabid).style.left='0px';
			} else {
				document.getElementById(tabid).style.left='40px';
				document.getElementById(tabid).style.top='874px';
			}
		}
	}
 }
 
 function ddchangecatswap(){
	var whichid;
	whichid=document.getElementById('whatsclose').options[document.getElementById('whatsclose').selectedIndex].value;
	mapswapcat(whichid);
 }
 
 function ddchangecatswap_events(){
	var whichid;
	whichid=document.getElementById('whatsclose').options[document.getElementById('whatsclose').selectedIndex].value;
	mapswapcat_events(whichid);
 }
 
 function ddchangecatmaptab(){
	var whichid;
	whichid=document.getElementById('whatsclosemini').options[document.getElementById('whatsclosemini').selectedIndex].value;
	var abbrarr=Array();
	abbrarr[1]='accomodations';
	abbrarr[2]='dnl';
	abbrarr[3]='ttd';
	abbrarr[4]='services';
	abbrarr[5]='pres';
	abbrarr[6]='events';
	$resultstabs.tabs('select',1);
	map.checkResize();
	map.setCenter(center);
	document.getElementById('whatsclose').selectedIndex=document.getElementById('whatsclosemini').selectedIndex;
	mapscheckall(abbrarr[document.getElementById('whatsclosemini').options[document.getElementById('whatsclosemini').selectedIndex].value]);
	document.getElementById('whatsclosemini').selectedIndex=0;
	ddchangecatswap();
 }
  function ddchangecatmaptab_meeting(){
	var whichid;
	whichid=document.getElementById('whatsclosemini').options[document.getElementById('whatsclosemini').selectedIndex].value;
	var abbrarr=Array();
	abbrarr[1]='accomodations';
	abbrarr[2]='dnl';
	abbrarr[3]='ttd';
	abbrarr[4]='services';
	abbrarr[5]='pres';
	abbrarr[6]='events';
	$eventstabs.tabs('select',1);
	map.checkResize();
	map.setCenter(center);
	document.getElementById('whatsclose').selectedIndex=document.getElementById('whatsclosemini').selectedIndex;
	mapscheckall(abbrarr[document.getElementById('whatsclosemini').options[document.getElementById('whatsclosemini').selectedIndex].value]);
	document.getElementById('whatsclosemini').selectedIndex=0;
	ddchangecatswap();
 }
 function ddchangecatmaptab_mview(whichtab){
	if(whichtab==null){
		var whichtab=2;
	}
	var whichid;
	whichid=document.getElementById('whatsclosemini').options[document.getElementById('whatsclosemini').selectedIndex].value;
	var abbrarr=Array();
	abbrarr[1]='accomodations';
	abbrarr[2]='dnl';
	abbrarr[3]='ttd';
	abbrarr[4]='services';
	abbrarr[5]='pres';
	abbrarr[6]='events';
	MVToggleTab(whichtab);
	map.checkResize();
	map.setCenter(center);
	document.getElementById('whatsclose').selectedIndex=document.getElementById('whatsclosemini').selectedIndex;
	mapscheckall(abbrarr[document.getElementById('whatsclosemini').options[document.getElementById('whatsclosemini').selectedIndex].value]);
	document.getElementById('whatsclosemini').selectedIndex=0;
	ddchangecatswap();
 }
 
 
/*
 * 
 * Check/uncheck all for maps
 *
 *
 */
 function maps_toggle_check(obj, category){
	$('#loader_container').css('visibility','visible');
	if(obj.checked){
		mapscheckall(category);
	} else {
		mapsuncheckall(category);
	}
 }
 
 
 
function display_wedding(show){
//	alert(show);
	$("div[id^=wedding_pane]").css('display','none');
	document.getElementById('wedding_pane_'+show).style.display="inline";
//	$('#wedding-carousel').children().filter('li').each().css('background-color','#2AA7C8');
	$("li[id^=story]").css('background-color','#2AA7C8');
	$('#story'+show).css('background-color','#F47920');
}
	
 function temp_wedding_1(show){	 	
 	document.getElementById('wedding1').style.display="inline"; 	 	
	document.getElementById('wedding2').style.display="none"; 	 	
 }
 
 function temp_wedding_2(show){
	document.getElementById('wedding2').style.display="inline"; 	 	 
 	document.getElementById('wedding1').style.display="none"; 	 	
 }
 
 function sameas(onoroff){
	if(onoroff){
		$('#Location_Name').val($('#BusinessDisplayName').val());
		$('#Location_Address').val($('#BusinessOwner_Address').val());
		$('#Location_Address2').val($('#BusinessOwner_Address2').val());
	} else {
		$('#Location_Name').val('');
		$('#Location_Address').val('');
		$('#Location_Address2').val('');
	}
 }
 
 function cancelemailit(){
	document.getElementById('emailitdiv').style.display="none";
	document.getElementById('emailitdiv').style.visibility="hidden";
 }
 
 function gotomaptab(){
 	if($('#tablink3').length>0){
 		MVToggleTab(3);
 	} else {
 		if($('#tablink2').length>0){
 			MVToggleTab(2);
 		}
 	}
 }
 
 function gotomaptabjquery(){
	if($eventstabs){
		$eventstabs.tabs('select', '#event_tab_2');
		window.location=window.location+'#detailtabs';
	}
 }
 
 
 /*
 * 
 * Check/uncheck all for maps
 *
 *
 */
 function enlarge_window(targetURL){
 	var target = targetURL;
 	alert(target);
 }

function ajaxwaiticon(){
	$('#loader_container').css('visibility','visible');
}

function event_print(){
	var selected=$eventstabs.tabs('option','selected');
	var eventid;
	if(selected==1){
//		alert('Loading Events Calendar Information for printing...');
		var getstr='p=';
		$('.upcomingevent_container').each(function(e){

			if(jQuery(this).css('display')=='block'){
				eventid=jQuery(this).find('.eventidval').val();
				getstr+='-'+eventid;
			} else {
//				getstr+='';
			}
		});
//		alert(getstr);
		$('#dummyiframe').attr('src',"http://ococean.com/events/print_list/"+getstr);
		$('.boxy-wrapper').css('display','block');
//		document.getElementById("dummyiframe").src="http://devococean.com/events/print_list";
	} else {
		var eventid=document.getElementById('eventid').value;
		$('#dummyiframe').attr('src',"http://ococean.com/assets/ajax/geteventmain.php?print=1&id="+eventid);
		$('.boxy-wrapper').css('display','block');
//		document.getElementById("dummyiframe").src="http://devococean.com/assets/ajax/geteventmain.php?print=1&id="+eventid;
	}
}

function closeboxy(){
	$('.boxy-wrapper').css('display','none');
}

function pruneresults(thisval){
//	alert(eventinfo);
	var eventcount=0;
	var thisval=document.getElementById('searchfiltertxt').value.toLowerCase();
	if(document.getElementById('caldatepicker').value!=''){
		var thisdate=new Date(document.getElementById('caldatepicker').value);
		var thisdatets=thisdate.getTime()/1000.0;
	} else {
		var thisdate='';
	}
	//alert(thisdatets);
	$('.upcomingevent_container h3').each(function(e){
		var thistext=jQuery(this).text().toLowerCase();
		var startdatets=jQuery(this).parent().find('.stdtts').val();
		var enddatets=jQuery(this).parent().find('.enddtts').val();

//		alert(startdatets);
		
		if(((thisdate=='') || (startdatets<=thisdatets && enddatets>=thisdatets)) && ((thistext.indexOf(thisval)>-1) || thisval=='')){
			jQuery(this).parent().parent().css('display','block');
			eventcount++;
		} else {
			jQuery(this).parent().parent().css('display','none');
		}			
	});
	$('#numresults').html(eventcount+' results found.');
	if(eventcount==0){
		$("#noresults").css('display','block');
 	} else {
		$("#noresults").css('display','none');
	} 		
}

function ccenter(mx, my){
  var display=0;
	var topsubtract=0;
	if(browsercheck()=='msie'){
		topsubtract=250;
	}
	var replacecontent;
//  $('#status').html( mx +', '+ my);
  	if($('#convention_center_tabs').tabs('option','selected')==1){ //only display on the convention center Floor Plan tab
		if($('#convention_center_tab_2').tabs('option','selected')==0){ //the 'if' block for Floor One
			if(mx>71 & mx<631 & my>711 & my<1092){
				var cc1src=$('#cc1img').attr('src');
				if(cc1src.indexOf('-cameras')==-1){
					$('#cc1img').attr('src','/assets/convention-center-level-1-cameras.jpg');
				}
			} else {
				$('#cc1img').attr('src','/assets/convention-center-level-1.jpg');
			}
			
			if(mx>310 & mx<410 & my>799 & my<842){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','310px');
				$('#floorhighlightdiv').css('top',(790-topsubtract)+'px');
				$('#floorhighlightdiv').css('width','100px');
				$('#floorhighlightdiv').css('height','43px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Food court</strong><br /><img src="/assets/images/ccenter/BaysidePlazaFoodCourt_web.jpg" />';
				if($('#tooltipdiv').html()!=replacecontent){
//					alert(replacecontent);
					$('#tooltipdiv').html(replacecontent);
				}
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
			if(mx>414 & mx<624 & my>799 & my<895){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','414px');
				$('#floorhighlightdiv').css('top',(799-topsubtract)+'px');
				$('#floorhighlightdiv').css('width','210px');
				$('#floorhighlightdiv').css('height','201px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Exhibit Hall A/B Theater-style</strong><br /><img src="/assets/images/ccenter/ExhibitHallAB_web.jpg" />';
				if($('#tooltipdiv').html()!=replacecontent){
					$('#tooltipdiv').html(replacecontent);
				}
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
			if(mx>414 & mx<624 & my>894 & my<1006){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','414px');
				$('#floorhighlightdiv').css('top',(799-topsubtract)+'px');
				$('#floorhighlightdiv').css('width','210px');
				$('#floorhighlightdiv').css('height','201px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Exhibit Hall A/B Exhibit-style</strong><br /><img src="/assets/images/ccenter/ExhibitHallAB_ExhibitStyle_web.jpg" />';
				if($('#tooltipdiv').html()!=replacecontent);
					$('#tooltipdiv').html(replacecontent);
				$('#tooltipdiv').html(replacecontent);
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
		}
		if($('#convention_center_tab_2').tabs('option','selected')==1){ //the 'if' block for Floor Two
			if(mx>71 & mx<631 & my>711 & my<1092){
				var cc2src=$('#cc2img').attr('src');
				if(cc2src.indexOf('-cameras')==-1){
					$('#cc2img').attr('src','/assets/convention-center-level-2-cameras.jpg');
				}
			} else {
				$('#cc2img').attr('src','/assets/convention-center-level-2.jpg');
			}
			if(mx>166 & mx<291 & my>800 & my<888){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','166px');
				$('#floorhighlightdiv').css('top',topsubtract-'px');
				$('#floorhighlightdiv').css('width','125px');
				$('#floorhighlightdiv').css('height','152px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Ballroom 1/2/3 Banquet-style</strong><br /><img src="/assets/images/ccenter/Ballroom123_banqueststyle_web.jpg" />';
				if($('#tooltipdiv').html()!=replacecontent){
					$('#tooltipdiv').html('<strong>Ballroom 1/2/3 Banquet-style</strong><br /><img src="/assets/images/ccenter/Ballroom123_banqueststyle_web.jpg" />');
				}
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
			if(mx>166 & mx<291 & my>887 & my<952){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','166px');
				$('#floorhighlightdiv').css('top',(800-topsubtract)+'px');
				$('#floorhighlightdiv').css('width','125px');
				$('#floorhighlightdiv').css('height','152px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Ballroom 1/2/3 Theater-style</strong><br /><img src="/assets/images/ccenter/Ballroom123_TheaterStyle_web.jpg" />';
				if($('#tooltipdiv').html()!='<strong>Ballroom 1/2/3 Theater-style</strong><br /><img src="/assets/images/ccenter/Ballroom123_TheaterStyle_web.jpg" />'){
					$('#tooltipdiv').html(replacecontent);
				}
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
			if(mx>366 & mx<403 & my>947 & my<968){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','366px');
				$('#floorhighlightdiv').css('top',(947-topsubtract)+'px');
				$('#floorhighlightdiv').css('width','37px');
				$('#floorhighlightdiv').css('height','21px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Board Room 214</strong><br /><img src="/assets/images/ccenter/boardroomRoom214_web.jpg" />';
				if($('#tooltipdiv').html()!='<strong>Board Room 214</strong><br /><img src="/assets/images/ccenter/boardroomRoom214_web.jpg" />'){
					$('#tooltipdiv').html(replacecontent);
				}
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
			if(mx>431 & mx<505 & my>998 & my<1032){
		//		alert('You\'re hovering over the Food Court');
				$('#floorhighlightdiv').css('left','431px');
				$('#floorhighlightdiv').css('top',(998-topsubtract)+'px');
				$('#floorhighlightdiv').css('width','74px');
				$('#floorhighlightdiv').css('height','34px');
				$('#floorhighlightdiv').css('z-index','500');
				$('#floorhighlightdiv').css('display','block');
				$('#floorhighlightdiv').css('visibility','visible');
				replacecontent='<strong>Meeting Room 215</strong><br /><img src="/assets/images/ccenter/meetingroom215-TheaterStyle_web.jpg" />';
				if($('#tooltipdiv').html()!='<strong>Meeting Room 215</strong><br /><img src="/assets/images/ccenter/meetingroom215-TheaterStyle_web.jpg" />'){
					$('#tooltipdiv').html(replacecontent);
				}
				$('#tooltipdiv').css('left',(mx-200)+'px');
				$('#tooltipdiv').css('top',(my-300-topsubtract)+'px');
				$('#tooltipdiv').css('display','block');
				$('#tooltipdiv').css('visibility','visible');
				display=1;
			}
		}
	}
	if(display==0){
		$('#floorhighlightdiv').css('display','none');
		$('#floorhighlightdiv').css('visibility','hidden');
		$('#tooltipdiv').css('display','none');
		$('#tooltipdiv').css('visibility','hidden');
	}	
}
