// JavaScript Document

var menu=new Array();

var submenu=new Array();

var menuUp=new Array();

var subUp=new Array();

var menuDwn=new Array();

var subDwn=new Array();

var subDwns=new Array();

menuUp[0]=new Array('HOME',"index.php");
menuUp[7]=new Array('CUSTOMIZED',"customized_tour.php");
menuUp[1]=new Array('FIND YOUR TRIP','general_information.php?guide_id=1','mm2');

subUp[1]=new Array();

subUp[1][0]=new Array('GENERAL INFORMATION','general_information.php?guide_id=1');

subUp[1][1]=new Array('DIVERSIFIED TOURS',
'main_tours.php?group_id=182be0c5cdcd5072bb1864cdee4d3d6e&group_name=Diversified+Vietnam');

subUp[1][2]=new Array('UNITED TOURS',
'main_tours.php?group_id=e369853df766fa44e1ed0ff613f563bd&group_name=United+Vietnam');

subUp[1][3]=new Array('BOUTIQUE TOURS',
'main_tours.php?group_id=1c383cd30b7c298ab50293adfecb7b18&group_name=Boutique+Vietnam');

subUp[1][4]=new Array('CLASSIC TOURS','main_tours.php?group_id=1ff1de774005f8da13f42943881c655f&group_name=Classic+Tours');

subUp[1][5]=new Array('CULTURAL TOURS','main_tours.php?group_id=8e296a067a37563370ded05f5a3bf3ec&group_name=Cultural+Tours');

subUp[1][6]=new Array('ADVENTURE TOURS','main_tours.php?group_id=4e732ced3463d06de0ca9a15b6153677&group_name=Adventure+-+Treeking+Tours');

subUp[1][7]=new Array('BEACH & VACATION TOURS','main_tours.php?group_id=02e74f10e0327ad868d138f2b4fdd6f0&group_name=Beach+Escape+%26+Vacation');

subUp[1][8]=new Array('SHORT LOCAL TOURS','main_tours.php?group_id=34173cb38f07f89ddbebc2ac9128303f&group_name=Daily+Departure+Tour');

subUp[1][9]=new Array('CROSS BORDER TOURS','main_tours.php?group_id=c16a5320fa475530d9583c34fd356ef5&group_name=Cross+Border+Tours');

subUp[1][10]=new Array('CUSTOMIZED TOURS','customized_tour.php');



menuUp[2]=new Array('VIETNAM OVERVIEW','vietnamdestination.php?province_id=22','mm3');

subUp[2]=new Array();

subUp[2][0]=new Array('VIETNAM DESTINATION','vietnamdestination.php?province_id=22');

subUp[2][1]=new Array('VIETNAM PHOTO','photogallary.php');

subUp[2][2]=new Array('VIETNAM PAINTING','vietnampainting.php');

subUp[2][3]=new Array('VIETNAM FOOD','venuevietnam.php?guide_id=5');



menuUp[3]=new Array('DOCUMENTS','#','mm4');

subUp[3]=new Array();

subUp[3][0]=new Array('BROCHURE 2007 - 2008','brochure/foto.php');

subUp[3][1]=new Array('DOWNLOAD DOCUMENTS','brochure/individual.php');



menuUp[4]=new Array('RELATED INFORMATION','venuevietnam.php?guide_id=6','mm5');

subUp[4]=new Array();

subUp[4][0]=new Array('BOOKING CONDITIONS','venuevietnam.php?guide_id=13');

subUp[4][1]=new Array('BOOKING FORM','bookingform.php');

subUp[4][2]=new Array('TRAVELER HELP & SUPPORTS','venuevietnam.php?guide_id=6');

subUp[4][3]=new Array('FAQs','venuevietnam.php?guide_id=7');

subUp[4][4]=new Array('FEEDBACK','feedback.php');

subUp[4][5]=new Array('TESTIMONIALS','testimonial.php');



menuUp[5]=new Array('ABOUT US','venuevietnam.php?guide_id=10','mm6');

subUp[5]=new Array();


menuUp[6]=new Array('CONTACT US',"contactus.php?guide_id=12");

function makeMenu(a,b,c,d){

 cel='<tr>'; cels='</tr>'; celt=''; celts=''; al='align=center';

 vl='#569482';tp='style="border-top:1px solid white"';t='colspan=2';

 if(a=='hor'){

  cel=''; cels='<td class=st>|</td>'; celt='<tr>'; celts='</tr>'; 

  al=''; vl='#00A002'; tp='';t='';

 }

 tmp='';

 tmpt='<table id=menutab class="tab menu" style=background:'+vl+' cellpadding=0 cellspacing=0 width=127>'

 sub='';

 for(var i=0;i<b.length;i++){

  arr=b[i].length;

  if (arr==3){

  id=b[i][2]+i;

  kt='';

  if((b.length-1)==i) kt='sa';

   if(a=='hor'){

    tmp=tmp + cel + '<td id="'+id+'" class="col padMenu" lowClass="bg padMenu" '+tp+' onmouseover="over(); showAll(\''+b[i][2]+'\',\''+id+'\',\''+a+'\',1); swClass(this)" onmouseout="out(\''+b[i][2]+'\'); swClass(this)" nowrap title="'+b[i][0] +'" onclick="goPage(\''+b[i][1]+'\')" kt='+kt+'>'+b[i][0]+'</td><td><div style=position:absolute>'+makeSubMenu(d,c[i],b[i][2],a,id)+'</div></td><td class=st>|</td>';

   }else{

    tmp=tmp + cel + '<td width=124px id='+id+' class="col padMenu" lowClass="bg padMenu" '+tp+' onmouseover="over(); showAll(\''+b[i][2]+'\',\''+id+'\',\''+a+'\',1); swClass(this,\''+id+'s\')" onmouseout="out(\''+b[i][2]+'\'); swClass(this,\''+id+'s\')" onclick="goPage(\'' + b[i][1] + '\')" nowrap title="'+b[i][0] +'">'+b[i][0]+'</td><td id='+id+'s class=col lowClass=bg onmouseover="over(); showAll(\''+b[i][2]+'\',\''+id+'\',\''+a+'\',0); swClass(this,\''+id+'\')" onmouseout="out(\''+b[i][2]+'\'); swClass(this,\''+id+'\')" '+tp+' onclick="goPage(\''+b[i][1]+'\')"><img hspace=2 src=/img/arrow.gif></td><td><div style=position:absolute>'+ makeSubMenu(d,c[i],b[i][2],a,id) + '</div></td>' + cels;

   }

  }else{

   tmp= tmp + cel + '<td class="padMenu col" lowClass="bg padMenu" '+tp+' nowrap st="'+b[i][1]+'" lowst="" onmouseover=swClass(this) onmouseout=swClass(this) onclick="goPage(\''+b[i][1]+'\')" '+t+'>'+ b[i][0] + '</td>' + cels;

  }//end if

 }//end for

 if(a=='hor'){tmp = tmp.substr(0,tmp.length-12);}

 return tmpt + celt + tmp + celts + '</table>'// + submenu;

}//end function makeMenu



function makeSubMenu(a,b,c,d,e){

 tmp=''; t='';

 st='style="border-top:1px solid white"';

 td='<tr>';tr='<tr><td><img src=/img/blank.gif width=1px height=2px></td></tr>'

 eve='onmouseover="over(); showAll(\''+c+'\',\''+e+'\'); swClass(this,\''+e+'\')" onmouseout="out(\''+c+'\'); swClass(this,\''+e+'\')"';

 if(d=='ver'){

 td='<tr><td width=1px rowspan='+b.length+'><img src=/img/blank.gif width=1px height=1px></td>'; tr='';

 eve='onmouseover="over(); showAll(\''+c+'\',\''+e+'\',\''+d+'\'); swClass(this,\''+e+'\',\''+e+'s\')" onmouseout="out(\''+c+'\'); swClass(this,\''+e+'\',\''+e+'s\')"';

 t='colspan=2';

 }

 tmptab='<table id='+c+' class=tab style=position:absolute;visibility:hidden cellpadding=0 cellspacing=0>'+tr;

 for(i=0;i<b.length;i++){

  arr=b[i].length;

  if(arr==3){

   id=b[i][2]+i;

   tmp = tmp + '<td id='+id+' class="bgMenu menu" lowClass="bgMenus menu" '+st+' onmouseover="over(); showAll(\''+c+'\',\''+e+'\',\''+d+'\',0,\''+b[i][2]+'\'); swClass(this,\''+id+'s\',\''+e+'\',\''+e+'s\')" onmouseout="out(\''+b[i][2]+'\',\''+c+'\'); swClass(this,\''+id+'s\',\''+e+'\',\''+e+'s\')" onclick="goPage(\''+b[i][1]+'\')"  nowrap>'+b[i][0]+'</td><td id='+id+'s class="bg menu" lowClass="bgs"  onmouseover="over(); showAll(\''+c+'\',\''+e+'\',\''+d+'\',0,\''+b[i][2]+'\',1); swClass(this,\''+id+'\')" onmouseout="out(\''+b[i][2]+'\',\''+c+'\'); swClass(this,\''+id+'\')" onclick="goPage(\''+b[i][1]+'\')" '+st+'><img hspace=4 src=/img/arrow.gif></td><td><div id=mk  style=position:absolute>'+makeSubMenus(a[i],b[i][2],c,e,id)+'</div></td></tr>'

  }else{

   tmp = tmp + '<td class="bgMenu menu" lowClass="bgMenus menu" st="'+b[i][1]+'" lowst="" '+eve+' onclick="goPage(\''+b[i][1]+'\')" style="border-top:1px solid white" '+t+' nowrap>'+b[i][0]+'</td></tr>';

  } //end if

 }//end for

 if(d=='ver'){tmp = tmp + '<tr><td height=2px></td></tr>'}

 return tmptab + td + tmp + '</table>'

}//end function makeSubMenu



function makeSubMenus(a,b,c,d,e){

 tmps='';

 len=a.length



 tmp='<table id='+b+' class=tab style=position:absolute;top:-9px;left:1px;visibility:hidden cellpadding=0 cellspacing=0>';

 for(var i=0;i<len;i++){

  tmp=tmp+'<tr><td class="bgMenu menu" lowClass="bgMenus menu" onmouseover="over(); swClass(this,\''+d+'\',\''+d+'s\',\''+e+'\',\''+e+'s\')" onmouseout="out(\''+c+'\',\''+b+'\'); swClass(this,\''+d+'\',\''+d+'s\',\''+e+'\',\''+e+'s\')" onclick="goPage(\''+a[i][1]+'\')" style="border-top:1px solid white" nowrap>'+a[i][0]+'</td></tr>'

 }

 return tmp + '</table>'

} //end function



var hideTime;

var wait=500;

var idlast='';

var opctime;

var kind=navigator.appName;

var idlasts='';



function over(){

 if(hideTime!=null) clearTimeout(hideTime);

}



function showAll(a,b,d,e,f,g){

 obj=document.getElementById(a);

 objs=document.getElementById(b);

 if(idlast!=''){

  objss=document.getElementById(idlast);

  objss.style.visibility='hidden';

  if(idlasts!=''){

  objss=document.getElementById(idlasts);

  objss.style.visibility='hidden'

  }

  

 }

 if(e==1) fadeIn(obj,'visible');

 if(f){

  objf=document.getElementById(f);

  if(!g) fadeIn(objf,'visible');

  objf.style.visibility='visible';

  idlasts=f;

  if(kind=='Netscape') objf.style.cssText='position:absolute;top:-9px;left:2px';

 }

 

 obj.style.visibility='visible';

 if(d=='ver'){

  tmp=0;

  tmptop=-9;

  if(kind=='Netscape'){

   tmp=0;

   tmptop=-9;

  }

 }else{

 tmp=-objs.offsetWidth;

 if(objs.getAttribute('kt')=='sa') tmp=-obj.offsetWidth

 tmptop=8;

 if(kind=='Netscape'){

   tmptop=9;

  }

 }

 obj.style.left=tmp+'px';

 obj.style.top =tmptop+'px';

 idlast=a;

 

}



function out(a,b){

 tmp='\''+a+'\'';

 if(b) tmp='\''+a+'\',\''+b+'\'';

 hideTime=setTimeout("hideAll("+tmp+")",wait);

}



function hideAll(a,b){

 obj=document.getElementById(a);

 fadeIn(obj,'hidden');

 obj.style.visibility='hidden';

 if(b){

  obj=document.getElementById(b);

//  fadeIn(obj,'hidden');

  obj.style.visibility='hidden';

 }

}



function fadeIn(a,b){

  if(kind == "Microsoft Internet Explorer"){

   a.style.filter="blendTrans(duration=0.4)";

   a.filters.blendTrans.apply();

   a.style.visibility=b

   a.filters.blendTrans.play();

  }

}





function swClass(a){

 len=arguments.length;

 if(len > 1){

  for(var i=1;i<len;i++){

   tmp=document.getElementById(arguments[i]);

   clss=tmp.className;

   tmp.className=tmp.getAttribute('lowClass');

   tmp.setAttribute('lowClass',clss);

  }

 }

  cls=a.className;

  a.className=a.getAttribute('lowClass');

  a.setAttribute('lowClass',cls);

 

}



function goPage(a){

 location.href=a;

}

var isNS = (navigator.appName == "Netscape") ? 1 : 0;

var EnableRightClick = 1;

if(isNS) 

document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);

function mischandler(){

  if(EnableRightClick==1){ return true; }

  else {return false; }

}

function mousehandler(e){

  if(EnableRightClick==1){ return true; }

  var myevent = (isNS) ? e : event;

  var eventbutton = (isNS) ? myevent.which : myevent.button;

  if((eventbutton==2)||(eventbutton==3)) return false;

}

function keyhandler(e) {

  var myevent = (isNS) ? e : window.event;

  if (myevent.keyCode==96)

    EnableRightClick = 1;

  return;

}

document.oncontextmenu = mischandler;

document.onkeypress = keyhandler;

document.onmousedown = mousehandler;

document.onmouseup = mousehandler;



function showhidden(a){

 tmp=a.lastChild;

 cls=tmp.className;

 tmp.className=tmp.getAttribute('lowclass');

 tmp.setAttribute('lowclass',cls)

}

function isemail(email) {

	var re = /^(\w|[^_]\.[^_]|[\-])+(([^_])(\@){1}([^_]))(([a-z]|[\d]|[_]|[\-])+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i



	return re.test(email);

}

function onlyNumber(){

	if((event.keyCode<48)||(event.keyCode>57))

	event.returnValue=false;

}

function go_search(){

	if(frmSearch.product_name.value==''){

		alert("Please chose keyword!");

		frmSearch.product_name.focus();

		return;

	}

	document.frmSearch.submit();

}

function change_combo(combo1,combo2){

	sindex = combo1.value;

	if(sindex=='') sindex = 0;

	for(i=0; i<step1[sindex].length; i++) {

		combo2.options[i] = null;

		}//endfor 1				

		combo2.options.length = step1[sindex].length;

		for(i=0; i<step1[sindex].length; i++) {		

			temp = step1[sindex][i]

			var k = temp.split("|")

			var step1_name = k[0]

			var step1_code = k[1]		

			combo2.options[i].text = step1_name;

			combo2.options[i].value = step1_code;		

		}//end for 2

}

function openwin(url,w_title,width,height){

		var maxw = window.screen.availWidth;

		var maxh = window.screen.availHeight;

		var win = window.open(url,w_title,'screenX=0,screenY=0,left='+((maxw-width)/2)+',top=0,width=' + width + ',height=' + height+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');

		win.focus();

}

function NewWindow(mypage, myname, w, h, scroll) { 

	var winl = (screen.width - w) / 2; 

	var wint = (screen.height - h) / 2; 

	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable' 

	win = window.open(mypage, myname, winprops) 

	if(parseInt(navigator.appVersion) >= 4) { win.window.focus(); } 

} 

function change_supplier(){

    var supplier_id=document.frmsupplier.cbosupplier.value;

	if(supplier_id){

		location.href = "tours_day.php?supplier_id=" + supplier_id;

	}

}
