/* Design & Code (c) Empire Group, Inc. */

/* Behaviour Rules */
var myrules = {
	'#wrapper #redbox' : function(el){
		el.onclick = function(){
			window.location='index.html';
		}
	},
	'#wrapper #title' : function(el){
		el.onclick = function(){
			window.location='index.html';
		}
	},
	'#wrapper .i1' : function(el){
		el.onmouseover = function(){
			if($('bigimage')&&($('bigimage').innerHTML.indexOf("i1b.html")==-1)){
				function app(){
					$('bigimage').innerHTML = "<img src='/img/p_header_i1b.jpg' alt='Jess Alway, Inc.' width='675' height='354' />";
					Effect.Appear('bigimage', {duration: 0.1});
				}
				Effect.Fade('bigimage', {duration: 0.1, afterFinish:app});
				
			}
		}
	},
	'#wrapper .i2' : function(el){
		el.onmouseover = function(){
			if($('bigimage')&&($('bigimage').innerHTML.indexOf("i2b.html")==-1)){
				function app(){
					$('bigimage').innerHTML = "<img src='/img/p_header_i2b.jpg' alt='Jess Alway, Inc.' width='675' height='354' />";
					Effect.Appear('bigimage', {duration: 0.1});
				}
				Effect.Fade('bigimage', {duration: 0.1, afterFinish:app});			}
		}
	},
	'#wrapper .i3' : function(el){
		el.onmouseover = function(){
			if($('bigimage')&&($('bigimage').innerHTML.indexOf("i3b.html")==-1)){
				function app(){
					$('bigimage').innerHTML = "<img src='/img/p_header_i3b.jpg' alt='Jess Alway, Inc.' width='675' height='354' />";
					Effect.Appear('bigimage', {duration: 0.1});
				}
				Effect.Fade('bigimage', {duration: 0.1, afterFinish:app});			}
		}
	},
	'#wrapper .i4' : function(el){
		el.onmouseover = function(){
			if($('bigimage')&&($('bigimage').innerHTML.indexOf("i4b.html")==-1)){
				function app(){
					$('bigimage').innerHTML = "<img src='/img/p_header_i4b.jpg' alt='Jess Alway, Inc.' width='675' height='354' />";
					Effect.Appear('bigimage', {duration: 0.1});
				}
				Effect.Fade('bigimage', {duration: 0.1, afterFinish:app});			}
		}
	},
	'#wrapper .i5' : function(el){
		el.onmouseover = function(){
			if($('bigimage')&&($('bigimage').innerHTML.indexOf("i5b.html")==-1)){
				function app(){
					$('bigimage').innerHTML = "<img src='img/p_header_i5b.jpg' alt='Jess Alway, Inc.' width='675' height='354' />";
					Effect.Appear('bigimage', {duration: 0.1});
				}
				Effect.Fade('bigimage', {duration: 0.1, afterFinish:app});			}
		}
	}
};
Behaviour.register(myrules);


/* Plat Map functions */

togglePlat = function(num){
	lots = 19;
	function appvis(){
		if(!$("lot"+num).visible()){
			Effect.Appear("lot"+num, {duration:0.3});
		}
	}
	for(i=0;i<=lots;i++){
		if($('lot'+i)&&(i!=num)){
			if($("lot"+i).visible()){
				Effect.Fade('lot'+i, {duration:0.5, afterFinish:appvis});
			}
		}
	}
}
function openPictureWindow_Fever(imageType,imageName,imageWidth,imageHeight,alt,posLeft,posTop) {  // v4.01
	newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",scrollbars=no,left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
	if (imageType == "swf"){
	newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
	newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\">');
	newWindow.document.write('</embed></object>');	}else{
	newWindow.document.write('<img src=\"'+imageName+'\" alt=\"'+alt+'\">'); 	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

/* sIFR */
if(typeof sIFR == "function"){
	sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"/swf/californian.swf", sColor:"#7A5D4A", sLinkColor:"#7A5D4A", sBgColor:"#FFFFFF", sHoverColor:"#7A5D4A", sWmode:"transparent", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
	
	sIFR.replaceElement(named({sSelector:"h2", sFlashSrc:"/swf/californian_bold.swf", sColor:"#7A5D4A", sLinkColor:"#7A5D4A", sBgColor:"#FFFFFF", sHoverColor:"#7A5D4A", sWmode:"transparent", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));

}

/* Preload images for Homepage */   	
pic1= new Image(675,354);
pic1.src="img/p_header_i1b.jpg"; 
pic2= new Image(675,354);
pic2.src="img/p_header_i1b.jpg"; 
pic3= new Image(675,354);
pic3.src="img/p_header_i1b.jpg"; 
pic4= new Image(675,354);
pic4.src="img/p_header_i1b.jpg"; 
pic5= new Image(675,354);
pic5.src="img/p_header_i1b.jpg"; 


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3){
  	if ($(args[i])) {
  	  obj = $(args[i]); 
  		v=args[i+2];
    	if (obj.display) { 
    		obj=obj.display; 
    		v=(v=='show')?'block':(v=='hide')?'none':v; 
    	}
    	if(v=="block"){
    		Element.show(obj);
    	}else{
    		Element.hide(obj);
    	}
    }
  }
	return false;
}