(function($){$.fn.adman=function(options){var $this=$(this);var $options=$.extend({},$.fn.adman.defaults,options);function update(){;$.ajax({type:$options.type,url:$options.url,cache:false,data:({zone:$options.zone}),dataType:$options.dataType,success:function(xml){var ad='';var src=$('ImgSrc',xml).text();var width=$('AdImg',xml).attr('width');var height=$('AdImg',xml).attr('height');if(src.match(/(swf)$/)){ad='<object type="application/x-shockwave-flash" id="name" width="'+width+'" height="'+height+'" data="'+src+'">'+'<param name="movie" value="'+$('ImgSrc',xml).text()+'" />'+'<param name="quality" value="high" />'+'<param name="wmode" value="transparent" />'+'<param name="allowScriptAccess" value="sameDomain" /></object>';}else if(src.match(/(gif|jpg|png)$/)){var img='<img src="'+src+'" width="'+width+'" height="'+height+'" border="0" alt="" />';ad='<a href="'+unescape($('AdHref',xml).text())+'" target="'+$('AdUrl',xml).attr('target')+'">'+img+'</a>';};var rotate=$('AdXml',xml).attr('AdRotate');if(rotate>0&&$options.interval===null){$options.interval=rotate*1000;};if($options.interval!==null&&$options.interval>0){setTimeout(update,$options.interval);};$this.empty().html(ad);}});};update();};$.fn.adman.defaults={type:"GET",dataType:'xml',url:"AdManProxy.aspx",interval:null,zone:null};})(jQuery);

jQuery(function($){
	$('div.Ad_180x150').each(function(){
		$(this).adman({zone:$('span', this).text()});
	});
});
