function Marquee(elm,width,height,spd,type,wspace){if(arguments.length<1){alert(I18n.marqueeIdEmpty);return false;};var element=elm;var scrollwidth=width?width:800;var scrollheight=height?height:200;scrollwidth=parseInt(scrollwidth);scrollheight=parseInt(scrollheight);var scrollwspace=wspace?wspace:5;var scrolltype=type?type:3;var speed=spd?spd:30;var scrolltext=new Array();var obj1=document.getElementById(element);if(!obj1){alert(I18n.marqueeIllegalParameter);return false;};obj1.style.height=scrollheight+'px';obj1.style.width=scrollwidth+'px';obj1.style.border='0px solid #000';var obj2=document.createElement("div");obj2.id=element+'obj2';var obj3=document.createElement("div");obj3.id=element+"obj3";obj2.style.border='0px solid #000';var objtab=document.createElement('table');var objtr=document.createElement('tr');var objtd=document.createElement('td');objtd.innerHTML=obj1.innerHTML;obj1.innerHTML="";objtab.style.display="inline";objtab.cellpadding="0";objtab.cellspacing="0";objtab.id=element+'tab';objtab.style.border="0px solid #FF0000";objtd.style.whiteSpace="nowrap";objtr.appendChild(objtd);objtab.appendChild(objtr);obj2.innerHTML=objtab.outerHTML;obj1.appendChild(obj2);obj1.appendChild(obj3);obj3.style.width=obj2.style.width=scrollwidth+'px';if(scrolltype==1||scrolltype==2){if(obj2.offsetHeight<scrollheight){var tabheight=scrollheight-obj2.offsetHeight;var tabmarginleft=(obj2.offsetWidth>scrollwidth)?scrollwidth:(obj2.offsetWidth+scrollwidth)/2;if(tabheight<0){tabheight=0;}else{obj2.innerHTML+="<table border=0 style='border:0px solid #ff0000;margin-left:"+tabmarginleft+"px;' cellpadding='0' cellspacing='0'><tr><td style='height:"+tabheight+"px;' nowrap></td></tr></table>";}}};document.write("<style type=\"text/css\">#"+element+"{overflow:hidden;width:"+scrollwidth+"px;}; #"+element+" #"+obj2.id+",#"+element+" #"+obj3.id+"{padding:0px !important;padding:0px;margin:0px !important;margin:0px;float:none;}; #"+obj2.id+" img,#"+obj3.id+" img{margin-right:"+scrollwspace+"px;};</style>");if(scrolltype==3||scrolltype==4){obj1.style.whiteSpace="nowrap";obj2.style.display=ospod.browser.isChrome?"inline-table":"inline";var tabwidth=scrollwidth-obj2.offsetWidth;var tabmargintop=(obj2.offsetHeight>scrollheight)?scrollheight:(obj2.offsetHeight+scrollheight)/2;if(tabwidth<0){tabwidth=0;}else{obj2.innerHTML+="<table border=0 style='display:inline;margin-top:"+tabmargintop+"px;' cellpadding='0' cellspacing='0'><tr><td style='width:"+tabwidth+"px;' nowrap></td></tr></table>";}};obj3.innerHTML=obj2.innerHTML;Marquee.prototype.marqueeScrollTop=function(element,scrolltype,scrollwidth,scrollheight,speed){var obj1=document.getElementById(element);var obj2=document.getElementById(element+"obj2");var obj3=document.getElementById(element+"obj3");if(obj2.offsetHeight>scrollheight)if(obj3.offsetTop-obj1.scrollTop<=0){obj1.scrollTop-=obj3.offsetTop;}else{var oldScrollTop=obj1.scrollTop;obj1.scrollTop++;if(oldScrollTop==obj1.scrollTop){obj1.scrollTop=0;}}else{if(scrollheight-obj1.scrollTop<=0){obj1.scrollTop-=scrollheight;}else{obj1.scrollTop++;}}};Marquee.prototype.marqueeScrollDown=function(element,scrolltype,scrollwidth,scrollheight,speed){var obj1=document.getElementById(element);var obj2=document.getElementById(element+"obj2");var obj3=document.getElementById(element+"obj3");if(document.all){if(obj2.offsetTop-obj1.scrollTop>=0){obj1.scrollTop+=obj3.offsetHeight;}else{obj1.scrollTop--;}}else{if(obj2.offsetTop-obj1.scrollTop-obj2.offsetTop>=0){obj1.scrollTop+=obj3.offsetHeight;}else{obj1.scrollTop--;}}};Marquee.prototype.marqueeScrollLeft=function(element,scrolltype,scrollwidth,scrollheight,speed){var obj1=document.getElementById(element);var obj2=document.getElementById(element+"obj2");var obj3=document.getElementById(element+"obj3");if(obj3.offsetWidth-obj1.scrollLeft<=0){obj1.scrollLeft-=obj2.offsetWidth;}else{obj1.scrollLeft++;}};Marquee.prototype.marqueeScrollRight=function(element,scrolltype,scrollwidth,scrollheight,speed){var obj1=document.getElementById(element);var obj2=document.getElementById(element+"obj2");var obj3=document.getElementById(element+"obj3");if(obj1.scrollLeft<=0){obj1.scrollLeft+=obj3.offsetWidth;}else{obj1.scrollLeft--;}};var count;Marquee.prototype.marqueeStart=function(element,scrolltype,scrollwidth,scrollheight,speed){switch(scrolltype){case 1:if(Marquee.prototype.scrollTopOrDown(element,scrolltype,scrollwidth,scrollheight,speed)){Marquee.prototype.clearInterval(element);count=window.setInterval(Marquee.prototype.marqueeScrollTop.bind(this,element,scrolltype,scrollwidth,scrollheight,speed),speed);MarqueeInterval[element]=count;};break;case 2:if(Marquee.prototype.scrollTopOrDown(element,scrolltype,scrollwidth,scrollheight,speed)){Marquee.prototype.clearInterval(element);count=window.setInterval(Marquee.prototype.marqueeScrollDown.bind(this,element,scrolltype,scrollwidth,scrollheight,speed),speed);MarqueeInterval[element]=count;};break;case 3:Marquee.prototype.scrollLeftOrRight(element,scrolltype,scrollwidth,scrollheight,speed);Marquee.prototype.clearInterval(element);count=window.setInterval(Marquee.prototype.marqueeScrollLeft.bind(this,element,scrolltype,scrollwidth,scrollheight,speed),speed);MarqueeInterval[element]=count;break;case 4:Marquee.prototype.scrollLeftOrRight(element,scrolltype,scrollwidth,scrollheight,speed);Marquee.prototype.clearInterval(element);count=window.setInterval(Marquee.prototype.marqueeScrollRight.bind(this,element,scrolltype,scrollwidth,scrollheight,speed),speed);MarqueeInterval[element]=count;break;}};Marquee.prototype.scrollLeftOrRight=function(element,scrolltype,scrollwidth,scrollheight,speed){var obj3=document.getElementById(element+"obj3");obj3.style.display=ospod.browser.isChrome?"inline-table":"inline";};Marquee.prototype.scrollTopOrDown=function(element,scrolltype,scrollwidth,scrollheight,speed){var obj2=document.getElementById(element+"obj2");if(scrollwidth-obj2.offsetWidth<0){return true;}else{obj2.style.display="block";return true;}};Marquee.prototype.clearInterval=function(element){var interval;for(var key in MarqueeInterval){if(key==element){interval=MarqueeInterval[key];break;}};window.clearInterval(interval);};obj1.onmouseover=function(){Marquee.prototype.clearInterval(element);};obj1.onmouseout=function(){Marquee.prototype.marqueeStart(element,scrolltype,scrollwidth,scrollheight,speed);};Marquee.prototype.marqueeStart(element,scrolltype,scrollwidth,scrollheight,speed);};var MarqueeInterval=new Object();function GetImageSize(oImage){var OriginImage=new Image();if(OriginImage.src!=oImage.src)OriginImage.src=oImage.src;return{"width":OriginImage.width,"height":OriginImage.height};};function ADItemObj(){this.id=0;this.type=1;this.resHeight=100;this.resWidth=100;this.hint="";this.resURL="";this.linkURL="";this.power=1;this.text="";this.getHtml=getADItemHTML;};function getADItemHTML(){var str="";var name="ad_"+this.id;switch(this.type){case 1:str="<A TARGET='_blank' HREF='"+this.linkURL+"'><IMG ID='"+name+"' NAME='"+name+"' BORDER=0 HEIGHT=";str+=this.resHeight+" WIDTH="+this.resWidth+" SRC='"+this.resURL+"' title='"+this.hint+"' ALT='"+this.hint+"'></A>";break;case 2:str="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' ";str+=" name='"+name+"' id='"+name+"'  width='"+this.resWidth+"' 	height='"+this.resHeight+"'>";str+="<param name='movie' value='"+this.resURL+"'>";str+="<param name='quality' value='autohigh'>";str+="<embed name='"+name+" id='"+name+"'  width='"+this.resWidth+"' height='"+this.resHeight+"' src='"+this.resURL+"'";str+=" quality='autohigh' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";str+="</object>";break;case 3:str="<div>"+this.text+"</div>";break;case 4:str="<script>"+this.text+"</script>";break;case 5:str="<IFRAME FRAMEBORDER=0 SCROLLING=NO FRAMESPACING=0 MAGINWIDTH=0 MARGINHEIGHT=0 HEIGHT=";str+=this.resHeight+" WIDTH="+this.resWidth+" SRC='"+this.resURL+"'></IFRAME>";};return str;};function ADFloatDIV(id){this.ID=id;this.divName="";this.status=true;this.virgin=true;this.adItems=new Array();this.currentAD=null;this.htmlDIV=null;this.floatType=1;this.divWidth=100;this.divHeight=100;this.left=-1;this.top=-1;this.dx=2*(Math.random()>0.5?1:-1);this.dy=1*(Math.random()>0.5?1:-1);this.counter=0;this.timer=null;this.step=1;this.rate=10;this.delay=3000;this.setADItem=Float_setADItem;this.adStart=adStart;this.showDIV=Float_showDIV;this.floatDIV=Float_floatDIV;this.pauseMove=Float_pauseMove;this.continueMove=Float_continueMove;this.divInvisible=Float_invisible;this.getCurrentAD=getRandomObj;this.initDiv=FLoat_InitDiv;this.popWindow=pop_window;};function adStart(){if(this.floatType<=10){this.showDIV();}else if(this.floatType>10){this.popWindow();}};function FLoat_InitDiv(){if(this.virgin==false)return;this.virgin=false;if(this.floatType==1||this.floatType==2||this.floatType==3||this.floatType==4){if(this.left<0){this.left=500+500*Math.random()*(Math.random()>0.5?1:-1);};if(this.top<0){this.top=300+300*Math.random()*(Math.random()>0.5?1:-1);}}else if(this.floatType==5||this.floatType==6){if(this.left==-1){this.left=(window.document.body.offsetWidth-this.divWidth)/2;}else if(this.left==-2){this.left=window.document.body.offsetWidth-this.divWidth;};var sHeight=document.documentElement.clientHeight||document.body.clientHeight;if(this.top==-1){this.top=(sHeight-this.divHeight-this.dy-22)/2;}else if(this.top==-2){this.top=sHeight-this.divHeight-this.dy*2-22;}};if(this.left>(window.document.body.offsetWidth-this.divWidth)){this.left=(window.document.body.offsetWidth-this.divWidth)/window.screen.width*this.left;if(this.left>(window.document.body.offsetWidth-this.divWidth)){this.left=(window.document.body.offsetWidth-this.divWidth);}};if(this.top>(window.document.body.offsetHeight-this.divHeight-this.dy*2-22)){this.top=(window.document.body.offsetHeight-this.divHeight-this.dy*2-22)/window.screen.width*this.top;if(this.top>(window.document.body.offsetHeight-this.divHeight-this.dy*2-22)){this.top=(window.document.body.offsetHeight-this.divHeight-this.dy*2-22);}}};function Float_floatDIV(){screenX=document.documentElement.scrollLeft||document.body.scrollLeft;screenY=document.documentElement.scrollTop||document.body.scrollTop;screenW=document.documentElement.clientWidth||document.body.clientWidth;screenW=screenW-this.divWidth;screenH=document.documentElement.clientHeight||document.body.clientHeight;screenH=screenH-this.divHeight-this.dy*2;this.initDiv();var theLeft,theTop;if(this.floatType==1){theLeft=this.left+this.dx*this.step;theTop=this.top+this.dy*this.step;if((theLeft>=screenW&&this.dx>0)||(theLeft<=0&&this.dx<0))this.dx=-1*this.dx;if((theTop>=screenH&&this.dy>0)||(theTop<=0&&this.dy<0))this.dy=-1*this.dy;}else if(this.floatType==2){if(this.counter>=(200/this.rate)){this.dx=(this.dx>0?1:-1)*Math.random()*5;this.dy=(this.dy>0?1:-1)*Math.random()*5;this.counter=0;};this.counter+=1;theLeft=this.left;theTop=this.top+this.dy*this.step;if((theLeft>=screenW&&this.dx>0)||(theLeft<=0&&this.dx<0))this.dx=-1*this.dx;if((theTop>=screenH&&this.dy>0)||(theTop<=0&&this.dy<0))this.dy=-1*this.dy;}else if(this.floatType==3){this.dx=0;theLeft=this.left+this.dx*this.step;theTop=this.top+this.dy*this.step;if((theLeft>=screenW)||(theLeft<=0)){this.left=this.left+this.currentAD.resWidth;};if((theTop>=screenH&&this.dy>0)||(theTop<=0&&this.dy<0))this.dy=-1*this.dy;}else if(this.floatType==4){this.dy=0;theLeft=this.left+this.dx*this.step;theTop=this.top+this.dy*this.step;if((theLeft<=0)){this.dx=-1*this.dx;};if((theLeft>=screenW&&this.dx>0)){this.dx=-1*this.dx;}}else if(this.floatType==5){this.dx=0;this.dy=0;}else if(this.floatType=6){if(document.all){this.htmlDIV.style.pixelLeft=this.left;this.htmlDIV.style.pixelTop=this.top;}else{this.htmlDIV.style.left=this.left+"px";this.htmlDIV.style.top=this.top+"px";};this.htmlDIV.timer=setTimeout(this.ID+".divInvisible()",this.delay);return;};this.left=this.left+this.dx*this.step;this.top=this.top+this.dy*this.step;if(document.all){this.htmlDIV.style.pixelLeft=this.left+screenX;this.htmlDIV.style.pixelTop=this.top+screenY;}else{this.htmlDIV.style.left=this.left+screenX+"px";this.htmlDIV.style.top=this.top+screenY+"px";};var	delay=80/this.rate;clearTimeout(this.htmlDIV.timer);this.htmlDIV.timer=setTimeout(this.ID+".floatDIV()",delay);};function Float_showDIV(){this.currentAD=this.getCurrentAD(this.adItems);this.divHeight=this.currentAD.resHeight;this.divWidth=this.currentAD.resWidth;if(this.currentAD==null||this.currentAD=="")return;this.divName="ADF_"+this.ID;this.divHeight=this.divHeight+22;var str="<DIV id='"+this.divName+"' onMouseOver='"+this.ID+".pauseMove()' onMouseOut='"+this.ID+".continueMove()";str+="' STYLE='position:absolute; visibility:visible; z-index:1; width:";if(document.all){str+=this.divWidth+"; height:"+this.divHeight+"; left:"+this.left+";top:"+this.top+"'>";}else{str+=this.divWidth+"; height:"+this.divHeight+"; left:"+this.left+"px;top:"+this.top+"px'>";};str+=this.currentAD.getHtml();str+="<span  STYLE='display:block;background-color:#ECE9D8;font-size:12px; width:30px; line-height:1.5;text-align:right;padding:2px;cousor:hand'  ><A HREF='javascript:"+this.ID+".divInvisible()'''>"+I18n.adClose+"</A>&nbsp;</span>";str+="</DIV>";document.write(str);this.htmlDIV=$oe(this.divName).get(0);this.floatDIV();};function Float_pauseMove(){clearTimeout(this.htmlDIV.timer);};function Float_continueMove(){if(this.status)this.floatDIV();};function Float_setADItem(ItemObj){var thisLine=this.adItems.length;this.adItems[thisLine]=new Array(ItemObj,ItemObj.power);};function Float_invisible(){clearTimeout(this.htmlDIV.timer);this.htmlDIV.style.visibility="hidden";this.status=false;};function pop_window(){var popC=getCookie("_cmsPopAD");if(popC&&popC>0){return;};this.currentAD=this.getCurrentAD(this.adItems);this.divHeight=this.currentAD.resHeight;this.divWidth=this.currentAD.resWidth;if(this.currentAD==null||this.currentAD=="")return;var str="width="+this.divWidth+"px,height="+this.divHeight+"px,toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,";str+="Top="+this.top+",Left="+this.left;var url="http://"+window.location.host+_contextPath+"/cad?_cmsADC="+this.currentAD.id;if(this.floatType==11){window.open(url,"",str);}else if(this.floatType==12){window.open(url,"",str);window.focus();}else if(this.floatType==13){if(browser.isNS){window.open(url,"","modal=yes,"+str);}else{if(browser.isIE7){str="dialogWidth:"+this.divWidth+"px;dialogHeight:"+this.divHeight+"px;dialogLeft:"+this.left+"px;dialogTop:"+this.top+"px;";}else if(browser.isIE){str="dialogWidth:"+(this.divWidth+6)+"px;dialogHeight:"+(this.divHeight+56)+"px;dialogLeft:"+this.left+"px;dialogTop:"+this.top+"px;";}else{str="dialogWidth:"+this.divWidth+"px;dialogHeight:"+this.divHeight+"px;dialogLeft:"+this.left+"px;dialogTop:"+this.top+"px;";};window.showModalDialog(url,window,str);}};setCookie("_cmsPopAD",this.delay,this.delay);};function getRandomObj(array){var totalPower=0;var start=0;for(ii=0;ii<array.length;ii++){totalPower+=array[ii][1];array[ii][2]=start;array[ii][3]=start+array[ii][1];start=array[ii][3];};var theSelected=Math.random()*totalPower;var counter=0;for(ii=0;ii<array.length;ii++){if(theSelected>array[ii][2]&&theSelected<array[ii][3]){return array[ii][0];}}};function staticADDIV(id){this.ID=id;this.adItems=new Array();this.currentAD=null;this.setADItem=static_setADItem;this.setHtml=positionADHTML;this.getCurrentAD=getRandomObj;};function positionADHTML(divName){var divObj=$oe(divName);this.currentAD=this.getCurrentAD(this.adItems);var str=this.currentAD.getHtml();divObj.innerHTML=str;};function static_setADItem(ItemObj){var thisLine=this.adItems.length;this.adItems[thisLine]=new Array(ItemObj,ItemObj.power);};function getVisitCount(url,type,visitID){$.ajax({url:url,type:'GET',dataType:'xml',success:function(xml){var status=$(xml).find("status").text();var msg=$(xml).find("message").text();if(status=="0"){buildVisitCountStyle(msg,type,visitID);}else{buildVisitCountStyle("888888",type,visitID);}}});};function buildVisitCountStyle(count,type,visitID){if(!type){type="NORMAL";};if(!visitID){visitID="visitCount";};if(type=="IMAGE"){var prefix="<img class=\"counterImg\" src=\"img/counter_";var suffix=".gif\">";var result=[];for(var i=0;i<count.length;i++){result.push(prefix);result.push(count.charAt(i));result.push(suffix);};$oe(visitID).after(result.join('')).remove();}else{$oe(visitID).after(count).remove();}};



