
function sort(d,b){var a=location.href,c=new RegExp(b+"/.*?/|"+b+"/.*$","gi");a=a.replace(c,"")+"/";a=a.replace(/\/+$/,"/");if(d.type=="checkbox"){if(d.checked){location.href=a+b+"/"+d.value}else{location.href=a}}else{if(d.value){location.href=a+b+"/"+d.options[d.selectedIndex].value}else{location.href=a}}};
var NOT_ANIMATED=0,FADE=1,SLIDE_LEFT=2,SLIDE_RIGHT=3,SLIDE_TOP=4,SLIDE_BOTTOM=5,SCROLL_LEFT=6,SCROLL_RIGHT=7,BLOCKS_SLIDE_TOP=8,BLOCKS_SLIDE_BOTTOM=9,BLOCKS_SLIDE_LEFT=10,BLOCKS_SLIDE_RIGHT=11,BLOCKS_SWIRL=12,BLOCKS_RANDOM=13;function Advert(a){this.name=a;this.list=new Array;this.index=-1;this.currentAd=null;this.nextAd=null;this.prevAd=null;this.timer=null;this.tiles=null;this.zindex=100;this.createTiles=function(g){var g=$("#"+g),e=g.width(),c=g.height(),f=parseInt(e/10),d=parseInt(c/7);this.tiles=new Array;this.sizeX=f;this.sizeY=d;for(var h=0;h<8;h++){this.tiles[h]=new Array;for(var b=0;b<11;b++){this.tiles[h][b]=0;g.parent().append('<div id="tilein_'+this.name+"-"+b+"-"+h+'" style="margin:0;padding:0;left:'+(b*f)+";top:"+(h*d)+";width:"+f+"px;height:"+d+"px;float:left;position:absolute;z-index:"+this.zindex+'"></div>');g.parent().append('<div id="tileout_'+this.name+"-"+b+"-"+h+'" style="margin:0;padding:0;left:'+(b*f)+";top:"+(h*d)+";width:"+f+"px;height:"+d+"px;float:left;position:absolute;z-index:"+this.zindex+'"></div>')}}};this.add=function(b){switch(b.type){case NOT_ANIMATED:b.transition=this.notAnimated;b.opposite=this.notAnimated;break;case FADE:b.transition=this.fade;b.opposite=this.fade;break;case SLIDE_LEFT:b.transition=this.slideLeft;b.opposite=this.slideRight;break;case SLIDE_RIGHT:b.transition=this.slideRight;b.opposite=this.slideLeft;break;case SLIDE_TOP:b.transition=this.slideTop;b.opposite=this.slideBottom;break;case SLIDE_BOTTOM:b.transition=this.slideBottom;b.opposite=this.slideTop;break;case SCROLL_LEFT:b.transition=this.scrollLeft;b.opposite=this.scrollRight;break;case SCROLL_RIGHT:b.transition=this.scrollRight;b.opposite=this.scrollLeft;break;case BLOCKS_SLIDE_TOP:b.transition=this.blocksSlideTop;b.opposite=this.blocksSlideBottom;break;case BLOCKS_SLIDE_BOTTOM:b.transition=this.blocksSlideBottom;b.opposite=this.blocksSlideTop;break;case BLOCKS_SLIDE_LEFT:b.transition=this.blocksSlideLeft;b.opposite=this.blocksSlideRight;break;case BLOCKS_SLIDE_RIGHT:b.transition=this.blocksSlideRight;b.opposite=this.blocksSlideLeft;break;case BLOCKS_SWIRL:b.transition=this.blocksSwirl;b.opposite=this.blocksSwirl;break;case BLOCKS_RANDOM:b.transition=this.blocksRandom;b.opposite=this.blocksRandom;break}b.parent=this;b.zindex=this.zindex;this.list.push(b);this.zindex++;if((b.type==BLOCKS_SLIDE_TOP||b.type==BLOCKS_SLIDE_BOTTOM||b.type==BLOCKS_SLIDE_LEFT||b.type==BLOCKS_SLIDE_RIGHT||b.type==BLOCKS_SWIRL||b.type==BLOCKS_RANDOM)&&!this.tiles){this.createTiles(b.object)}};this.exec=function(){clearTimeout(this.timer);if(!this.currentAd&&this.list[0].type!=SCROLL_LEFT&&this.list[0].type!=SCROLL_RIGHT&&this.list[0].type!=NOT_ANIMATED){this.index++;this.currentAd=this.list[this.index];this.currentAd.fade=this.fade;this.currentAd.duration/=3;this.currentAd.fade(1);this.currentAd.duration*=3}else{if(!this.currentAd){this.doNext()}}this.timer=setTimeout(this.name+".doNext()",(this.currentAd.type==SCROLL_LEFT||this.currentAd.type==SCROLL_RIGHT?this.currentAd.duration:this.currentAd.delay))};this.pause=function(){if(this.currentAd.type!=SCROLL_LEFT&&this.currentAd.type!=SCROLL_RIGHT){clearTimeout(this.timer)}};this.resume=function(){if(this.currentAd.type!=SCROLL_LEFT&&this.currentAd.type!=SCROLL_RIGHT){this.timer=setTimeout(this.name+".doNext()",(this.currentAd.type==SCROLL_LEFT||this.currentAd.type==SCROLL_RIGHT?this.currentAd.duration:this.currentAd.delay))}};this.doNext=function(){if(!this.currentAd||this.currentAd.type==SCROLL_LEFT||this.currentAd.type==SCROLL_RIGHT||this.currentAd&&$("#"+this.currentAd.object).queue().length==0){clearTimeout(this.timer);this.index++;this.next();this.exec()}};this.doPrevious=function(){if(!this.currentAd||this.currentAd.type==SCROLL_LEFT||this.currentAd.type==SCROLL_RIGHT||this.currentAd&&$("#"+this.currentAd.object).queue().length==0){clearTimeout(this.timer);this.currentAd=this.list[this.index];this.index--;this.previous();this.exec()}};this.next=function(){if(this.index>=this.list.length){this.index=0}this.nextAd=this.list[this.index];if(this.currentAd&&this.list.length>1&&this.currentAd.opposite){this.nextAd.transition(null,this.currentAd)}this.currentAd=this.list[this.index];this.currentAd.transition(1)};this.previous=function(){if(this.index==-1){this.index=this.list.length-1}this.nextAd=this.list[this.index];if(this.currentAd&&this.list.length>1&&this.currentAd.opposite){this.nextAd.opposite(null,this.currentAd)}this.currentAd=this.list[this.index];this.currentAd.opposite(1)};this.notAnimated=function(c,b){var b=$("#"+(b?b.object:this.object));b.css("left",0);b.css("top",0);if(c){b.show()}else{b.hide()}};this.fade=function(c,b){var b=$("#"+(b?b.object:this.object));b.css("left",0);b.css("top",0);if(c){b.fadeIn(this.duration)}else{b.fadeOut(this.duration)}};this.scrollLeft=function(){var b=$("#"+this.object);b.stop();b.show();b.css("left",0);b.animate({left:"-="+(b.width()/2)},this.duration,"linear")};this.scrollRight=function(){var b=$("#"+this.object);b.stop();b.show();b.css("left",-(b.width()/2));b.animate({left:"+="+(b.width()/2)},this.duration,"linear")};this.slideLeft=function(c,b){var b=$("#"+(b?b.object:this.object));b.css("top",0);if(c){b.css("left",b.width());b.show();b.animate({left:"-="+b.width()},this.duration)}else{b.css("left",0);b.animate({left:"-="+b.width()},this.duration,function(){b.hide()})}};this.slideRight=function(c,b){var b=$("#"+(b?b.object:this.object));b.css("top",0);if(c){b.css("left",-b.width());b.show();b.animate({left:"+="+b.width()},this.duration)}else{b.css("left",0);b.animate({left:"+="+b.width()},this.duration,function(){b.hide()})}};this.slideTop=function(c,b){var b=$("#"+(b?b.object:this.object));b.css("left",0);if(c){b.css("top",b.height());b.show();b.animate({top:"-="+b.height()},this.duration)}else{b.css("top",0);b.animate({top:"-="+b.height()},this.duration,function(){b.hide()})}};this.slideBottom=function(c,b){var b=$("#"+(b?b.object:this.object));b.css("left",0);if(c){b.css("top",0-b.height());b.show();b.animate({top:"+="+b.height()},this.duration)}else{b.css("top",0);b.animate({top:"+="+b.height()},this.duration,function(){b.hide()})}};this.setBlock=function(d,b,e,c){$("#"+d+this.name+"-"+b+"-"+e).css({top:e*this.sizeY,left:b*this.sizeX,"background-image":"url("+c+")","background-position":-(b*this.sizeX)+"px "+(-(e*this.sizeY)+"px"),"background-repeat":"no-repeat","z-index":this.zindex})};this.blocksSlideTop=function(g,d){var c=(d?d.object:this.object),d=$("#"+c);d.css("left",0);d.css("top",0);if(g){for(var f=this.parent.tiles.length-1,e=0;f>=0;f--,e++){for(var b=0;b<this.parent.tiles[f].length;b++){this.parent.setBlock("tilein_",b,f,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+f).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+f).fadeIn(e*(this.duration/10))}}setTimeout("$('#"+c+"').show();$(\"div[id*='tilein']\").hide();",this.duration)}else{for(var f=this.parent.tiles.length-1,e=0;f>=0;f--,e++){for(var b=0;b<this.parent.tiles[f].length;b++){this.parent.setBlock("tileout_",b,f,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+f).show();$("#tileout_"+this.parent.name+"-"+b+"-"+f).fadeOut(e*(this.duration/10))}}setTimeout("$('#"+c+"').hide();",this.duration)}};this.blocksSlideBottom=function(f,d){var c=(d?d.object:this.object),d=$("#"+c);d.css("left",0);d.css("top",0);if(f){for(var e=0;e<this.parent.tiles.length;e++){for(var b=0;b<this.parent.tiles[e].length;b++){this.parent.setBlock("tilein_",b,e,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+e).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+e).fadeIn(e*(this.duration/10))}}setTimeout("$('#"+c+"').show();$(\"div[id*='tilein']\").hide();",this.duration)}else{for(var e=0;e<this.parent.tiles.length;e++){for(var b=0;b<this.parent.tiles[e].length;b++){this.parent.setBlock("tileout_",b,e,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+e).show();$("#tileout_"+this.parent.name+"-"+b+"-"+e).fadeOut(e*(this.duration/10))}}setTimeout("$('#"+c+"').hide();",this.duration)}};this.blocksSlideLeft=function(g,d){var c=(d?d.object:this.object),d=$("#"+c);d.css("left",0);d.css("top",0);if(g){for(var f=0;f<this.parent.tiles.length;f++){for(var b=this.parent.tiles[f].length-1,e=0;b>=0;b--,e++){this.parent.setBlock("tilein_",b,f,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+f).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+f).fadeIn(e*(this.duration/10))}}setTimeout("$('#"+c+"').show();$(\"div[id*='tilein']\").hide();",this.duration)}else{for(var f=0;f<this.parent.tiles.length;f++){for(var b=this.parent.tiles[f].length-1,e=0;b>=0;b--,e++){this.parent.setBlock("tileout_",b,f,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+f).show();$("#tileout_"+this.parent.name+"-"+b+"-"+f).fadeOut(e*(this.duration/10))}}setTimeout("$('#"+c+"').hide();",this.duration)}};this.blocksSlideRight=function(f,d){var c=(d?d.object:this.object),d=$("#"+c);d.css("left",0);d.css("top",0);if(f){for(var e=0;e<this.parent.tiles.length;e++){for(var b=0;b<this.parent.tiles[e].length;b++){this.parent.setBlock("tilein_",b,e,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+e).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+e).fadeIn(b*(this.duration/10))}}setTimeout("$('#"+c+"').show();$(\"div[id*='tilein']\").hide();",this.duration)}else{for(var e=0;e<this.parent.tiles.length;e++){for(var b=0;b<this.parent.tiles[e].length;b++){this.parent.setBlock("tileout_",b,e,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+e).show();$("#tileout_"+this.parent.name+"-"+b+"-"+e).fadeOut(b*(this.duration/10))}}setTimeout("$('#"+c+"').hide();",this.duration)}};this.blocksSwirl=function(g,d){var c=(d?d.object:this.object),d=$("#"+c);d.css("left",0);d.css("top",0);if(g){xstart=0;xfinish=this.parent.tiles[0].length-1;ystart=0;yfinish=this.parent.tiles.length-1;nn=1;for(var f=0;f<4;f++){for(var b=xstart;b<=xfinish;b++){this.parent.setBlock("tilein_",b,ystart,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+ystart).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+ystart).fadeIn(++nn*(this.duration/100))}ystart++;for(var e=ystart;e<=yfinish;e++){this.parent.setBlock("tilein_",xfinish,e,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+xfinish+"-"+e).hide();$("#tilein_"+this.parent.name+"-"+xfinish+"-"+e).fadeIn(++nn*(this.duration/100))}xfinish--;for(var b=xfinish;b>=xstart;b--){this.parent.setBlock("tilein_",b,yfinish,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+yfinish).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+yfinish).fadeIn(++nn*(this.duration/100))}yfinish--;for(var e=yfinish;e>=ystart;e--){this.parent.setBlock("tilein_",xstart,e,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+xstart+"-"+e).hide();$("#tilein_"+this.parent.name+"-"+xstart+"-"+e).fadeIn(++nn*(this.duration/100))}xstart++}setTimeout("$('#"+c+"').show();$(\"div[id*='tilein']\").hide();",this.duration)}else{xstart=0;xfinish=this.parent.tiles[0].length-1;ystart=0;yfinish=this.parent.tiles.length-1;nn=1;for(var f=0;f<4;f++){for(var b=xstart;b<=xfinish;b++){this.parent.setBlock("tileout_",b,ystart,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+ystart).show();$("#tileout_"+this.parent.name+"-"+b+"-"+ystart).fadeOut(++nn*(this.duration/100))}ystart++;for(var e=ystart;e<=yfinish;e++){this.parent.setBlock("tileout_",xfinish,e,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+xfinish+"-"+e).show();$("#tileout_"+this.parent.name+"-"+xfinish+"-"+e).fadeOut(++nn*(this.duration/100))}xfinish--;for(var b=xfinish;b>=xstart;b--){this.parent.setBlock("tileout_",b,yfinish,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+yfinish).show();$("#tileout_"+this.parent.name+"-"+b+"-"+yfinish).fadeOut(++nn*(this.duration/100))}yfinish--;for(var e=yfinish;e>=ystart;e--){this.parent.setBlock("tileout_",xstart,e,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+xstart+"-"+e).show();$("#tileout_"+this.parent.name+"-"+xstart+"-"+e).fadeOut(++nn*(this.duration/100))}xstart++}setTimeout("$('#"+c+"').hide();",this.duration)}};this.blocksRandom=function(f,d){var c=(d?d.object:this.object),d=$("#"+c);d.css("left",0);d.css("top",0);if(f){for(var e=0;e<this.parent.tiles.length;e++){for(var b=0;b<this.parent.tiles[e].length;b++){this.parent.setBlock("tilein_",b,e,d.find("img").attr("src"));$("#tilein_"+this.parent.name+"-"+b+"-"+e).hide();$("#tilein_"+this.parent.name+"-"+b+"-"+e).fadeIn(Math.floor(Math.random()*(this.duration/2)))}}setTimeout("$('#"+c+"').show();$(\"div[id*='tilein']\").hide();",this.duration)}else{for(var e=0;e<this.parent.tiles.length;e++){for(var b=0;b<this.parent.tiles[e].length;b++){this.parent.setBlock("tileout_",b,e,d.find("img").attr("src"));$("#tileout_"+this.parent.name+"-"+b+"-"+e).show();$("#tileout_"+this.parent.name+"-"+b+"-"+e).fadeOut(Math.floor(Math.random()*(this.duration/2)))}}setTimeout("$('#"+c+"').hide();",this.duration)}}};
var LEFT=0,RIGHT=1,UP=2,DOWN=3,ALPHA=4,WIDTH=5,HEIGHT=6,WIDTH_LEFT=7,HEIGHT_UP=8,SCROLL_LEFT=9,SCROLL_RIGHT=10,SCROLL_UP=11,SCROLL_DOWN=12,WIDTH_CENTER=13,HEIGHT_CENTER=14,HEIGHT_CENTER_CLOSE=15,SLIDE_LEFT=16,SLIDE_RIGHT=17;function Animation(b,a){this.name=b||"unnamed";this.parent=parent||null;this.object=a||null;this.timer=null;this.waitingTimer=null;this.delay=6;this.duration=null;this.destination=0;this.init=0;this.distance=0;this.time=0;this.formula=null;this.action=null;this.step=0;this.startTime=0;this.startPos=0;this.onstart=null;this.onfinish=null;this.onexecute=null;this.active=false;this.paused=false;this.pos=0;this.start=function(){clearTimeout(this.timer);if(this.onstart){this.onstart(this)}this.time=0;this.init=this.getStart();this.distance=this.destination-this.init;this.step=this.distance/this.duration/this.duration;this.startTime=new Date().getTime();this.active=true;this.exec()};this.getStart=function(){if(this.action==HEIGHT_UP||this.action==HEIGHT_CENTER||this.action==HEIGHT_CENTER_CLOSE){this.startPos=this.object.getY()}else{if(this.action==WIDTH_LEFT||this.action==WIDTH_CENTER||this.action==HEIGHT_CENTER_CLOSE){this.startPos=this.object.getX()}}switch(this.action){case SCROLL_UP:case SCROLL_DOWN:return this.object.getScrollY();case SCROLL_LEFT:case SCROLL_RIGHT:return this.object.getScrollX();case UP:case DOWN:return this.object.getY();case LEFT:case RIGHT:return this.object.getX();case SLIDE_LEFT:case SLIDE_RIGHT:return this.pos;case WIDTH:case WIDTH_LEFT:return this.object.getWidth();case HEIGHT:case HEIGHT_UP:return ie?this.object.getHeight():this.object.getHeight()-2;case WIDTH_CENTER:return this.object.getWidth();case HEIGHT_CENTER:return this.object.getHeight();case HEIGHT_CENTER_CLOSE:return ie?this.object.getHeight():this.object.getHeight()-2;case ALPHA:return this.object.getAlpha()}};this.exec=function(){clearTimeout(this.timer);this.time=new Date().getTime()-this.startTime;if(!this.duration||this.time<this.duration){if(!this.paused){switch(this.action){case UP:this.object.moveY(this.formula());break;case DOWN:this.object.moveY(this.formula());break;case SLIDE_LEFT:this.object.moveX(this.pos--);break;case SLIDE_RIGHT:this.object.moveX(this.pos++);break;case LEFT:this.object.moveX(this.formula(this.object.getX()));break;case RIGHT:this.object.moveX(this.formula(this.object.getX()));break;case WIDTH:this.object.resizeX(this.formula());break;case SCROLL_LEFT:case SCROLL_RIGHT:this.object.scrollX(this.formula(this.object.getScrollX()));break;case SCROLL_UP:case SCROLL_DOWN:this.object.scrollY(this.formula(this.object.getScrollY()));break;case WIDTH_LEFT:n=this.formula();this.object.resizeX(n);this.object.moveX(this.init+this.startPos-n);break;case HEIGHT:this.object.resizeY(this.formula());break;case HEIGHT_UP:n=this.formula();this.object.resizeY(n);this.object.moveY(this.init+this.startPos-n);break;case WIDTH_CENTER:n=this.formula();this.object.resizeX(n);this.object.moveX(this.init+this.startPos-(n/2));break;case HEIGHT_CENTER:n=this.formula();this.object.resizeY(n);this.object.moveY(this.init+this.startPos-(n/2));break;case HEIGHT_CENTER_CLOSE:n=this.formula();this.object.resizeY(n);this.object.moveY(this.init-this.startPos-(n/2));break;case ALPHA:this.object.alpha(this.formula());break}if(this.onexecute){this.onexecute(this)}}this.timer=setTimeout(this.name+".exec()",this.delay)}else{this.active=false;switch(this.action){case UP:this.object.moveY(this.destination);break;case DOWN:this.object.moveY(this.destination);break;case LEFT:this.object.moveX(this.destination);break;case RIGHT:this.object.moveX(this.destination);break;case WIDTH:this.object.resizeX(this.destination);break;case WIDTH_LEFT:this.object.resizeX(this.destination);this.object.moveX(this.init+this.startPos-this.destination);break;case HEIGHT:this.object.resizeY(this.destination);break;case HEIGHT_UP:this.object.resizeY(this.destination);this.object.moveY(this.init+this.startPos-this.destination);break;case WIDTH_CENTER:this.object.resizeX(this.destination);this.object.moveX(this.init+this.startPos-(this.destination/2));break;case HEIGHT_CENTER:this.object.resizeY(this.destination);this.object.moveY(this.init+this.startPos-(this.destination/2));break;case ALPHA:this.object.alpha(this.destination);break}if(this.onfinish){this.onfinish(this)}if(this.onfinal){this.onfinal(this)}}};this.stop=function(){clearTimeout(this.timer)};this.pause=function(c){this.paused=c};this.incremental=function(c){switch(this.action){case UP:case LEFT:case SCROLL_LEFT:case SLIDE_LEFT:return c;case DOWN:case RIGHT:case SCROLL_RIGHT:case SLIDE_RIGHT:return ++c}};this.pow=function(){return this.distance-Math.round(Math.pow(this.duration-this.time,2)*this.step)+this.init};this.pow2=function(d,c){this.object.layer.innerHTML+="a ";return Math.pow(d,c||6)};this.expo=function(c){this.object.layer.innerHTML+=" e";return Math.pow(2,8*(c-1))};this.circ=function(c){return 1-Math.sin(Math.acos(c))};this.sine=function(c){return 1-Math.sin((1-c)*Math.PI/2)};this.back=function(d,c){c=c[0]||1.618;return Math.pow(d,2)*((c+1)*d-c)};this.bounce=function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=-Math.pow((11-6*d-11*f)/4,2)+c*c;break}}return e};this.elastic=function(d,c){return Math.pow(2,10*--d)*Math.cos(20*d*Math.PI*(c[0]||1)/3)};this.formula=this.pow};
var ie=document.all,dragObj=null;function Layer(b,a,c){this.obj=b;this.name=a||null;this.parent=c||null;this.dragStatus=false;this.dragStarted=false;this.constrainX=false;this.constrainY=false;this.layer=null;this.alphaValue=100;this.visible=false;this.type="layer";this.document=document;this.window=window;this.drag=function(){if(this.layer){this.layer.setAttribute("onmousedown",this.obj+".startDrag()")}};this.construct=function(d){if(d){this.name=d;this.layer=this.document.getElementById(d);this.parent=this.parent?this.parent:this.document.body}else{if(this.name&&this.document.getElementById(this.name)){this.layer=this.document.getElementById(this.name);this.parent=this.parent?this.parent:this.document.body}else{this.name=this.obj;this.layer=this.document.createElement("DIV");this.layer.style.position=this.parent?"relative":"absolute";if(this.parent){this.parent.appendChild(this.layer)}else{this.parent=this.document.body;this.document.body.appendChild(this.layer)}this.layer.setAttribute("id",this.name)}}if(this.layer){this.layer.style.display="none"}};this.close=function(){if(this.layer){this.document.body.removeChild(this.layer);this.layer=null}};this.moveX=function(d){var e=this.getBrowserLeft();if(ie){if(this.constrainX){if(d>this.parent.clientWidth-this.layer.clientWidth+e){d=this.parent.clientWidth-this.layer.clientWidth+e}if(d<e){d=e}}}else{if(this.constrainX){if(d>window.innerWidth-this.layer.offsetWidth+e){d=window.innerWidth-this.layer.offsetWidth+e}if(d<e){d=e}}}if(this.layer){this.layer.style.left=d+"px"}};this.moveY=function(e){var d=this.getBrowserTop();if(ie){if(this.constrainY){if(e>this.parent.clientHeight-this.layer.clientHeight+d){e=this.parent.clientHeight-this.layer.clientHeight+d}if(e<d){e=d}}}else{if(this.constrainY){if(e>window.innerHeight-this.layer.offsetHeight+d){e=window.innerHeight-this.layer.offsetHeight+d}if(e<d){e=d}}}if(this.layer){this.layer.style.top=e+"px"}};this.move=function(d,e){this.moveX(d);this.moveY(e)};this.moveTo=function(e,g){var d=g*Math.cos((e-90)*Math.PI/180),f=g*Math.sin((e-90)*Math.PI/180);this.moveX(this.getX()+d);this.moveY(this.getY()+f)};this.alpha=function(d){this.alphaValue=d;if(this.layer){this.layer.style.opacity=parseInt(d)/100;this.layer.style.MozOpacity=parseInt(d)/100;if(ie){this.layer.style.filter="alpha(opacity="+d+")"}}};this.write=function(d){if(this.layer){this.layer.innerHTML=d}};this.output=function(d){if(this.layer){this.layer.innerHTML+=d}};this.resize=function(e,d){if(this.layer){this.layer.style.width=e+"px";this.layer.style.height=d+"px"}};this.resizeX=function(d){if(this.layer){this.layer.style.width=d+"px"}};this.resizeY=function(d){if(this.layer){this.layer.style.height=d+"px"}};this.show=function(d){this.visible=d;if(this.layer){this.layer.style.display=d?"block":"none"}};this.getPos=function(d){var f=0,e=0;if(d){obj=d}else{obj=this.layer}if(obj&&obj.offsetParent){f=obj?obj.offsetLeft:0;e=obj?obj.offsetTop:0;if(obj){while(obj=obj.offsetParent){f+=obj.offsetLeft;e+=obj.offsetTop}}}return[f,e,this.getWidth(d),this.getHeight(d)]};this.getAlpha=function(){return parseInt(this.alphaValue)};this.getX=function(){if(this.layer.position==undefined||this.layer.position=="relative"){pos=this.getPos(this.layer);return pos[0]}return parseInt(this.layer.style.left==""?0:this.layer.style.left)};this.getY=function(){if(this.layer.position==undefined||this.layer.position=="relative"){pos=this.getPos(this.layer);return pos[1]}return parseInt(this.layer.style.top)};this.getWidth=function(d){if(d){return parseInt(ie?d.offsetWidth+2:d.offsetWidth)}else{if(this.layer){return parseInt(ie?this.layer.clientWidth+2:this.layer.offsetWidth)}}};this.getHeight=function(d){if(d){return parseInt(ie?d.offsetHeight+2:d.offsetHeight)}else{if(this.layer){return parseInt(ie?this.layer.clientHeight+2:this.layer.offsetHeight)}}};this.getBrowserLeft=function(){return ie?(this.document.documentElement?this.document.documentElement.scrollLeft:this.document.body.scrollLeft):this.window.pageXOffset};this.getBrowserTop=function(){return ie?(this.document.documentElement?this.document.documentElement.scrollTop:this.document.body.scrolltop):this.window.pageYOffset};this.getBrowserWidth=function(){return ie?this.document.body.clientWidth:this.window.innerWidth};this.getBrowserHeight=function(){return ie?this.document.body.clientHeight:this.window.innerHeight};this.getWindowHeight=function(){return ie?document.documentElement.clientHeight:this.window.innerHeight};this.setWidth=function(d){if(this.layer){this.layer.style.width=d+"px"}};this.setHeight=function(d){if(this.layer){this.layer.style.height=d+"px"}};this.resize=function(e,d){this.setWidth(e);this.setHeight(d)};this.scrollX=function(d){if(this.layer){this.layer.scrollLeft=d}};this.scrollY=function(d){if(this.layer){this.layer.scrollTop=d}};this.getScrollX=function(){if(this.layer){return this.layer.scrollLeft}};this.getScrollY=function(){if(this.layer){return this.layer.scrollTop}};this.getScrollWidth=function(){if(this.layer){return this.layer.scrollWidth}};this.getScrollHeight=function(){if(this.layer){return this.layer.scrollHeight}};this.startDrag=function(d){dragObj=this;this.dragStatus=true;this.dragStarted=true;document.onmouseup=this.endDrag;document.onmousemove=this.doDrag;document.onselectstart=function(){return false};document.onmousedown=function(){return false}};this.startResize=function(d){dragObj=this;this.dragStatus=true;this.dragStarted=true;document.onmouseup=this.endDrag;document.onmousemove=this.doResize;document.onselectstart=function(){return false};document.onmousedown=function(){return false}};this.endDrag=function(){this.dragStatus=false;document.onmousemove=null;document.onselectstart=null;document.onmousedown=null};this.doDrag=function(i){var h=document.body.scrollTop,g=document.body.scrollLeft;if(dragObj.dragStarted){dragObj.dragStartX=g+parseInt(ie?window.event.clientX:i.pageX)-parseInt(dragObj.layer.style.left);dragObj.dragStartY=h+parseInt(ie?window.event.clientY:i.pageY)-parseInt(dragObj.layer.style.top);dragObj.dragStarted=false}var f=g+parseInt(ie?window.event.clientX:i.pageX)-parseInt(dragObj.dragStartX),d=h+parseInt(ie?window.event.clientY:i.pageY)-parseInt(dragObj.dragStartY);dragObj.move(f,d)};this.doResize=function(i){var h=document.body.scrollTop,g=document.body.scrollLeft;if(dragObj.dragStarted){dragObj.dragStartX=g+parseInt(ie?window.event.clientX:i.pageX)-parseInt(dragObj.layer.style.left);dragObj.dragStartY=h+parseInt(ie?window.event.clientY:i.pageY)-parseInt(dragObj.layer.style.top);dragObj.dragStarted=false}var f=g+parseInt(ie?window.event.clientX:i.pageX)-parseInt(dragObj.dragStartX),d=h+parseInt(ie?window.event.clientY:i.pageY)-parseInt(dragObj.dragStartY);dragObj.resize(f,d)};this.index=function(d){if(this.layer){this.layer.style.zIndex=d}};this.isVisible=function(){return this.visible}};