function addBannerAd( zone )
{
    if( !document.phpAds_used) document.phpAds_used = ',';
    phpAds_random = new String(Math.random()); phpAds_random = phpAds_random.substring(2,11);
    document.write( '<'+'script type="text/javascript" src="http://ads.iwant-in.net/v1/adjs.php?n='+phpAds_random+'&amp;what=zone:'+zone+'&amp;exclude='+document.phpAds_used+'&amp;charset='+(document.charset || document.characterSet)+(document.referrer?'&amp;referer='+document.referrer:'')+'"></'+'script>');
}
function loadBannerAds( )
{
	divEls = document.getElementsByTagName('div');
	adRE = new RegExp( "phpad-[0-9]{1,8}" ); // phpad-(id)
	div_id_params = '';
	for( var i=0; i< divEls.length; i++ )
	{
		if ( adRE.test( divEls[i].getAttribute('id') ) )
		{
			div_id_params = divEls[i].getAttribute('id') + ';' + div_id_params;
		}
	}
	if( !document.phpAds_used) document.phpAds_used = ',';
	phpAds_random = new String(Math.random()); phpAds_random = phpAds_random.substring(2,11);
	var s;
	s=document.createElement("script");
	s.setAttribute('id',phpAds_random);
	s.setAttribute('type','text/javascript');
	s.setAttribute('src','http://ads.itry.com.tw/v1/loadalladjs.php?n='+phpAds_random+'&exclude='+document.phpAds_used+'&charset='+(document.charset || document.characterSet)+(document.referrer?'&referer='+escape(document.referrer):'') + '&div_id=' + div_id_params);
	//s.setAttribute('src','http://ads02.iwant-in.net/v1/loadalladjs.php?n='+phpAds_random+'&exclude='+document.phpAds_used+'&charset='+(document.charset || document.characterSet)+(document.referrer?'&referer='+escape(document.referrer):'') + '&div_id=' + div_id_params);
	var head=document.getElementsByTagName("head")[0];
	head.appendChild(s);
	//return false;        
}
