// JavaScript Document
st_jspath="Scripts/menu/stmenu.js";
document.write('<script type="text/javascript" src="'+st_jspath+'"><\/script>');
function flashGetHref() { return location.href; }
function flashPutHref(href) { location.href = href; }
function flashGetTitle() { return document.title; }
function flashPutTitle(title) { document.title = title; }
function changeLang(sLangId){

    var new_url=new String();
	var first0=document.URL.indexOf("?");
	var first1=document.URL.indexOf("?langid=");
	if(first0==-1)
	{new_url=document.URL+'?'+'langid='+sLangId;}
	else
	{
		if(first1!=-1)
		{
			var se=document.URL.indexOf("&");
			if(se!=-1)
			{
			var subLangVal=document.URL.substring(first1+8,se-1);
			new_url=document.URL.replace(subLangVal,sLangId);
			}
			else
			{
				var subLangVal=document.URL.substring(first1+8,document.URL.length);
				new_url=document.URL.replace(subLangVal,sLangId);
			}
		}
		else
		{
			var first3=document.URL.indexOf("langid=");
			if(first3==-1)
			{
				new_url=document.URL+'&'+'langid='+sLangId;
			}
			else
			{
				var subLangVal=document.URL.substring(first3+7,document.URL.length);
				new_url=document.URL.replace(subLangVal,sLangId);
			}
		}
	}
	new_url=new_url.replace(/#/gi,"");
	window.open(new_url,target='_self',
		'toolbar=no,status=no,width=200,height=100');
}

function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
 }
 
function getLengthPath(div_id,content_id,default_value)
			{
			    
			    //getFlashMovie("movie").sendTextToFlash(text);
				//getFlashMovie("mapPlayer").sendTextToFlash("trainstation");
				subject_id = div_id;
				var menu1_str=document.getElementById(content_id);
				if(default_value==1){
					content =menu1_str.options[0].value;
					content2 =menu1_str.options[0].name;
				}
				else
				{
					content =menu1_str.options[menu1_str.selectedIndex].value;
					content2 =menu1_str.options[menu1_str.selectedIndex].name;
				}
				
				http.open("GET", "map_script.php?lengthPath=" + escape(content)+"&time_id="+escape(content2), true);
				http.onreadystatechange = handleHttpResponse;
				http.send(null);
				switch(content2){
   				case "0":
				getFlashMovie("mapPlayer").sendTextToFlash("quynhonport");
				break;
				case "1":
				getFlashMovie("mapPlayer").sendTextToFlash("airport");
				break;
				case "2":
				getFlashMovie("mapPlayer").sendTextToFlash("trainstation");
				break;
				case "3":
				getFlashMovie("mapPlayer").sendTextToFlash("quynhonbus");
				break;
				default:
				getFlashMovie("mapPlayer").sendTextToFlash("quynhonport");
				break;
				}
				
			}
function formSend(datapath,output_div,text,text2){

 var dtId_a=new Array('dt1','dt2','dt3','dt4','dt5','dt6');
       for(var i=1;i<=dtId_a.length;i++)
	   if(output_div==dtId_a[i-1])
	   {
	    document.getElementById("titItemCol_id").innerHTML="<script type='text/javascript' src='images/FixPNG.js'></script>"+"<img src='"+datapath+"images/leftmenu/leftmenu"+i+ ".gif' />";
   		document.getElementById("content_id").innerHTML=text2;
		break;
	   }
  getFlashMovie("mainPlayer").sendTextToFlash(text);
  
 }
function messageReturn(output_div,text,text2){
				subject_id = output_div;
				
				http.open("GET", "formsendcv.php?show=" + escape(text)+"&messreturn="+escape(text2), true);
				http.onreadystatechange = handleHttpResponse;
				http.send(null);
 }
function replaceTitle(dName_div,text){
    
        document.getElementById(dName_div).innerHTML="<h1>"+text+"</h1>";
     
        }
function getScriptPage(div_id,content_id,get_count)
			{
				subject_id = div_id;
				var menu1_str=document.getElementById(content_id);
			
				content =menu1_str.options[menu1_str.selectedIndex].value;
			
				http.open("GET", "products_script.php?dir_img=" + escape(content)+"&amp;page="+escape(get_count), true);
				http.onreadystatechange = handleHttpResponse;
				http.send(null);
			}
///////////////////////////////////////////////////////////////////
/*
var message="Bản quyền thuộc sở hữu THANH THUY CO.,LTD ";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

//////////// End function alert  message ///////////////////////////
*/
//////////// Slide show simple//////////////////////////////////////
var step=1;
var whichimage=1;
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src");
whichimage=step;
if (step<3)
step++;
else
step=1;
setTimeout("slideit()",3000);
}
function slidelink(){
if (whichimage==1)
window.location="#";
else if (whichimage==2)
window.location="#";
else if (whichimage==3)
window.location="#";
}
//////////// End slideshow simple //////////////////////////////////
