
var agt = navigator.userAgent.toLowerCase();
var ns6 = (!document.all && document.getElementById);
var ie5 = (agt.indexOf('msie') != -1);
var ie4 = document.all;
var ns4 = (document.layers);
var t;
var submenus = ["aboutus","services","people","client","markets","careers"];
var currentStory = -1;
var currentLength = 0;
var objTicker;
var characterTimeout = 50;
var storyTimeout = 5000;
var WidgetOne = "_";
var WidgetTwo = "-";
var NoWidget = "";
var headLines = new Array();
var headLineLinks = new Array();
var objTicker;


function jsfnHighlightItem(item,cname)
{//alert();
      /**********************************************************************************   
      *   Function Name: jsfnHighlight
      *   Parameters: item
      *   Returns: N/A
      *   Description: The function Highlights the menu Cell
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   SK                       12/02/07          Created
      *********************************************************************************/
  var obj;
  obj = jsfnfindObj(item);
  obj.className = cname;
}


function jsfnDimItem(item,cname)
{
      /**********************************************************************************   
      *   Function Name: jsfnDimMe
      *   Parameters: obj
      *   Returns: N/A
      *   Description: The function dims the highlighted Cell
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   SK                       12/02/07          Created
      *********************************************************************************/
  var obj;
  obj = jsfnfindObj(item);
  obj.className = cname;
}
	
function jsfnfindObj(n,d) { //v4.01
      /**********************************************************************************   
      *   Function Name: jsfnfindObj
      *   Parameters: n = id, d=document object
      *   Returns:  an object 
      *   Description: The function parses thorugh all the components in the page to locate 
      * 	the object corresponding to the id given and returns it
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   ML                       02/03/05          Created
      *********************************************************************************/
  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&&d.layers&&i<d.layers.length;i++) 
    x=jsfnfindObj(n,d.layers[i].document);
  if(!x && d.getElementById) 
	x=d.getElementById(n); 
  return x;
}	



function jsfnPopUp(menuid,action)
{//alert(menuid);
      /**********************************************************************************   
      *   Function Name: jsfnPopUp(id,action)
      *   Parameters: menuid = identity of the item , action=show/hide
      *   Returns: N/A
      *   Description: The function displays the popupmenu
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   ML                       02/03/05          Created
      *********************************************************************************/
var obj,v;

v = action;
if (t) {
      clearTimeout(t);
      t = null;
}
if ((obj=jsfnfindObj(menuid))!=null)  { 
		
         if (obj.style) {
			
            obj=obj.style; 
            v=(action=='show')?'block':(action=='hide')?'none':action; 
          }
        obj.display=v; 
	}	
}


function jsfnsetTimer(menuid)
{ 
      /**********************************************************************************   
      *   Function Name: jsfnsetTimer
      *
      *   Parameters: menuid = identity of the item
      *               
      *   Returns: N/A
      *   Description: The function sets a timer to call the function to hide the item 
      *        represened by the id.
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   ML                       02/03/05          Created
      *********************************************************************************/

 t = setTimeout("jsfnPopUp('" + menuid + "','hide')",400);

}
function jsfnlayersCloseAll(){
      /**********************************************************************************   
      *   Function Name: jsfnlayersCloseAll
      *   Parameters: None
      *   Returns: N/A
      *   Description: The function forcibly hides all the popup submenus 
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   ML                       02/05/05          Created
      *********************************************************************************/
for (var i=0;i < submenus.length;i++)
         jsfnPopUp(submenus[i],'hide');
}

function jsfnfindObj(n,d) { //v4.01
      /**********************************************************************************   
      *   Function Name: jsfnfindObj
      *   Parameters: n = id, d=document object
      *   Returns:  an object 
      *   Description: The function parses thorugh all the components in the page to locate 
      * 	the object corresponding to the id given and returns it
      *   Revision History:
      *   Initials                 Date              Changes
      * ---------------------------------------------------------- 
      *   ML                       02/03/05          Created
      *********************************************************************************/
  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&&d.layers&&i<d.layers.length;i++) 
    x=jsfnfindObj(n,d.layers[i].document);
  if(!x && d.getElementById) 
	x=d.getElementById(n); 
  return x;
}


function validate()
{

	if (document.f1.fname.value=="")
	{
		alert("Please enter your name");
		document.f1.fname.focus();
		return false;
	}

	

	if (document.f1.privatephone.value=="")
	{
		alert("Please enter company phone");
		document.f1.privatephone.focus();
		return false;
	}


	if (document.f1.privateemail.value=="")
	{
		alert("Enter your email address");
		document.f1.privateemail.focus();
		return false;
		
	}
	else
	{
		var str=document.f1.privateemail.value;

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(dot)==(str.length-1))
		{
			alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
			return false;
		}
		 if (str.indexOf(at)==-1){
		   alert("Invalid e-mail ID");
		   document.f1.privateemail.focus();
		   return false;
		}

		 if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid e-mail ID");
		   document.f1.privateemail.focus();
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		}

		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }

		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }
		
		if (str.indexOf(" ")!=-1){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }
}

if (document.f1.date1xx.value=="")
	{
		alert("Please enter arrival date");
		document.f1.date1xx.focus();
		return false;
	}

if (document.f1.date2xx.value=="")
	{
		alert("Please enter departure date");
		document.f1.date2xx.focus();
		return false;
	}

if (document.f1.roomtype.value=="")
	{
		alert("Please enter room type");
		document.f1.roomtype.focus();
		return false;
	}

if (document.f1.noofadults.value=="")
	{
		alert("Please enter number of adults");
		document.f1.noofadults.focus();
		return false;
	}

if (isNaN(document.f1.noofadults.value))
	{
   alert("Please enter numerals only");
   document.f1.noofadults.focus();
		return false;
	}  

if (document.f1.noofchild.value=="")
	{
		alert("Please enter number of children");
		document.f1.noofchild.focus();
		return false;
	}
if (isNaN(document.f1.noofchild.value))
	{
   alert("Please enter numerals only");
   document.f1.noofchild.focus();
		return false;
	}  

document.f1.submit();

}
  
	   
function contactvalidate()
  {
	if (document.f1.fname.value=="")
	{
		alert("Please enter your first name");
		document.f1.fname.focus();
		return false;
	}

	if (document.f1.lname.value=="")
	{
		alert("Please enter your last name");
		document.f1.lname.focus();
		return false;
	}

	

	if (document.f1.city.value=="")
	{
		alert("Please enter your city");
		document.f1.city.focus();
		return false;
	}

	if (document.f1.country.value=="")
	{
		alert("Please enter your country");
		document.f1.country.focus();
		return false;
	}

	

	if (document.f1.email.value=="")
	{
		alert("Please enter your email");
		document.f1.email.focus();
		return false;
	}
   else
	{
		var str=document.f1.email.value;

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(dot)==(str.length-1))
		{
			alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
			return false;
		}
		 if (str.indexOf(at)==-1){
		   alert("Invalid e-mail ID");
		   document.f1.privateemail.focus();
		   return false;
		}

		 if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid e-mail ID");
		   document.f1.privateemail.focus();
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		}

		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }

		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }
		
		if (str.indexOf(" ")!=-1){
		    alert("Invalid e-mail ID");
			document.f1.privateemail.focus();
		    return false;
		 }
}

	if (document.f1.pobox.value=="")
	{
		alert("Please enter your pst box number");
		document.f1.pobox.focus();
		return false;
	}
   document.f1.submit();
  }


  function contactreset()
  {
	document.f1.fname.value="";
	document.f1.lname.value="";
	document.f1.company.value="";
	document.f1.city.value="";
	document.f1.country.value="";
	document.f1.phone.value="";
	document.f1.fax.value="";
	document.f1.email.value="";
	document.f1.pobox.value="";
	document.f1.comments.value="";

  }

   function reservationreset()
  {
	document.f1.fname.value="";	
	document.f1.company.value="";
	document.f1.companyphone.value="";
	document.f1.companyfax.value="";
	document.f1.privatephone.value="";
	document.f1.privatefax.value="";
	document.f1.privateemail.value="";
	document.f1.arrivaltime.value="";
	document.f1.departuretime.value="";
	document.f1.arrivalflight.value="";
	document.f1.departureflight.value="";
	document.f1.remarks.value="";
	document.f1.roomtype.value="";
	document.f1.noofadults.value="";
	document.f1.noofchild.value="";
	document.f1.date1xx.value="";
	document.f1.date2xx.value="";
  }
  
  
  
  
  
var emailwnd = '';
var prnwnd = '';
var popwnd='';
var locwnd='';

function printpage(val,val1,val2)
	{	
	var url;	
	url="print.asp?sec=" + val + "&cat=" + val1 + "&subcat=" + val2;

	 	if (!prnwnd.closed && prnwnd.location)
				{
					prnwnd.location.href=url ;
				}
				else
				{
					prnwnd = window.open(url,'prnwnd','toolbar=no,status=yes,resizable=no,scrollbars=yes,width=617,height=411,top=0,left=0');
					if (!prnwnd.opener) prnwnd.opener = self;
				}
				if (window.focus) {prnwnd.focus()}			
	}		



function emailpage(val1,val2,val3)
	{	
	var url;	
		url="emailpage.asp?sec=" +  val1 + "&cat=" + val2 + "&subcat=" +val3;
		
		if (!emailwnd.closed && emailwnd.location)
				{
					emailwnd.location.href=url;
				}
				else
				{
				emailwnd = window.open(url,'emailwnd','toolbar=no,status=yes,resizable=no,scrollbars=no,width=400,height=300,top=0');
					if (!emailwnd.opener) emailwnd.opener = self;
				}
				if (window.focus) {emailwnd.focus()}				
	}		
	
	
	
	
	
	function popquestion()
	{
		var url;	
		url="question.asp";
		
		if (!emailwnd.closed && emailwnd.location)
				{
					emailwnd.location.href=url;
				}
				else
				{
				emailwnd = window.open(url,'emailwnd','toolbar=no, menubar=yes, status=yes,resizable=no,scrollbars=yes,width=450,height=600,top=0');
					if (!emailwnd.opener) emailwnd.opener = self;
				}
				if (window.focus) {emailwnd.focus()}				
	}
	
	
	
	
	
	
	
	
	
	
	
	function emailvalidate()
  	{	

	if (document.frmQuest.txtemail.value=="")
	{
		alert("Please enter your email");
		document.frmQuest.txtemail.focus();
		return false;
	}
   else
	{
		var str=document.frmQuest.txtemail.value;
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(dot)==(str.length-1))
		{
			alert("Invalid e-mail ID");
			document.frmQuest.txtemail.focus();
			return false;
		}
		 if (str.indexOf(at)==-1){
		   alert("Invalid e-mail ID");
		   document.frmQuest.txtemail.focus();
		   return false;
		}

		 if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid e-mail ID");
		   document.frmQuest.txtemail.focus();
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid e-mail ID");
			document.frmQuest.txtemail.focus();
		    return false;
		}

		if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid e-mail ID");
			document.frmQuest.txtemail.focus();
		    return false;
		 }

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid e-mail ID");
			document.frmQuest.txtemail.focus();
		    return false;
		 }

		if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid e-mail ID");
			document.frmQuest.txtemail.focus();
		    return false;
		 }
		
		if (str.indexOf(" ")!=-1){
		    alert("Invalid e-mail ID");
			document.frmQuest.txtemail.focus();
		    return false;
		 }
	}
	
   document.frmQuest.submit();
  }
  
  
  
  
  function txtOther()
  {			
	if (document.getElementById("chkOther").checked==true)
	{		
		document.getElementById("txtOtherDetails").disabled=false;				
	}	
	else
	{
		document.getElementById("txtOtherDetails").disabled=true;		
	}
  }
  
  
  

  
  
  

