function showhint(text){	var xtext = text;	document.getElementById('divhint').innerHTML='<table width="250px" cellspacing="0" cellpadding="3" align="center" class="mrgt5" style="border:1px solid #e37930;padding:3px 5px;color:#e37a32;position:fixed;"><tr bgcolor="#ffffff"><td>'+xtext+'</td></tr></table>';}function check_form_apply(){	if (document.applystep2.name.value == '')	{		alert('Please input your Name!');		document.applystep2.name.focus();		return false;	}	if (document.applystep2.country.value == '')	{		alert('Please select your Country!');		document.applystep2.country.focus();		return false;	}		if (document.applystep2.passport_number.value == '')	{		alert('Please input Passport Number!');		document.applystep2.passport_number.focus();		return false;	}	if (document.applystep2.birth.value == '')	{		alert('Please input Date of birth!');		document.applystep2.birth.focus();		return false;	}			if (document.applystep2.email.value == '')	{		alert('Please input your email!');		document.applystep2.email.focus();		return false;	}		if (document.applystep2.arrival.value == '')	{		alert('Please input Date of arrival!');		document.applystep2.arrival.focus();		return false;	}    if (document.applystep2.flight.value == '')	{		alert('Please input Flight Ref!');		document.applystep2.flight.focus();		return false;	}	return true;}function check_form_apply1(){	if (document.applystep1.number_visa.value == '')	{		alert('Please select Number of visa !');		document.applystep1.number_visa.focus();		return false;	}	if (document.applystep1.purpose.value == '')	{		alert('Please choose Purpose of visit!');		document.applystep1.purpose.focus();		return false;	}	if (document.applystep1.type.value == '')	{		alert('Please choose Type of Visa!');		document.applystep1.type.focus();		return false;	}			return true;}function check_form_apply5(){	if (document.applystep5.terms_of_ervice.value == '')	{		alert('To complete your purchase you must accept the ');		document.applystep5.terms_of_ervice.focus();		return false;	}		return true;}function getXMLHTTP() { //fuction to return the xml http object		var xmlhttp=false;			try{			xmlhttp=new XMLHttpRequest();		}		catch(e)	{					try{							xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");			}			catch(e){				try{				req = new ActiveXObject("Msxml2.XMLHTTP");				}				catch(e1){					xmlhttp=false;				}			}		}		 			return xmlhttp;	}function getSubCat(strURL){       var req = getXMLHTTP(); // fuction to get xmlhttp object     if (req)     {      req.onreadystatechange = function()      {		 		  if (req.readyState == 4)		  { //data is retrieved from server		 	   if (req.status == 200)			   	{ // which reprents ok status 					 document.getElementById('subCatDiv').innerHTML=req.responseText;				}		       else		       { 				 alert("There was a problem while using XMLHTTP:\n");		       }    	   }                  }            req.open("GET", strURL, true); //open url using get method    req.send(null);	}}function checkfrm(searchfrm) {var keyword = searchfrm.keyword.value;if (keyword=='' || keyword=='Nhập nội dung cần tìm kiếm' || keyword=='Nháº­p%20ná»™i%20dung%20cáº§n%20tÃ¬m%20kiáº¿m') {alert("Vui lòng nhập nội dung tìm kiếm!");searchfrm.keyword.focus();return false;	}}function sshow( targetId ){	if (document.getElementById)	{		target = document.getElementById( targetId );		if (target.style.display == "none")		{			target.style.display = "";		}	}}function shide( targetId ){	if (document.getElementById)	{		target = document.getElementById( targetId );		if (target.style.display == "block" || target.style.display == "")		{			target.style.display = "none";		}	}}function loadpage(url,id,eval_str){    if(document.getElementById){var x=(window.ActiveXObject)?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();}    if(x){x.onreadystatechange=function() {        el=document.getElementById(id);        el.innerHTML='<img src=\"img/spinner.gif\" width=\"16\" height=\"16\" alt=\"Loading..\" class=\"inlineimg\" />';        if(x.readyState==4&&x.status==200){            el.innerHTML='';            el=document.getElementById(id);            el.innerHTML=x.responseText;            eval(eval_str);            }        }    x.open("GET",url,true);x.send(null);    }}function makePOSTAddRequest(url, parameters) { http_request = false; if (window.XMLHttpRequest) {     http_request = new XMLHttpRequest();     if (http_request.overrideMimeType) {       http_request.overrideMimeType('text/html');     } } else if (window.ActiveXObject) {     try {       http_request = new ActiveXObject("Msxml2.XMLHTTP");     } catch (e) {       try {           http_request = new ActiveXObject("Microsoft.XMLHTTP");       } catch (e) {}     } } if (!http_request) {     alert('Lỗi XMLHTTP');     return false; } http_request.onreadystatechange = alertAdd; http_request.open('POST', url, true); http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http_request.setRequestHeader("Content-length", parameters.length); http_request.setRequestHeader("Connection", "close"); http_request.send(parameters);}function alertAdd() {   document.getElementById('loading').innerHTML = '<img src=\"img/spinner.gif\" width=\"16\" height=\"16\" alt=\"Loading..\" class=\"inlineimg\" /> '; if (http_request.readyState == 4) {     if (http_request.status == 200) {       result = http_request.responseText;       document.getElementById('loading').innerHTML = '';       document.getElementById('showresult').innerHTML = result;       document.getElementById('stf').innerHTML = '';               } else {       alert('Lỗi trong quá trình thực hiện!');     } }}function get_data(obj) {	pid = encodeURIComponent(document.getElementById("pid").value);	name = encodeURIComponent(document.getElementById("name").value);	rate = encodeURIComponent(document.getElementById("rate").value);	comment = encodeURIComponent(document.getElementById("comment").value);	var poststr = ('pid='+pid+'&name='+name+'&rate='+rate+'&comment='+comment);	makePOSTAddRequest('danh-gia.html', poststr);	commentfrm.name.value = "";	commentfrm.comment.value = "";}function bookmark() {	if(window.sidebar) { window.sidebar.addPanel(document.title,document.location.href,""); }	else if( document.all ) { window.external.AddFavorite(document.location.href,document.title); }	else { alert("Rất tiếc! Trình duyệt của bạn không hỗ trợ đặt Bookmark!"); }}function bookmarksite(title, url){	if (document.all)	window.external.AddFavorite(url, title);	else if (window.sidebar)	window.sidebar.addPanel(title, url, "")}function GoCategory(objCat){	window.open(objCat, '_top', '');}function toggle( targetId ){	if (document.getElementById)	{		target = document.getElementById( targetId );		if (target.style.display == "none")		{			target.style.display = "";		}		else		{			target.style.display = "none";		}	}}function togglebox( bid, add ){	if ( add )	{				my_show_div( my_getbyid( 'close_'+bid  ) );		my_hide_div( my_getbyid( 'open_'+bid  ) );	}	else	{		my_show_div( my_getbyid( 'open_'+bid  ) );		my_hide_div( my_getbyid( 'close_'+bid  ) );	}}function characterCounter(fieldName, maxLength, elementName){	var field = getById(fieldName);	var value = field.value.replace(/\n/g,'**');		if (value.length > maxLength){		getById(fieldName).value = getById(fieldName).value.substr(0, maxLength);	}	getById(elementName).innerHTML = getById(fieldName).value.length;}function footer() {	document.writeln('');}function banner() {	document.writeln('<embed flashvars=\"link=#\" src=\"img/banner/header.swf\" type=\"application/x-shockwave-flash\" width=\"480\" height=\"80\" />');}function headbanner() {	document.writeln('<embed flashvars=\"link=#\" src=\"img/banner/head.swf\" type=\"application/x-shockwave-flash\" width=\"616\" height=\"80\" />');}function left(){	document.writeln('');}function right(){}function forex(){	document.writeln('<table width=\'100%\' cellspacing=\'1\' cellpadding=\'3\' bgcolor=\'#333\'>');	document.writeln('<tr bgcolor=\'#222\'><td align=\'center\' width=\'50%\'>', vForexs[0],'</td><td align=\'center\' width=\'50%\'>', vCosts[0],'</td></tr>');	document.writeln('<tr bgcolor=\'#222\'><td align=\'center\'>', vForexs[1],'</td><td align=\'center\'>', vCosts[1],'</td></tr>');	document.writeln('<tr bgcolor=\'#222\'><td align=\'center\'>', vForexs[6],'</td><td align=\'center\'>', vCosts[6],'</td></tr>');	document.writeln('<tr bgcolor=\'#222\'><td align=\'center\'>', vForexs[9],'</td><td align=\'center\'>', vCosts[9],'</td></tr>');	document.writeln('<tr bgcolor=\'#222\'><td align=\'center\'>', vForexs[10],'</td><td align=\'center\'>', vCosts[10],'</td></tr>');	document.writeln('</table>');}function write_cookie (name, value, days){	// Build the expiration date string:	if (!days) {		days = 365;	} 			var expiration_date = new Date();	expiration_date.setDate(expiration_date.getDate () + days);	expiration_date = expiration_date.toGMTString ();	// Build the set-cookie string:	var cookie_string = escape (name) + "=" + escape (value) +		"; expires=" + expiration_date;	// Set path to root for all cookies	cookie_string += "; path=/";	// Create/update the cookie:	document.cookie = cookie_string;}function read_cookie (key, skips){	// Set skips to 0 if parameter was omitted:	if (skips == null)		skips = 0;	// Get cookie string and separate into individual cookie phrases:	var cookie_string = "" + document.cookie;	var cookie_array = cookie_string.split ("; ");	// Scan for desired cookie:	for (var i = 0; i < cookie_array.length; ++i)	{		var single_cookie = cookie_array [i].split ("=");		if (single_cookie.length != 2)			continue;		var name  = unescape (single_cookie [0]);		var value = unescape (single_cookie [1]);		// Return cookie if found:		if (key == name && skips -- == 0)			return value;	}	// Cookie was not found:	return null;}// better "create cookie" function. if no days are passed, session ends when browser closes.// function createCookie(name,value,days) {	if (days) {		var date = new Date();		date.setTime(date.getTime()+(days*24*60*60*1000));		var expires = "; expires="+date.toGMTString();	}	else var expires = "";	document.cookie = name+"="+value+expires+"; path=/";}function eraseCookie (name) {write_cookie (name,"",-1);}function addProdId(productId) {	currentProductId = productId;	var x = read_cookie('listprod');	if (x) {		x = x; // list of products in cookie		y = currentProductId; // current product to be passed into cookie		if (x.indexOf(y) > -1) {			products = x;		} else { 			products = x +","+ y;		}		// create the final cookie		write_cookie('listprod',products,30);		completeList = read_cookie('listprod');		loadRecentView(completeList,currentProductId);	} else {		write_cookie('listprod',currentProductId,30);	}}function loadRecentView(completeList, currentProductId) {		var completeList = completeList.split(',');		var prod1 = completeList[completeList.length-1];		var prod2 = completeList[completeList.length-2];		var prod3 = completeList[completeList.length-3];		var prod4 = completeList[completeList.length-4];		if (prod4 && prod3 && prod2 && prod1) {			prodd = prod1+","+prod2+","+prod3+","+prod4;			write_cookie('recentviewed',prodd,30);		}		else if (prod1 && prod2 && prod3 && !prod4) {			prodd = prod1+","+prod2+","+prod3;			write_cookie('recentviewed',prodd,30);		}		else if (prod1 && prod2 && !prod3 && !prod4) {			prodd = prod1+","+prod2;			write_cookie('recentviewed',prodd,30);		}		else if (prod1 && !prod2 && !prod3 && !prod4) {			prodd = prod1;			write_cookie('recentviewed',prodd,30);		}		else {			prodd = currentProductId;			write_cookie('recentviewed',currentProductId,30);	}}function removeItem(completeList, currentProd) {		var j = 0;		while (j < completeList.length) {			if (completeList[j] == currentProd) {						completeList.splice(j, 1);			} else { 			j++; 		}	}		return completeList;}
