// JavaScript Document
function navigateMenu()
{
	//alert('navigate menu');
	var fullPath = new String;
	var currPath = new String;
	var currMenu = new String;
	var outputNavMenu = new String;
	var subPath = new Array;
	var url = new String;
	var i = 0;
	
	outputNavMenu = "";
	currPath = "/";
	fullPath = location.pathname;
	url = location.href;
	//alert(url);
	//alert(url.indexOf('view'))
	fullPath = fullPath.replace('Press(Clippings)', 'International-Media');
	if ((url.indexOf('profile') > -1) || (url.indexOf('view') > -1))
	{
		//alert('Profile');
		if (fullPath.indexOf('Register') > -1)
			fullPath = fullPath.replace('Register', 'Profile');
	}
	
	//alert(fullPath);
	subPath = fullPath.split("/");
	//alert(fullPath.indexOf('aspx'));
	for (i=0;i<subPath.length;i++)
	{
		
		currMenu = replaceSpChar(subPath[i]);
		//if (i != 1)
		//{
			currPath += subPath[i];
		//}
		if (i!=0 && i != 1) { outputNavMenu += "&nbsp;&gt;&nbsp;"; }
		if (i<subPath.length-1) {
			outputNavMenu += "<a class=\"linkgray11bold\" href=\"" + currPath;
			if (i==0) {
				outputNavMenu += "Overseas-Medical-Care/Bumrungrad-International.aspx";
			}
			else if (i==1){
				outputNavMenu += ""
				currPath += "/"
			} else {
				outputNavMenu += ".aspx";
				currPath += "/";
			}
			outputNavMenu += "\">" + currMenu + "</a>";
		} else {
			outputNavMenu += currMenu;
		}
	}
	  
		outputNavMenu = outputNavMenu.replace('Overseas Medical Care', '');
		//outputNavMenu = outputNavMenu.replace(' > ', '>');
		//alert(outputNavMenu);
		document.getElementById('navi').innerHTML = outputNavMenu;

}

function replaceSpChar(menuStr)
{
	for (i=0;i<=10;i++){
		if (menuStr == "") menuStr = "Home";
		menuStr = menuStr.replace('_and_',' &amp; ');
		menuStr = menuStr.replace('-and-',' &amp; ');
		menuStr = menuStr.replace("_s_","\'s ");
		menuStr = menuStr.replace("-s-","\'s ");
		menuStr = menuStr.replace('_',' ');
		menuStr = menuStr.replace('-',' ');
		menuStr = menuStr.replace('.aspx','');
	}
	return menuStr;
}

function popup(url, width, height){
               window.open(url ,"","width="+width+",scrollbars=no, height="+height+",top="+((screen.height-height)/2)+",left="+((screen.width-width)/2));
}

function collaspemenu(id) 
	{

	 if (document.getElementById) {
	
	  var mnustyle = document.getElementById(id).style;
	
	  if (mnustyle.display == "none") {
	
	   mnustyle.display = "block";
	
	   } 
	  // window.location="../About_Us/Services_and_Facilities.aspx";
	  return false;
	
	  } else {
	
	  return true;
	
	 }

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
		  window.open(theURL,winName,features);
		}
function AutoSelectForRadio() 
{ 
	var txtbox = document.getElementById("txtCasNo");
	if (document.getElementById("RadioFollow").checked == true) 
	{
		txtbox.disabled = false;
		txtbox.style.backgroundColor="";
		txtbox.focus();
	}else if(document.getElementById("RadioFirst").checked == true){	
		txtbox.value='';
		txtbox.disabled = "disabled";
		txtbox.style.backgroundColor="#eeeeee";
	}
}

function AutoSelectForRadio1() 
{ 
	var txtbox = document.getElementById("txtHnNo");
	if (document.getElementById("RadioYes").checked == true) 
	{
		txtbox.disabled = false;
		txtbox.style.backgroundColor="";
		txtbox.focus();
	}else if(document.getElementById("RadioNo").checked == true){	
		txtbox.value='';
		txtbox.disabled = "disabled";
		txtbox.style.backgroundColor="#eeeeee";
	}
}

function DisableSubmit()
{
	var btn = document.getElementById("btnSubmit");
	var btnNext = document.getElementById("btnNext");
	if (document.getElementById("ddlInquiryType").selectedIndex == 2) 
	{
		if (document.getElementById("RadioAgree").checked == true) 
		{
			btn.disabled = true;
			btnNext.disabled = false;
			btnNext.focus();
		}else if(document.getElementById("RadioNotAgree").checked == true){
			btn.disabled = true;
			btnNext.disabled = true;
		}
	}else{
		if (document.getElementById("RadioAgree").checked == true) 
		{
			btn.disabled = false;
			btn.focus();
		}else if(document.getElementById("RadioNotAgree").checked == true){
			btn.disabled = true;
		}
	}
}

function hideUrl(){
window.status="";
return true; 
} 