/* CHANGE CITIES FUNCTIONS */
function changeCity(zip, current_page) {
	$("changeCity_request").innerHTML = "";	
	var change_city_url = "/change_city.php";
	
	var query = "zipcode="+encodeURIComponent(zip)+"&currentpage="+encodeURIComponent(current_page);
	var jax = new Ajax.Request(change_city_url, {
		method:"post",
		parameters:query,
		onSuccess:function(qres) {
			$("changeCity_request").innerHTML = qres.responseText;
			$("changeCity_request").style.display = "block";
			autocomplete();
		} 
	});
}


function switch_city(city_state) {
	var query = "citystate="+ encodeURIComponent(city_state);
}


function closeChangeCities() {
		Effect.SlideUp("changeCity_request");
}
/* END CHANGE CITIES */




/* DRIVING DIRECTIONS FUNCTIONS */
function myDrivingDirections() {
	$("drivingDirections_request").innerHTML = "";
	var driving_url = "/driving_directions_prompt.php";
	var query = "from=none";
	var jax = new Ajax.Request(driving_url, {
			method:"post",
			parameters:query,
			onSuccess:function(qres) {
				$("drivingDirections_request").innerHTML = qres.responseText;
				$("drivingDirections_request").style.display = "block";
					$("start_address").value = current_address;
					$("city_start").value = current_city_name;
					$("zip_start").value = default_zipcode;
					$("state_start").value = current_state_name;
					Event.observe("start_address", "focus", checkStartAddressField);
					Event.observe("start_address", "blur", checkStartAddressFieldRevert);
					Event.observe("city_start", "focus", checkCityAddressField);
					Event.observe("city_start", "blur", checkCityAddressRevert);
					Event.observe("zip_start", "focus", checkZipcodeAddressField);
					Event.observe("zip_start", "blur", checkZipcodeAddressRevert);
				}
			});
} // END OF FUNCTION

function closeMyDrivingDirections() {
		Effect.SlideUp("drivingDirections_request");
}

function btnDrivingDirectionsClickWait() {
	var wait_wheel = "<table><tr><td><img src='http://citywaboo.com/index_images/progress_wheel.gif' border='0' /></td><td style='font-family:verdana,arail;font-size:12px;color:#333333;font-weight:bold;'>Please Wait...</td></tr></table>";
	$("td_drivingDirections_progress").innerHTML = wait_wheel;
}



// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below
/*
Pic[0] = '1.jpg'
Pic[1] = '2.jpg'
Pic[2] = '3.jpg'
Pic[3] = '4.jpg'
Pic[4] = '5.jpg'
*/
var t;
var j = 0;
var p = Pic.length;


function init_slideshow_images(piximages) {
	p = piximages.length;
	
	for(i=0; i<piximages.length; i++) {
		Pic[i] = piximages[i];	
	}
preload_profile_images();
runSlideShow(); // start slideshow
}

// =======================================
// do not edit anything below this line
// =======================================


var preLoad = new Array()

function preload_profile_images() {
	for (i = 0; i < p; i++){
	   preLoad[i] = new Image();
	   preLoad[i].src = Pic[i];
	}
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();      
   }
   document.images.SlideShow.src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed);
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~