var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;
var isIE = 0;
var nav = 0;

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
}}
if (navigator.appName.indexOf('Microsoft') != -1) { isIE = 1; }
if (navigator.appName.indexOf('Netscape') != -1) { nav = 1; }

enableKeypress();
function enableKeypress()
{
document.onkeypress = enterKey;
}
function enterKey(evt)
{
var nkey = 0;
if (evt) { nkey = evt.which; }
     else { nkey = window.event.keyCode; }
//nkey = key.keyCode; 
if (nkey == 13) {
               return false; } 
}
function findDOM(objectID,withStyle) 
{
        if (withStyle == 1) {
                if (isID) { return (document.getElementById(objectID).style) ; }
                else {
                        if (isAll) { return (document.all[objectID].style); }
                else {
                        if (isLayers) { return (document.layers[objectID]); }
                };}
        }
        else {
                if (isID) { return (document.getElementById(objectID)) ; }
                else {
                        if (isAll) { return (document.all[objectID]); }
                else {
                        if (isLayers) { return (document.layers[objectID]); }
                };}
        }
}


function seteCookie(cname, cvalue, expires, path)
{
document.cookie = cname + "=" + escape (cvalue) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : ""); 
}
function geteCookie(cname)
{
var cfound;
var cvalue = "";
var i;
if (document.cookie == "") {return "";}
cfound = document.cookie.split("; ");
for (i = 0; i < cfound.length; i++) {
          if (cname == cfound[i].split("=")[0]) {
                  cvalue = cfound[i].split("=")[1];
                  break;
                  }
       }
return cvalue;
}
function moveIt (msource, mdestination)
{
var output ="";
var sourceObj;
var destinationObj;
if (isIE) { 
     output = document.all[msource].innerHTML; 
     document.all[mdestination].innerHTML=output;
            }
			else {
 sourceObj = document.getElementById(msource);
        destinationObj = document.getElementById(mdestination);
		     output = sourceObj.innerHTML;
	       destinationObj.innerHTML = output;
 }

}
function injectIt (output, mdestination)
{

var sourceObj;
var destinationObj;
if (isIE) { 
     document.all[mdestination].innerHTML=output;
            }
			else {
        destinationObj = document.getElementById(mdestination);
	    destinationObj.innerHTML = output;
 }

}
/// change the colour of the menu items as the mouse passes over

function valsubmit()
{
 if (document.FORM6.F6SEARCH.value.length < 6)
               return false;
 document.FORM6.submit();
 return true;
}


/// change the colour of the menu items as the mouse passes over
function CM(objectID, inout)
{
  var dom = findDOM(objectID,1);
  if (inout == 1) {
  dom ['backgroundImage'] = "url(../images6/../images6/08_yelbut_hovbg_no.jpg)";
//  dom ['border'] = '1px solid #30508b';
//  dom ['color'] = "#30508b";
  }
  else{
  dom ['backgroundImage'] = "url(../images6/2010_menuhov.jpg)";
//  dom ['border'] = '1px solid #30508b';
//  dom ['color'] = "#30508b";
  }

}
function CMX(objectID, inout)
{
  var dom = findDOM(objectID,1);
  if (inout == 1) {
  dom ['backgroundImage'] = "url(../images6/08_yelbut_hovbg_no.jpg)";
//  dom ['border'] = '1px solid #30508b';
//  dom ['color'] = "#30508b";
  }
  else{
  dom ['backgroundImage'] = "url(../images6/2010_menuhov.jpg)";
//  dom ['border'] = '1px solid #30508b';
//  dom ['color'] = "#30508b";
  }

}
function P300A(file, wheight)
{
       var fxp = "doc\\" + file + ".htm";
       PopupDispay(fxp, wheight);

 //      window.event.cancelBubble = true;
}

function P300D(file, wheight)
{
       var fxp = "doc\\" + file + ".htm";
       PopupDispay(fxp, wheight);
}
function PopupDispay(fxp, aheight)
{
       var strFeatures = "";
         if (isIE) {
       strFeatures = "dialogHeight=";
       strFeatures += aheight;
       strFeatures += "px";
       strFeatures += ";dialogWidth=480px;dialogTop=0px;dialogLeft=0px;help=no;scrollbars=1;border=no;status=no;titlebar=no;toolbar=no;";
       showModalDialog(fxp, "xx", strFeatures);
       }
       else {
       strFeatures = "height=";
       strFeatures += aheight;
       strFeatures += ",width=460,top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,border=0;titlebar=no;";
       wind = window.open(fxp, "xx", strFeatures);
       }
 //      window.event.cancelBubble = true;
}
function closewind()
{
if (wind != null)
         wind.close()
         wind = null;
}

var oldM = "";
function dPop(obj)
{
    var Mdom = findDOM(obj,1);
	if (oldM != null) {
    	if (oldM != Mdom) {
               oldM.visibility = 'hidden';
                oldM.zIndex = '0';
        }
	}
    Mdom.visibility = 'visible';
    oldM = Mdom;

}

function dHide(obj)
{
if (obj) {
         oldM.visibility = 'hidden';
         oldM.zIndex = '0';
         oldM = null;
         }
      else {
          var Mdom = findDOM(obj,1);
          Mdom.visibility = 'hidden';
          Mdom.zIndex = '0';
          oldM = null;
          }
}

function goback()
{
window.history.go(-1)
}
function goehome()
{
seteCookie('process', '0', null, '/'); 
seteCookie('UniqueRef', 'Z', null, '/');  
var floc = "http://www.etravelinsure.com/index.htm";
window.location.href=floc;
}
function goeback()
{
	 var tracker = geteCookie('tracker');
	 var htracker = geteCookie('htracker'); 
var floc = "";
	if (tracker == 'ib' )
    	     floc += "backpacker-insurance-ireland.htm";
	if (tracker == 'ub' )
    	     floc += "backpacker-insurance-UK.htm";  
	if (tracker == 'u3' )
    	     floc += "annual-insurance-31days-UK.htm";
	if (tracker == 'i3' )
    	     floc += "annual-insurance-31days-ireland.htm"; 
	if (tracker == 'u9' )
    	     floc += "annual-insurance-90days-UK.htm";
	if (tracker == 'i9' )
    	     floc += "annual-insurance-90days-ireland.htm"; 	 
	if (tracker == 'is' )
    	     floc += "travel-insurance-s31-ireland.htm"; 
	if (tracker == 'us' )
    	     floc += "travel-insurance-s31-UK.htm"; 
    if (floc == "")
         floc += "index.htm";
window.location.href= floc;
}
function setMSidebar(s)
{
if (s == "0") { moveIt('easysteps','sidebar' ) }
if (s == "1") { moveIt('europe','sidebar' ) }
if (s == "2"){ moveIt('children','sidebar' ) }
if (s == "3") { moveIt('partner','sidebar' ) }
if (s == "4") { moveIt('skydiving','sidebar' ) } 
}
function setGWidth()
{
var scrwidth = findLPW();
var bufferwidth = scrwidth - 740;
var ob = document.getElementById('toppage');
ob.style.width = bufferwidth + "px";
var midsec = scrwidth * .375;  

ob = document.getElementById('leftside');
ob.style.width = midsec + "px";
} 
function findLPW()
{
if (document.body.clientWidth != null )
   { return document.body.clientWidth; }
return (screen.availWidth - 21);
}
