/*
 *
 * Created by Bernie Cultess
 * March 23, 2010
 * 
 *  
 */
 
 var Ad = {
	version:'1.0',
	collection:function(){
		var sets = [
			["/images/liveauctions/sir/070910/070910_Homepage_StLucia.jpg",
			"http://www.sothebysrealty.com/en/PropertyDetails.aspx?R=4100006187&WT.mc_id=sauc",
			"sirHomes",
			"SIR_AnseLaRaye_St_Lucia"],
			["/images/liveauctions/sir/070910/070910_Homepage_Czech.jpg",
			"http://www.sothebysrealty.com/en/PropertyDetails.aspx?R=4100014987&WT.mc_id=sauc",
			"sirHomes",
			"SIR_Kremze_SouthBohemia_CzechRepublic"],
			["/images/liveauctions/sir/070910/070910_Homepage_MA.jpg",
			"http://www.sothebysrealty.com/en/PropertyDetails.aspx?R=104201482&WT.mc_id=sauc",
			"sirHomes",
			"SIR_Manchester_Massachusetts"],
			["/images/liveauctions/sir/070910/070910_Homepage_Brazil.jpg",
			"http://www.sothebysrealty.com/en/PropertyDetails.aspx?R=4100009430&WT.mc_id=sauc",
			"sirHomes",
			"SIR_SaoPaulo_SaoPaulo_Brazil"],
			["/images/liveauctions/sir/070910/070910_Homepage_NJ.jpg",
			"http://www.sothebysrealty.com/en/PropertyDetails.aspx?R=104215179&WT.mc_id=sauc",
			"sirHomes",
			"SIR_Galloway_NewJersey"],
			["/images/graphics/mysothebys/preferredClients/assouline_banner.jpg",
			"/app/global/mySothebys.do?dispatch=assouline",
			"assoulineAd",
			"Assouline_from_homepage_ad_banner_section"]//,
			//["/images/banners/mutualart/Mutual-Art-Banner_v2.jpg",
			//"http://www.mutualart.com/?promo=6D80CD75C06BACE7&utm_source=sothebys&utm_medium=banner&utm_campaign=sot_banner_hp",
			//"mutualArtAd",
			//"MutualArt_from_homepage_ad_banner_section"]			
		]
		var n = (Math.random()*2) + '';
		//Bid.log(n);
		var numOfSets = sets.length;
		n = parseInt(n.charAt(numOfSets));
		if(n >numOfSets) {
        	n = n - numOfSets;
		}else if(n == numOfSets) {
			n = 0;
		}
		
		var ad = '<a href="' + sets[n][1] + '" name="&lid=' +sets[n][3] + '&lpos=Homepage_Ad_Banner" target="newad">'
		+ '<img id="' + sets[n][2] + '" src="' + sets[n][0] + '" width="728" height="90" border="0" alt="" /></a>';	
		document.getElementById('adBlockHP').innerHTML = ad;
	}
}

Bid.addEvent(window,'load',Ad.collection);
