
/************************************************************************************
DETECT BROWSER
*************************************************************************************/
// Check the browser...we're looking for ie/win, but not aol
var isIE4 	= 	(document.all && !document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 4.0') != -1) ? true : false;
var isIE5 	= 	(document.all && document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 5.0') != -1) ? true : false;
var isIE55 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 5.5') != -1) ? true : false;
var isIE6 	= 	(document.getElementById && navigator.appName.indexOf('Microsoft') != -1 && navigator.appVersion.indexOf('MSIE 6.0') != -1) ? true : false;
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    
var isSafari=	(navigator.userAgent.indexOf('Safari')!=-1) ? true : false;
var isMacIE =	(navigator.userAgent.indexOf('MSIE')!=-1 && navigator.userAgent.indexOf('Mac')!=-1) ? true : false;
var isGecko = 	(!document.all && document.getElementById) ? true : false;
var isOP=(
		  (navigator.appName.indexOf('Opera') != -1)
		  ||(navigator.plugins.length>0 && navigator.appName.indexOf('Microsoft') != -1)
		  ||(!navigator.product && navigator.appName.indexOf('Netscape') != -1)
		  )
var isWindows=(navigator.userAgent.toLowerCase().indexOf('win')!=-1) ? true : false;
var isMac=(navigator.userAgent.toLowerCase().indexOf('mac')!=-1) ? true : false;

var thisbrowser = 'unknown';

//FireFox PC AND MAC
if (isGecko)
{
	if(isMac)
	{
		document.write('<link rel="stylesheet" href="css/MacGeckostyle.css" type="text/css">');		
//		alert('MacGeckostyle.css');
		thisbrowser = "MacGecko";
	}
	else
	{
		document.write('<link rel="stylesheet" href="css/Geckostyle.css" type="text/css">');
//		alert('Geckostyle.css');
		thisbrowser = "PCGecko";
	}
}

//IE 5 WINDOWS
if (isIE)
{
	thisbrowser = "IE";
	if(isIE5 && isWindows)
	{
		document.write('<link rel="stylesheet" href="css/IE5style.css" type="text/css">');
//		alert('IE5style.css');
		thisbrowser = "IE5 Windows";
	}

	//IE 5.5 WINDOWS
	if (isIE55)
	{
		thisbrowser = "IE";
		if(isIE55 && isWindows)
		{
			document.write('<link rel="stylesheet" href="css/IE55style.css" type="text/css">');
//			alert('IE55style.css');
			thisbrowser = "IE55 Windows";
		}
	}

	//IE 6 WINDOWS
	if (isIE6)
	{
		thisbrowser = "IE";
		if(isIE6 && isWindows)
		{
			document.write('<link rel="stylesheet" href="css/style.css" type="text/css">');
//			alert('style.css');
			thisbrowser = "IE6 Windows";
		}
	}
	//MAC IE
		if(isMac)
		{
			document.write('<link rel="stylesheet" href="css/IEMacstyle.css" type="text/css">');
//			alert('IEMacstyle.css');
			thisbrowser = "IE Mac";
		}

}


//MAC SAFARI
if(isSafari)
{
	thisbrowser = "Safari";
	document.write('<link rel="stylesheet" href="css/safari.css" type="text/css">');
//		alert('safari.css');
}

//alert(navigator.userAgent);

//alert(thisbrowser);

/* if tou want to support OPERA browser
if (isOP)
	{
	if(isWindows){
	var thisbrowser = 'Opera'; 
	isIE4=false;isIE5=false;isGecko=false;isIE=false; 
	}
}
*/

/************************************************************************************
STORE CLINT VARIABLES
*************************************************************************************/
var displayText="";
var randomnumber1=0;
var randomnumber2=0;

/************************************************************************************
TEXT BANNER LINKS DATA ARRAY
syntax : URL|LINK_TEXT
The values are seperated by the | vertical line
URL is placed on the left and LINK_TEXT is placed on the right
*************************************************************************************/
var textArray= new Array(
"http://americanexpress.ro/gold|Gold",
"http://americanexpress.ro/ro/oferte/|Oferte"
);

/************************************************************************************
IMAGE BANNER LINKS DATA ARRAY
syntax : URL|IMAGE_URL|IMAGE_ALT_TEXT
The values are seperated by the | vertical line
URL is placed on the left, IMAGE_URL is placed in the middle ( excluding [.jpg] ) and IMAGE_ALT_TEXT is placed on the right
*************************************************************************************/
var imgArray= new Array(
"http://americanexpress.ro/ro/carduri/|img1|American Express - Deschide usa oportunit&#259;tilor - Afla mai multe"
);

/************************************************************************************
ENSURES THAT THE LINK2 AND LINK3 RANDOM LINKS ARE NOT IDENTICAL
*10 = generate a random number between 1 and 10.
Change the value to reflect the quantity of items in the TEXT BANNER LINKS DATA ARRAY
*************************************************************************************/
if(imgArray.length > 1)
{
	while(randomnumber1==randomnumber2)
	{
		randomnumber1=Math.floor(Math.random()*imgArray.length); 	//
		randomnumber2=Math.floor(Math.random()*imgArray.length); 	//
	}
}

/************************************************************************************
DOCUMENT WRITE IMAGE BANNER LINK
*2 = generate a random number between 1 and 2.
Change the value to reflect the quantity of items in the IMAGE BANNER LINKS DATA ARRAY
*************************************************************************************/
function doBannerLink()
{
var randomnumber=Math.floor(Math.random()*imgArray.length); 	//
$bannerLink=imgArray[randomnumber].split("|")
document.write('<a href="'+($bannerLink[0])+'"><img src="images/'+($bannerLink[1])+'.jpg" width="540" height="210" alt="'+($bannerLink[2])+'" title="'+($bannerLink[2])+'"></a>');
displayText+='<a href="'+($bannerLink[0])+'"><img src="images/'+($bannerLink[1])+'.jpg" width="540" height="210" alt="'+($bannerLink[2])+'" title="'+($bannerLink[2])+'"></a>\n\n';
}


/************************************************************************************
DOCUMENT WRITE TEXT BANNER LINKS
*************************************************************************************/
function doTextLink(whichLink)
{
if(whichLink==2)
	{
	$textLink=textArray[randomnumber1].split("|")
	document.write('<a href="'+($textLink[0])+'" class="bannerlink'+(whichLink)+'">'+($textLink[1])+'</a>');
	displayText+='<a href="'+($textLink[0])+'" class="bannerlink'+(whichLink)+'">'+($textLink[1])+'</a>\n\n';
	}
if(whichLink==3)
	{
	$textLink=textArray[randomnumber2].split("|")
	document.write('<a href="'+($textLink[0])+'" class="bannerlink'+(whichLink)+'">'+($textLink[1])+'</a>');
	displayText+='<a href="'+($textLink[0])+'" class="bannerlink'+(whichLink)+'">'+($textLink[1])+'</a>\n\n';
	}
}

/************************************************************************************
MAC FIX
Not used
The Mac was not loading the banner links so I gathered the HTML that the javascript 
created for the BANNER LINKS into a variable called displayText. 
A link was placed on the HTML page with a link to the below function to display the HTML.
*************************************************************************************/
function getLinks()
{
Mycc=document.getElementById("cc");
Mycc.innerText=displayText;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function get_LOGOUT_URL_HDR () { var protocolstr = window.location.protocol; if (window.location.host.indexOf(":") != -1) var hoststr = window.location.host; else var hoststr = window.location.hostname; var url = LOGOUT_URL; if (!((url.substring(0,5) == "https") || (url.substring(0,4) == "http"))) url = protocolstr + "//" + hoststr + url; return url; }; function getDomaintoSet() { var fulldomain = document.domain; var pairs = fulldomain.split("."); var j = pairs.length; if (parseInt(j) == 0) var reqdomain = null; else if (parseInt(j) == 1) var reqdomain = pairs[0]; else if (parseInt(j) == 2) var reqdomain = pairs[0] + "." + pairs[1]; else var reqdomain = "." + pairs[parseInt(j)-2] + "." + pairs[parseInt(j)-1]; return reqdomain; }; function logoutnow () { var pageUrl = get_logout_URL(); if (readCookie("blueboxexpires")) eraseCookie("blueboxexpires"); location = pageUrl; }; function isSecure() { if (typeof LOGOUT_URL == 'undefined') { return false; } return true; }; function trackIdleTime() { if (isSecure()) trackSecureSession(); }; function trackSecureSession() { var LOGOUT_URL_HDR = get_LOGOUT_URL_HDR(); var expiryValue = document.URL+"~"+LOGOUT_URL_HDR; var valuePair = readCookie("blueboxexpires"); if (valuePair != null) { eraseCookie("blueboxexpires"); createCookie("blueboxexpires",expiryValue,""); } else createCookie("blueboxexpires",expiryValue,""); }; function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; var domaintoset = getDomaintoSet(); if (domaintoset) document.cookie = name+"="+value+expires+"; path=/; domain="+domaintoset; else document.cookie = name+"="+value+expires+"; path=/"; }; function eraseCookie(name) { createCookie(name,"",-1); }; function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; }; function chkvaliduser() { var chkcookie = readCookie("blueboxexpires"); if (chkcookie != null) return true; else return false; }; function get_logout_URL() { var valuePair = readCookie("blueboxexpires"); if (valuePair != null) { var list = (new String(valuePair)).split('~'); var logouturl = list[1]; return logouturl; } else return "https://www.americanexpress.com"; }; 


    trackIdleTime();
    function cdd_menu0(){
        this.rel_icon_image0 = "images/clear.gif"
        this.rel_icon_rollover0 = "images/clear.gif"
        this.use_divider_caps = false
        this.divider_width = 1
        this.divider_height = 0
        this.is_horizontal = false
        this.is_horizontal_main = true
        this.menu_padding_main = "0,0,0,0"
        this.menu_padding_sub = "3,3,3,3"
        this.item_padding_main = "2,3,1,3"
        this.item_padding_sub = "1,1,1,1"
        this.menu_border_main = 0
        this.menu_border_sub = 1;
        this.item_border_main = 1
        this.item_border_sub = 0
        this.menusub_left = 0


        		this.item_rollover_class0 = "cdd0_main_items_rollover";
			
        	this.item0 = "My Account"
        	this.icon_rel0 = 0
		
        	this.url0 = 'https://www99.americanexpress.com/myca/acctsumm/emea/action?request_type=authreg_intlacctAccountSummary&Face=en_GB&uk_nu=subtab'
		
			this.menu_xy0 = "-0,0"
		
        			this.item0_0 = "Online Services Overview"
        			this.url0_0 = 'http://www.americanexpress.co.uk/online'
			
        		this.item_rollover_class1 = "cdd0_main_items_rollover";
			
        	this.item1 = "Apply Now"
        	this.icon_rel1 = 0
		
        	this.url1 = 'http://www.americanexpress.com/pes/uk/choose_card_flash.shtml?uk_nu=subtab'
		
			this.menu_xy1 = "-0,0"
		
        			this.item1_0 = "Choose your Card"
        			this.url1_0 = 'http://www.americanexpress.com/pes/uk/choose_card_flash.shtml?uk_nu=dd'
			
        			this.item1_1 = "Card Selector Tool"
        			this.url1_1 = 'http://www.americanexpress.com/pes/uk/choose_card_flash.shtml?uk_nu=dd'
			
        			this.item1_2 = "Compare Cards"
        			this.url1_2 = 'http://www.americanexpress.com/pes/uk/benefits/compare_cards.shtml?uk_nu=dd'
			
        			this.item1_3 = "Add someone to my Card Account"
        			this.url1_3 = 'http://www.americanexpress.com/uk/personal/cards/apply/pc_addsomeonetomycard.shtml?uk_nu=dd'
			
        		this.item_rollover_class2 = "cdd0_main_items_rollover";
			
        	this.item2 = "Membership Rewards"
        	this.icon_rel2 = 0
		
        	this.url2 = 'http://www10.americanexpress.com/sif/cda/page/0,1641,12026,00.asp?uk_nu=subtab'
		
			this.menu_xy2 = "-0,0"
		
        			this.item2_0 = "Programme Information"
        			this.url2_0 = 'http://www10.americanexpress.com/sif/cda/page/0,1641,12039,00.asp?uk_nu=dd'
			
        			this.item2_1 = "Search for Rewards"
        			this.url2_1 = 'http://www99.americanexpress.com/myca/loyalty/catalog/action?request_type=un_intlCatalog&action=CatalogHomePage&Face=en_GB&uk_nu=dd'
			
        		this.item_rollover_class3 = "cdd0_main_items_rollover";
			
        	this.item3 = "Cardmember Offers"
        	this.icon_rel3 = 0
		
        	this.url3 = 'http://www.americanexpress.co.uk/selects?uk_nu=subtab'
		
			this.menu_xy3 = "-0,0"
		
        			this.item3_0 = "American Express Selects"
        			this.url3_0 = 'http://www.americanexpressofferzone.com/selects/homepage.aspx??uk_nu=dd&cntry=GB&lang=EN&acct=prop'
			
        			this.item3_1 = "Membership Rewards"
        			this.url3_1 = 'http://www10.americanexpress.com/sif/cda/page/0,1641,12026,00.asp'
			
        		this.item_rollover_class4 = "cdd0_main_items_rollover";
			
        	this.item4 = "Cardmember News"
        	this.icon_rel4 = 0
		
        	this.url4 = 'http://www10.americanexpress.com/sif/cda/page/0,1641,20735,00.asp?uk_nu=dd'
		
			this.menu_xy4 = "-0,0"
		
        			this.item4_0 = "New places to use your Card"
        			this.url4_0 = 'http://www.americanexpress.com/uk/newtoamex/new/categories.shtml?uk_nu=dd'
			
        			this.item4_1 = "Chip and PIN"
        			this.url4_1 = 'http://www10.americanexpress.com/sif/cda/page/0,1641,26371,00.asp?uk_nu=dd'
			
				this.item_class5 = "cdd3_main_menu";
			
        		this.item_rollover_class5 = "cdd0_main_items_rollover";
			
        	this.item5 = "Chip & PIN"
        	this.icon_rel5 = 0
		
        	this.url5 = 'http://www10.americanexpress.com/sif/cda/page/0,1641,26371,00.asp?uk_nu=dd'
		
			this.menu_xy5 = "-0,0"
		
    }

    function cdd_menu1(){
        this.rel_icon_image0 = "images/menu_off.gif"
        this.rel_icon_rollover0 = "images/menu_on.gif"
        this.use_divider_caps = false
        this.divider_width = 1
        this.divider_height = 0
        this.is_horizontal = false
        this.is_horizontal_main = true
        this.menu_padding_main = "0,0,0,0"
        this.menu_padding_sub = "1,1,1,1"
        this.item_padding_main = "0,3,0,0"
        this.item_padding_sub = "1,1,1,1"
        this.menu_border_main = 0;
        this.menu_border_sub = 1;
        this.item_border_main = 1;
        this.item_border_sub = 0;
        this.menusub_left = 1



        if (chkvaliduser()){
            this.item0 ="&nbsp;&nbsp;&nbsp;&nbsp;";
            this.item0 = this.item0+"VIEW&nbsp;ACCOUNTS";
            this.item0 = this.item0+"&nbsp;&nbsp;";
         } else{
            this.item0="&nbsp;&nbsp;&nbsp;&nbsp;"
            this.item0=this.item0+"LOG&nbsp;IN";
            this.item0=this.item0+"&nbsp;&nbsp;&nbsp;";
        }


        this.icon_rel0 = 0
        this.url0 = ''
        this.menu_xy0 = "-0,0"

        this.item0_0 = "My Account"
        
        this.url0_0 = 'https://www99.americanexpress.com/myca/estatement/canlac/action?ca_en_nu=logincontrol&request_type=authreg_CardsList&Face=en_CA'
        
        this.item0_1 = "AMEX Online Banking"
        
        this.url0_1 = 'https://www.securebankca.americanexpress.com/english/auth/servlet/FrontServlet?ca_en_nu=logincontrol&request_type=root'
        
        this.item0_2 = "Online Merchant Services"
        
        this.url0_2 = 'https://www209.americanexpress.com/merchant/mainpage/FrontServlet?ln=en&frm=CA&request_type=authreg_main'
        
        this.item0_3 = "American Express @Work"
        
        this.url0_3 = 'https://www65.americanexpress.com/atwork/en_CA/authreg/AtworkControl'
        
    }