﻿// JScript File

var newwindow;
function newWindow(url)
{
	newwindow=window.open(url,'Video','height=400,width=445');
	if (window.focus) {newwindow.focus()}
}

function newWindowOpen(url,winTitle,width,height,left,top,menubar,resizable,scrollbars,location,status,toolbar)
{
    var properties = 'menubar=' + menubar + ',resizable=' + resizable + ',scrollbars=' + scrollbars + ',location=' + location + ',status=' + status + ',toolbar=' + toolbar + ',height=' + height + ',width=' + width + ',left=' + left + ',top=' + top;
	newwindow=window.open(url,winTitle,properties);
	if (window.focus) {newwindow.focus()}
}

function ChangeCheckBoxStatus(CheckBoxID)
{
    if (document.getElementById(CheckBoxID).checked)
    {
        document.getElementById(CheckBoxID).checked = false;
    }
    else 
    {
        document.getElementById(CheckBoxID).checked = true;
    }
}

function getQueryVariable(variable)
{
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0;i<vars.length;i++)
    {
        var pair = vars[i].split("=");
        if (pair[0] == variable)
        {
            return pair[1];
        }
    }
} 

//Used for expanding the hotel room selector box for when more than one room is selected
//var roomsWanted = 1;
//function RoomNumberChanged(number) {
//    
//    var counter = document.getElementById(number).value;
//    
//    for (var j=counter; j<4; j++) 
//    {
//        HideContent('room' + j);
//        document.getElementById('ctl00_ContentPlaceHolder1_RoomSearchBox1_txt_number_of_adults_room' + j).value = "0";
//        document.getElementById('ctl00_ContentPlaceHolder1_RoomSearchBox1_txt_number_of_children_room' + j).value = "0";
//    }
//    
//    for (var i=1; i<counter; i++) 
//    {
//        ShowContent('room' + i);
//    }  
//    
//}

function HideContent(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "none";
}

function ShowContent(d) 
{
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "block";
}

function ReverseContentDisplay(d) 
{
    if(d.length < 1) { return; }
    if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
    else { document.getElementById(d).style.display = "none"; }
}

var theObj="";
function toolTip(text,me) {
  theObj=me;
  theObj.onmousemove=updatePos;
  document.getElementById('toolTipBox').innerHTML=text;
  document.getElementById('toolTipBox').style.display="block";
  window.onscroll=updatePos;
}

function updatePos() {
  var ev=arguments[0]?arguments[0]:event;
  var x=ev.clientX;
  var y=ev.clientY;
  diffX=20;
  diffY=0;
  //document.getElementById('toolTipBox').style.top  = y-2+diffY+document.body.scrollTop+ "px";
  document.getElementById('toolTipBox').style.left = x-2+diffX+document.body.scrollLeft+"px";
  theObj.onmouseout=hideMe;
}

function hideMe() {
  document.getElementById('toolTipBox').style.display="none";
}

