var DHTML = (document.getElementById || document.all || document.layers);
function findlayer(layerscollection, layerid) {
for(i=0; i 0) {
innerlayers = findlayer(layerscollection[i].document.layers, layerid);
if(innerlayers != false) return innerlayers;
}
if(i == layerscollection.length-1 && layerscollection[i].document.layers.length == 0) {
return false;
}
}
}
function getObj(name){
if (document.getElementById) {
if(document.getElementById(name)) {
return document.getElementById(name);
} else {
return false;
}
} else if (document.all) {
if(document.all[name]) {
return document.all[name];
} else {
return false;
}
} else if (document.layers) {
return findlayer(document.layers, name);
}
}
function right(e) {
if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)){
return false;
}else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) {
alert("Just Cities, the premier site for luxury city breaks and holidays!");
return false;
}
return true;
}
/*
document.onmousedown=right;
document.onmouseup=right;
if (document.layers){
window.captureEvents(Event.MOUSEDOWN);
}
if (document.layers){
window.captureEvents(Event.MOUSEUP);
}
window.onmousedown=right;
window.onmouseup=right;
*/
if (navigator.appName == "Microsoft Internet Explorer"){
isNavigator = "n";
}else{
isNavigator = "y";
}
//bookmark
function bookmark()
{
if (navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) >= 4)
{
window.external.AddFavorite('http://www.justcities.com/', 'Just Cities - Luxury city breaks and Holidays');
}
}
//top menu code
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 0 ) { // If Internet Explorer, return version number
// if(parseInt (ua.substring (msie+5, ua.indexOf (".", msie ))) <=3) {
// display = "false";
// }
//
// }
if (!DHTML) return;
thelayer = new getObj(layer);
if (thelayer == false) return;
if(action == 'show') {
thelayer.style.visibility = "visible";
} else {
thelayer.style.visibility = "hidden";
}
}
function popitup(imagename) {
itis = window.open("areamap.php?image="+imagename,"","toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=500");
itis.moveTo(100,100);
itis.focus();
}
function getObj(name)
{
if (document.getElementById)
{
this.obj = document.getElementById(name);
this.style = document.getElementById(name).style;
}
else if (document.all)
{
this.obj = document.all[name];
this.style = document.all[name].style;
}
else if (document.layers)
{
this.obj = document.layers[name];
this.style = document.layers[name];
}
}
var clipTop = 0;
var clipWidth = 210;
var clipBottom = 200;
var topper = 0;
var lyrheight = 0;
var time,amount,theTime,theHeight,DHTML;
function prepLyr(layername)
{
DHTML = (document.getElementById || document.all || document.layers)
if (!DHTML) return;
var x = new getObj(layername);
if (document.layers)
{
lyrheight = x.style.clip.bottom;
lyrheight += 20;
x.style.clip.top = clipTop;
x.style.clip.left = 0;
x.style.clip.right = clipWidth;
x.style.clip.bottom = clipBottom;
}
else if (document.getElementById || document.all)
{
lyrheight = x.obj.offsetHeight;
x.style.clip = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
}
}
function scrollayer(layername,amt,tim)
{
if (!DHTML) return;
thelayer = new getObj(layername);
if (!thelayer) return;
amount = amt;
theTime = tim;
realscroll();
}
function realscroll()
{
if (!DHTML) return;
clipTop += amount;
clipBottom += amount;
topper -= amount;
if (clipTop < 0 || clipBottom > (lyrheight + 10))
{
clipTop -= amount;
clipBottom -= amount;
topper += amount;
return;
}
if (document.getElementById || document.all)
{
clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
thelayer.style.clip = clipstring;
thelayer.style.top = topper;
}
else if (document.layers)
{
thelayer.style.clip.top = clipTop;
thelayer.style.clip.bottom = clipBottom;
thelayer.style.top = topper;
}
time = setTimeout('realscroll()',theTime);
}
function stopScroll()
{
if (time) clearTimeout(time);
}
function resetLyr(layername)
{
clipTop = 0;
clipWidth = 210;
clipBottom = 200;
topper = 0;
lyrheight = 0;
amount = 0;
thelayer = new getObj(layername);
if (document.getElementById || document.all)
{
clipstring = 'rect('+clipTop+' '+clipWidth+' '+clipBottom+' 0)'
thelayer.style.clip = clipstring;
thelayer.style.top = topper;
}
else if (document.layers)
{
thelayer.style.clip.top = clipTop;
thelayer.style.clip.bottom = clipBottom;
thelayer.style.top = topper;
}
}
function changeborder(imagename, type)
{
if (!DHTML) return;
theimage = new getObj(imagename);
if (theimage == false) return;
if(type == 0) {
theimage.style.borderColor = "#66CC66";
} else {
theimage.style.borderColor = "#FDD55E";
}
}
function changebackground(id,type)
{
if(!DHTML) return;
thelayer = new getObj(id);
if (thelayer == false) return;
if(type == 0) {
thelayer.style.background = "#81C1ED";
//thelayer.style.background = "#FFFFFF";
thelayer.style.color = "#514C8C";
} else {
thelayer.style.background = "#514C8C";
thelayer.style.color = "#ffffff";
}
}
function recalctotal(subtotal, rooms, maintotal, partysize, price, formname, perperson) {
//get new subtotal for the selected number of rooms of a certain type
numrooms = eval("document.forms."+formname+"."+rooms+".options[document.forms."+formname+"."+rooms+".selectedIndex].value"+";");
if(perperson == 'y') {
newsubtotal = partysize * price * numrooms;
} else {
newsubtotal = price * numrooms;
}
//get the difference in the new main total and the current main total - the complex string functions are used to remove the
//'£' sign from the beginning of the string.
oldsubtotal = eval("document.forms."+formname+"."+subtotal+".value;");
maintotaldiff = newsubtotal - (oldsubtotal.substring(1,(oldsubtotal.length)));
//get the new main total using the difference
currentmaintotal = eval("document.forms."+formname+"."+maintotal+".value;");
newmaintotal = parseInt(currentmaintotal.substring(1,(currentmaintotal.length)))+parseInt(maintotaldiff);
//write the new main total and sub total values to their appropriate boxes
eval("document.forms."+formname+"."+subtotal+".value=\"£\"+newsubtotal;");
eval("document.forms."+formname+"."+maintotal+".value=\"£\"+newmaintotal;");
}
function testforselections(formname, formnum, numberofrooms) {
formname = formname+formnum;
selectionmade=false;
for(i=1; i<=numberofrooms; i++) {
if(eval("document.forms."+formname+".norooms"+i+".options[document.forms."+formname+".norooms"+i+".options.selectedIndex].value;") > 0) {
selectionmade=true;
break;
}
}
if(selectionmade==false) {
alert("Please select some accommodation for this date");
return false;
} else {
return true;
}
}