<!--
/****** Below script is to rotate the main banner on the home page ******/
var global_divid = 'div_banners01';

function Promo(refreshTime, width, height, altText, start, random){
	this.objName = "PromoBanner" + (Promo.count++);
	eval(this.objName + "=this");
	if (!refreshTime) this.refreshTime = 5000; else this.refreshTime = refreshTime*1000;
	if (!width) this.width = 421; else this.width = width;
	if (!height) this.height = 150; else this.height = height;
	if (random == null) this.random = 0; else this.random = random;
	this.altText = altText;
	this.Banners = [];
	this.defaultfirst = 0;  /* whether the first banner is fixed */
	if (start) {
		this.currentBanner = start-1;
		this.defaultfirst = 1;
	} else {
		start = null;
	}
	this.mySize = 0;

	this.Banner = function(src, href, target, mouseover) {
		if (src.indexOf(".swf") >= 0) {  // load flash
			this.Banners[this.mySize] = new Object();
			var Banner = this.Banners[this.mySize];
			Banner.src = src;
			if (typeof(target) == "undefined" || target == null) Banner.target = "_self"; else Banner.target = target;
			Banner.href = href;
			Banner.mouseover = mouseover;
			this.mySize++;
		} else {
			var tempImage = new Image();
			tempImage.src = src;
			this.Banners[this.mySize] = new Object();
			var Banner = this.Banners[this.mySize];
			Banner.src = src;
			if (typeof(target) == "undefined" || target == null) Banner.target = "_self"; else Banner.target = target;
			Banner.href = href;
			Banner.mouseover = mouseover;
			this.mySize++;
		}
	}

	this.link = function(){
		var	Banner = this.Banners[this.currentBanner];
		if (Banner.target == "_self"){
			location.href = Banner.href;
		}
		else if (Banner.target == "_blank" || Banner.target == "_new"){
			open(Banner.href,this.objName + "Win");
		}
		else top.frames[Banner.target].location.href = Banner.href;
	}

	this.showStatus = function(){
		var Banner = this.Banners[this.currentBanner];
		if (Banner.mouseover) status = Banner.mouseover;
		else status = Banner.href;
	}

	this.randomBanner = function(){
		var n;
		do { n = Math.floor(Math.random() * (this.mySize)); } 
		while(n == this.currentBanner);
		this.currentBanner = n;
	}

	this.output = function(){
		var tempCode = "";
		if (this.mySize > 1){
			if (this.currentBanner == null) this.randomBanner();
			if (this.currentBanner >= this.mySize) this.currentBanner = this.mySize - 1;

			var strsrc = this.Banners[this.currentBanner].src;
			var loadpage_target = '0';
			if (strsrc.indexOf(".swf") >= 0) {  // load flash
				var Banner = this.Banners[this.currentBanner];
				// Banner.href ; Banner.target;
				loadpage_target = '1';
				if (Banner.target == '_self') {
					loadpage_target = '0';
				}
				var fo = new FlashObject(strsrc +"?clickTAG=`"+ Banner.href +"`;`Home`;`"+ loadpage_target +"`;`null`;`null`;`null`", "movie", this.width, this.height, "6", "#000000");
				fo.addParam("quality", "high");
				fo.addParam("movie", strsrc +"?clickTAG=`"+ Banner.href +"`;`Home`;`"+ loadpage_target +"`;`null`;`null`;`null`");
				fo.write(global_divid);
			} else {
				tempCode = '<a href="javascript:'+this.objName+'.link();"';
				tempCode += ' onMouseOver="' + this.objName + '.showStatus(); return true"';
				tempCode += ' onMouseOut="status=\'\';return true">';
				tempCode += '<img src="' + strsrc + '" width="' + this.width;
				tempCode += '" name="' + this.objName + 'Img" height="' + this.height + '" ';
				if (this.altText) tempCode += 'alt="'+this.altText + '" ';
				tempCode += 'border="0" /></a>';
				document.getElementById(global_divid).innerHTML = tempCode;
				// document.write(tempCode);
			}
			// this.nextBanner();
		} else document.write("Error: two Promos must be defined for the script to work.");
	}

	this.newBanner = function(){
		if (!this.random){	
			this.currentBanner++;
			if (this.currentBanner >= this.mySize)
			   this.currentBanner = 0;
		}
		else {
			if (this.defaultfirst == 1) {
				this.defaultfirst = 0;
			} else {
				this.randomBanner();
			}
		}
		this.output();
		this.nextBanner();
	}

	this.nextBanner = function(){
		// document.images[this.objName+ 'Img'].src = this.Banners[this.currentBanner].src;
		setTimeout(this.objName+'.newBanner()',this.refreshTime);
		// this.output();
	}
}
Promo.count = 0;


function get_random(maxNum)
{
	if (Math.random && Math.round) {
		var ranNum= Math.round(Math.random()*(maxNum-1));
		ranNum+=1;
		return ranNum;
	} else {
		today= new Date();
		hours= today.getHours();
		mins=   today.getMinutes();
		secn=  today.getSeconds();
		if (hours==19) hours=18;
		var ranNum= (((hours+1)*(mins+1)*secn * Math.round(Math.random()*1000) )%maxNum)+1;
		return ranNum;
	}
}

/*
function Rotate01BannerImage()
{

var currentCookie = getCurrentCookie();
var bannerObj = "";

var setrandombanner = true;
if (currentCookie == "Image1"){  // the first image to display
	if (document.frmHome.Main01Promo0) {
		bannerObj= document.frmHome.Main01Promo0.value;
		setrandombanner = false;
	} else {
		setrandombanner = true;
	}
  }

if (setrandombanner) {  // generate random
	// get max
	var maxnum,loopmax, kj;
	maxnum = 0; loopmax= 1000;
	for (kj=1; kj<=loopmax; kj++) {
		if (document.frmHome.elements['Main01Promo'+ kj]) {
		} else {
			break;  // if not exists then break
		}
	}
	maxnum = kj - 1;
	// alert('debug max: '+ maxnum);

	// generate
	var randnum = get_random(maxnum);
	bannerObj= document.frmHome.elements['Main01Promo'+ randnum].value;
	// alert('debug banner: Main01Promo'+ randnum);
}


  //else if (currentCookie == "Image2"){
	//  bannerObj= document.frmHome.Main01Promo2.value;
  //}
  //else if (currentCookie == "Image3"){
	//  bannerObj= document.frmHome.Main01Promo3.value;
  //}

// Get the image to be shown and the other parameters to be passed to Loadpage
var myArray = bannerObj.split(',');
var size = myArray.length;
var path		=	myArray[0];
var productId	=	myArray[1];
var target		=	myArray[2];
var external	=	myArray[3];
var height		=	myArray[4];
var width		=	myArray[5];
var imageName	=   myArray[6];


//document.write('<td width="180">');
//document.write('<a href='+'"'+'javascript:top.Loadpage'+'('+path +',' + productId +',' +target+',' +external + ','+height +',' + width +')'+'""'+'>');
document.write('<a href='+'"'+'javascript:top.Loadpage'+'(\''+path +'\',\'' + productId +'\',\'' +target+'\',\'' +external + '\',\''+height +'\',\'' + width +'\')'+'""'+'>');
document.write('<img src=' +'"'+imageName + '"' +'alt='+'""'+'width='+'"230"'+'height='+'"75"'+'hspace='+'"0"'+'border='+'"0"'+'/>' );
document.write('</a>');


}

function SetCookie(name, value) {

var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

function getCookie(Name)
{
	var search = Name + "="

	if (document.cookie.length > 0) { // if there are any cookies

		offset = document.cookie.indexOf(search)
		if (offset != -1) {// if cookie exists
			offset += search.length

			// set index of beginning of value
			var end = document.cookie.indexOf(";", offset)
			// set index of end of cookie value
			if (end == -1)
				end = document.cookie.length
				//return unescape(document.cookie.substring(offset, end))
				return offset;
		}
		else if(offset < 0) // NO COOKIES
		{

			//alert(document.frmHome.Main02Promo1.value);



		}
	}
}

function DeleteCookie (name) {

var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = getCookie(name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}

function getCurrentCookie()
{
	var image1 = "citi_wow1";
	var image2= "citi_wow2" ;
	var image3= "citi_wow3";


	Image1_offset = getCookie(image1);
	Image2_offset = getCookie(image2);
	Image3_offset = getCookie(image3);

	//If no cookie exists create one
	var exp = new Date();
	exp.setTime (exp.getTime() + (30*1000*60) );  // 30 min
	if((Image1_offset == null) && (Image2_offset == null)&&(Image3_offset == null))
	{
		//alert("No cookie exists creating one....");
		SetCookie("citi_wow1" ,"Image1", exp);
		Image1_offset = getCookie(image1);
		return "Image1";
	}

	if (Image1_offset > 0 )
	{

		DeleteCookie("citi_wow1");
		SetCookie("citi_wow2" ,"Image2", exp);
		return "Image2";
	}

	else if (Image2_offset > 0 )
	{

		DeleteCookie("citi_wow2");
		SetCookie("citi_wow3" ,"Image3", exp);
		return "Image3";
	}
	else if (Image3_offset > 0 )
	{
		// DeleteCookie("citi_wow3");
		// SetCookie("citi_wow1" ,"Image1", exp);
		// return "Image1";
		return "Image3";
	}

}



function Rotate03BannerImage()
{

var currentCookie = getCurrentCookie();
var bannerObj = "";

var setrandombanner = true;
if (currentCookie == "Image1"){  // the first image to display
	if (document.frmHome.Main03Promo0) {
		bannerObj= document.frmHome.Main03Promo0.value;
		setrandombanner = false;
	} else {
		setrandombanner = true;
	}
  }

if (setrandombanner) {  // generate random
	// get max
	var maxnum,loopmax, kj;
	maxnum = 0; loopmax= 1000;
	for (kj=1; kj<=loopmax; kj++) {
		if (document.frmHome.elements['Main03Promo'+ kj]) {
		} else {
			break;  // if not exists then break
		}
	}
	maxnum = kj - 1;
	// alert('debug max: '+ maxnum);

	// generate
	var randnum = get_random(maxnum);
	bannerObj= document.frmHome.elements['Main03Promo'+ randnum].value;
	// alert('debug banner: Main03Promo'+ randnum);
}


  //else if (currentCookie == "Image2"){
	//  bannerObj= document.frmHome.Main03Promo2.value;
  //}
  //else if (currentCookie == "Image3"){
	//  bannerObj= document.frmHome.Main03Promo3.value;
  //}

// Get the image to be shown and the other parameters to be passed to Loadpage
var myArray = bannerObj.split(',');
var size = myArray.length;
var path		=	myArray[0];
var productId	=	myArray[1];
var target		=	myArray[2];
var external	=	myArray[3];
var height		=	myArray[4];
var width		=	myArray[5];
var imageName	=   myArray[6];


//document.write('<td width="180">');
//document.write('<a href='+'"'+'javascript:top.Loadpage'+'('+path +',' + productId +',' +target+',' +external + ','+height +',' + width +')'+'""'+'>');
document.write('<a href='+'"'+'javascript:top.Loadpage'+'(\''+path +'\',\'' + productId +'\',\'' +target+'\',\'' +external + '\',\''+height +'\',\'' + width +'\')'+'""'+'>');
document.write('<img src=' +'"'+imageName + '"' +'alt='+'""'+'width='+'"180"'+'height='+'"100"'+'hspace='+'"0"'+'border='+'"0"'+'/>' );
document.write('</a>');


}





function Rotate04BannerImage()
{

var currentCookie = getCurrentCookie();
var bannerObj = "";

var setrandombanner = true;
if (currentCookie == "Image1"){  // the first image to display
	if (document.frmHome.Main04Promo0) {
		bannerObj= document.frmHome.Main04Promo0.value;
		setrandombanner = false;
	} else {
		setrandombanner = true;
	}
  }

if (setrandombanner) {  // generate random
	// get max
	var maxnum,loopmax, kj;
	maxnum = 0; loopmax= 1000;
	for (kj=1; kj<=loopmax; kj++) {
		if (document.frmHome.elements['Main04Promo'+ kj]) {
		} else {
			break;  // if not exists then break
		}
	}
	maxnum = kj - 1;
	// alert('debug max: '+ maxnum);

	// generate
	var randnum = get_random(maxnum);
	bannerObj= document.frmHome.elements['Main04Promo'+ randnum].value;
	// alert('debug banner: Main04Promo'+ randnum);
}


  //else if (currentCookie == "Image2"){
	//  bannerObj= document.frmHome.Main04Promo2.value;
  //}
  //else if (currentCookie == "Image3"){
	//  bannerObj= document.frmHome.Main04Promo3.value;
  //}

// Get the image to be shown and the other parameters to be passed to Loadpage
var myArray = bannerObj.split(',');
var size = myArray.length;
var path		=	myArray[0];
var productId	=	myArray[1];
var target		=	myArray[2];
var external	=	myArray[3];
var height		=	myArray[4];
var width		=	myArray[5];
var imageName	=   myArray[6];


//document.write('<td width="180">');
//document.write('<a href='+'"'+'javascript:top.Loadpage'+'('+path +',' + productId +',' +target+',' +external + ','+height +',' + width +')'+'""'+'>');
document.write('<a href='+'"'+'javascript:top.Loadpage'+'(\''+path +'\',\'' + productId +'\',\'' +target+'\',\'' +external + '\',\''+height +'\',\'' + width +'\')'+'""'+'>');
document.write('<img src=' +'"'+imageName + '"' +'alt='+'""'+'width='+'"180"'+'height='+'"100"'+'hspace='+'"0"'+'border='+'"0"'+'/>' );
document.write('</a>');


}
*/


/****** end rotate the main banner on the home page ******/

//-->