/**********************************************************
 *                                                        *
 *  Copyright ©2005  Corillian Corporation                *
 *                                                        *
 *  All rights reserved.                                  *
 *                                                        *
 *  Highly Confidential.                                  *
 *                                                        *
 *  No portion of this code may be reproduced,            *
 *  transmitted or distributed without the express        *
 *  written permission of Corillian Corporation.          *
 *                                                        *
 **********************************************************/
 
 
 //Disable right mouse click Script
/*
var message="Function Disabled!";

///////////////////////////////////
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("return false")
 */
 
//funcion to open the popup window.
function popupWindow(url, winOptions)
{	
	var winOpen = window.open(url,'_new',winOptions,false);
}

///Function to Print the  <Div> Content to the Printer.
function printField(divname) {
				var dctl =	document.getElementById(divname);	
				if (dctl == null)
					return false;
				pWin = window.open('Golden1Print','pWin','location=false, menubar=yes, height = 500, width=500,  toolbar=yes, scrollbars=yes'); 
				if (pWin == null)
					return false;
				pWin.document.open(); 
				pWin.document.write('<html><head></head><body>'); 
				pWin.document.write(dctl.innerHTML); 
				pWin.document.write('</body></html>'); 
				pWin.print(); 
				pWin.document.close(); 
				pWin.close(); 
				return false;
}


//Will be used popup window to assign the Parent Window URL
var strParentWindowURL = "";
//  Check Whether the Parent window is closed.If parent window closed or pointing to different URL  //
//  Close this child window. //
function CloseifParentWindowIsClosed()
{
  try
    {
      if (window.opener.closed == true)
         {self.close();}
      else
         {
           var strNovo = "";
           strNovo = window.opener.location.href;
           if (strNovo != strParentWindowURL)
              {
              //User might exit the site And moved to new one.
               self.close(); 
              } 
         }
     }
   catch (e)
    {
      /// "User exit site. might moved to new window.
      self.close()
    }
}
//call Fees & Charges for helpfulhints
function CallChargesPage(){
	var winURL="http://www.ambg.com.my/personal/others/feescharges/feescharges.asp";
	//alert(winURL);
	window.open(winURL, 'Branches','scrollbars=yes,resizable=no,width=800,height=600');
}

//Application Form for helpfulhints
function CallBranchPage(intcode){
	var winURL="http://www.ambg.com.my/personal/atmsbranches/ambankbranchresults.asp?inst=" + intcode;
	window.open(winURL, 'Branches','scrollbars=yes,resizable=no,width=800,height=600');
}

function displayCurrMarket(){
	var winURL = "http://www.ambg.com.my/rates3.asp#unit prices";
	window.open(winURL, 'QChatStandAlone','scrollbars=yes,resizable=yes,width=400,height=400,top=200,left=200');
}
function openPrintWindow(url){
	var ciw = window.open(url, 'CORICHECKIMAGE', 'width=600,height=630,left=0,top=0,status=yes,scrollbars=yes,resizable=yes,toolbar=no,menubar=no,location=no');
	ciw.focus();
}


function onOpenApplicationForm(urllink){
	var winURL = "https://ambg.com.my/forms/" + urllink + ".asp";	
	window.open(winURL, 'QChatStandAlone','scrollbars=yes,resizable=yes,width=400,height=520,top=20,left=200');
	
	if (urllink == "cc")
	location.href="APCreditCard.asp";
	else if (urllink == "hl")
	location.href="APConsumerLoan.asp";
	else if (urllink == "hp")
	location.href="APHirePurchase.asp";
}

function ViewSampleBill(payeeCode){


	winURL="../payee/payee.asp?payeecode="  + payeeCode;
	
	window.open(winURL, 'QChatStandAlone','scrollbars=no,resizable=no,width=400,height=600,top=20,left=200');
}


function sampleAccount(){
	var winURL = "http://www.ambg.com.my/onlinebankinglinks/tips/ais.asp";
	window.open(winURL, 'QChatStandAlone','scrollbars=yes,resizable=yes,width=400,height=300,top=200,left=200');
}

function CallFAQ() {
	var filename= "http://www.ambg.com.my/amonline/faq/amonline.asp#2.8";
    window.open(filename,'','toolbar=no,status=yes,scrollbars=yes,location=no,menubar=no,directories=no,resizable=yes,width=740,height=370,top=25,left=25');
}

