﻿window.onload = initBannerLink;

var adImages = new Array("images/mainb_reward.jpg","images/mainb_words.jpg");
var adAlt = new Array("住酒店，获奖励！关于优悦会会议奖励计划", "这里发现更多关于皇冠假日酒店会务体验。");
var adURL = new Array("http://www.priorityclub.com.cn/apacmeetings","help.htm");
var thisAd = 0;

function rotate() {
	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}
	document.getElementById("ChangingPix").src = adImages[thisAd];
	document.getElementById("ChangingPix").alt = adAlt[thisAd];

	setTimeout("rotate()", 5 * 1000);
}

function newLocation() {
	if (thisAd == 0){
		window.open("http://www.priorityclub.com.cn/apacmeetings");
		} else {
 		document.location.href = adURL[thisAd];
	}
	return false;
}

function initBannerLink() {
	MM_preloadImages('images/logos_sliced_01on.gif','images/logos_sliced_02on.gif','images/logos_sliced_03on.gif','images/logos_sliced_04on.gif','images/logos_sliced_05on.gif','images/logos_sliced_06on.gif','images/logos_sliced_07on.gif','images/logos_sliced_08on.gif')

if (document.getElementById("ChangingPix").parentNode.tagName == "A") {
	document.getElementById("ChangingPix").parentNode.onclick = newLocation;
	}
	
	rotate();
	
}
