folder = new String('phuket');
destination = new String('Phuket');

function openWindow(myLink,windowName)
{
  if(! window.focus)return;
  var myWin=window.open("",windowName,"height=350,width=316,dependent=yes,scrollbars=yes,resizable");
  myWin.focus();
  myLink.target=windowName;
}
function openLargeWin(myLink,windowName)
{
  if(! window.focus) return;
  var myWin=window.open("",windowName,"height=400,width=600,dependent=yes,scrollbars=yes,resizable");
  myWin.focus();
  myLink.target=windowName;
}
function submitMe(formName) 
{
	var form = document.forms[formName];
	ratecount = new Number(form.rateloops.value);
	allsel = new Number(0); 
	cfactor = new Number(0);  gap = new Number(0);
	
	for (var i=0;i<ratecount ;i++ ) 
	{
		if (form.elements["book_"+i].checked) 
		{ 
			if (allsel==0)		cfactor=i;
			allsel++;	
			if ((i-allsel+1)!=cfactor)	gap++;

		} 
		
	}
	
	minstay = new Number(form.minNight.value);
	
	if (allsel==0) 
	{
		alert(index_alert[0]);
		return false;
	} 
	if (allsel > 1 && form.dayuse.value == 1)
	{
		alert(index_alert[1]);
		return false;
	}
	if (allsel<minstay) 
	{
		var string = index_alert[2].replace("{minstay}",minstay);
		alert(string);
		return false;
	} 
	if (gap>0)	
	{
		alert(index_alert[3]);
		return false;
	}
	promo = new Number(form.lpromoNight.value);
//	if (promo==allsel) 	
//	{
//		var take=confirm("You are entitled for a promotional special discount.  To take this offer, press CANCEL and select another night.  To ignore it and continue with only "+allsel+" night(s) stay press OK");
//		if (!take)	return false;
//	}

	// GTA
	// pageTracker._linkByPost(form)
	// /GTA

	applyRule = CheckRule(form);
	if (applyRule == 1)
	{
		alert(index_alert[4]);
		return false;
	}
	else if (applyRule == 2)
	{
		alert(index_alert[5]);
		return false;	
	}
	
	form.submit();
}
function setCookie (cookieName, cookieValue, expires, path, domain, secure) 
{
  document.cookie = 
    escape(cookieName) + '=' + escape(cookieValue) 
    + (expires ? '; EXPIRES=' + expires.toGMTString() : '')
    + (path ? '; PATH=' + path : '')
    + (domain ? '; DOMAIN=' + domain : '')
    + (secure ? '; SECURE' : '');
}

function getCookie (cookieName) 
{
  var cookieValue = null;
  var posName = document.cookie.indexOf(escape(cookieName) + '=');
  if (posName != -1) 
  {
    var posValue = posName + (escape(cookieName) + '=').length;
    var endPos = document.cookie.indexOf(';', posValue);
    if (endPos != -1)
      cookieValue = unescape(document.cookie.substring(posValue, endPos));
    else
      cookieValue = unescape(document.cookie.substring(posValue));
  }
  return cookieValue;
}

function showbox(boxname)
{
	leftpos = new Number(xMousePos+12);
	toppos = new Number(yMousePos+12);
	elebox = document.getElementById(boxname);
	if (elebox)
	{
		if (leftpos>600)
			leftpos = leftpos-342;


		elebox.style.left=leftpos;
		elebox.style.top=toppos;
		elebox.style.display='block'
		
	}
}
function hidebox(boxname)
{
	elebox = document.getElementById(boxname);
	if (elebox)
	{
		elebox.style.display = 'none';
	}
}
function bookmarkThisPage()
{
 if (!((navigator.appName).indexOf("Netscape") == -1)) {
  alert("Please press ctrl-D - thank you!")
 } else if (!((navigator.appName).indexOf("Microsoft") == -1)) {
  window.external.AddFavorite(location.href, document.title)
 } else if (window.opera && window.print) {
  return true
 }
}