//-------------------------------//
//           website by          //
//    Still Water Interactive    //
//  http://www.still-water.com/  //
//-------------------------------//


//nav roll-over images variable declaration
var accooff = new Image();accooff.src = "images/navs/nv_acco_off.gif";
var amenoff = new Image();amenoff.src = "images/navs/nv_amen_off.gif";
var areaoff = new Image();areaoff.src = "images/navs/nv_area_off.gif";
var meetoff = new Image();meetoff.src = "images/navs/nv_meet_off.gif";
var reseoff = new Image();reseoff.src = "images/navs/nv_rese_off.gif";
var restoff = new Image();restoff.src = "images/navs/nv_rest_off.gif";
var specoff = new Image();specoff.src = "images/navs/nv_spec_off.gif";

var accoon = new Image();accoon.src = "images/navs/nv_acco_on.gif";
var amenon = new Image();amenon.src = "images/navs/nv_amen_on.gif";
var areaon = new Image();areaon.src = "images/navs/nv_area_on.gif";
var meeton = new Image();meeton.src = "images/navs/nv_meet_on.gif";
var reseon = new Image();reseon.src = "images/navs/nv_rese_on.gif";
var reston = new Image();reston.src = "images/navs/nv_rest_on.gif";
var specon = new Image();specon.src = "images/navs/nv_spec_on.gif";


//open new window
function global_winopen(url, larkspur, width, height, xoffset, yoffset)
{
 // default offsets
 
 var default_xoffset = 300;
 var default_yoffset = 200;
 
 // do we have offset parameters?
 
 xoffset = (xoffset == null) ? default_xoffset : xoffset;
 yoffset = (yoffset == null) ? default_yoffset : yoffset;
 
 // make sure that at a minimum the url is present else do nothing
 
 if (url != null)
 {
  // set the window properties
  
  var winproperties = "toolbar=yes,location=yes,status=no,directories=no,width=" + width + ",height=" + height + ",scrollbars=yes,resizable=yes,left=" + 300 + ",top=" + 100;
  
  // open the window
 
  window.open(url, larkspur, winproperties);
 }
}


//reseravation initializer
var winOffsetX = 0;
var winOffsetY = 0;
var winX = 0;
var winY = 0;

var isOpera = (navigator.userAgent.indexOf("Opera")!=-1) ? true : false;
var isOpera5 = (navigator.appVersion.indexOf("MSIE 5")!=-1 && navigator.userAgent.indexOf("Opera 5")!=-1) ? true : false;
var isOpera6 = (navigator.appVersion.indexOf("MSIE 5")!=-1 && navigator.userAgent.indexOf("Opera 6")!=-1) ? true : false;
var isN6 = (navigator.userAgent.indexOf("Gecko")!=-1);
var isN4 = (document.layers) ? true : false;
var isMac = (navigator.userAgent.indexOf("Mac")!=-1);
var isIE = (document.all && !isOpera && (!isMac || navigator.appVersion.indexOf("MSIE 4")==-1)) ? true : false;

var thisMonth;
var thisYear;
var thisDay;
/**
 * Sets the form dates
 *
 * @param integer month
 * @param integer year
 * @param integer day
 */
function setFormDates(month, year, day)
{
	// get todays date
	
	var today = new Date();
	
	// set current month, year, day
	// checks and balances to make sure values that do not apply default to today's date
	
	thisMonth = (month == undefined) ? today.getMonth() : month;
	thisYear = (year == undefined) ? today.getFullYear() : year;
	thisDay = (day == undefined) ? document.resLauncher.arrDay.value : day;

	// set the todays date for the form items
	
	// set the month/year
	
	var selectMonthYears = document.resLauncher.arrMnthYr.options.length; // get the current month/year array
	
	// create new month/year Date from the data sent from the flash calendar
	
	var newMonthYear = new Date(thisYear, thisMonth, thisDay);

	for (m = 0; m < selectMonthYears; m++)
	{
		var selectMonthYear = new Date(document.resLauncher.arrMnthYr.options[m].value); // convert value to date object
		
		// condition months and years should match
		
		if (newMonthYear.getMonth() == selectMonthYear.getMonth() && newMonthYear.getYear() == selectMonthYear.getYear())
		{
			document.resLauncher.arrMnthYr.selectedIndex = m;
			
			// we now need to set the date
			
			setDays(new Date(newMonthYear), true);
			setDates(); // both functions located in hubx.js
		}
	}
}

function mouseClick(e) 
{
  	if (isIE || isOpera6) 
  	{
    	winX = event.screenX;
    	winY = event.screenY;
  	}
  	else if (isN4 || isN6) 
  	{
    	winX = e.screenX;
    	winY = e.screenY;
 
    	document.routeEvent(e);
  	}
 
  	if (isN4 || isN6) 
  	{ 
    	document.routeEvent(e); 
  	} 
  	else 
  	{ 
    	event.cancelBubble = false; 
	} 
 
	return true;
}

function calePopUp(width, height)
{
	// get the selected month & date values

	// Month/Year
	var selmnthYr = new Date(document.resLauncher.arrMnthYr.options[document.resLauncher.arrMnthYr.selectedIndex].value);
	var selMnth = selmnthYr.getMonth();
	var selYear = selmnthYr.getFullYear();
	// Day
	var seldt = new Date(document.resLauncher.arrDay.options[document.resLauncher.arrDay.selectedIndex].value);
	var selDay = seldt.getDate();
	
	// form the calendar url with variables to be passed in order to open the calendar
	// to the month,year,date that is set on this form.
	
	var winURL = "calendar.html?var_month=" + selMnth + "&var_year=" + selYear + "&var_day=" + selDay;
	
	// open popup
	
	window.open(winURL,"winCale","toolbar=no,location=no,status=no,directories=no,width=" +width+ ",height=" +height+ ",scrollbars=no,resizable=no,left="+(winX+winOffsetY)+",top="+(winY+winOffsetY));
}

if (isN4 || isN6) 
{
  document.captureEvents(Event.CLICK);
}
document.onclick = mouseClick;

// write the res form
function writeres() {
document.write('<table border="0" cellpadding="0" cellspacing="0" width="200">');
document.write('<form name="resLauncher" style="margin-bottom: 0" onSubmit="launchBE(); return false;">');
document.write('<input type="hidden" name="step" value="2" id="Hidden3" />');
document.write('<input type="hidden" name="hotelId" value="11162" />');
document.write('<tr>');
document.write('<td colspan="3" valign="top"><img src="images/hd_arri.gif" width="73" height="7" style="margin:24px 0px 2px;" alt="" border="0" /><br />');
document.write('<select name="arrMnthYr" onChange="setDates(true);" class="monospace" style="margin:0px 5px 0px 0px;"></select>&nbsp;&nbsp;<select name="arrDay" value="" onChange="setDates(false);" class="monospace" style="margin:0px 5px 0px 0px;"></select>&nbsp;&nbsp;<a href="javascript:calePopUp(170,160)"><img src="images/bt_cale.gif" width="18" height="16" alt="" align="absmiddle" border="0" /></a></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td valign="top"><img src="images/hd_nigh.gif" width="39" height="7" style="margin:12px 10px 2px 0px;" alt="" border="0" /><br />');
document.write('<select name="nights" value="" onChange="setDates(false);" class="monospace">');
document.write('<option value="1">1</option>');
document.write('<option value="2">2</option>');
document.write('<option value="3">3</option>');
document.write('<option value="4">4</option>');
document.write('<option value="5">5</option>');
document.write('<option value="6">6</option>');
document.write('<option value="7">7</option>');
document.write('<option value="8">8</option>');
document.write('<option value="9">9</option>');
document.write('<option value="10">10</option>');
document.write('<option value="11">11</option>');
document.write('<option value="12">12</option>');
document.write('<option value="13">13</option>');
document.write('<option value="14">14</option>');
document.write('</select></td>');
document.write('<td valign="top"><img src="images/hd_prom.gif" width="73" height="7" style="margin:12px 0px 1px;" alt="" border="0" /><br />');
document.write('<input name="promo" type="text" class="monospace" size="10" border="0"></td>');
document.write('<td valign="top"><img src="images/hd_grou.gif" width="61" height="7" style="margin:12px 0px 1px;" alt="" border="0" /><br />');
document.write('<input name="group" type="text" class="monospace" size="10" border="0"></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan="3"><input type="image" src="images/bt_avai.gif" width="109" height="17" style="margin:11px 0px 10px;" border="0" type="submit" value="CHECK AVAILABILITY"></td>');
document.write('</tr>');
document.write('<tr>');
document.write('<td colspan="3"><a href="http://www.larkspurhotels.com/bestrates/index.html" target="_blank" onfocus="if(this.blur)this.blur();"><img src="images/bt_bestrate.gif" width="184" height="31" alt="" border="0" /></a><br />');
document.write('<a href="mailinglist.html" onfocus="if(this.blur)this.blur();"><img src="images/bt_joinourm.gif" width="184" height="31" alt="" border="0" /></a><br />');
document.write('<a href=# onclick="javascript:window.open(\'http://iceportal.com/brochures/ice/brochure.aspx?did=4153&brochureid=ICE6015&mtype=4321\',\'\', \'width=700,height=450\')" title="Visual Tour: PruneYard Plaza Hotel"><img src="images/bt_virtualtour.gif" width="184" height="31" alt="" border="0" /><img style="display:none;" src="http://iceportal.com/brochures/ice/available.aspx?did=4153&brochureid=ICE6015&mtype=4321" /></a><br /><br />');
//document.write('<div style="text-align:center"><a href="specials/index.html"><img src="images/specials.gif" alt="internet specials" border="0"/></a></div></td>');
document.write('<div style="text-align:center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="index_flash" width="145" height="45" align="middle" id="index_flash"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="promo.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="promo.swf" quality="high" wmode=transparent width="145" height="45" name="promo" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div></td>');
document.write('</tr>');
document.write('</form>');
document.write('</table>');
}