var barleft = null;var barwidth = null;var returnleft = null;var returnwidth = null;var frame = null;var new_frame = null;var start_frame = null;var end_frame = null;var last_frame = null;var switch_image = null;var header_color = null;var text_location = null;var direction = "out";var weather_direction = "out";var newCity = null;var oldCity = null;var buttonNum = null;var google_map = null;var transition = null;var pageTitle = null;var pe = null;var galleryStatus = null;var next_img = null;var next_img_str = null;var newimg = null;var oldimg = null;var newimg_src = null;var gal = null;var map_start_frame = null;var map_end_frame = null;var map_delay = null;// THIS SECTION IS USED FOR THE GALLERY TIMER //PeriodicalExecuter.prototype.registerCallback = function() {    this.intervalID = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);}PeriodicalExecuter.prototype.stop = function() {    clearInterval(this.intervalID);}// END OF THIS SECTION //function ChangePhoto (oldimg, newimg) {   document.images[oldimg].src=newimg;}function overBar(barleft, barwidth){	new Effect.Morph(		"navline_over",		{style: 'left:' +barleft+'px; width: ' +barwidth+'px;', duration: 0.4});}function returnBar(returnleft, returnwidth){	new Effect.Morph(		"navline_over",		{style: 'left:' +returnleft+'px; width: ' +returnwidth+'px;', duration: 0.4});}function rickrolled(){	new Effect.Morph(	"rickroll_div",	{style: 'top: -150px; height: 120%; width: 100%; z-index:1000; background: #ccc;', duration: 0.2});}// GALLERY SECTION //function open_gallery(start_frame, end_frame) {	new Effect.Appear('gallery_container');	transition = 1;	frame = 1;	new_frame = frame;	last_frame = end_frame;	start_slideshow(start_frame, end_frame);	}function fadeOld() { // THIS FUNCTION IS NOT USED ANYMORE //	Effect.Fade('image' + (frame -1));}function ChangeImage(frame, start_frame, end_frame) {	return (function() {		Effect.Fade('image' + frame);		if (frame == end_frame) { 			pe.stop();			new Effect.Fade('gallery_container');			start_frame = 1;			frame = 1;			new_frame = 1;		} else {			frame = frame + 1;			new_frame = frame;			last_frame = end_frame;		}		switch(transition) {				case 1:				Effect.Appear('image' + frame); 				transition = 2;				break;								case 2:				Effect.BlindDown('image' + frame);				transition = 1;				break;		}	})}function start_slideshow(start_frame, end_frame) {	frame = 1;	if (pe) pe.stop();	pe = new PeriodicalExecuter(ChangeImage(frame, start_frame, end_frame), 5);}function pauseGallery() {	if (galleryStatus == "paused") {		galleryStatus = "playing";		if (pe) {			pe.stop();		}		pe = new PeriodicalExecuter(ChangeImage(new_frame, new_frame, last_frame), 5);		document.getElementById('gallery_instructions').innerHTML = 'Click image to pause gallery';	} else {		galleryStatus = "paused";		pe.stop();		document.getElementById('gallery_instructions').innerHTML = ' &nbsp; Click image to play gallery';	}}// SLIDER SECTION //function slide_content(text_location) {	if ((pageTitle == "location") && (google_map == "no")) {		google_map = "yes";		document.getElementById('location_link').style.display="none";		document.getElementById('google_link').style.display="inline";	}	else if ((pageTitle == "location") && (google_map == "yes")) {		document.getElementById('location_link').style.display="inline";		document.getElementById('google_link').style.display="none";	}	if (weather_direction == "in") {		slide_weather(text_location);	}	if (direction == "out") {		direction = "in";		if (text_location == "map") {			google_map = "yes";		} else {			document.getElementById('slider_button').innerHTML = 'Hide';		}		Effect.Appear('slider_bg');		if ((text_location == "right") || (text_location == "map")) {			Effect.MoveBy('slider_container_outer', 0, -689);			document.getElementById('slider_container').style.zIndex=10;			document.getElementById('slider_container_outer').style.zIndex=10;					} else {			Effect.MoveBy('slider_container_outer', 0, 689);						document.getElementById('slider_container').style.zIndex=1500;						document.getElementById('slider_container_outer').style.zIndex=1500;		}	} else {		direction = "out";		if (text_location == "map") {			document.getElementById('slider_button').innerHTML = 'View Location Map';			google_map = "yes";		} else {			document.getElementById('slider_button').innerHTML = 'View';		}		Effect.Fade('slider_bg');		if ((text_location == "right") || (text_location == "map")) {			Effect.MoveBy('slider_container_outer', 0, 689);									document.getElementById('slider_container').style.zIndex=1500;									document.getElementById('slider_container_outer').style.zIndex=1500;		} else {			Effect.MoveBy('slider_container_outer', 0, -689);						document.getElementById('slider_container').style.zIndex=10;						document.getElementById('slider_container_outer').style.zIndex=10;		}	}}function slide_weather(text_location) {	if (direction == "in") {		slide_content(text_location);		}	if (weather_direction == "out") {		weather_direction = "in";		document.getElementById('weather_button').innerHTML = 'Hide';		Effect.Appear('weather_bg');		if (text_location == "right") {			Effect.MoveBy('weather_container', 0, -689);			document.getElementById('weather_frame_right').style.zIndex=15;		} else {			Effect.MoveBy('weather_container', 0, 689);			document.getElementById('weather_frame_left').style.zIndex=15;		}	} else {		weather_direction = "out";		document.getElementById('weather_button').innerHTML = 'View';		Effect.Fade('weather_bg');		if (text_location == "right") {			Effect.MoveBy('weather_container', 0, 689);			document.getElementById('weather_frame_right').style.zIndex=10;		} else {			Effect.MoveBy('weather_container', 0, -689);			document.getElementById('weather_frame_left').style.zIndex=10;		}	}}function changeCity(newCity, oldCity, buttonNum) {	document.getElementById('cityButton' + buttonNum).innerHTML = oldCity;}function confirmSubmit() {	Effect.Fade('slider_content');	Effect.Appear('slider_confirmation');}function swapRealestate() {	Effect.Fade('real_estate_main');	Effect.Fade('more_button');	Effect.Appear('real_estate_page');}//THIS SECTION IS FOR THE REAL ESTATE SLIDESHOW //function StartRealEstateShow(start_frame, end_frame, delay) {	map_start_frame = start_frame;	map_end_frame = end_frame;	map_delay = delay;	setTimeout(SwapImage(start_frame,start_frame,end_frame, delay), 8000);}/*function ChangeMainImage(thumbnum, thumbcount) {	if(oldimg != ('home_image' + thumbnum)) {//		clearTimeout(repeatSwapImage);		newimg = 'home_image' + thumbnum;//		alert('oldimg=' + oldimg + ' newimg=' + newimg);		Effect.Appear(newimg, 5);		Effect.Fade(oldimg);		oldimg = newimg;//		SwapImage(Number(thumbnum, 1, thumbcount, 3000));		//repeatSwapImage = setTimeout(SwapImage(Number(thumbnum), 1, thumbcount, 3000), 5000);	}}*/// Rewrote ChangeMainImage function to prevent auto-slideshow // and to support proper image swapping. (INE 10/12/2011)function ChangeMainImage(thumbnum, thumbcount) {	if(oldimg != null) {		Effect.Fade(oldimg);//$(oldimg).hide();	}	newimg = 'home_image'+thumbnum;	//alert('oldimg=' + oldimg + ', newimg=' + newimg);	Effect.Appear(newimg);//$(newimg).show();	oldimg = newimg;}						function SwapImage(frame, start_frame, end_frame, delay) {	return (function() {		Effect.Fade('home_image' + frame);		if (frame == end_frame) {			frame = start_frame;		} else {			frame = frame + 1;		}		for (t = start_frame; t <= end_frame; t++) {			lastthumbID = String('thumblink' + t);			$(lastthumbID).blur();		}		var thumbID = String('thumblink' + frame);		$(thumbID).focus();		oldimg = "home_image" + frame;		setTimeout(Effect.Appear(oldimg), 5);//		repeatSwapImage = setTimeout(SwapImage(frame, start_frame, end_frame, delay), delay + 850);	})}function NewImage(newimg, newimg_src) {	document.images[newimg].src = newimg_src;}function FadeImage(oldimg, newimg, newimg_src) {	new Effect.Opacity(oldimg, {duration:1, from:1.0, to:0, afterFinish: function() { SwapImage(oldimg, newimg_src) }});}function OpenMap() {	new Effect.Appear("map_frame");	clearTimeout(repeatSwapImage);}function CloseMap() {	new Effect.Fade("map_frame");	repeatSwapImage = setTimeout(SwapImage(1, 1, end_frame, delay), delay + 850);}/*===================================*/// FORM HANDLER AND VERIFICATION STUFF/*===================================*/function sndForm(frm) {		var url = 'includes/cf_process.php';	var pars = Form.serialize(frm);	var myAjax = new Ajax.Request( 		url, {				method: 'post', 				parameters: pars, 				//onLoading: function() {				//				$('cload').show();				//			}, 				onSuccess: function(transport) {					if (transport.responseText.match(/OK/)) {							var Holder = $('cform');							// Set the method in the Ajax Options below to be 'get' rather than the default of 'post'							// which was causing an HTTP 405 error to occur. - INE 3/7/2011 12:15AM							new Ajax.Updater(Holder, 'thankyou.html', {evalScripts:true, method:'get'});					} else {						alert(transport.responseText);						return false;					}				}			 } 	);}
