// ravlakhempur.com by info@arroWebs.com
//
// there are much better scripts available on the web.. really much better
// do get some and work on them...
//
// there are some dreamweaver scripts and some which are handcoded!
//
///////

var ie5 = false;
var sWidth = screen.width;
var sHeight = screen.height;
ie5 = (navigator.appVersion.indexOf("IE 5") > 0);

lt = (sWidth) ? (sWidth-800)/2 : 0;
tp = (sHeight) ? (sHeight-310)/2 : 0;
function writeSpec() {
	if( sWidth != 800 || sHeight != 600 )
		document.write("<br><font color=red>o  Best Viewed on 800 x 600 resolution.</font>");
	if( !ie5 )
		document.write("<br><font color=red>o  Optimised for IE 5 or better</font>");
}

function openmap() {
  features = "toolbar=no,status=no,menubar=no,directories=no,width=530,height=290";
  map = window.open("map.html", "map", features )
}

function opentariff() {
  features = "toolbar=no,status=no,menubar=no,directories=no,width=465,height=170";
  tariff = window.open("tariff.html", "tariff", features )
}


function GetSiteMap() {
	document.write('<p align=center><br><br>');
	document.write('<form name=form1>');
	document.write('<select name=sitemap class=input onchange=gopage(this)>');
	document.write('<option>Site map</option>');
	document.write('<option>&nbsp;</option>');
	document.write('<option>&nbsp;&nbsp;History</option>');
	document.write('<option>&nbsp;&nbsp;What is ravla ?</option>');
	document.write('<option>&nbsp;</option>');
	document.write('<option>&nbsp;The Heritage Hotel:</option>');
	document.write('<option>&nbsp;&nbsp;en suite rooms</option>');
	document.write('<option>&nbsp;&nbsp;gardens</option>');
	document.write('<option>&nbsp;&nbsp;cuisine</option>');
	document.write('<option>&nbsp;&nbsp;baithak</option>');
	document.write('<option>&nbsp;</option>');
	document.write('<option>&nbsp;&nbsp;Horses</option>');
	document.write('<option>&nbsp;&nbsp;Marwari - legend...</option>');
	document.write('<option>&nbsp;</option>');
	document.write('<option>&nbsp;Information:</option>');
	document.write('<option>&nbsp;&nbsp;location</option>');
	document.write('<option>&nbsp;&nbsp;tariff</option>');
	document.write('<option>&nbsp;&nbsp;contact</option>');
	document.write('<option>&nbsp;</option>');
	document.write('<option>&nbsp;Interact:</option>');
	document.write('<option>&nbsp;&nbsp;reservation</option>');
	document.write('<option>&nbsp;&nbsp;enquiry</option>');
	document.write('<option>&nbsp;&nbsp;feedback</option>');
	document.write('<option>&nbsp;&nbsp;site credits</option>');
	document.write('<option>&nbsp;</option>');
	document.write('<option>&nbsp;Home page</option>');
	document.write('<option>&nbsp;</option>');
	document.write('</select></form></p>');
}


var textlist = new Array();
var n = 0;
textlist[n] = "history"; n++;
textlist[n] = "ravla"; n++;
textlist[n] = "hotel"; n++;
textlist[n] = "room"; n++;
textlist[n] = "garden"; n++;
textlist[n] = "baithak"; n++;
textlist[n] = "cuisine"; n++;
textlist[n] = "horses"; n++;
textlist[n] = "marwari"; n++;
textlist[n] = "information"; n++;
textlist[n] = "tariff"; n++;
textlist[n] = "location"; n++;
textlist[n] = "contact"; n++;
textlist[n] = "interact"; n++;
textlist[n] = "reserv"; n++;
textlist[n] = "enquiry"; n++;
textlist[n] = "feedback"; n++;
textlist[n] = "credit"; n++;
textlist[n] = "page";

function gopage(obj) {
	txt = obj.options[obj.selectedIndex].text;
	txt = txt.toLowerCase();
	for(i = 0; i <= textlist.length; i++ ) {
		if (txt.indexOf( textlist[i] ) > 0) {
			txt = textlist[i];
			switch(txt) {
				case "page":
					window.location.href = "index.html";
					break
				case "contact":
					window.location.href = "index.html#contact";
					break
				case "credit":
					openGS();
					break
				default:
					window.location.href = textlist[i] + ".html";
				}
		}
	}
}

function modiDate() {
	document.write(document.lastModified);
}

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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

MM_preloadImages('images/b1-over.gif','images/b2-over.gif','images/b3-over.gif','images/b4-over.gif','images/b5-over.gif','images/b6-over.gif','images/b7-over.gif');

// Credits
function openGS() {
	features = "width=200,height=80,resizable=no"
	winGS = window.open("credits.html", "winGS", features );
	winGS.focus();
}


// The date drop-down in reservation 02/10/2004 6:01PM

var months = new Array();
i = 0;
months[i] = 'January'; i++;
months[i] = 'February'; i++;
months[i] = 'March'; i++;
months[i] = 'April'; i++;
months[i] = 'May'; i++;
months[i] = 'June'; i++;
months[i] = 'July'; i++;
months[i] = 'August'; i++;
months[i] = 'September'; i++;
months[i] = 'October'; i++;
months[i] = 'November'; i++;
months[i] = 'December';

function printMonth(){
	var now = new Date();
	var current = now.getMonth();
	document.write('<select name="month">');
	for(i=0; i < months.length; i++) {
		txt = '<option value="' + months[i] + '"';
		if (i == current) {
			txt = txt + ' selected';
		}
		txt = txt + '>' + months[i] + '</option>';
		document.write(txt);
	}
	document.write('</select>');
}	

function printDay() {
	var now = new Date();
	var current = now.getDate();
	document.write('<select name="day">');
	for(i=1; i <= 31; i++) {
		txt = '<option value="' + i + '"';
		if (i == current) {
			txt = txt + ' selected';
		}
		txt = txt + '>' + i + '</option>';
		document.write(txt);
	}
	document.write('</select>');
}

function printYear() {
	var now = new Date();
	var current = now.getFullYear();
	document.write('<select name="year">');
	for(i=0; i < 2; i++) {
		txt = '<option value="' + (current+i) + '"';
		if (i == 0) {
			txt = txt + ' selected';
		}
		txt = txt + '>' + (current+i) + '</option>';
		document.write(txt);
	}
	document.write('</select>');
}