function bookmark(url, description)
{
netscape="Netscape User's hit CTRL+D to add a bookmark to this site."
if (navigator.appName=='Microsoft Internet Explorer')
{
window.external.AddFavorite(url, description);
}
else if (navigator.appName=='Netscape')
{
alert(netscape);
}
}

function goBack()
{
history.go(-1);
}


function SavePage(strPage)
{
if (document.execCommand)
{
document.execCommand("SaveAs",false,strPage+".html")
}
else
{
window.status = 'Feature available only in Internet Exlorer 4.0 and later';
}
} 


function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function PopUp(Url,WinName,Width,Height)
	{
		LeftPosition	= (screen.availWidth) ? (screen.availWidth-Width)/2 : 0;  
		TopPosition		= (screen.availHeight) ? (screen.availHeight-Height)/2 : 0;
		PopUpWin = window.open(Url,WinName,'menubar=no,scrollbars=yes,resizable=yes,toolbar=no,directories=no, left='+LeftPosition+' , top='+TopPosition+' ,width='+ Width +',height=' + Height)
		PopUpWin.focus()
	}

function list_me(x,y){
if(x=="inline")
 eval(y + '.style.display="none"');
else
 eval(y + '.style.display="inline"');
}

function store_rest(x,y){
 eval(x + '.style.display="none"');
 eval(y + '.style.display="inline"');
}


function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Please enter a valid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Please enter a valid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Please enter a valid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Please enter a valid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Please enter a valid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Please enter a valid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Please enter a valid E-mail ID")
		    return false
		 }

 		 return true					
	}
	
function checknewsletter()
{
var emailID=document.frmnewsletter.txtmail;
//var emailID1=document.form1.txtemail.value.replace(/[\s<>']/g, "");
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	theURL = "../newsletter/subscribe.asp?txtmail=" + document.frmnewsletter.txtmail.value + "&action=" +  document.frmnewsletter.action.value;
window.open(theURL,'newsletter','width=300,height=100');
	document.frmnewsletter.txtmail.value='';
	return false;
	}

//Start of inc_octo.asp
	Date.prototype.isNorthAmerica = function(){
            return (this.getTimezoneOffset() < 660 && this.getTimezoneOffset() > 180);
            //return false;
	}
	Date.prototype.octopusDisplayFormat = function(){
	  if(this.isNorthAmerica()){
	      return (this.getMonth()+1) + "/" + this.getDate() + "/" + this.getFullYear();
	  }
	  else{
	      return this.getDate() + "/" + (this.getMonth()+1) + "/" + this.getFullYear();
	  }
	}
	
	today = new Date();
	dFormat = today.isNorthAmerica()?"mm/dd/yyyy":"dd/mm/yyyy";


	function makeDateFromString(str){
	    var vals = str.split("/");
	    var d = new Date();
	    var dPos = 0;
	    var mPos = 1;
	    var yPos = 2;
	    if(vals[2].length == 2){
	       vals[2] = "20" + vals[2];
	    }
	    if(d.isNorthAmerica()){
	        mPos = 0;
	        dPos = 1;
	    }
	    d.setDate(parseInt(vals[dPos]));
	    d.setMonth(parseInt(vals[mPos])-1);
	    d.setYear(parseInt(vals[yPos]));
	    return d;
	}
	function formatDateForURL(d){
	    var month = d.getMonth() + 1;
	    if(month < 10) month = "0" + month;
	    var date = d.getDate();
	    if(date < 10) date = "0" + date;
	    return d.getFullYear() + "-" + month + "-" + date;
	}

	function getSelectedValue(id){
	    try{
	        var theSelect = DGE(id);
	        return theSelect.options[theSelect.options.selectedIndex].value;
	    }
	    catch(Error){
	       return null;
	    }
	}
	expDate = /^\d{1,2}\/\d{1,2}\/\d{2,4}$/
	function DGE(x){return document.getElementById(x)}
	function setCheckout(){
	    var aSpan = DGE("alertSpan");
	    aSpan.innerHTML = "";	
	    var numNights = parseInt(DGE("nights").value);
	    if(!isNaN(numNights)){
	        var checkinDateVal = DGE("checkin").value;
	        if(expDate.test(checkinDateVal)){
	            var tDate = makeDateFromString(checkinDateVal);
	            tDate.setDate(tDate.getDate() + numNights);
                    DGE("checkout").innerHTML = tDate.octopusDisplayFormat();
	        }
	        else{
                    aSpan.innerHTML = "The checkin date you entered must be in " + dFormat + " format";
	        }
	    }
	    else{
	        aSpan.innerHTML = "Please make sure that the '# of nights' value is a number";
	    }
	}
	function makeURL(){
		
	    var aSpan = DGE("alertSpan");
	    aSpan.innerHTML = "";
		
	    var destinationVal = getSelectedValue("destination");
		
	    var checkinVal = DGE("checkin").value;
	    var nightsVal = DGE("nights").value;
	    var adultsVal = getSelectedValue("adults");
	    var childrenVal = getSelectedValue("children");
	    var starratingVal = getSelectedValue("starrating");
		
	    //var locationVal = getSelectedValue("location");
	    var languageVal = getSelectedValue("language");
		
	    var currencyVal = getSelectedValue("currency");

            var bErrors = false;	    
            var errorMsg = "";
	    if(destinationVal == 0){
	        errorMsg = "Please select a destination.<BR>";
	        bErrors = true;
	    } 
	    if(!expDate.test(checkinVal) ){
	        errorMsg += "Please enter a checkin date in " + dFormat + " format.<BR>";
	        bErrors = true;
	    }
	    if(isNaN(parseInt(nightsVal)))
	    {
	        errorMsg += "The '# of Nights' value must be digits only<BR>";
	        bErrors = true;
	    }
	    if(bErrors){
	        aSpan.innerHTML = errorMsg;
	        return;
	    }
		
	    var destinationArg = "&destination=" + destinationVal;
	    var checkinArg = checkinVal == ""?"":"&checkin=" + formatDateForURL(makeDateFromString(checkinVal));
	    var nightsArg= nightsVal == ""?"":"&nights=" + nightsVal;
	    var adultsArg = "&adults=" + adultsVal;
	    var childrenArg = childrenVal == 0?"":"&children=" + childrenVal;
	    var starratingArg = starratingVal == 0?"":"&starrating=" + starratingVal;
	   // var locationArg = locationVal == 0?"":"&location=" + locationVal;
   	    var currencyArg = currencyVal == "0"?"":"&currency=" + currencyVal;
	    var langArg= languageVal == "0"?"":"&language=" + languageVal;

	    var URLRoot = "http://www.octopustravel.com/em/HotelLink?siteid=dubaieye&Country=EM";
		var URL = URLRoot + destinationArg + checkinArg + nightsArg + adultsArg + childrenArg + starratingArg + currencyArg + langArg;
	    //DGE("alertSpan").innerHTML = URL;
	    document.location = URL;
	}

	function init(){
	   var co = DGE("checkout")
	   var ci = DGE("checkin");
	   var ciDate = new Date(today);
	   ciDate.setDate(ciDate.getDate() + 7)
	   ci.value = ciDate.octopusDisplayFormat();
	   ciDate.setDate(ciDate.getDate() + 1);
	   co.innerHTML = ciDate.octopusDisplayFormat();
	}
//End of inc_octo

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

//Begin inc_genconverter
function isInteger()
	{
		var a = document.conv.value1.value
			if (a =="")
					{
						alert("Please enter valid value");
						return false;
						
					}
		inputStr = a.toString()
		//alert(a);
		for (var i = 0; i < inputStr.length; i++)
			{
			var oneChar = inputStr.charAt(i)			
			if ((oneChar < "0" || oneChar > "9" || onechar=='') && oneChar != ".")
					{
						alert("Please enter valid value");
						return false;
						
					}
			}
		return true;
	}
//End inc_genconverter




//Begin Tooltip


//Begin dHTML Toolltip Timer
var tipTimer;
//End dHTML Toolltip Timer
<!--
function locateObject(n, d) { //v3.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=locateObject(n,d.layers[i].document); return x;
}

function hideTooltip(object)
{
if (document.all)
{
	locateObject(object).style.visibility="hidden"
	locateObject(object).style.left = 1;
	locateObject(object).style.top = 1;
return false
}
else if (document.layers)
{
	locateObject(object).visibility="hide"
	locateObject(object).left = 1;
	locateObject(object).top = 1;
	return false
}
else
	return true
}

function showTooltip(object,e, tipContent, backcolor, bordercolor, textcolor, displaytime)
{
	window.clearTimeout(tipTimer)
	
	if (document.all)
		{
			locateObject(object).style.top=document.body.scrollTop+event.clientY+20
			
			locateObject(object).innerHTML='<table style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="10" border="0" cellspacing="1" cellpadding="1"><tr><td nowrap><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table> '

			if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft))
				{	
					locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;
				}
			else
			{
			locateObject(object).style.left=document.body.scrollLeft+event.clientX
			}
		locateObject(object).style.visibility="visible"
		tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
		return true;
		}
	else if (document.layers)
		{
		locateObject(object).document.write('<table width="10" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="'+bordercolor+'"><td><table width="10" border="0" cellspacing="0" cellpadding="2"><tr bgcolor="'+backcolor+'"><td nowrap><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table></td></tr></table>')
		locateObject(object).document.close()
		locateObject(object).top=e.y+20

		if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth))
			{
				locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;
			}
		else
			{
			locateObject(object).left=e.x;
			}
		locateObject(object).visibility="show"
		tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
		return true;
	}
	else
	{
		return true;
	}
}
//-->

//End Tooltip


//show or hide layers
<!--
function MM_showHideLayers() { //v6.0
alert("hi");
  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; }
}
//-->
//end show or hide layers

// for business directory and hide flash banner

//end of busines directory