﻿// JScript File
var timeoutID;
var currentID;
var currentURL;

function NavOver(navid, url)
{
   if ((currentID != null) && (currentID != navid))
    {
        clearTimeout(timeoutID);
        var navOldObj = document.getElementById(currentID);
        navOldObj.src = currentURL;
    }
    currentID = navid;
    currentURL = url;
    var navObj = document.getElementById(navid);
    navObj.src = url;
    clearTimeout(timeoutID);

}

function NavOff(navid, url)
{
    var cmd = "NavOver('" + navid + "', '" + url + "')";
    timeoutID = setTimeout(cmd, 500);
    currentID = navid;
    currentURL = url;
}

function mainNavOff(navobj, url)
{
    var cmd = "mainNavChange(navobj, '" + url + "')";
    timeoutID = setTimeout(cmd, 500);
   
}


function mainNavChange(navobj, url)
{
    navObj.src = url;
    clearTimeout(timeoutID);

}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function openPrintView(pid)
{
	var PrintViewPath = "printpropertyinfo.aspx?print=yes&pid=" + pid;

	window.open(PrintViewPath , "PrintView", "width=670,height=600,resizable=1,menubar=0,locations=0,status=0,scrollbars=1,top=0,left=0");

}

function openPhotoViewer(pid, color, pagenum, imagenum)
{
	var PrintViewPath = "photoviewer.aspx?color=" + color + "&pid=" + pid + "&pagenum=" + pagenum + "&imagenum=" + imagenum;

	window.open(PrintViewPath , "PrintView", "width=603,height=540,resizable=0,menubar=0,locations=0,status=0,scrollbars=0,top=0,left=0");

}

var irmBookWindow = 0;
function openIRMBookNow(IRMPath)
{
	irmBookWindow++;
	window.open(IRMPath , "RDP_IRM" + irmBookWindow, "width=900,height=700,resizable=1,menubar=0,locations=0,status=0,scrollbars=1,top=0,left=0");

}

function openIRMRoom(roomcode)
{
	var IRMPath = "http://booking.rosemarybeach.com/irm/Calendar.asp?room=" + roomcode;

	window.open(IRMPath , "RDP_IRM", "width=800,height=600,resizable=1,menubar=0,locations=0,status=0,scrollbars=1,top=0,left=0");

}

function openIRMRoomDate(roomcode, strstartdate, strenddate){
	var IRMPath = "http://booking.rosemarybeach.com/irm/Calendarsdbx.asp?room=" + roomcode + "&Arv=" + strstartdate + "&Dep=" + strenddate;

	window.open(IRMPath , "RDP_IRM", "width=800,height=600,resizable=1,menubar=0,locations=0,status=0,scrollbars=1,top=0,left=0");
}

function leadingZero(nr) { if (nr < 10) nr = "0" + nr; return nr; } 
function takeYear(theDate) { x = theDate.getYear(); var y = x % 100; y += (y < 38) ? 2000 : 1900; return y; } 

function onClientItemOpen(sender, eventArgs)  
{  
    var item = eventArgs.Item;  
              
    item.ImageUrl = item.ImageOverUrl; 
              
}  
function onClientMouseOut(sender, eventArgs)  
{  
    var item = eventArgs.Item;  
    item.ImageUrl = item.Value; 
              
}  
