crossfading=0;
var crossfadeOpen;
var crossfadeLast;
var googlemapRequest=0;

function crossFade(showDiv){
	if(!crossfadeOpen){
		if(document.getElementById('main_image_wrapper') && document.getElementById('main_image_wrapper').style.display!=='none'){
			crossfadeOpen = 'main_image_wrapper';
		}
		else {
			if(document.getElementById('blankdiv')){
				crossfadeOpen='blankdiv';
			}
			else {
				crossfadeOpen='google-map';
			}
		}
	}
	
	if(crossfadeOpen==showDiv){
		showDiv=crossfadeLast;
		return 1;
	}

	if(!document.getElementById(showDiv) || document.getElementById(showDiv).style.display=='none' || !showDiv){
		return 0;	
	}
	
	fadeTime = 1000;
	if(!crossfading){
		crossfading=1;
		setTimeout("crossfading=0;",fadeTime);
		if(document.getElementById(showDiv).style.visibility == 'hidden' || !document.getElementById(showDiv).style.visibility){
			var fader1 = new Fx.Style(crossfadeOpen,'opacity', {duration:fadeTime});
			fader1.start(1,0);
		
			var fader2 = new Fx.Style(showDiv,'opacity', {duration:fadeTime});
			fader2.start(0,1);
		}
		else {
			var fader1 = new Fx.Style(showDiv,'opacity', {duration:fadeTime});
			fader1.start(1,0);
		
			var fader2 = new Fx.Style(crossfadeOpen,'opacity', {duration:fadeTime});
			fader2.start(0,1);
		}
		crossfadeLast=crossfadeOpen;
		crossfadeOpen=showDiv;
	}
	return 1;
}
