function Util(){}function IsArgumentValid(b){if(b==null||b=="")return false;return true;}Util.prototype.IsArgumentValid=IsArgumentValid;function Network(c){this.service=c;this.headElement=document.getElementsByTagName("head")[0];}function BeginInvoke(e,g,h,j){try{var executionid=GetExecutionID();if(g){var methodurl=this.service+"?method="+g+"&callingmethod="+e+"&params=";for(var i=0;i<h.length;i++){methodurl=methodurl+h[i].Name;methodurl=methodurl+"=";methodurl=methodurl+h[i].Value;methodurl=methodurl+"%26";}}else var methodurl=this.service;var endinvoke=new String(e).replace(/\./g,"")+"EndInvoke";var elScript=document.createElement("script");elScript.type="text/javascript";elScript.language="javascript";elScript.id=executionid;elScript.src=methodurl;if(navigator.userAgent.indexOf("IE")>=0)elScript.onreadystatechange=function(){if(elScript&&("loaded"==elScript.readyState||"complete"==elScript.readyState)){elScript.onreadystatechange=null;EndInvoke(j,endinvoke,elScript,executionid);}};else elScript.onload=function(){elScript.onload=null;EndInvoke(j,endinvoke,elScript,executionid);};this.headElement.appendChild(elScript);}catch(err){}}function EndInvoke(k,l,m,n){try{var objects=null;if(l)eval("objects = "+l+"();");document.getElementsByTagName("head")[0].removeChild(m);m=null;k(objects);}catch(err){}}function GetExecutionID(){var date=new Date();return Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds());}function GetXmlHttp(){var xmlhttp=null;try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(ex){try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(ex){xmlhttp=null;}}if(!xmlhttp&&typeof XMLHttpRequest!="undefined")xmlhttp=new XMLHttpRequest();return xmlhttp;}Network.prototype.BeginInvoke=BeginInvoke;Network.prototype.EndInvoke=EndInvoke;Network.prototype.GetExecutionID=GetExecutionID;Network.prototype.ServiceEndPoint=this.service;function Marquee(o){this.imageElArray=new Array();this.imagesForwardBufferArray=new Array();this.imagesBackwordBufferArray=new Array();this.el=null;this.timer=null;this.images=new Array();this.iLeft=0;this.arrImgList=new Array();this.iLeader=0;this.ready=false;this.loadedImageCount=0;this.quadKey=0;this.quadKeyIndex=0;this.quadName="";this.baseurl="http://"+location.hostname+"/labs/striptiles/%1/Strip_%2_%3_s_%4_%5.jpg";this.height=256;this.width=1200;this.imagewidth=256;this.first=true;this.el=document.getElementById(o);if(!this.el){var err=new Object();err.name="err_invalidelement";throw err;return;}if(!this.el.style.height)this.el.style.height=this.height;if(!this.el.style.width)this.el.style.width=this.width;this.el.style.overflow="hidden";this.el.style.overflowX="hidden";this.el.style.overflowY="hidden";this.el.style.textAlign="center";this.el.style.position="relative";this.Clear();}function GoForward(){var seq=parseInt(this.quadKeyIndex);var imgarray=this.imagesForwardBufferArray.pop();this.ShowTiles(imgarray);this.LoadBuffers(this.quadKey,this.quadName,this.quadKeyIndex);this.quadKeyIndex=seq+1;}function GoBackward(){var seq=parseInt(this.quadKeyIndex);var imgarray=this.imagesBackwordBufferArray.pop();this.ShowTiles(imgarray);this.LoadBuffers(this.quadKey,this.quadName,this.quadKeyIndex);this.quadKeyIndex=seq-1;}function LoadImageStrip(p,q,r){this.quadKey=p;this.quadKeyIndex=r;this.quadName=q;var imageArray=new Array();for(var i=0;i<6;i++){imageArray.push(this.baseurl.replace("%1",p).replace("%2",q).replace("%3",r).replace("%4","0").replace("%5",i));}this.ShowTiles(imageArray);}function LoadBuffers(s,t,u){var len=this.imagesForwardBufferArray.length;for(var j=0;j<len;j++){this.imagesForwardBufferArray.pop();}len=this.imagesBackwordBufferArray.length;for(var j=0;j<len;j++){this.imagesBackwordBufferArray.pop();}var fbuffer=new Array();var seq=parseInt(u)+1;for(var i=0;i<6;i++){fbuffer.push(this.baseurl.replace("%1",s).replace("%2",t).replace("%3",seq).replace("%4","0").replace("%5",i));}for(var i=0;i<6;i++){fbuffer.push(this.baseurl.replace("%1",s).replace("%2",t).replace("%3",seq).replace("%4","1").replace("%5",i));}this.imagesForwardBufferArray.push(fbuffer);var bbuffer=new Array();var seq=parseInt(u)-1;for(var i=0;i<6;i++){bbuffer.push(this.baseurl.replace("%1",s).replace("%2",t).replace("%3",seq).replace("%4","0").replace("%5",i));}for(var i=0;i<6;i++){bbuffer.push(this.baseurl.replace("%1",s).replace("%2",t).replace("%3",seq).replace("%4","1").replace("%5",i));}this.imagesBackwordBufferArray.push(bbuffer);}function ShowTiles(v){if(this.first==true){for(var i=0;i<v.length;i++){var image=new Image();image.src=v[i];this.images[i]=image;var elSpan=document.createElement("div");elSpan.style.cssFloat="left";elSpan.style.top=i>=5?256:0;elSpan.style.left=(i>=5?i-5:i)*256;elSpan.style.height=256;elSpan.style.width=256;elSpan.style.overflow="hidden";elSpan.style.overflowX="hidden";elSpan.style.overflowY="hidden";elSpan.style.position="absolute";var elImg=document.createElement("img");elImg.src=v[i];this.imageElArray[i]=elImg;this.arrImgList.push(elSpan.style);elSpan.appendChild(elImg);this.el.appendChild(elSpan);}this.first=false;}else for(var i=0;i<v.length;i++){this.imageElArray[i].src=v[i];this.imageElArray[i].width=256;this.imageElArray[i].height=256;}}function Clear(){if(this.el.childNodes)for(var j=0;j<this.el.childNodes.length;j++){var element=this.el.childNodes[j];this.el.removeChild(element);element=null;}this.first=true;}function LoadImage(w,x){var image=new Image();image.src=w;this.images.push(image);var elSpan=document.createElement("div");elSpan.style.cssFloat="left";elSpan.style.height=this.height*1;elSpan.style.width=this.imagewidth*1;elSpan.style.overflow="hidden";elSpan.style.overflowX="hidden";elSpan.style.overflowY="hidden";elSpan.style.position="absolute";var elImg=document.createElement("img");elImg.src=w;elImg.width=image.width;elImg.height=image.height;this.arrImgList.push(elSpan.style);elSpan.appendChild(elImg);x.appendChild(elSpan);}function Start(){this.timer=setInterval(RollTheShow,1);}function Stop(){clearInterval(this.timer);}function RollTheShow(y){var iTemp=1;if(y!=null)iTemp=y;var secondRow=true;var iAddIncr=0;var iLocal=0;var i=0;iLocal=this.iLeader;for(var i=0;i<this.images.length;i++){if(i>=6&&secondRow){this.iLeft=0;iAddIncr=0;secondRow=false;}eval("this.arrImgList["+iLocal+"].left="+(this.iLeft+iAddIncr));iAddIncr+=this.imagewidth*1;iLocal+=1;if(iLocal>=this.images.length)iLocal=0;}if(this.iLeft<=-(this.imagewidth*1)){this.iLeft=0;this.iLeader+=1;if(this.iLeader>=this.images.length)this.iLeader=0;}this.iLeft-=iTemp;}function Rotate(z){if(z==null||z=="undefined"||z==undefined)return;var index=parseInt(6*parseFloat(z)/360);if(index==0)index=1;this.RollTheShow(index*5);for(var i=0;i<this.arrImgList.length;i++){var left=parseInt(this.arrImgList[i].left);eval("this.arrImgList["+i+"].left="+(left+this.iLeft));}}Marquee.prototype.Start=Start;Marquee.prototype.Stop=Stop;Marquee.prototype.RollTheShow=RollTheShow;Marquee.prototype.LoadImage=LoadImage;Marquee.prototype.Clear=Clear;Marquee.prototype.LoadImageStrip=LoadImageStrip;Marquee.prototype.GoForward=GoForward;Marquee.prototype.GoBackward=GoBackward;Marquee.prototype.LoadBuffers=LoadBuffers;Marquee.prototype.ShowTiles=ShowTiles;Marquee.prototype.Rotate=Rotate;