function removepx(a){var b=a+"";a=b.replace("px","");return a}function Moowind(a,b,p,g,m,l,n,j,o){var k=document.getElementById(a);this.status="";if(k){this.status="error";return(null)}this.name=a;this.width=b;this.height=p;this.display=g;this.fgcolor="#000000";this.bgcolor="#ffffff";this.x=m;this.y=l;this.oldwidth=b;this.oldheight=p;this.oldx=0;this.oldy=0;this.fullscreen=0;this.titre=j;this.rootwindow=n;this.newGSWIN=null;var d=this.newGSWIN;var f=this.newGSBAR;var q=this;this.closeoption=1;this.resizeoption=1;this.fullscreenoption=1;this.autoslideoption=1;this.zeffectoption=0;for(var e=0;e<o.length;e++){switch(o[e]){case"nozeffect":this.zeffectoption=0;break;case"noclosebutton":this.closeoption=0;break;case"nofullscreenbutton":this.fullscreenoption=0;break;case"noresizebutton":this.resizeoption=0;break;default:break}}this.handlebtn="BTNHANDLE"+this.name;this.movebtn="MOVEHANDLE"+this.name;this.closebtn="CLOSEHANDLE"+this.name;this.fullscreenbtn="FULLSCREENH"+this.name;this.foreground=function(i){this.newGSWIN.set("styles",{color:i});this.fgcolor=i};this.background=function(i){this.newGSWIN.set("styles",{"background-color":i});this.bgcolor=i};this.backgroundimage=function(i){$(this.name).style.backgroundImage="url("+i;this.bgimage=i};this.get_backgroundimage=function(i){return this.bgimage};this.get_fg=function(){return this.fgcolor};this.get_bg=function(i){return this.bgcolor};this.root_get_width=function(){rootwidth=this.rootwindow.getStyle("width");var i=rootwidth+"";rootwidth=i.replace("px","");return rootwidth};this.root_get_height=function(){rootheight=this.rootwindow.getStyle("height");var i=rootheight+"";rootheight=i.replace("px","");return rootheight};this.root_get_limit_width=function(){return(this.root_get_width())-(this.get_width())};this.root_get_limit_height=function(){return(this.root_get_height())-(this.get_height())};this.set_focus=function(){var s=-2220;zbase=parseInt(this.newGSWIN.getStyle("z-index"));if(isNaN(zbase)){zbase=0}var r=this.newGSWIN.rootwindow;var t=0;var i=this.rootwindow.getChildren();for(e=0;e<i.length;e++){t=parseInt($(i[e]).getStyle("z-index"));if(s<=t){s=t}}s++;if(s>=zbase){this.newGSWIN.setStyle("z-index",s)}};this.set_size=function(u,i){var s=i+"";this.height=s.replace("px","");var r=u+"";this.width=r.replace("px","");var v=i+"px";var t=u+"px";this.newGSWIN.set("styles",{width:t});this.newGSWIN.set("styles",{height:v})};this.get_width=function(){var r=this.newGSWIN.getStyle("width");var i=r+"";r=i.replace("px","");this.width=r;return r};this.get_height=function(){var i=this.newGSWIN.getStyle("height");var r=i+"";i=r.replace("px","");this.height=i;return i};this.get_xpos=function(){var i=this.newGSWIN.getStyle("left");var r=i+"";i=r.replace("px","");this.x=i;return i};this.get_ypos=function(){var i=this.newGSWIN.getStyle("top");var r=i+"";i=r.replace("px","");this.y=i;return i};this.set_position=function(z,w){var u=this.x;var t=this.y;var B=w+"";var r=z+"";var i=this.root_get_width();var s=this.root_get_height();var A=this.get_width();var v=this.get_height();this.x=r.replace("px","");this.y=B.replace("px","");if(this.x<10){this.x=0}if(this.y<10){this.y=0}if(this.y<10){this.y=0}if(this.x>(i-(A/2))){this.x=(i-(A/2))}if(this.y>(s-(v/2))){this.y=(s-(v/2))}r=this.x+"px";B=this.y+"px";if((this.oldx!=this.x)||(this.oldy!=this.y)){this.newGSWIN.set("styles",{left:r});this.newGSWIN.set("styles",{top:B});this.oldx=u;this.oldy=t}};this.update_position=function(A,z){var w=0;var u=this.x;var t=this.y;var C=z+"";var r=A+"";var i=this.root_get_width();var s=this.root_get_height();var B=this.get_width();var v=this.get_height();this.x=r.replace("px","");this.y=C.replace("px","");if((u==this.x)&&(t==this.y)){return}if(this.x<10){w=1;this.x=0}if(this.y<10){this.y=0;w=1}if(this.y<10){this.y=0;w=1}if(this.x>(i-(B/2))){this.x=(i-(B/2));w=1}if(this.y>(s-(v/2))){this.y=(s-(v/2));w=1}r=this.x+"px";C=this.y+"px";if(w==1){this.newGSWIN.set("styles",{left:r});this.newGSWIN.set("styles",{top:C})}};this.inject_ajax=function(i){var r=this.newGSCONTENT;var s=new Request({url:i,method:"post",evalScripts:true,update:r,onComplete:function(t){$(r).set("html",t)}});s.send()};this.inject=function(i){this.newGSCONTENT.innerHTML=i};this.inject_frame=function(i){this.inject('<iframe src="'+i+'" WIDTH="100%" BORDER="0"  HEIGHT="100%"></iframe>')};this.show=function(i){this.display=i;if(this.display!=false){this.newGSWIN.display="block";this.newGSWIN.set("styles",{display:"block"})}else{this.newGSWIN.display="none";$$(this.name).set("styles",{display:"none"})}};this.destroy=function(){this.newGSCONTENT.tween("opacity",0.7,0);this.newGSBAR.tween("opacity",0.7,0);this.newGSWIN.tween("opacity",0.7,0);this.closewins()};this.wrap=function(r,i){this.newGSCONTENT.innerHTML=$(r).innerHTML;if(i==1){$(r).destroy()}};this.closewins=function(){this.newGSCONTENT.destroy();this.newGSBAR.destroy();this.newGSWIN.destroy()};this.closewins=function(){this.newGSCONTENT.destroy();this.newGSBAR.destroy();this.newGSWIN.destroy()};this.fullscreen=function(){var r=this.get_width();var u=this.get_height();var t=this.get_xpos();var s=this.get_ypos();var v=this.root_get_width();var i=this.root_get_height();if((this.width!=v)||(this.height!=i)){this.set_size(v,i);this.set_position(0,0)}else{this.set_position(this.oldx,this.oldy);this.set_size(this.oldwidth,this.oldheight)}this.oldwidth=r;this.oldheight=u;this.oldx=t;this.oldy=s};this.write_text=function(i){$(this.newGSCONTENT).appendText(i)};this.destroyIT=function(i){var r=this.rootwindow;r.removeChild($(i));this.style.display="none"};this.drag_off=function(){this.myDrag.stop()};this.drag_on=function(){var v=this;var u=this.newGSBAR;var i=$(this.rootwindows);this.myDrag=new Drag.Move($(this.name),{droppables:i,container:i,handle:$(u),onDrag:function(){v.newGSCONTENT.style.visibility="hidden"},onStart:function(){var B=$$("div.GSWIN form, div.GSWIN iframe, div.GSWIN img, div.GSWIN embed");for(var z=0,x=B.length;z<x;z++){B[z].style.visibility="hidden"}if(v.zeffectoption!=0){var A=v.newGSWIN.getParent();var y=A.getChildren();for(z=0;z<y.length;z++){if(y[z]!=v.newGSWIN){$(y[z]).tween("opacity",1,0.2)}}}},onDrop:function(B,D){var A=v.newGSWIN.getParent();var z=A.getChildren();var C=$$("div.GSWIN form, div.GSWIN iframe, div.GSWIN img, div.GSWIN embed");for(var y=0,x=C.length;y<x;y++){C[y].style.visibility="visible"}if(v.zeffectoption!=0){for(y=0;y<z.length;y++){if(z[y]!=v.newGSWIN){$(z[y]).tween("opacity",0.5,1)}}}v.newGSCONTENT.style.visibility="visible";if(!D){}else{}},onLeave:function(x,y){},onComplete:function(x,y){m=x.getStyle("left");l=x.getStyle("top");v.update_position(m,l)}});var r=this.handlebtn;var w=v.root_get_width()-50;var t=v.root_get_height()-50;if(this.resizeoption!=0){var s=$(this.name).makeResizable({limit:{x:[100,w],y:[40,t]},handle:$(r),grid:10,onStart:function(A){v.drag_off();var z=$$("div.GSWIN form, div.GSWIN iframe, div.GSWIN img, div.GSWIN embed");for(var y=0,x=z.length;y<x;y++){z[y].style.visibility="hidden"}v.newGSWIN.set("styles",{cursor:"nw-resize"})},onComplete:function(z){v.myDrag.attach();var A=$$("div.GSWIN form, div.GSWIN iframe, div.GSWIN img, div.GSWIN embed");for(var y=0,x=A.length;y<x;y++){A[y].style.visibility="visible"}v.newGSWIN.set("styles",{cursor:"auto"})},})}this.newGSBAR.addEvent("click",function(x){v.set_focus()})};var c=this.rootwindow;this.newGSWIN=new Element("div",{"class":"GSWIN",id:this.name,name:this.name,style:{position:"absolute",width:b,display:"none"}});this.newGSWIN.className="GSWIN";this.newGSWIN.setAttribute("id",this.name);this.newGSWIN.setAttribute("name",this.name);this.newGSBAR=new Element("div",{"class":"GSBAR",id:"BAR"+this.name,name:"BAR"+this.name,style:{position:"absolute",width:b}});this.newGSCONTENT=new Element("div",{"class":"GSCONTENT",id:"CONTENT"+this.name,name:"CONTENT"+this.name,style:{position:"absolute",width:b,padding:"2px"}});if(this.resizeoption!=0){this.resize_handle=new Element("div",{"class":"GSresize",id:this.handlebtn,name:this.handlebtn,style:{position:"absolute"}})}if(this.closeoption==1){this.destroy_handle=new Element("div",{"class":"GSdestroy",id:this.closebtn,name:this.closebtn,style:{position:"absolute"}})}if(this.fullscreenoption==1){this.fullscreen_handle=new Element("div",{"class":"GSfullscreen",id:this.fullscreenbtn,name:this.fullscreenbtn,style:{position:"absolute"}})}this.newGSBAR.className="GSBAR";var h="<h1>"+this.titre+"</h1>";this.newGSBAR.innerHTML=h;this.set_size(this.width,this.height);this.foreground(this.fgcolor);this.background(this.bgcolor);this.set_size(this.width,this.height);this.set_position(this.x,this.y);this.show(this.display);this.rootwindow.appendChild(this.newGSWIN);this.newGSWIN.appendChild(this.newGSBAR);this.newGSWIN.appendChild(this.newGSCONTENT);if(this.resizeoption!=0){this.newGSWIN.appendChild(this.resize_handle)}if(this.closeoption==1){this.newGSWIN.appendChild(this.destroy_handle)}if(this.fullscreenoption==1){this.newGSWIN.appendChild(this.fullscreen_handle)}var q=this;if(this.closeoption!=0){$(this.closebtn).addEvent("click",function(i){i.stop();q.destroy()})}if(this.fullscreenoption==1){$(this.fullscreenbtn).addEvent("click",function(i){q.fullscreen()});this.set_focus()}};