function Banner(){this.xmlPath=gHost+"xml";this.createBanner=g;function g(h,i){if($("#"+i).length<=0){return}if(h.indexOf("http")<0){var j=this.xmlPath+h.toLowerCase()+".xml"}else{var j=h.toLowerCase()+".xml"}$.ajax({type:"GET",url:j,dataType:"xml",success:function(k){b(k,i)},error:function(){}})}function b(m,l){$("#"+l).empty();var h=$(m).find("content").attr("height");if(!h){h=110}var k=$(m).find("items").length;for(var j=1;j<=k;j++){$(m).find("items").each(function(){if(parseInt($(this).attr("slot"))==j){if(j==k){var i=0}else{var i=8}$("#"+l).append(a(this,"slot"+j,i));c("slot"+j,h);f("slot"+j,$(this).attr("type"),$(this).attr("timing"))}})}$("#"+l).append($('<br clear="both"/>'));$("#"+l).show()}function c(i,h){$("#"+i).ready(function(){$("#"+i).css({height:h+"px"})})}function f(h,i,j){if(i=="sequence"){i=0}else{i=1}$("#"+h).cycle({fx:"scrollUp",timeout:j*1000,delay:-2000,random:i})}function a(l,h,k){var i=$('<div id="'+h+'" class="slot"></div>');var j=$(l).attr("width");if(j=="323"){j="322"}if(k){i.css({paddingRight:k+"px",width:j+"px"})}else{i.css({width:j+"px"})}$(l).find("item").each(function(){i.append(e(this,j))});$(i).mouseover(function(){$(i).cycle("pause")});$(i).mouseout(function(){$(i).cycle("resume")});return i}function e(n,j){var l=$(n).find("img").text();var p=$(n).find("title").text();var m=$(n).find("sdesc").text();var i=$(n).find("url").text();var o=$(n).find("target").text();var h=$('<div class="slot-item"></div>');if(i!=""){var k=$("<a></a>").append($(d(l,j))).append($("<h4></h4>").html(p)).append($("<p></p>").html(m));if(isPopup(o)){k.attr({href:"javascript:void(0)"});k.click(function(){popupWindow(i,"bannerLink",o)})}else{k.attr({href:i,target:o})}}else{var k=$("<span></span>").append($(d(l,j))).append($("<h4></h4>").html(p)).append($("<p></p>").html(m))}h.append(k);return h}function d(h,k){var j="";var i=h.split(".");if(i[i.length-1]=="swf"){j='<embed src="'+h+'" quality="high" width="'+k+'" height="75" swliveconnect=true align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent"/>'}else{j='<img src="'+h+'" width="'+k+'"></img>'}return j}};