/* Copyright Digital:Idiom c 1999 - 2006 - Contact design @ digitalidiom.co.uk */
/* www.digitalidiom.co.uk for professional web design to W3C standards */
/* NO copy or use of original material by Digital:Idiom without permission */


/* =======  bug fix for Netscape 4: reloads styles if Nav4 resized===== */
function DC_reloadPage(init) {
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.DC_pgW=innerWidth; document.DC_pgH=innerHeight; onresize=DC_reloadPage; }}
else if (innerWidth!=document.DC_pgW || innerHeight!=document.DC_pgH) location.reload();
}
DC_reloadPage(true);


/* BROWSER CHECKS */
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ie6 = (document.all && document.getElementById && navigator.userAgent.indexOf("6") > 0);
var ns6 = (!document.all && document.getElementById);


/* ====================================================== */
/* MENU HIGHLIGHTER Changes appearance of selected menu   */
/* item to indicate which page is being viewed */

function chgNavBar(id){
	// Netscape 4
	if(ns4){
		document.layers[id].color ="#CCC";
	}
	// Explorer 4
	else if(ie4){
		document.all[id].style.color ="#CCC";
	}
	// W3C - Explorer 5+ and Netscape 6+
	else if(ie5 || ns6){
		document.getElementById(id).style.color ="#CCC";
	}
}


/* ====================================================== */
/* Dynamically Write Email or Address so spam spiders do not        */
/*  pick up email or address details */

function writeEmail(who)
{
	document.write("<a href='mailto:"+who+"@spanishholidaycottages.com?subject=Spanish%20Holiday%20Cottages%20Enquiry'>");
	document.write(who);
	document.write("@");
	document.write("spanishholidaycottages");
	document.write(".com");
	document.write("</a>");
}

/* ====================================================== */
/* COUNTER ROLLOVER (hide or show) */
function showStats(state)
{
	if (ie5) {
		document.all.stats.style.visibility = state;
	}
	if (ns6) {
		document.getElementById('stats').style.visibility = state;
	}
}


/* ====================================================== */
/* REVEAL HIDDEN DIV from an anchor   */

function revealDiv(id,state)
{
var d = document.getElementById(id);
if (d) {d.style.display=state;}
}


/* ---------------------------------------------------------- */

function openWindow(strURL)
{
   if (strURL)
   {
      window.open(strURL, "productPopup","status=0,toolbar=0,directories=0,location=0,menubar=0,scrollbars=1,resizable=1,width=720,height=540,top=20,left=20");
	  //productPopup.focus();
     //location.reload(true);
   }
}

/* ---------------------------------------------------------- */
