function $(a){return document.getElementById(a)}function CallAjax(a,c,b){JsHttpRequest.query(c,{str:b},function(d,e){$(a+"_Body").innerHTML=e;$(a+"_Body").innerHTML=d.str},true)}function CloseWindow(a){$(a).innerHTML="";$(a).style.visibility="hidden"}var flag=false;var shift_x;var shift_y;function WriteDiv(a,b){$(a+"_Body").innerHTML="<center><img src='http://www.carrida.ru/images/elm/loader-0.gif' width='32' height='32'></center>";if(CallAjax(a,"http://www.carrida.ru/init.php",b)==true){return true}else{return false}}function CreateWindow(e,d,l,g,c,a,m,k,i,b){var j=$(e);if(!j){var f=document.createElement("div");f.id=e;f.name=e;f.className="Window";document.body.appendChild(f)}$(e).style.visibility="hidden";$(e).style.position="absolute";if(a>0){$(e).style.height=a+"px"}if(m>0){$(e).style.width=m+"px"}$(e).style.zIndex=c;$(e).style.visibility="visible";var h="<table onMouseUp=NEndDragWindow('"+e+"',event) onMouseDown=NStartDragWindow('"+e+"',event) border='0' width='100%' id='"+e+"_ControlTab' name='"+e+"_ControlTab' class='ControlTab'><tr><td>"+d+"</td><td align='right'><a href=javascript:void; onClick=CloseWindow('"+e+"');><img src='http://www.carrida.ru/elm/buttons/x.gif' border='0' height='16' width='16'></a></td></tr></table>";if(b==1){document.getElementById(e).innerHTML=h}$(e).innerHTML+="<div id='"+e+"_Body'></div>";$(e+"_Body").innerHTML="<center><img src='http://www.carrida.ru/images/elm/loader-0.gif' width='32' height='32'></center>";if(l==0){CallAjax(e,"http://www.carrida.ru/init.php",g)}else{$(e+"_Body").innerHTML=l}if(k==0){WindowPosition(e)}else{$(e).style.top=k+"px"}if(i==0){WindowPosition(e)}else{$(e).style.left=i+"px"}}function StartDragWindow(a,b){if(!b){b=window.event}flag=true;shift_x=b.clientX-parseInt($(a).style.left);shift_y=b.clientY-parseInt($(a).style.top);if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}function EndDragWindow(){flag=false}function DragWindow(a,b){if(!flag){return}if(!b){b=window.event}$(a).style.left=parseInt((b.clientX-shift_x));$(a).style.top=parseInt((b.clientY-shift_y));if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}};
