﻿<!--
//Rollovers
function rollon(name) {
	var imgname = "";
	imgname = name.replace(/ /g,"");
	imgname = imgname.toLowerCase();
	imgname = "/signature/" + website + "/images/tnav_" + imgname + "_on.gif";
	document.images[name].src = imgname;
}

function rolloff(name) {
	var imgname = "";
	imgname = name.replace(/ /g,"");
	imgname = imgname.toLowerCase();
	imgname = "/signature/" + website + "/images/tnav_" + imgname + "_off.gif";
	document.images[name].src = imgname;

}

// Print this page
function printerfriendly() 
{
    var currentURL = window.location;
    var smartprint = "http://www.visasignature-asia.com";
    var features   = "height=460,width=612,status=yes,scrollbars=yes,resizable=no;toolbar=no,menubar=no,location=no";
    window.open("", "printwin", features);
	document.printform.action     = "/signature/Print";
    document.printform.pull.value = currentURL;
    document.printform.title.value= document.title;
    document.printform.target     = "printwin";
	document.printform.ws.value   = "tw";
	if(  document.getElementById("hiddenbc") ) { document.printform.bc.value = document.getElementById("hiddenbc").innerHTML; }
	document.printform.submit();
}

// Tell a Friend
function tellyourfriend() 

{
  var currentURL = window.location;
  var features   = "height=488,width=390,status=no,scrollbars=yes,resizable=no;toolbar=no,menubar=no,location=no";
  window.open("", "tellfriendform", features);
  document.tafform.action         = "/signature/TellAFriend";
  document.tafform.referurl.value = currentURL;
  document.tafform.title.value    = document.title;
  document.tafform.command.value  = "form";
  document.tafform.ws.value       = "tw";
  document.tafform.target         = "tellfriendform";
  document.tafform.submit();
}


// Logout
function logout(){
  document.logout.submit();
}

// Check if link opens in new window ; function used by setleftnav.js
function setWinTarget(url) {
	var strWinTarget = "";
	
	// if url begins with http:// https:// or consists of /includes/uploads/
	if ((url.indexOf("http://")==0) || (url.indexOf("https://")==0))
	{
		// if url does not being with the Visa Signature domain, open in new window
		if ((url.indexOf("http://www.visasignature-asia.com")!=0) && (url.indexOf("https://www.visasignature-asia.com")!=0))
		{
			strWinTarget = "target=\"_blank\" ";
		}
	} 
	
	if  (url.indexOf("/includes/uploads/") >= 0)
	{
		strWinTarget = "target=\"_blank\" ";
	}
	return strWinTarget;
}

// ****************************************************
// Functions for Breacrumbs
function displaysection(){
	if (section != "")
	{
		var bc_section = "";
		section_cnt = arsection.length;
		for (i=0; i < section_cnt; i++)
		{
			if (arsection[i][0] == section)
			{
				bc_section = arsection[i][1];
			}
		}
	}
	document.write(bc_section);
}
function displaysubsection(){
	if (subsection != "")
	{
		var bc_subsection = "";
		subsection_cnt = arsubection.length;
		for (i=0; i < subsection_cnt; i++)
		{
			if (arsubsubection[i][0] == subsection)
			{
				bc_subsection = arsubsection[i][1];
			}
		}
	}
	document.write(bc_subsection);
}
// ****************************************************

// Display localised text based on variable name passed
function displaytext(vtext){
	if (vtext == "home")
	{
		document.write(v_home);
	}
	else if (vtext == "page")
	{
		document.write(v_page);
	}
	else if (vtext == "details")
	{
		document.write(v_details);
	}

}

// ****************************************************

// Functions for user login (used in homepage)
function sendPwdRequest()
{
  document.login.action="/ConciergeController?action=mailPassword";
  document.login.submit(); 
}

function doLogin(){
if (trim(document.login.username.value) == ""){
   alert("請輸入使用者代號");	
   document.login.username.focus();
   document.login.username.value="";
   return;
}  
if (trim(document.login.password.value) == ""){
   alert("請輸入密碼");
   document.login.password.focus();
   document.login.password.value="";
   return;
}  
  document.login.submit();
}
// ****************************************************
// -->