var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thecolor, thewidth){
if (ns6||ie){
if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip




function mmLoadMenus() {
    if (window.mm_menu_1208131443_0) return;
    window.mm_menu_1208131443_0 = new Menu("root",103,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,true,true);
    mm_menu_1208131443_0.addMenuItem("Canada","location='place/canada/'");
    mm_menu_1208131443_0.addMenuItem("United&nbsp;States","location='place/united_states/'");
    mm_menu_1208131443_0.hideOnMouseOut=true;
    mm_menu_1208131443_0.bgColor='#D7D7D7';
    mm_menu_1208131443_0.menuBorder=100;
    mm_menu_1208131443_0.menuLiteBgColor='#FFFFFF';
    mm_menu_1208131443_0.menuBorderBgColor='#3d8eba';
    window.mm_menu_1208133541_0 = new Menu("root",106,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,false,true);
    mm_menu_1208133541_0.addMenuItem("Austria","location='place/austria/'");
    mm_menu_1208133541_0.addMenuItem("Belgium","location='place/belgium/'");
    mm_menu_1208133541_0.addMenuItem("Czech&nbsp;Republic","location='place/czech_republic/'");
    mm_menu_1208133541_0.addMenuItem("France","location='place/france/'");
    mm_menu_1208133541_0.addMenuItem("Germany","location='place/germany/'");
    mm_menu_1208133541_0.addMenuItem("Greece","location='place/greece/'");
    mm_menu_1208133541_0.addMenuItem("Italy","location='place/italy/'");
    mm_menu_1208133541_0.addMenuItem("Malta","location='place/malta/'");
    mm_menu_1208133541_0.addMenuItem("Monaco","location='place/monaco/'");
    mm_menu_1208133541_0.addMenuItem("Netherlands","location='place/netherlands/'");
    mm_menu_1208133541_0.addMenuItem("Portugal","location='place/portugal/'");
    mm_menu_1208133541_0.addMenuItem("Spain","location='place/spain/'");
    mm_menu_1208133541_0.addMenuItem("Switzerland","location='place/switzerland/'");
    mm_menu_1208133541_0.addMenuItem("Turkey","location='place/turkey/'");
    mm_menu_1208133541_0.addMenuItem("United&nbsp;Kingdom","location='place/united_kingdom/'");
    mm_menu_1208133541_0.hideOnMouseOut=true;
    mm_menu_1208133541_0.bgColor='#D7D7D7';
    mm_menu_1208133541_0.menuBorder=100;
    mm_menu_1208133541_0.menuLiteBgColor='#FFFFFF';
    mm_menu_1208133541_0.menuBorderBgColor='#3d8eba';
    window.mm_menu_1208134206_0 = new Menu("root",89,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,true,true);

    //mm_menu_1208134206_0.addMenuItem("Cambodia","location='place/cambodia/'");
    mm_menu_1208134206_0.addMenuItem("China","location='place/china/'");
      mm_menu_1208134206_0.addMenuItem("HongKong","location='place/hong_kong/'");
      mm_menu_1208134206_0.addMenuItem("India","location='place/india/'");
      mm_menu_1208134206_0.addMenuItem("Indonesia","location='place/indonesia/'");
      mm_menu_1208134206_0.addMenuItem("Japan","location='place/japan/'");
      mm_menu_1208134206_0.addMenuItem("Malaysia","location='place/malaysia/'");
      mm_menu_1208134206_0.addMenuItem("Maldives","location='place/maldives/'");
      mm_menu_1208134206_0.addMenuItem("Singapore","location='place/singapore/'");
      mm_menu_1208134206_0.addMenuItem("Sri&nbsp;Lanka","location='place/sri_lanka/'");
      mm_menu_1208134206_0.addMenuItem("Thailand","location='place/thailand/'");
    mm_menu_1208134206_0.hideOnMouseOut=true;
     mm_menu_1208134206_0.bgColor='#D7D7D7';
     mm_menu_1208134206_0.menuBorder=1;
     mm_menu_1208134206_0.menuLiteBgColor='#FFFFFF';
     mm_menu_1208134206_0.menuBorderBgColor='#3d8eba';
window.mm_menu_1208134517_0 = new Menu("root",80,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,false,true);
  mm_menu_1208134517_0.addMenuItem("Australia","location='place/australia/'");
  mm_menu_1208134517_0.addMenuItem("New&nbsp;Zealand","location='place/new_zealand/'");
  mm_menu_1208134517_0.addMenuItem("Tahiti","location='place/tahiti/'");
   mm_menu_1208134517_0.hideOnMouseOut=true;
   mm_menu_1208134517_0.bgColor='#D7D7D7';
   mm_menu_1208134517_0.menuBorder=1;
   mm_menu_1208134517_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1208134517_0.menuBorderBgColor='#3d8eba';
  window.mm_menu_1208134746_0 = new Menu("root",127,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,false,true);
  mm_menu_1208134746_0.addMenuItem("Bahrain","location='place/bahrain/'");
  mm_menu_1208134746_0.addMenuItem("Jordan","location='place/jordan/'");
  mm_menu_1208134746_0.addMenuItem("Kuwait","location='place/kuwait/'");
  mm_menu_1208134746_0.addMenuItem("Oman","location='place/oman/'");
  mm_menu_1208134746_0.addMenuItem("Qatar","location='place/qatar/'");
  mm_menu_1208134746_0.addMenuItem("United&nbsp;Arab&nbsp;Emirates","location='place/united_arab_emirates/'");
   mm_menu_1208134746_0.hideOnMouseOut=true;
   mm_menu_1208134746_0.bgColor='#D7D7D7';
   mm_menu_1208134746_0.menuBorder=1;
   mm_menu_1208134746_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1208134746_0.menuBorderBgColor='#3d8eba';
window.mm_menu_1208135145_0 = new Menu("root",98,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,true,true);
  //mm_menu_1208135145_0.addMenuItem("Botswana","location='place/botswana/'");
  //mm_menu_1208135145_0.addMenuItem("Mauritius","location='place/mauritius/'");
  mm_menu_1208135145_0.addMenuItem("South&nbsp;Africa","location='place/south_africa/'");
  mm_menu_1208135145_0.addMenuItem("Tanzania","location='place/tanzania/'");
  //mm_menu_1208135145_0.addMenuItem("Zambia","location='place/zambia/'");
   mm_menu_1208135145_0.hideOnMouseOut=true;
   mm_menu_1208135145_0.bgColor='#D7D7D7';
   mm_menu_1208135145_0.menuBorder=1;
   mm_menu_1208135145_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1208135145_0.menuBorderBgColor='#3d8eba';
          window.mm_menu_1208135403_0 = new Menu("root",123,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,true,true);
  mm_menu_1208135403_0.addMenuItem("Grenada","location='place/grenada/'");
  mm_menu_1208135403_0.addMenuItem("Puerto&nbsp;Rico","location='place/puerto_rico/'");
  mm_menu_1208135403_0.addMenuItem("St.Kitts&nbsp;&&nbsp;Nevis","location='place/st_kitts_and_nevis/'");
  mm_menu_1208135403_0.addMenuItem("Turks&nbsp;&&nbsp;Caikos","location='place/turks_and_caicos/'");
   mm_menu_1208135403_0.hideOnMouseOut=true;
   mm_menu_1208135403_0.bgColor='#000000';
   mm_menu_1208135403_0.menuBorder=1;
   mm_menu_1208135403_0.menuLiteBgColor='#FFFFFF';
   mm_menu_1208135403_0.menuBorderBgColor='#3d8eba';
window.mm_menu_1219134729_0 = new Menu("root",53,17,"Arial, Helvetica, sans-serif",11,"#000000","#FF0000","#D7D7D7","#53ab47","left","middle",3,0,600,-5,7,true,false,true,5,true,true);
  mm_menu_1219134729_0.addMenuItem("Chile","location='place/chile/'");
  //mm_menu_1219134729_0.addMenuItem("Peru","location='place/peru/'");
   mm_menu_1219134729_0.hideOnMouseOut=true;
   mm_menu_1219134729_0.bgColor='#555555';
   mm_menu_1219134729_0.menuBorder=0;
   mm_menu_1219134729_0.menuLiteBgColor='';
   mm_menu_1219134729_0.menuBorderBgColor='#3d8eba';

mm_menu_1219134729_0.writeMenus();
} // mmLoadMenus()

function MM_preloadImages() { //v3.0
  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() { //v3.0
  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) { //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_swapImage() { //v3.0
  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];}
}

function bookmarksite(title,url){
if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
}
else if(document.all)// ie
	window.external.AddFavorite(url, title);
}
function tellAjax(){
	var ajaxReq;  // The variable that makes Ajax possible!
//	document.getElementById('imgholder'+imageid).innerHTML="imgholder";
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxReq = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxReq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxReq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxReq.onreadystatechange = function(){
		if(ajaxReq.readyState == 1 || ajaxReq.readyState == 2 || ajaxReq.readyState == 3){
			document.getElementById('tellResult').innerHTML="<p style=\"color:green; font-weight:bold\">Sending mail</p>";
		}
		if(ajaxReq.readyState == 4){
			var ajaxDisplay = document.getElementById('tellResult');
			ajaxDisplay.innerHTML = ajaxReq.responseText;
		}
	}
	var fname=document.getElementById('fname').value
	var femail=document.getElementById('femail').value
	var name=document.getElementById('name').value
	var email=document.getElementById('email').value
	var note=document.getElementById('note').value
	var str="fname="+fname+"&femail="+femail+"&name="+name+"&email="+email+"&note="+note
	ajaxReq.open("POST","../inc/tellProcess.php", true)
	ajaxReq.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxReq.setRequestHeader("Content-length", str.length);
    ajaxReq.setRequestHeader("Connection", "close");
	ajaxReq.send(str)
}

function formvalidate(form)
            {

	            if(document.advertiseForm.firstName.value=="")
	            {
	            alert("Please Enter Your First Name");
	            document.advertiseForm.firstName.focus();
	            return false;
	            }
        else if(document.advertiseForm.lastName.value=="")
	            {
	            alert("Please Enter Your Last Name");
	            document.advertiseForm.lastName.focus();
	            return false;
	            }
		else if(document.advertiseForm.email.value=="")
	            {
	            alert("Please Enter Your Email");
	            document.advertiseForm.email.focus();
	            return false;
	            }
       else if (echeck(document.advertiseForm.email.value)==false)
			{
					document.advertiseForm.email.value=""
					document.advertiseForm.email.focus();
					return false;
			}
		else if(document.advertiseForm.Country.value=="")
	            {
	            alert("Please select a Country");
	            document.advertiseForm.Country.focus();
	            return false;
	            }
        else if(document.advertiseForm.State.value=="")
	            {
	            alert("Please select a State");
	            document.advertiseForm.State.focus();
	            return false;
	            }
		else if(document.advertiseForm.referrer.value=="")
	            {
	            alert("Please Enter Security Word");
	            document.advertiseForm.referrer.focus();
	            return false;
	            }

          else
                  {
                 document.advertiseForm.submit();
                  }
	  return true;
}
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("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true
	}
