/*******************************************************************
 * soopa-rollovers.js
 * 7/28/2001
 * www.youngpup.net
 *
 * easiest rollovers on earth, baby!
 * see www.youngpup.net for documentation.
 *******************************************************************/

function soopaSetup() {
	var img, sh, sn
	for (var i = 0; (img = document.images[i]); i++) {
		if (img.getAttribute) {

			sn = img.getAttribute("src");
			sh = img.getAttribute("hsrc");

			if (sn != "" && sn != null) {
				img.n = new Image();
				img.n.src = img.src;
			
				if (sh != "" && sh != null) {
					img.h = new Image();
					img.h.src = sh;
					img.onmouseover = soopaSwapOn
					img.onmouseout  = soopaSwapOff
				}
			}
		}
	}
}

function soopaSwapOn() {
	this.src = this.h.src;
}

function soopaSwapOff() {
	this.src  = this.n.src;
}

function soopaSwapUp() {
	var ths = soopaSwapUp.img;
	ths.src = ths.n.src;
	if (ths.temp) document.onmouseup = ths.temp;
}


//*******************************************************************

function MM_preloadImages() {
  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() {
  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) {
  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() {
  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];}
}

if (navigator.appName == 'Netscape') {
  var browser = 'NS';
  var version = (navigator.appVersion);
}

if (navigator.appName == 'Microsoft Internet Explorer') {
  var browser = 'IE';
  var version = (navigator.appVersion);
}

NS4 = (document.layers) ? 1 : 0;

NS6 = ((browser == 'NS') && (document.getElementById)) ? 1 : 0;

var agent = navigator.userAgent.toLowerCase();

opera = (agent.indexOf("opera")!=-1) ? true : false

macs = (agent.indexOf("mac")!=-1) ? true : false

function MM_showHideLayers() {
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function showHideLayersNS(layerName,actions){
	if(NS4){
		document.layers[layerName].visibility = actions;
	}
	else {
		document.getElementById(layerName).style.visibility = actions;
		}
	}	
	
function popupWindow(url,name,width,height) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow.window.focus();
	}
	
function popupWindow2(url,name,width,height) {
		newwindow2 = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow2.window.focus();
	}

function popupWindow3(url,name,width,height) {
		newwindow3 = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow3.window.focus();
	}	
	
function popupWindowNoScroll(url,name,width,height) {
		newwindow4 = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0,left=162,top=200");
		newwindow4.focus();
	}	
	
function popupWindowScroll(url,name,width,height) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=1,location=0,scrollbars=1,copyhistory=0,left=162,top=200");
		newwindow.window.focus();
	}
function popupWindowNoScrollPos(url,name,width,height,left,top) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=0,copyhistory=0,left="+left+",top="+top+"");
		newwindow.window.focus();
	}	
	
function popupWindowScrollPos(url,name,width,height,left,top,resize) {
		newwindow = window.open(url,name, "width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=0,resizable="+resize+",location=0,scrollbars=1,copyhistory=0,left="+left+",top="+top+"");
		newwindow.window.focus();
	}
	
function generalPopup(url,name,width,height,left,top,resize,tool,menu,directories,status,location,scrollbars,history){
		generalwindow = window.open(url,name, "width="+width+",height="+height+",toolbar="+tool+",directories="+directories+",menubar="+menu+",status="+status+",resizable="+resize+",location="+location+",scrollbars="+scrollbars+",copyhistory="+history+",left="+left+",top="+top+"");
		generalwindow.window.focus();
	}
	
function closeThisOpenThat(redirectUrl){		
		parent.opener.location = redirectUrl;
		self.close();		
	}
	
function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}	

function MM_jumpMenuInNew(selObj,restore){
  var url = 'http://'+selObj.options[selObj.selectedIndex].value;
  PCD = window.open(url,'');
  PCD.window.focus();
  if (restore) selObj.selectedIndex=0;  
}

function MM_reloadPage(init) {
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

var cookiesaloud
function checkcookies() {
 if (document.cookie.length > 0) { 
  cookiesaloud = 1
 }
 else {  
  cookiesaloud = 0
 }
}
//checkcookies();

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function changeClass(cellid,strNewClass){	
	if(!macs){
		document.getElementById(cellid).className=strNewClass;
		}
	}
	
function setState(cellref){
		if(cellref!=""){
			if(macs||browser=="NS"){document.images['NAV_'+cellref].src="images/navi/" + cellref + "_2.gif";}
			else{if(document.getElementById('NAV_'+cellref)){document.getElementById('NAV_'+cellref).src = "images/navi/" + cellref + "_2.gif";}}
			}
		}
		
function viewFavCot(){
	var selObj = document.favForm.cottages
	var parseArr = new Array(selObj.options[selObj.selectedIndex].value);
	elements = parseArr[0].split (/\s*\|\s*/);
	intCotId = elements[0]
	isDirect = elements[1]				
	document.actionForm.i.value=intCotId
	document.actionForm.isRESERVATION.value=isDirect
	document.actionForm.submit();}
	
function sendContactEMail(){
		var strDom = "cmltd.uk.com"
		var strBox = "sales"
		document.location.href = "mailto:"+strBox+"@"+strDom
		}