

function addToFavorites()
{ if (window.external) { window.external.AddFavorite("http://www.tan-tar-a.com/","Tan-Tar-A Resort"); }
else  { alert("Sorry! Your browser doesn't support this function.\nPress Ctrl+D to add site to bookmark list."); } }


function popup(url, width, height, scrollable)
{ if(scrollable){scbars = 1;} else{scbars = 0;} var nomargin; if(scrollable == 2){ nomargin = true; scbars = 0; }
  if(url == "ecap"){ url="http://www.secure-res.com/emgr/csemail.asp?ID="+width; width=400; height = 455;}
  if(url == "srlogo"){ width = 445; height = 455; url="http://www.hotelwebsitedesign.com/secureres/srpopup/"}
  if(url == "stf"){ if(height==1){height=80;} if(!height){height=0;} url="http://www.secure-res.com/emgr/stf/sendpage.asp?pg="+location.href+"&id="+width; width = 560; height += 490;   }
  var wopt = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+ scbars +",resizable=0,width="+width+",height="+height+",top="+(screen.height/2-height/2)+",left="+(screen.width/2 - width/2)
  if(nomargin){ newwin=window.open("","",wopt);	newwin.document.write("<html><head><style>body{margin:0}</style></head><body><img src='"+ url +"'></body></html>");  }
  else { newwin=window.open(url,"popup",wopt); }			
  newwin.focus(); }


function generate_address( un, hn, sty, lnk, subline) 
{ var stycl = ""; var atsign = "&#64;"; var subject = "";
  var addr = un + atsign + hn;
  if(sty){stycl = " class=" + sty } if(subline){subject = "?Subject=" + subline } 
  if(!lnk){ var lnk = addr; } 
  document.write( "<" + "a " + stycl + " href='" + "mail" + "to:" + addr + subject +"'>" + lnk + "</a>");	}

var wmonths = ["Jan","Feb","Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; 

function do_opt(numopts,startnum,selnum)
{ if(!startnum && startnum != 0){startnum=1} 
  if(numopts == "mo"){ for (var xi=0; xi<wmonths.length; xi++) { document.write('<option value=' + (xi+1) + '>' + (wmonths[xi])); } }
  else { for (var xi=startnum; xi<=numopts; xi++) { sel=(selnum == xi)?" selected ":""; document.write('<option value=' + (xi) + sel + '>' + (xi) ); } }
}

var currdiv = "n_def";

function hotswap(div)
{ if(div != currdiv)
	{  	document.getElementById(currdiv).style.display = "none"; 
 		document.getElementById(div).style.display = "block";  
		currdiv = div; 		} 
}

function swaptitle(somediv)
{  ttitle = document.getElementById(somediv);
   var oheight = 27; 
   if (ttitle.innerHTML.length > 45) { oheight *= 2; }
   var so = new SWFObject("/flash/tantara_title.swf", "ftitle", 524, 55, "7");
   so.addVariable("t_text", ttitle.innerHTML + ttitle.style.width );
   so.addParam("wmode","transparent");
   so.write(ttitle); 
   ttitle.style.height = oheight;
   ttitle.style.overflow = "hidden"
}

function generate_leftbar()
{ imgs = new Array("leftbar_r1","leftbar_r2","leftbar_r3","leftbar_r4"); 
  var ran_num=Math.floor(Math.random()*imgs.length);
  document.getElementById('left_r').innerHTML = "<img src='/img/"+imgs[ran_num]+".jpg'>";
}




function addEvent(elm, evType, fn, useCapture)
{
	if (elm.addEventListener) {
		elm.addEventListener(evType, fn, useCapture);
		return true;	}
	else if (elm.attachEvent) {
		var r = elm.attachEvent('on' + evType, fn);
		return r;	}
	else {	elm['on' + evType] = fn;	}
}
function calStizuff()
{
            SetDefault();
			CheckPassedDates();
			SetPeople();
			//window.location.hash='Start1';
}
addEvent(window,'load',calStizuff,false);
