
var cIconOceanFront = "../images/gicon_red.png";
var cIconStepsToSand = "../images/gicon_green.png";
var cIconYearly = "../images/gicon_pink.png";
var cIconOffice = "../images/gicon_blue.png";

var defaultdescription = "";

function goTo(strURL){
	document.location = strURL;
}

function describe(strText){
	document.getElementById('LinkDescription').innerText = strText;
}

function clearDescribe(){
	document.getElementById('LinkDescription').innerText = "";
}
	
// close the window
function closeMe(){
	window.close();
}
	
function redirectParent(url,closeWin){
	self.opener.top.location.href = url;
	if (closeWin) closeMe();
}

function openTC(){ 
	var h = 350;
	var w = 550;
	var strURL = "/Reservations/TermsConditions.asp";
	 var LeftPosition, TopPosition, settings, newWin; 
	 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
	 TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
	 settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,toolbar=no,status=no,location=no,resizable=no'; 
	 newWin = window.open(strURL,'VillaRntls',settings);
	 newWin.focus();
	 }
function openWin(strURL,h,w){ 
	 var LeftPosition, TopPosition, settings, newWin; 
	 LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; 
	 TopPosition = (screen.height) ? (screen.height-h)/2 : 0; 
	 settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=no,toolbar=no,status=no,location=no,resizable=no'; 
	 newWin = window.open(strURL,'VillaRntls',settings);
	 newWin.focus();
 } 

function checkDateSync(sDate, eDate){
	var sdt = new Date(sDate);
	var edt = new Date(eDate);
	if (sdt.getFullYear() < 2000) sdt.setFullYear(sdt.getFullYear() + 100);
	if (edt.getFullYear() < 2000) edt.setFullYear(edt.getFullYear() + 100);
	return (sdt <= edt);		
}

function formatCurrency(num) {
	num = num.toString().replace(/\$|\,/g,'');
	if(isNaN(num))
		num = "0";
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num%100;
	num = Math.floor(num/100).toString();
	if(cents<10)
		cents = "0" + cents;
	for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
		num = num.substring(0,num.length-(4*i+3))+','+
		num.substring(num.length-(4*i+3));
	//return (((sign)?'':'-') + '$' + num + '.' + cents);
	return (((sign)?'':'-') + '$' + num);
}