function imgOn(imgName) {
    document[imgName].src = eval(imgName + "_roll.src");
}

function imgOff(imgName) {
    document[imgName].src = eval(imgName + "_norm.src");
}

function disPlay(addy, winName, winWidth, winHeight) {
	if (winWidth == null) winWidth = 311;
	if (winHeight == null) winHeight = 311;
	if (winName == null) winName = 'unknown';
	var newWindow = window.open(addy, winName, 'width=' + winWidth + ',height=' + winHeight + ',toolbar=0,alwaysRaised=1,alwaysLowered=0,scrollbars=no,resizable=no,menubar=no,status=no,statusbar=0,directories=no,location=no,top=0,left=0');
}

function disPlayFP(addy, winName, winWidth, winHeight) {
	if (winWidth == null) winWidth = 800;
	if (winHeight == null) winHeight = 800;
	if (winName == null) winName = 'unknown';
	winHeight = parseInt(winHeight) + 24; // print btn 
	if (winHeight > (screen.height-70)){
		winHeight = screen.height-70;
	}
	window.console && console.log("Creating new window width: %i - height: %i",winWidth,winHeight);
	var newWindow = window.open(addy, winName, 'width=' + winWidth + ',height=' + winHeight + ',toolbar=0,alwaysRaised=1,alwaysLowered=0,scrollbars=yes,resizable=no,menubar=no,status=no,statusbar=0,directories=no,location=no,top=0,left=0');
}

function disPlayImg(addy, winName, winWidth, winHeight) {
	if (winWidth == null) winWidth = 311;
	if (winHeight == null) winHeight = 311;
	if (winName == null) winName = 'unknown';
	var newWindow = window.open(addy, winName, 'width=' + winWidth + ',height=' + winHeight + ',toolbar=0,alwaysRaised=1,alwaysLowered=0,scrollbars=yes,resizable=no,menubar=no,status=no,statusbar=0,directories=no,location=no,top=0,left=0');
}

function wrapGuide(hoodID, l, t){
	w = document.body.clientWidth;
	h = document.body.clientHeight;

	if((document.getElementById)&&(document.getElementById(hoodID)!=null)){
	  var myElement = document.getElementById(hoodID);
		if(myElement.style.visibility=='hidden'||!myElement.style.visibility){
			var offsX = (w-715)/2;
			var newX = l+offsX;
			myElement.style.left = newX;
			myElement.style.visibility='visible';
		}else{
			myElement.style.visibility='hidden';
		}
	}else{
	  // DOM1 not supported
	}
}

function wrapPropInfo(propID){
	w = document.body.clientWidth;
	h = document.body.clientHeight;
	//alert(w+' x '+h);
	
	
	if((document.getElementById)&&(document.getElementById(propID)!=null)){
	  var myElement = document.getElementById(propID);
		if(myElement.style.visibility=='hidden'||!myElement.style.visibility){
			myElement.style.visibility='visible';
		}else{
			myElement.style.visibility='hidden';
		}
	}else{
	  // DOM1 not supported
	}
	
	
	// wrapPropInfo
	
	//var hood = document.getElementById(hoodID);
	//activateMenu(menuID, newX, origY);
	//alert("hoodID='"+hoodID+"'");
	//hood.visibility = hoodGo;
	
}

function popup(theURL,winname,features) {
    window.open(theURL,winname,features);
}

var navSelected = false;
$(document).ready(function(){
    $('#sq').focusin(function(){
        if($(this).val() == "Enter web id, address, or agents last name"){
            $(this).val("");
        }
    }).focusout(function(){
        if($(this).val() == ""){
            $(this).val("Enter web id, address, or agents last name");
        }
    });
    $("#navigation .properties, #navigation .guide").hover(function(){
        if($(this).hasClass('active')){
           navSelected = true; 
        }else{
           $(this).addClass('active');
        }
        $(this).children('ul').show();
    },function(){
        if(!navSelected){
            $(this).removeClass('active');
        }
        $(this).children('ul').hide();
    });
});

