﻿<!--

// Print this page
function printerfriendly() 
{
    var currentURL = window.location;
    var smartprint = "http://www.visaplatinum.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     = "/platinum/Print";
    document.printform.pull.value = currentURL;
    document.printform.title.value= document.title;
    document.printform.target     = "printwin";
	document.printform.ws.value   = "ap";
	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         = "/platinum/TellAFriend";
  document.tafform.referurl.value = currentURL;
  document.tafform.title.value    = document.title;
  document.tafform.command.value  = "form";
  document.tafform.ws.value       = "ap";
  document.tafform.target         = "tellfriendform";
  document.tafform.submit();
}

// Logout
function logout(){
  document.logout.submit();
}

// ****************************************************
// Functions for Breacrumbs
function displaysection(){
	if (Page_Section != "")
	{
		section_cnt = arsection.length;
		for (i=0; i < section_cnt; i ++)
		{
			if (arsection[i][0] == Page_Section)
			{
				Page_Section = arsection[i][1];
			}
		}
	}
	document.write(Page_Section);
}
function displaysubsection(){
	if (Page_Subsection != "")
	{
		subsection_cnt = arsubsection.length;
		for (i=0; i < subsection_cnt; i ++)
		{
			if (arsubsection[i][0] == Page_Subsection)
			{
				Page_Subsection = arsubsection[i][1];
			}
		}
	}
	document.write(Page_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 Image Rollovers (extracted from templates)
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
// ****************************************************

// Functions for user login (used in homepage)
function doLogin(){
if (document.login.username.value == ""){
   alert("Please enter username");	
   document.login.username.focus();
   return;
}  
if (document.login.password.value == ""){
   alert("Please enter password");
   document.login.password.focus();
   return;
}  
  document.login.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 Platinum domain, open in new window
		if ((url.indexOf("http://www.visaplatinum.com")!=0) && (url.indexOf("https://www.visaplatinum.com")!=0))
		{
			strWinTarget = "target=\"_blank\" ";
		}
	} 
	
	if  (url.indexOf("/includes/uploads/") >= 0)
	{
		strWinTarget = "target=\"_blank\" ";
	}
	return strWinTarget;
}

// -->