function ShowToolTip(elementid,status,text) {

	if (status == "on") {
		document.getElementById(elementid).style.backgroundColor = "#EBF4FF";
		document.getElementById('ToolTip').style.visibility="visible";
		document.getElementById('ToolTip').style.backgroundColor = "#EBF4FF";
		document.getElementById('ToolTip').innerHTML = text;
	} else {
		document.getElementById(elementid).style.backgroundColor = "#FFFFFF";
		document.getElementById('ToolTip').style.visibility="hidden";
		document.getElementById('ToolTip').style.backgroundColor = "#FFFFFF";
		document.getElementById('ToolTip').innerHTML = text;
	}
}

function PrintFriendly(propertyID) {
	PrintWindow = window.open('/property.php?propertyID=' + propertyID + '&pf=1' ,'PrintWindowName','width=700,height=500,toolbar=0,menubar=0,scrollbars=1,resizeable=1');
	PrintWindow.focus();
}

function ShowPlan(propertyID,width,height) {
	PlanWindow = window.open('/property.php?propertyID=' + propertyID + '&showplan=1' ,'PlanWindowName','width='+(width+25)+',height='+(height+50)+',toolbar=0,menubar=0,scrollbars=1,resizeable=1');
	PlanWindow.focus();
}

function AddFavorite(propertyID) {
	
	if (document.all) {
		w = document.body.clientWidth;
		h = document.body.clientHeight;
	} else if (document.layers) {
		w = window.innerWidth;
		h = window.innerHeight;
	}

	var popW = 300, popH = 200;
	var leftPos = (w-popW)/2;
	var topPos = (h-popH)/2;
	
	FavoriteWindow = window.open('/favorites.php?propertyID=' + propertyID ,'FavoriteWindowName','width=' + popW + ',height=' + popH + ',top=' + topPos + ',left=' + leftPos + ',toolbar=0,menubar=0,scrollbars=0,resizeable=1');
	FavoriteWindow.focus();
}

function ShowBig(fileID,width,height) {
	BigWindow = window.open('/property.php?fileID=' + fileID + '&showbig=1','BigWindowName','width='+(width+17)+',height=810,toolbar=0,menubar=0,scrollbars=0,resizeable=0');
	BigWindow.focus();
}

function SelectCurrency() {
	CurrencyWindow = window.open('/property.php?currencyselect=1','BigWindowName','width=300,height=200,toolbar=0,menubar=0,scrollbars=0,resizeable=0');
	CurrencyWindow.focus();
}

function SaveCurrency(object) {
	var selectedID = 0;
	for (var i = 0 ; i < object.selectedcurrency.length; i++) {
	    if (object.selectedcurrency[i].checked) {
    	   selectedID = object.selectedcurrency[i].value;
		}
	}
	var today = new Date();
	var expires = new Date(today.getTime() + (60000 * 60 * 24 * 356));
	Set_Cookie("UserSelectedCurrency",selectedID,expires,"/","");
	opener.location.reload();
	window.close();
}

function CloseFavoriteWindow() {
	opener.location.reload();
	window.close();
}