// Drop down menu code
/*-------------------------------------------------
************* Parameter Settings ******************
---------------------------------------------------*/
function imenus_data0(){
this.unlock = "wkvmcnh"
this.enable_visual_design_mode = false
this.main_is_horizontal = true
this.menu_showhide_delay = 150
 /*---------------------------------------------
   Expand Icon Images
   ---------------------------------------------*/
	this.main_expand_image = "/images/spacer.gif"
	this.main_expand_image_hover = "/images/spacer.gif"
	this.main_expand_image_width = "1"
	this.main_expand_image_height = "1"
	this.main_expand_image_offx = "0"
	this.main_expand_image_offy = "0"

	this.sub_expand_image = "/images/spacer.gif"
	this.sub_expand_image_hover = "/images/spacer.gif"
	this.sub_expand_image_width = "1"
	this.sub_expand_image_height = "1"
	this.sub_expand_image_offx = "undefined"
	this.sub_expand_image_offy = "undefined"

   /*---------------------------------------------
   Global Menu Styles
   ---------------------------------------------*/

	//Main Menu
	this.main_container_styles = "background-color:#fff; border-style:solid; border-color:#fff; border-width:1px; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:0px; "
	this.main_item_styles = "color:#fff; text-align: center; font-family:Arial; font-size: 10px; font-weight:bold; text-decoration:none; padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; border-style:none; border-color:#000000; border-width:0px; "
	this.main_item_hover_styles = "background-color:#5a477b; color:#e0e0e0; "
	this.main_item_active_styles = ""

	//Sub Menu
	this.subs_container_styles = "border-style:solid; border-width:1px; padding-top:5px; padding-right:5px; padding-bottom:5px; padding-left:5px;"
	this.subs_item_styles = "color:#fff; text-align:left; font-size:11px; font-weight:normal; text-decoration:none; padding-top:2px; padding-right:5px; padding-bottom:2px; padding-left:5px; border-style:none; border-color:#fff; border-width:1px; "
	this.subs_item_hover_styles = "background-color:#e6d7e6; color:#333; "
	this.subs_item_active_styles = ""
}


// Formhandler dropdown function
function formHandler(){
var URL = document.nav.site.options[document.nav.site.selectedIndex].value;
window.location.href = URL;
}

function popupList(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=435,top=50,left=50');");
}

function popupConvertor(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=320,height=550,top=50,left=50');");
}

function popupFavourites(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=400,height=435,top=50,left=50');");
}

function popupView(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=1,width=385,height=400,top=50,left=50');");
}

function popupTour(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=450,top=50,left=50');");
}

function popupWindow(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=750,height=500,top=50,left=50');");
}

function popupAgentDirect(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=650,height=600,top=50,left=50');");
}

function popupTellafriend(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=400,height=435,top=50,left=50');");
}

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header

function printWindow(){
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}


// Initialise Superfish Main Navigation
$(function() {
	// Main navigation
	$("#navMain").superfish({
		speed:'fast',
		delay: 1, 
		autoArrows: false
	});

	$('ul#navMain li').hover(function(){
	    $(this).find('a:first').addClass('active');
	},
	function(){
	    $(this).find('a:first').removeClass('active');
	});
});


// Price format on property page
function addCommas(nStr)
{
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

