	var baseURL = "http://202.175.82.109/adcounter/hit.php?name=";
	var totalBanners = new Array();
	function AdCounter(){
		this.name;
		this.paths = new Array();
		this.checkPath = function(){
			for(var i=0; i<this.paths.length; i++){
				if(this.paths[i] == window.location){
					return true;
				}
			}
			return false;
		} 
		this.hitCounter = function(){
			if(this.checkPath()){
				var img = new Image();
				img.src = baseURL + this.name;
			}
		}
	}
	
	function clickBanner(name){
		var img = new Image();
		img.src = baseURL + name;		
	}

	function genImagePath(sImageName){
		return 'http://web.macauslot.com/soccer/html/match_info/images/'+sImageName;
	}
	
	function AdBanner(click_banner_id, img_url, site_url, alt){
		this.click_banner_id = click_banner_id;
		this.img_url = img_url;
		this.site_url = site_url;
		this.alt = alt;
	}	
	
	function getGenericADBanner(type){
		var AD_LIST = eval(type);
		var width = 120;
		var height = 80;
		
		var sContent = '<table id="' + type + '" border="0" cellspacing="0" cellpadding="0">';
		for(var i=0; i<AD_LIST.length; i++){		
			sContent += '<tr>';
    		sContent += '	<td>';
    		if(AD_LIST[i].site_url != ""){
    			sContent += '		<a href="' + AD_LIST[i].site_url + '" target="_blank">';
    		}
    		if(AD_LIST[i].click_banner_id != ""){
    			sContent += '			<img src="' + AD_LIST[i].img_url + '" onclick="clickBanner(\'' + AD_LIST[i].click_banner_id + '\');" alt="' + AD_LIST[i].alt + '" width="' + width + '" height="' + height + '" style="border-color=#FFFFFF;border-width=1;">';
    		} else {
    			sContent += '			<img src="' + AD_LIST[i].img_url + '" alt="' + AD_LIST[i].alt + '" width="' + width + '" height="' + height + '" style="border-color=#FFFFFF;border-width=1;">';    		
    		}
    		if(AD_LIST[i].site_url != ""){    		
    			sContent += '		</a>';
    		}
    		sContent += '	</td>';			
			sContent += '</tr>';
		}
		sContent += '</table>';	
		return sContent;
	}	 
 
 	function getGenericADLink(type){
		var AD_LIST = eval(type);
		var sContent = '';
		if(AD_LIST.length > 0){
			sContent += '<table width="100%" border="0" cellpadding="1" cellspacing="0"><tr><td style="line-height:5pt;">&nbsp;</td></tr></table>';
					
			sContent += '<table width="100%" border="0" cellpadding="1" cellspacing="0" background="' + genImagePath("adv_bg.gif") + '">';
			sContent += '<tr height="23">';			
			sContent += '<td width="10%" nowrap><b>¼s §i:</b></td>';
			for(var i=0; i<AD_LIST.length; i++){
				if(i > 1) continue;
    			sContent += '	<td width="45%" nowrap>'; 
    			if(AD_LIST[i].site_url != ""){
    				sContent += '		<a title="' + AD_LIST[i].alt + '" style="font-size:14;font-style:italic;color:' + ((AD_LIST.click_banner_id.indexOf('^blue')==-1)?'#FF0000':'blue')+';text-decoration:underline;" href="' + AD_LIST[i].site_url + '" target="_blank" onclick="clickBanner(\'' + AD_LIST[i].click_banner_id + '\');">';
    				sContent += AD_LIST[i].img_url;
    				sContent += '		</a>';
    			} else {
    				sContent += '&nbsp;';
    			} 
    			sContent += '	</td>';			
			} 
			if(AD_LIST.length == 1){
				sContent += '<td width="45%" nowrap>&nbsp;</td>';
			}
			
			sContent += '</tr>';			
			sContent += '</table>';
						
		}		
		return sContent;
	}	
 
 	function fixGenericAdBannerLocation(type){
		if(document.getElementById(type) != null){
			var left_banner_element = document.getElementById(type);
			left_banner_element.style.position = "absolute";
			left_banner_element.style.right = 5;
			left_banner_element.style.top = document.body.scrollTop + 5;
		}
	}
 
	//var ac1 = new AdCounter();
	//ac1.name = "www_main";	
	//ac1.paths.push("http://www.macauslot.com/slot/advertise/ch-homeAdvertise2.htm");
	//ac1.paths.push("http://translation.macauslot.com:89/gate/gb/www.macauslot.com/slot/advertise/sc-homeAdvertise2.htm");
	//ac1.paths.push("http://www.macauslot.com/slot/advertise/en-homeAdvertise2.htm");
	//ac1.paths.push("http://www.macauslot.com/soccer/advertise/ch-homeAdvertise2.htm");
	//ac1.paths.push("http://translation.macauslot.com:89/gate/gb/www.macauslot.com/soccer/advertise/sc-homeAdvertise2.htm");
	//ac1.paths.push("http://www.macauslot.com/soccer/advertise/en-homeAdvertise2.htm");	
	//ac1.paths.push("http://www.macauslot.com/nba/advertise/ch-homeAdvertise2.htm");
	//ac1.paths.push("http://translation.macauslot.com:89/gate/gb/www.macauslot.com/nba/advertise/sc-homeAdvertise2.htm");
	//ac1.paths.push("http://www.macauslot.com/nba/advertise/en-homeAdvertise2.htm");
	//totalBanners.push(ac1);
	
	//var ac2 = new AdCounter();
	//ac2.name = "www_odds";
	//ac2.paths.push("http://www.macauslot.com/soccer/advertise/ch-oddsAdvertise2.htm");
	//ac2.paths.push("http://www.macauslot.com/soccer/advertise/sc-oddsAdvertise2.htm");
	//ac2.paths.push("http://www.macauslot.com/soccer/advertise/en-oddsAdvertise2.htm");
	//ac2.paths.push("http://www.macauslot.com/nba/advertise/ch-oddsAdvertise2.htm");
	//ac2.paths.push("http://www.macauslot.com/nba/advertise/sc-oddsAdvertise2.htm");
	//ac2.paths.push("http://www.macauslot.com/nba/advertise/en-oddsAdvertise2.htm");
	//totalBanners.push(ac2);

	window.onload = function(){
		for(var i=0; i<totalBanners.length; i++){
			totalBanners[i].hitCounter();
		}
	}