
/************************************************************************************
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;
}