var map;var markersArray = new Array;var bounds = new google.maps.LatLngBounds();var infoWindow = new google.maps.InfoWindow({});var locationarray=new Array;locationarray['id']=new Array;locationarray['business_name']=new Array;locationarray['street_address']=new Array;locationarray['city']=new Array;locationarray['state']=new Array;locationarray['zip']=new Array;locationarray['office_phone']=new Array;locationarray['email_address']=new Array;locationarray['lat']=new Array;locationarray['lng']=new Array;locationarray['small_image_url']=new Array;locationarray['large_image_url']=new Array;locationarray['slide_show_location']=new Array;locationarray['slide_show_flag']=new Array;locationarray['step1_blurb']=new Array;locationarray['step2_blurb']=new Array;// this is the jquery onready function - anything in here gets called whenever the page is loaded$(function(){	setup_mouseover();	ddsmoothmenu.init({			mainmenuid: "smoothmenu1", //menu DIV id			orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"			classname: 'ddsmoothmenu', //class added to menu's outer DIV			contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]	});	submit_on_enter();	// set up accordion control	$('#step2accord').accordion({ },function(){		$( '#step2accord' ).accordion({ header: 'h1' });		$( '#step2accord' ).accordion( "option", "icons", { 'header': '', 'headerSelected': '' } );		$( '#step2accord' ).accordion( "option", "autoHeight", true);	});	// setup tab control 	$('#tabs').tabs();	// click handler for step 1 'Next' button	$('.nextbutton').live('click', function() { // process step 1 'next' button click and goto step 2		select_tab(1);		var button_id = $(this).attr('id');		buildstep2(button_id);	});	// click handler for step 2 'Reserve Now' button	$('.reservenowbutton').live('click', function() { // process step 2 'reserve now' button click and goto step 3		select_tab(2);		var button_id = $(this).attr('id');		buildstep3(button_id);	});	$('.step3formsubmit').live('click',function(){ // submit step 3 form when 'reserve unit now' button clicked		$('#formsubmit').submit();	});	// disable step 2 and step 3 tabs	$('#tabs').tabs("disable",1);	$('#tabs').tabs("disable",2);	$('#tabs').tabs({ // determine which tab is shown and respond accordingly		show: function(event, ui) {			var $tabs = $('#tabs').tabs();			var tab_shown = $tabs.tabs('option', 'selected');			switch(tab_shown){				case 0:					select_tab(0);				break;				case 1:					select_tab(1);				break;				case 2:					select_tab(2);				break;			}		}	}); 	$('#step_2_menu_item_1').live('mouseover mouseout',function(){		if (event.type == 'mouseover') {			$('#step_2_menu_item_1').css({ backgroundImage : "url(images/blue_arrow.png)" });		}else{			$('#step_2_menu_item_1').css({ backgroundImage : "url(images/red_arrow.png)" });		} 	}); 	$('#step_2_menu_item_2').live('mouseover mouseout',function(){		if (event.type == 'mouseover') {			$('#step_2_menu_item_2').css({ backgroundImage : "url(images/blue_arrow.png)" });		}else{			$('#step_2_menu_item_2').css({ backgroundImage : "url(images/red_arrow.png)" });		} 	}); 	$('#step_2_menu_item_3').live('mouseover mouseout',function(){		if (event.type == 'mouseover') {			$('#step_2_menu_item_3').css({ backgroundImage : "url(images/blue_arrow.png)" });		}else{			$('#step_2_menu_item_3').css({ backgroundImage : "url(images/red_arrow.png)" });		} 	}); 	$('#step_2_menu_item_4').live('mouseover mouseout',function(){		if (event.type == 'mouseover') {			$('#step_2_menu_item_4').css({ backgroundImage : "url(images/blue_arrow.png)" });		}else{			$('#step_2_menu_item_4').css({ backgroundImage : "url(images/red_arrow.png)" });		} 	});});function submit_on_enter(){// used to submit search critera on hitting 'enter key' or clicking 'search' button	var  testTextBox = $('#searchcritera');	var code =null;	testTextBox.keypress(function(e)	{		code= (e.keyCode ? e.keyCode : e.which);		if (code == 10 || code == 13){			$("#submit_button").click();		}	});}function load_simple_map() {	var mapOptions = {		mapTypeId: google.maps.MapTypeId.ROADMAP,		mapTypeControl: false,		zoomControl:true,		streetViewControl:false,	};	map =  new google.maps.Map(document.getElementById("map_canvas"), mapOptions);	getlocationjson();}function load_full_map(params) {	//$("#searchcritera").val(params);	if(params){		var location_string="&nbsp;>&nbsp;<font color=red>"+params+"</font>";		$("#location_name").html(location_string);	}	var mapOptions = {		mapTypeId: google.maps.MapTypeId.ROADMAP,		mapTypeControl: false,		zoomControl:true,		streetViewControl:false,	};	map =  new google.maps.Map(document.getElementById("map_canvas"), mapOptions);	getlocationjson(params); 	select_tab(0);}function addMarker(location,title,infowindow) {	var marker = new google.maps.Marker({		position: location,		map: map,		city: title  	});	markersArray.push(marker);	google.maps.event.addListener(marker, "click", function(event) {		infoWindow.setContent(infowindow);        infoWindow.open(map,this);	}); 	bounds.extend(location); 	map.fitBounds(bounds);}function getlocationjson(searchcritera){	locationarray['id'].length=0;	if(searchcritera){		var dataString="searchcritera="+searchcritera;	}else{		var dataString="searchcritera=0";	}    $.getJSON("getlocationjson.php",dataString,function(json){		var pincount=1;		for (i in json.rows) {			var id=json.rows[i]['id'];			var title=json.rows[i]['business_name'];			var street_address=json.rows[i]['street_address'];			var city=json.rows[i]['city'];			var state=json.rows[i]['state'];			var zip=json.rows[i]['zip'];			var office_phone=json.rows[i]['office_phone'];			var small_image_url=json.rows[i]['small_image_url'];			var large_image_url=json.rows[i]['large_image_url'];			var slide_show_location=json.rows[i]['slide_show_location'];			var slide_show_flag=json.rows[i]['slide_show_flag'];			var facility_info_url=json.rows[i]['facility_info_url'];			if(facility_info_url){				var infowindow="<div class='infowindow'><img class='smallimage' src='images/buildings/"+small_image_url+"'><strong>"+title+"</strong><br>"+street_address+"<br>"+city+","+state+" "+zip+"<br>"+office_phone+"<br><br><a href="+facility_info_url+">View Facility Info</a></div>";			}else{				var infowindow="<div class='infowindow'><img class='smallimage' src='images/buildings/"+small_image_url+"'><strong>"+title+"</strong><br>"+street_address+"<br>"+city+","+state+" "+zip+"<br>"+office_phone+"</div>";			}			var location = new google.maps.LatLng(parseFloat(json.rows[i]['lat']),parseFloat(json.rows[i]['lng'])); 			locationarray['id'][i]=json.rows[i]['id']; 			locationarray['business_name'][i]=json.rows[i]['business_name']; 			locationarray['street_address'][i]=json.rows[i]['street_address'];  			locationarray['city'][i]=json.rows[i]['city'];  			locationarray['state'][i]=json.rows[i]['state'];  			locationarray['zip'][i]=json.rows[i]['zip'];  			locationarray['office_phone'][i]=json.rows[i]['office_phone'];			locationarray['email_address'][i]=json.rows[i]['email_address'];			locationarray['lat'][i]=json.rows[i]['lat'];  			locationarray['lng'][i]=json.rows[i]['lng'];  			locationarray['small_image_url'][i]=json.rows[i]['small_image_url'];			locationarray['large_image_url'][i]=json.rows[i]['large_image_url'];			locationarray['slide_show_location'][i]=json.rows[i]['slide_show_location'];			locationarray['slide_show_flag'][i]=json.rows[i]['slide_show_flag'];			locationarray['step1_blurb'][i]=json.rows[i]['step1_blurb'];			locationarray['step2_blurb'][i]=json.rows[i]['step2_blurb'];			addMarker(location,title,infowindow);		}		buildstep1();		$("#message").html("&nbsp;&nbsp;"+json['message']);    });}function buildstep1(){	var pincount=0;	var buttoncount=0;	var loc_content="<h1>&nbsp;&nbsp;Find Storage Near You</h1>";	var loc_content=loc_content+"<table id=step1table border=0 cellpadding=0 cellspacing=0>";	$('#locations_link').css({'color':'#BE2226'});	$("#select_storage_unit").hide();	$("#select_unit_size").hide();	for(var i=0;i<locationarray['id'].length;i++){		pincount++;		// pin settings are documented here: http://groups.google.com/group/google-chart-api/web/chart-types-for-map-pins		var pin='<img src=http://chart.apis.google.com/chart?chst=d_map_spin&chld=.65|0|f16353|8|_|'+pincount+'> ';		var small_image='<img class=small_image src=images/buildings/'+locationarray['small_image_url'][i]+'>';		var loc_info="";		var loc_info=loc_info+"<br>";		var loc_info=loc_info+locationarray['business_name'][i]+"<br>";		var loc_info=loc_info+locationarray['street_address'][i]+"<br>";		var loc_info=loc_info+locationarray['city'][i]+", ";		var loc_info=loc_info+locationarray['state'][i]+" ";		var loc_info=loc_info+locationarray['zip'][i];		var loc_info=loc_info+"<br>"+locationarray['office_phone'][i]+"<br>";		var loc_info=loc_info+"<span class=step1blurb>"+locationarray['step1_blurb'][i]+"</span>";		var nextbutton="<div class=nextbutton id='nextbutton_"+buttoncount+"~loc_"+locationarray['id'][i]+"'><img src=images/buttons/next_button.png></div>No Obligation<br>No Credit Card Required";		var loc_content=loc_content+"<tr id=row"+i+">";		var loc_content=loc_content+"<td class='pin padded'>"+pin+"</td>";		var loc_content=loc_content+"<td class='thumbnail padded'>"+small_image+"</td>";		var loc_content=loc_content+"<td class='info padded'>"+loc_info+"</td>";		var loc_content=loc_content+"<td class='button padded'>"+nextbutton+"</td>";		var loc_content=loc_content+"</tr>";		buttoncount++;    }	var loc_content=loc_content+"</table>";	$("#step1div").html(loc_content);}function buildstep2(button_id){	splitarray=button_id.split("~");	loc=splitarray[0];	button=splitarray[1];	loc_index=loc.split("_")[1];	button_index=button.split("_")[1];	$('#locations_link').css({'color':'#BE2226'});	var destination=locationarray['city'][loc_index]+" "+locationarray['zip'][loc_index];	$('#destination').html(' > '+destination);	var large_image_url="<img class=large_image src=images/buildings/"+locationarray["large_image_url"][loc_index]+" align=right>"; 	var step2banner="<div id=step2banner>";	if(locationarray["slide_show_flag"][loc_index]==1){		var step2banner=step2banner+"<div class=slideshow></div>";	}else{		var step2banner=step2banner+large_image_url;	}	var step2banner=step2banner+"<br><h1>"+locationarray['office_phone'][loc_index]+"</h1>";	var step2banner=step2banner+"<h2>"+locationarray['business_name'][loc_index]+"</h2>";	var step2banner=step2banner+"<div id=step2banner_text>";	var step2banner=step2banner+locationarray['street_address'][loc_index]+"<br>";	var step2banner=step2banner+locationarray['city'][loc_index]+", "+locationarray['state'][loc_index]+" "+locationarray['zip'][loc_index]+"<br>";	var step2banner=step2banner+locationarray['office_phone'][loc_index]+"<br>";	var step2banner=step2banner+"<a href=mailto:"+locationarray['email_address'][loc_index]+">"+locationarray['email_address'][loc_index]+"</a>";	var step2banner=step2banner+"</div>";	var step2banner=step2banner+"<div id=step2buttons><a href=get_a_quote.php><img src=images/buttons/get_a_quote_button.png border=0></a>&nbsp;&nbsp;&nbsp;<a href=pay_online.php><img src=images/buttons/pay_online_button.png border=0></a></div>"; 	var step2banner=step2banner+"</div>";	var step2content=step2banner;	var step2wrapper="<div id=step2wrapper>";	var step2menu="<div id=step2menu>";	var step2menu=step2menu+"</div>";	var step2wrapper=step2wrapper+step2menu;	// build HTML for accordion layout	var step2accord="<div id=step2accord>";	var step2accord=step2accord+"<h1><span id=small_accord_header><img src=images/small_header.png></span></h1>";	var step2accord=step2accord+"<div id=small_units></div>";	var step2accord=step2accord+"<h1><span id=medium_accord_header><img src=images/medium_header.png></span></h1>";	var step2accord=step2accord+"<div>";	var step2accord=step2accord+"<div id=medium_units></div>";	var step2accord=step2accord+"</div>";	var step2accord=step2accord+"<h1><span id=large_accord_header><img src=images/large_header.png></span></h1>";	var step2accord=step2accord+"<div>";	var step2accord=step2accord+"<div id=large_units></div>";	var step2accord=step2accord+"</div>";	var step2accord=step2accord+"<h1><span id=boat_rv_accord_header><img src=images/boat_rv_header.png></span></h1>";	var step2accord=step2accord+"<div>";	var step2accord=step2accord+"<div id=boat_rv></div>";	var step2accord=step2accord+"</div>";	var step2accord=step2accord+"<h1><span id=office_accord_header><img src=images/office_header.png></span></h1>";	var step2accord=step2accord+"<div>";	var step2accord=step2accord+"<div id=office></div>";	var step2accord=step2accord+"</div>";	var step2accord=step2accord+"</div>";	var step2wrapper=step2wrapper+step2accord;	var step2wrapper=step2wrapper+"</div>";	var step2content=step2content+step2wrapper;	$("#step2div").html(step2content);	$("#select_storage_unit").show();	$("#select_unit_size").show();	// build HTML for table for small units accordion panel	var dataString="location_id="+button_index;//	if(locationarray["slide_show_flag"][loc_index]==1){		$(".slideshow").load(locationarray["slide_show_location"][loc_index]+'_slideshow.html',function(){			$('.slideshow').cycle({				fx     : 'fade',				speed  : 1000,				timeout: 5000			});		});	}//	$("#step2menu").load('step_2_menu.html',function(){ 		$.getJSON("getstep2blurb.php",dataString,function(json){ 			if(json.success==true){ 				//$("#step2blurb").html(json.step2_blurb); 			} 		});	});	$.getJSON("getsmallunitjson.php",dataString,function(json){		var table_string="";		if(json.success==true){			var table_string=table_string+"<table id=small_unit_table border=0>";			var table_string=table_string+"<thead>";			var table_string=table_string+"<tr>";			var table_string=table_string+"<th class=unit_header>Unit</th>";			var table_string=table_string+"<th class=unit_header>Size</th>";			var table_string=table_string+"<th class=unit_header>Description</th>";			var table_string=table_string+"<th class=unit_header>Montly Rent</th>";			var table_string=table_string+"<th class=unit_header>Details</th>";			var table_string=table_string+"<th class=unit_header align=right><a href=what_size.php>What Size Do I Need?</a></th>";			var table_string=table_string+"</tr>";			var table_string=table_string+"</thead>";			for (i in json.rows) {				table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";				table_string=table_string+"<tr>";				table_string=table_string+"<td class=unit>"+json.rows[i]['unit']+"</td>";				table_string=table_string+"<td class=size>"+json.rows[i]['size']+"</td>";				table_string=table_string+"<td class=description>"+json.rows[i]['description']+"</td>";				table_string=table_string+"<td class=monthly_rent>"+json.rows[i]['monthly_rent']+"</td>";				table_string=table_string+"<td class=details>"+json.rows[i]['details']+"</td>";				table_string=table_string+"<td class=button_url><img class='reservenowbutton' id='reservenowbutton_"+loc_index+"~small_"+json.rows[i]['small_unit_id']+"' src=images/buttons/"+json.rows[i]['button_url']+"></td>";				table_string=table_string+"</tr>";			}			var table_string=table_string+"<tfoot>";			table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";			var table_string=table_string+"<tr>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=faq.php>NEED HELP?</a></td>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=climate_controlled_storage.php>What is climate controlled storage?</a></td>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=non_climate_controlled_storage.php>What is non-climate controlled storage?</a></td>";			var table_string=table_string+"</tr>";			var table_string=table_string+"</tfoot>";			var table_string=table_string+"</table>";		}else{			var table_string=table_string+"<table id=small_unit_table border=0>";			table_string=table_string+"<tr><td class=no_units colspan=6>There are no Small Units Available.</td></tr>";			var table_string=table_string+"</table>";		}		$('#small_units').append(table_string);  		$('#step2accord').accordion({ fillSpace: false });		$('#step2accord').accordion({ fillSpace: true });		//$('#small_units').height($('#small_unit_table').height()+21); // fudge factor to pad table to prevent scroll bar. Adjust if table height changes very much.	});	// build HTML for table for medium units accordion panel	$.getJSON("getmediumunitjson.php",dataString,function(json){		var table_string="";		if(json.success==true){			var table_string=table_string+"<table id=medium_unit_table border=0>";			var table_string=table_string+"<thead>";			var table_string=table_string+"<tr>";			var table_string=table_string+"<th class=unit_header>Unit</th>";			var table_string=table_string+"<th class=unit_header>Size</th>";			var table_string=table_string+"<th class=unit_header>Description</th>";			var table_string=table_string+"<th class=unit_header>Montly Rent</th>";			var table_string=table_string+"<th class=unit_header>Details</th>";			var table_string=table_string+"<th class=unit_header><a href=what_size.html>What Size Do I Need?</a></th>";			var table_string=table_string+"</tr>";			var table_string=table_string+"</thead>";			for (i in json.rows) {				table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";				table_string=table_string+"<tr>";				table_string=table_string+"<td class=unit>"+json.rows[i]['unit']+"</td>";				table_string=table_string+"<td class=size>"+json.rows[i]['size']+"</td>";				table_string=table_string+"<td class=description>"+json.rows[i]['description']+"</td>";				table_string=table_string+"<td class=monthly_rent>"+json.rows[i]['monthly_rent']+"</td>";				table_string=table_string+"<td class=details>"+json.rows[i]['details']+"</td>";				table_string=table_string+"<td class=button_url><img class='reservenowbutton' id='reservenowbutton_"+loc_index+"~medium_"+json.rows[i]['medium_unit_id']+"' src=images/buttons/"+json.rows[i]['button_url']+"></td>";				table_string=table_string+"</tr>";			}			var table_string=table_string+"<tfoot>";			table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";			var table_string=table_string+"<tr>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=faq.php>NEED HELP?</a></td>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=climate_controlled_storage.html>What is climate controlled storage?</a></td>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=non_climate_controlled_storage.html>What is non-climate controlled storage?</a></td>";			var table_string=table_string+"</tr>";			var table_string=table_string+"</tfoot>";			var table_string=table_string+"</table>";		}else{			var table_string=table_string+"<table id=medium_unit_table>";			table_string=table_string+"<tr><td class=no_units colspan=6>There are no Medium Units Available.</td></tr>";			var table_string=table_string+"</table>";		}		$('#medium_units').append(table_string);  		$('#step2accord').accordion({ fillSpace: false });        $('#step2accord').accordion({ fillSpace: true });		//$('#medium_units').height($('#medium_unit_table').height()+21); // fudge factor to pad table to prevent scroll bar. Adjust if table height changes very much.	});	// build HTML for table for large units accordion panel	$.getJSON("getlargeunitjson.php",dataString,function(json){		var table_string="";		if(json.success==true){			var table_string=table_string+"<table id=large_unit_table>";			var table_string=table_string+"<thead>";			var table_string=table_string+"<tr>";			var table_string=table_string+"<th class=unit_header>Unit</th>";			var table_string=table_string+"<th class=unit_header>Size</th>";			var table_string=table_string+"<th class=unit_header>Description</th>";			var table_string=table_string+"<th class=unit_header>Montly Rent</th>";			var table_string=table_string+"<th class=unit_header>Details</th>";			var table_string=table_string+"<th class=unit_header><a href=what_size.html>What Size Do I Need?</a></th>";			var table_string=table_string+"</tr>";			var table_string=table_string+"</thead>";			for (i in json.rows) {				table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";				table_string=table_string+"<tr>";				table_string=table_string+"<td class=unit>"+json.rows[i]['unit']+"</td>";				table_string=table_string+"<td class=size>"+json.rows[i]['size']+"</td>";				table_string=table_string+"<td class=description>"+json.rows[i]['description']+"</td>";				table_string=table_string+"<td class=monthly_rent>"+json.rows[i]['monthly_rent']+"</td>";				table_string=table_string+"<td class=details>"+json.rows[i]['details']+"</td>";				table_string=table_string+"<td class=button_url><img class='reservenowbutton' id='reservenowbutton_"+loc_index+"~large_"+json.rows[i]['large_unit_id']+"' src=images/buttons/"+json.rows[i]['button_url']+"></td>";				table_string=table_string+"</tr>";			}			var table_string=table_string+"<tfoot>";			table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";			var table_string=table_string+"<tr>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=faq.php>NEED HELP?</a></td>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=climate_controlled_storage.html>What is climate controlled storage?</a></td>";			var table_string=table_string+"<td class=table_footer colspan=2><a href=non_climate_controlled_storage.html>What is non-climate controlled storage?</a></td>";			var table_string=table_string+"</tr>";			var table_string=table_string+"</tfoot>";			var table_string=table_string+"</table>";		}else{			var table_string=table_string+"<table id=large_unit_table>";			table_string=table_string+"<tr><td class=no_units colspan=6>There are no Large Units Available.</td></tr>";			var table_string=table_string+"</table>";		}		$('#large_units').append(table_string);  		$('#step2accord').accordion({ fillSpace: false });        $('#step2accord').accordion({ fillSpace: true });		//$('#large_units').height($('#large_unit_table').height()+21); // fudge factor to pad table to prevent scroll bar. Adjust if table height changes very much.		// build HTML for table for boat & rv accordion panel		$.getJSON("get_boat_rv_json.php",dataString,function(json){			var table_string="";			if(json.success==true){				var table_string=table_string+"<table id=rv_boat_table>";				var table_string=table_string+"<thead>";				var table_string=table_string+"<tr>";				var table_string=table_string+"<th class=unit_header>Unit</th>";				var table_string=table_string+"<th class=unit_header>Size</th>";				var table_string=table_string+"<th class=unit_header>Description</th>";				var table_string=table_string+"<th class=unit_header>Montly Rent</th>";				var table_string=table_string+"<th class=unit_header>Details</th>";				var table_string=table_string+"<th class=unit_header><a href=what_size.php>What Size Do I Need?</a></th>";				var table_string=table_string+"</tr>";				var table_string=table_string+"</thead>";				for (i in json.rows) {					table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";					table_string=table_string+"<tr>";					table_string=table_string+"<td class=unit>"+json.rows[i]['unit']+"</td>";					table_string=table_string+"<td class=size>"+json.rows[i]['size']+"</td>";					table_string=table_string+"<td class=description>"+json.rows[i]['description']+"</td>";					table_string=table_string+"<td class=monthly_rent>"+json.rows[i]['monthly_rent']+"</td>";					table_string=table_string+"<td class=details>"+json.rows[i]['details']+"</td>";					table_string=table_string+"<td class=button_url><img class='reservenowbutton' id='reservenowbutton_"+loc_index+"~large_"+json.rows[i]['large_unit_id']+"' src=images/buttons/"+json.rows[i]['button_url']+"></td>";					table_string=table_string+"</tr>";				}				var table_string=table_string+"<tfoot>";				table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";				var table_string=table_string+"<tr>";				var table_string=table_string+"<td class=table_footer colspan=2><a href=faq.php>NEED HELP?</a></td>";				var table_string=table_string+"<td class=table_footer colspan=2><a href=climate_controlled_storage.html>What is climate controlled storage?</a></td>";				var table_string=table_string+"<td class=table_footer colspan=2><a href=non_climate_controlled_storage.html>What is non-climate controlled storage?</a></td>";				var table_string=table_string+"</tr>";				var table_string=table_string+"</tfoot>";				var table_string=table_string+"</table>";			}else{				var table_string=table_string+"<table id=rv_boat_table>";				table_string=table_string+"<tr><td class=no_units colspan=6>There are no Boat & RV Units Available.</td></tr>";				var table_string=table_string+"</table>";			}			$('#boat_rv').append(table_string);			$('#step2accord').accordion({ fillSpace: false });			$('#step2accord').accordion({ fillSpace: true });			$('#boat_rv').height($('#boat_rv_table').height()+21); // fudge factor to pad table to prevent scroll bar. Adjust if table height changes very much.		});		// build HTML for table for boat & rv accordion panel		$.getJSON("get_office_json.php",dataString,function(json){			var table_string="";			if(json.success==true){				var table_string=table_string+"<table id=rv_boat_table>";				var table_string=table_string+"<thead>";				var table_string=table_string+"<tr>";				var table_string=table_string+"<th class=unit_header>Unit</th>";				var table_string=table_string+"<th class=unit_header>Size</th>";				var table_string=table_string+"<th class=unit_header>Description</th>";				var table_string=table_string+"<th class=unit_header>Montly Rent</th>";				var table_string=table_string+"<th class=unit_header>Details</th>";				var table_string=table_string+"<th class=unit_header><a href=what_size.php>What Size Do I Need?</a></th>";				var table_string=table_string+"</tr>";				var table_string=table_string+"</thead>";				for (i in json.rows) {					table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";					table_string=table_string+"<tr>";					table_string=table_string+"<td class=unit>"+json.rows[i]['unit']+"</td>";					table_string=table_string+"<td class=size>"+json.rows[i]['size']+"</td>";					table_string=table_string+"<td class=description>"+json.rows[i]['description']+"</td>";					table_string=table_string+"<td class=monthly_rent>"+json.rows[i]['monthly_rent']+"</td>";					table_string=table_string+"<td class=details>"+json.rows[i]['details']+"</td>";					table_string=table_string+"<td class=button_url><img class='reservenowbutton' id='reservenowbutton_"+loc_index+"~large_"+json.rows[i]['large_unit_id']+"' src=images/buttons/"+json.rows[i]['button_url']+"></td>";					table_string=table_string+"</tr>";				}				var table_string=table_string+"<tfoot>";				table_string=table_string+"<tr><td class=blue_line colspan=6><hr class=blue_line></td></tr>";				var table_string=table_string+"<tr>";				var table_string=table_string+"<td class=table_footer colspan=2><a href=faq.php>NEED HELP?</a></td>";				var table_string=table_string+"<td class=table_footer colspan=2><a href=climate_controlled_storage.html>What is climate controlled storage?</a></td>";				var table_string=table_string+"<td class=table_footer colspan=2><a href=non_climate_controlled_storage.html>What is non-climate controlled storage?</a></td>";				var table_string=table_string+"</tr>";				var table_string=table_string+"</tfoot>";				var table_string=table_string+"</table>";			}else{				var table_string=table_string+"<table id=rv_boat_table>";				table_string=table_string+"<tr><td class=no_units colspan=6>There are no Office and Warehouse Units Available.</td></tr>";				var table_string=table_string+"</table>";			}			$('#office').append(table_string);			$('#step2accord').accordion({ fillSpace: false });			$('#step2accord').accordion({ fillSpace: true });			$('#office').height($('#office_table').height()+21); // fudge factor to pad table to prevent scroll bar. Adjust if table height changes very much.		});	});}function buildstep3(button_id){	// split up the id from the reservenow button to get the index and size_id, and size_type	splitarray=button_id.split("~");	unitstring=splitarray[1];	unit_sizearray=unitstring.split("_");	unit_size=unit_sizearray[0];	unit_id=unit_sizearray[1];	$('#locations_link').css({'color':'black'});	$("#select_storage_unit").hide();	$("#select_unit_size").hide();	$("#step3div").html('<br><br>Step 3 Goes Here');	return;	var step3businfo="<div id=step3businfo>";	var step3businfo=step3businfo+"<img class=step3businfo src=images/buildings/"+locationarray['small_image_url'][loc_index]+" align=left>";	var step3businfo=step3businfo+locationarray['business_name'][loc_index]+"<br>";	var step3businfo=step3businfo+locationarray['street_address'][loc_index]+"<br>";	var step3businfo=step3businfo+locationarray['city'][loc_index]+", "+locationarray['state'][loc_index]+", "+locationarray['zip'][loc_index]+"<br>";	var step3businfo=step3businfo+locationarray['office_phone'][loc_index]+"<br>";	var step3businfo=step3businfo+"</div><br>";	$('#step3div').html(step3businfo);	var dataString="location_id="+button_index+"&unit_id="+unit_id;	switch(unit_size){		case 'small':			url="getsmallunitjson.php";		break;		case 'medium':			url="getmediumunitjson.php";		break;		case 'large':			url="getlargeunitjson.php";		break;	}	$.getJSON(url,dataString,function(json){		var step3unitinfo="";		if(json.success==true){			var step3unitinfo=step3unitinfo+"<div id=step3unitinfo>";			for (i in json.rows) {				step3unitinfo=step3unitinfo+json.rows[i]['unit']+"<br>";				//step3unitinfo=step3unitinfo+json.rows[i]['size']+"<br>";				step3unitinfo=step3unitinfo+json.rows[i]['description']+"<br>";				//step3unitinfo=step3unitinfo+json.rows[i]['monthly_rent']+"<br>";				//step3unitinfo=step3unitinfo+json.rows[i]['details']+"<br>";			}			var step3unitinfo=step3unitinfo+"</div><br>";		}		var step3content=step3content+step3unitinfo;		$('#step3div').append(step3unitinfo);		step3form="<div id=step3formdiv>";		step3form=step3form+"<form id=step3form action='process_form.php'>";		step3form=step3form+"<table>";		step3form=step3form+"<tr>";		step3form=step3form+"<td class=formlabel>";		step3form=step3form+"First Name:";		step3form=step3form+"</td>";		step3form=step3form+"<td>";		step3form=step3form+"<input type=text name=first_name>";		step3form=step3form+"</td>";		step3form=step3form+"</tr>";		step3form=step3form+"<tr>";		step3form=step3form+"<td class=formlabel>";		step3form=step3form+"Last Name:";		step3form=step3form+"</td>";		step3form=step3form+"<td>";		step3form=step3form+"<input type=text name=last_name>";		step3form=step3form+"</td>";		step3form=step3form+"</tr>";		step3form=step3form+"<tr>";		step3form=step3form+"<td class=formlabel>";		step3form=step3form+"Rental Start Date:";		step3form=step3form+"</td>";		step3form=step3form+"<td>";		step3form=step3form+"<input type=text name=start_date>";		step3form=step3form+"</td>";		step3form=step3form+"</tr>";		step3form=step3form+"<tr>";		step3form=step3form+"<td class=formlabel>";		step3form=step3form+"Email:";		step3form=step3form+"</td>";		step3form=step3form+"<td>";		step3form=step3form+"<input type=text name=email>";		step3form=step3form+"</td>";		step3form=step3form+"</tr>";		step3form=step3form+"<tr>";		step3form=step3form+"<td class=formlabel>";		step3form=step3form+"Phone:";		step3form=step3form+"</td>";		step3form=step3form+"<td>";		step3form=step3form+"<input type=text name=phone_number>";		step3form=step3form+"</td>";		step3form=step3form+"</tr>";		step3form=step3form+"<tr>";		step3form=step3form+"<td>";		step3form=step3form+"&nbsp;";		step3form=step3form+"</td>";		step3form=step3form+"<td class=formsubmit align=center>";		step3form=step3form+"<img class='step3formsubmit' src='images/buttons/reserve_unit_now_button.png' onclick='submitform();'>";		step3form=step3form+"</td>";		step3form=step3form+"</tr>";		step3form=step3form+"</table>";		var unitinfo=$('#step3businfo').html();		unitinfo=unitinfo+"<br>"+$('#step3unitinfo').html();		step3form=step3form+"<input type='hidden' name=unitinfo value='"+unitinfo+"'>";		step3form=step3form+"</form>";		step3form=step3form+"</div>";		$('#step3div').append(step3form);	});}function submitform(){	$('#step3form').submit();}// Removes the overlays from the map, but keeps them in the arrayfunction clearOverlays() {  if (markersArray) {    for (i in markersArray) {      markersArray[i].setMap(null);    }  }}// Shows any overlays currently in the arrayfunction showOverlays() {  if (markersArray) {    for (i in markersArray) {      markersArray[i].setMap(map);    }  }}// Deletes all markers in the array by removing references to themfunction deleteOverlays() {  if (markersArray) {    for (i in markersArray) {      markersArray[i].setMap(null);    }    markersArray.length = 0;  }}function redirect_to_full_map(){	var params=$("#searchcritera").val();	var url='full_map.php?params='+params; 	document.location = url;}function get_params(){	var params=$("#searchcritera").val();	load_full_map(params);}function select_tab(tab){	switch(tab){		case 0:			$('#tabs').tabs("enable",0);			$('#tabs').tabs("select",0); // select first tab 'Step 1'			$('#tabs').tabs("disable",1);			$('#tabs').tabs("disable",2);			$("#select_storage_unit").hide();			$("#select_unit_size").hide();			$("#step_1_left_column").show();			$("#step_1_right_column").show();			$("#content").height('870');			$('#locations_link').css({'color':'black'});		break;		case 1:			$('#tabs').tabs("enable",1);			$('#tabs').tabs("select",1); // select second tab 'Step 2'			//$('#tabs').tabs("disable",0);			$('#tabs').tabs("disable",2);			$("#select_storage_unit").show();			$("#select_unit_size").show();			$("#step_1_right_column").hide(); 			$("#content").height('1400'); // resize content to accomdate accordion			$('#locations_link').css({'color':'#BE2226'});		break;		case 2:			$('#tabs').tabs("enable",2);			$('#tabs').tabs("select",2); // select third tab 'Step 3'			//$('#tabs').tabs("disable",0);			//$('#tabs').tabs("disable",1);			$("#step_1_right_column").hide();		break;	}}function setup_mouseover(){	$('#menu_locations').mouseover(function(){		$('#menu_locations').css({ backgroundImage : "url(images/locations_red.png)" });	});	$('#menu_locations').mouseout(function(){		$('#menu_locations').css({ backgroundImage : "url(images/locations_blue.png)" });	});	$('#menu_about_storage').mouseover(function(){		$('#menu_about_storage').css({ backgroundImage : "url(images/about_storage_red.png)" });	});	$('#menu_about_storage').mouseout(function(){		$('#menu_about_storage').css({ backgroundImage : "url(images/about_storage_blue.png)" });	});	$('#menu_special_offers').mouseover(function(){		$('#menu_special_offers').css({ backgroundImage : "url(images/special_offers_red.png)" });	});	$('#menu_special_offers').mouseout(function(){		$('#menu_special_offers').css({ backgroundImage : "url(images/special_offers_blue.png)" });	});	$('#menu_special_offers').mouseover(function(){		$('#menu_special_offers').css({ backgroundImage : "url(images/special_offers_red.png)" });	});	$('#menu_special_offers').mouseout(function(){		$('#menu_special_offers').css({ backgroundImage : "url(images/special_offers_blue.png)" });	});	$('#menu_packing_supplies').mouseover(function(){		$('#menu_packing_supplies').css({ backgroundImage : "url(images/packing_supplies_red.png)" });	});	$('#menu_packing_supplies').mouseout(function(){		$('#menu_packing_supplies').css({ backgroundImage : "url(images/packing_supplies_blue.png)" });	});	$('#menu_about_us').mouseover(function(){		$('#menu_about_us').css({ backgroundImage : "url(images/about_us_red.png)" });	});	$('#menu_about_us').mouseout(function(){		$('#menu_about_us').css({ backgroundImage : "url(images/about_us_blue.png)" });	});	$('#learn_more_button_1').mouseover(function(){		$('#learn_more_button_1').css({ backgroundImage : "url(images/learn_more_red.png)" });	});	$('#learn_more_button_1').mouseout(function(){		$('#learn_more_button_1').css({ backgroundImage : "url(images/learn_more_blue.png)" });	});	$('#learn_more_button_2').mouseover(function(){		$('#learn_more_button_2').css({ backgroundImage : "url(images/learn_more_red.png)" });	});	$('#learn_more_button_2').mouseout(function(){		$('#learn_more_button_2').css({ backgroundImage : "url(images/learn_more_blue.png)" });	});	$('#tab1').mouseover(function(){ 		$('#tab1').css({ backgroundImage : "url(images/tab_step_1_red.png)" });	});	$('#tab1').mouseout(function(){		$('#tab1').css({ backgroundImage : "url(images/tab_step_1_blue.png)" });	});	$('#tab2').mouseover(function(){ 		$('#tab2').css({ backgroundImage : "url(images/tab_step_2_red.png)" });	});	$('#tab2').mouseout(function(){		$('#tab2').css({ backgroundImage : "url(images/tab_step_2_blue.png)" });	});	$('#tab3').mouseover(function(){ 		$('#tab3').css({ backgroundImage : "url(images/tab_step_3_red.png)" });	});	$('#tab3').mouseout(function(){		$('#tab3').css({ backgroundImage : "url(images/tab_step_3_blue.png)" });	});}
