var localIsDOM=document.getElementById?true:false,localIsJava=navigator.javaEnabled(),localIsStrict=document.compatMode=="CSS1Compat",localPlatform=navigator.platform,localVersion="0",localBrowser="",localBFamily="",isHttps=false; if(window.opera&&localIsDOM){localBFamily=localBrowser="Opera";localVersion=navigator.userAgent.search(/^.*Opera.([\d.]+).*$/)!=-1?navigator.userAgent.replace(/^.*Opera.([\d.]+).*$/,"$1"):window.print?"6":"5"}else if(document.all&&document.all.item)localBFamily=localBrowser="MSIE"; if(navigator.appName=="Netscape"){localBFamily="NC";if(localIsDOM)localBrowser=navigator.userAgent.indexOf("Chrome")>=0?"Chrome":navigator.userAgent.indexOf("Safari")>=0?"Safari":navigator.userAgent.indexOf("Netscape")>=0?"Netscape":navigator.userAgent.indexOf("Firefox")>=0?"Firefox":"Mozilla";else{localBrowser="Netscape";localVersion=navigator.userAgent.replace(/^.*Mozilla.([\d.]+).*$/,"$1");if(localVersion!="")localVersion="4"}} if(navigator.userAgent.indexOf("MSMSGS")>=0)localBrowser="WMessenger";else if(navigator.userAgent.indexOf("e2dk")>=0)localBrowser="Edonkey";else if(navigator.userAgent.indexOf("Gnutella")+navigator.userAgent.indexOf("Gnucleus")>=0)localBrowser="Gnutella";else if(navigator.userAgent.indexOf("KazaaClient")>=0)localBrowser="Kazaa";if(localVersion=="0"&&localBrowser!=""){var rg=new RegExp("^.*"+localBrowser+".([\\d.]+).*$");localVersion=navigator.userAgent.replace(rg,"$1")} var localIsCookie=localBrowser=="Netscape"&&localVersion=="4"?document.cookie!="":navigator.cookieEnabled;isHttps=document.location.protocol=="https:";function change_antibot_image(a){var b=document.getElementById(a);if(b){var c="/antibot_image.php?tmp="+Math.random()+"&section="+a+"&regenerate=Y";setTimeout(function(){b.src=c},200)}} function getRealWidth(a){var b=$(a).attr("scrollWidth");if($.browser.opera)return b;var c=parseInt($(a).css("padding-left"));isNaN(c)||(b-=c);a=parseInt($(a).css("padding-right"));isNaN(a)||(b-=a);return b}function showNote(a,b){var c=$("#"+a).get();$("#"+a).remove();$("body").append(c);$("#"+a).show();c=getRealWidth("#"+a);$("#"+a).css("left",$(b).offset().left+$(b).width()+"px");$("#"+a).css("top",$(b).offset().top+"px");c>$("#"+a).width()&&$("#"+a).css("width",c+"px")} function getElementsByClassName(a){for(var b,c=[],d=document.getElementsByTagName("*"),e=0;b=d[e];e++)if(b.className==a)c[c.length]=b;return c}function getProperDimensions(a,b,c,d,e){if(a<=0||b<=0||c<=0&&d<=0||e&&a<=c&&b<=d)return[a,b];var f=1;if(c<=0)f=e&&b<=d?1:d/b;else if(d<=0)f=e&&a<=c?1:c/a;else{c=c/a;d=d/b;f=e?Math.min(c,d,1):Math.min(c,d)}return[round(f*a),round(f*b)]} function visibleBox(a,b){elm1=document.getElementById("open"+a);elm2=document.getElementById("close"+a);elm3=document.getElementById("box"+a);if(!elm3)return false;if(b)elm3.style.display=elm3.style.display==""?"none":"";else if(elm1)if(elm1.style.display==""){elm1.style.display="none";if(elm2)elm2.style.display="";elm3.style.display="none";for(var c=getElementsByClassName("DialogBox"),d=0;d<c.length;d++)c[d].style.height="1%"}else{elm1.style.display="";if(elm2)elm2.style.display="none";elm3.style.display= ""}return true}function switchVisibleBox(a){var b=document.getElementById(a),c=document.getElementById(a+"_plus");a=document.getElementById(a+"_minus");if(!b||!c||!a)return false;if(b.style.display=="none"){b.style.display="";c.style.display="none";a.style.display=""}else{b.style.display="none";a.style.display="none";c.style.display=""}return true}function urlEncode(a){return a.replace(/\s/g,"+").replace(/&/,"&amp;").replace(/"/,"&quot;")} function round(a,b){if(isNaN(a))a=parseFloat(a);if(!b||isNaN(b))return Math.round(a);b=Math.pow(10,b);return Math.round(a*b)/b} function price_format(a,b,c,d,e){b=arguments.length>1&&b!==false?b:number_format_th;c=arguments.length>2&&c!==false?c:number_format_dec;d=arguments.length>3&&d!==false?d:number_format_point;e=arguments.length>4&&e!==false?currency_format:"x";if(d>0){d=Math.pow(10,d);a=Math.round(a*d)/d;var f=Math.floor(a),g=Math.round((a-f)*d)+d}else{f=Math.round(a);g=0}f+="";g+="";for(var i=0,h=f.length;h>=0;h--){if(i%3==0&&i>0&&h>0)f=f.substr(0,h)+b+f.substr(h,f.length);i++}return e.replace("x",g>0?f+c+g.substr(1, g.length):f)}function substitute(a){for(var b=1;b<arguments.length;b+=2)if(arguments[b]&&arguments[b+1])a=a.replace(new RegExp("\\{\\{"+arguments[b]+"\\}\\}","gi"),arguments[b+1]).replace(new RegExp("~~"+arguments[b]+"~~","gi"),arguments[b+1]);return a}function getWindowOutWidth(a){a||(a=window);return localBFamily=="MSIE"?a.document.body.clientWidth:a.outerWidth}function getWindowOutHeight(a){a||(a=window);return localBFamily=="MSIE"?a.document.body.clientHeight:a.outerHeight} function getWindowWidth(a){a||(a=window);return localBFamily=="MSIE"?a.document.body.clientWidth:a.innerWidth}function getWindowHeight(a){a||(a=window);return localBFamily=="MSIE"?a.document.body.clientHeight:a.innerHeight}function getDocumentHeight(a){a||(a=window);return Math.max(a.document.documentElement.scrollHeight,a.document.body.scrollHeight)}function getDocumentWidth(a){a||(a=window);return Math.max(a.document.documentElement.scrollWidth,a.document.body.scrollWidth)} function expandWindowX(a,b,c){a||(a=window);b||(b=10);for(var d=true,e=200;d&&e--;){if(c&&getWindowOutWidth()+b>c)break;try{a.scrollTo(b,0);(d=a.document.documentElement&&a.document.documentElement.scrollLeft>0||a.document.body&&a.document.body.scrollLeft>0)&&a.resizeBy(b,0)}catch(f){return false}}return true} function expandWindowY(a,b,c){a||(a=window);b||(b=10);for(var d=true,e=200;d&&e--;){if(c&&getWindowOutHeight()+b>c)break;try{a.scrollTo(0,b);(d=a.document.documentElement&&a.document.documentElement.scrollTop>0||a.document.body&&a.document.body.scrollTop>0)&&a.resizeBy(0,b)}catch(f){return false}}return true} function checkMarks(a,b,c){var d=false;if(!a||a.elements.length==0)return true;for(var e=0;e<a.elements.length;e++)if(a.elements[e].name.search(b)==0&&a.elements[e].type=="checkbox"&&!a.elements[e].disabled){d=true;if(a.elements[e].checked)return true}if(!d)return true;if(c)alert(c);else lbl_no_items_have_been_selected&&alert(lbl_no_items_have_been_selected);return false} function submitForm(a,b,c){if(!c&&typeof window.event!="undefined")c=event;if(c)if(c.stopPropagation)c.stopPropagation();else c.cancelBubble=true;if(!a)return false;if(a.tagName!="FORM"){if(!a.form)return false;a=a.form}if(typeof window.$!="undefined")if($(a).triggerHandler("submit")===false)return false;if(a.mode)a.mode.value=b;return a.submit()} function convert_number(a){var b=new RegExp(reg_quote(number_format_dec),"gi"),c=new RegExp(reg_quote(number_format_th),"gi"),d=Math.pow(10,parseInt(number_format_point));a=parseFloat(a.replace(" ","").replace(c,"").replace(b,"."));return Math.round(a*d)/d}function check_is_number(a){var b=new RegExp(reg_quote(number_format_dec),"gi"),c=new RegExp(reg_quote(number_format_th),"gi");a=a.replace(" ","").replace(c,"").replace(b,".");return a.search(/^[+-]?[0-9]+(\.[0-9]+)?$/)!=-1} function reg_quote(a){return a.replace(/\./g,"\\.").replace(/\//g,"\\/").replace(/\*/g,"\\*").replace(/\+/g,"\\+").replace(/\[/g,"\\[").replace(/\]/g,"\\]")} function setCookie(a,b,c,d){if(typeof d=="object")try{var e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],f=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];if(e[d.getDay()]&&f[d.getMonth()])d=e[d.getDay()]+" "+d.getDate()+"-"+f[d.getMonth()]+"-"+d.getFullYear()+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+" GMT"}catch(g){}if(typeof d!="string")d=false;document.cookie=a+"="+escape(b)+(d?"; expires="+d:"")+(c?"; path="+c:"")} function getCookie(a){if(document.cookie.length>0){start=document.cookie.indexOf(a+"=");if(start!=-1){start=start+a.length+1;end=document.cookie.indexOf(";",start);if(end==-1)end=document.cookie.length;return unescape(document.cookie.substring(start,end))}}return false}function deleteCookie(a){document.cookie=a+"=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;"}function cloneObject(a){var b={};for(var c in a)if(hasOwnProperty(a,c))b[c]=a[c];return b} function getFirstCB(a,b){for(;a.tagName&&a.tagName.toUpperCase()!="FORM";)a=a.parentNode;if(!a.tagName||a.tagName.toUpperCase()!="FORM"||a.elements.length==0)return false;for(var c=false,d=0;d<a.elements.length&&!c;d++)if(a.elements[d].name.search(b)==0&&a.elements[d].type=="checkbox"&&!a.elements[d].disabled&&a.elements[d].checked)c=a.elements[d];if(!c){lbl_no_items_have_been_selected&&alert(lbl_no_items_have_been_selected);return false}return c} function _getById(a){if(typeof a!="string"||!a)return false;var b=document.getElementById(a);if(b&&b.id!=a){b=false;for(var c=0;c<document.all.length&&b===false;c++)if(document.all[c].id==a)b=document.all[c]}return b}function isset(a){return typeof a!="undefined"&&a!==null}function isFunction(a){return typeof a=="function"||typeof a=="object"&&(a+"").search(/\s*function /)===0}function getPureLength(a){return a&&a.replace?a.replace(new RegExp("\r","g"),"").length:-1} function getTASelection(a){if(document.selection){a.focus();var b=document.selection.createRange(),c=b.duplicate();c.moveToElementText(a);var d=b.text,e=String.fromCharCode(1);b.text=e;e=c.text.indexOf(e);a.selectionStart=getPureLength(e==-1?c.text:c.text.substring(0,e));a.selectionEnd=getPureLength(d)+a.selectionStart;b.moveStart("character",-1);b.text=d}return[a.selectionStart,a.selectionEnd]} function insert2TA(a,b){if(!a)return false;var c=getTASelection(a);if(isNaN(c[0])){c=getPureLength(a.value);a.value+=b}else{a.value=a.value.substr(0,c[0])+b+a.value.substr(c[0]);c=c[0]}setTACursorPos(a,c);return c} function setTACursorPos(a,b,c){if(!a||!a.tagName||a.tagName.toUpperCase()!="TEXTAREA")return false;if(isNaN(b))b=0;else if(getPureLength(a.value)<b)c=b=getPureLength(a.value);if(isNaN(c))c=b;if(document.selection){var d=a.createTextRange();d.collapse(true);d.moveStart("character",b);d.moveEnd("character",c-b);d.select()}else if(!isNaN(a.selectionStart)){a.selectionStart=b;a.selectionEnd=c}a.focus&&a.focus();return true} function viewHelp(a,b,c,d){if(!a)return false;if(a.constructor==String)a=document.getElementById(a);if(!a||!b)return false;if(!b.helpBox){b.helpBox=a;a.helpLink=b;a.onmouseout=viewHelpOut;b.onmouseout=viewHelpOut;a.onmouseover=viewHelpOver;a.helpBoxVisible=false;a.helpBoxHideTO=false;a.helpBoxHideTTL=c?c:1E3;if(d)a.style.width=d+"px"}a.style.top=posGetTop(b)+posGetHeight(b)+2+"px";d=$(a).width();c=posGetLeft(b);if(c+d>$(window).width())c=c-d+$(b).width();a.style.left=c+"px";viewHelpOver.call(a);viewHelpVisible(a, true);d=getRealWidth(a);if(d>$(a).width()){d=Math.min(d,$(window).width()-40);$(a).width(d);$(b).offset();var e=$(b).width(),f=$(a).offset().left;if(f+d>$(window).width()){a.style.left=c-d+e+"px";f=$(a).offset().left}if(f<0){a.style.left="10px";$(a).offset()}}b.blur&&b.blur();return true} function viewHelpGetObjects(a){if(!a.tagName||a.tagName.toUpperCase()!=="DIV"&&a.tagName.toUpperCase()!=="A"||$(a).hasClass("help-link"))return false;if(a.helpBox){var b=a;a=a.helpBox}else{b=a.helpLink;a=a}if(!b||!a||!b.helpBox||!a.helpLink)return false;return{a:b,box:a}}function viewHelpVisible(a,b){a.style.display=b?"block":"none";a.helpBoxVisible=b;return true}function viewHelpStartHide(a){a.helpBoxHideTO=setTimeout(function(){viewHelpVisible(a,false)},a.helpBoxHideTTL);return true} function viewHelpOut(){var a=viewHelpGetObjects(this);if(!a)return false;return a.box.helpBoxVisible&&viewHelpStartHide(a.box)}function viewHelpOver(){var a=viewHelpGetObjects(this);if(!a)return false;a.box.helpBoxVisible&&a.box.helpBoxHideTO&&clearTimeout(a.box.helpBoxHideTO);return true}function posGetPageOffset(a){var b=0,c=0;do{b+=a.offsetLeft;c+=a.offsetTop}while(a=a.offsetParent);return{left:b,top:c}}function posGetLeft(a){return posGetPageOffset(a).left} function posGetTop(a){return posGetPageOffset(a).top}function posGetWidth(a){return a.offsetWidth}function posGetHeight(a){return a.offsetHeight}function buttonOver(a){a=a.getElementsByTagName("SPAN");if(a.length>0)a[0].className="underline"}function buttonOut(a){a=a.getElementsByTagName("SPAN");if(a.length>0)a[0].className="normal"} function getMethod(a,b){for(var c=[],d=2;d<arguments.length;d++)c[c.length]=arguments[d];b||(b=window);return function(){isFunction(a)||(a=b[a]);return a.apply?a.apply(b,c):a()}}function lockForm(a){if(a.locked)return false;a.locked=true;setTimeout(function(){a.locked=false},1E3);return true}function getPopupControl(a){for(a=a;a&&a.tagName&&!a._popupControl;)a=a.parentNode;return a&&a._popupControl?a._popupControl:false} function parse_url(a){if(!a||a.constructor!=String)return false;a=a.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/);if(!a)return false;var b={scheme:a[2],host:a[4],path:a[5],query:a[7],fragment:a[9]};if(b.host)if(a=b.host.match(/^(?:([^:]+):)?([^@]+)@(.+)$/)){b.host=a[3];b.user=a[1]?a[1]:a[2];b.password=a[1]?a[2]:false}return b}var xxx=0; function pngFix(a){if(!a||!a.tagName||!$.browser.msie||parseFloat($.browser.version)>=7||a.tagName.toUpperCase()!="IMG")return false;var b=a.src.replace(/\(/g,"%28").replace(/\)/g,"%29");a.src=images_dir+"/spacer.gif";a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b.replace(/"/,'"')+'",sizingMethod="scale")';return true} function getImgSrc(a){if(!a||!a.tagName||a.tagName.toUpperCase()!="IMG"||!a.src)return false;if($.browser.msie&&a.src.search(/\/spacer\.gif$/)!=-1&&a.filters["DXImageTransform.Microsoft.AlphaImageLoader"])return a.filters["DXImageTransform.Microsoft.AlphaImageLoader"].src;return a.src}function isPngFix(a){return $.browser.msie&&a&&a.tagName&&a.tagName.toUpperCase()=="IMG"&&a.src&&a.src.search(/\/spacer\.gif$/)!=-1&&a.filters["DXImageTransform.Microsoft.AlphaImageLoader"]} function extend(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.superclass=b.prototype}function hasOwnProperty(a,b){if(typeof a!="undefined"&&Object.prototype.hasOwnProperty)return a.hasOwnProperty(b);return typeof a[b]!="undefined"&&a.constructor.prototype[b]!==a[b]}var hint_timer=[];function hint_mouseout(a,b){$("#"+b).css("z-index",1);hint_timer[a]=setTimeout(function(){$("#"+b).hide()},50)} function hint_mouseover(a,b){hint_timer[a]&&clearTimeout(hint_timer[a]);$("#"+b).css("z-index",999).show()}function resetDefault(a){if(!a.isReseted){a.value="";$(a).removeClass("default-value");a.isReseted=true}return true}function skipDefaultValue(a){$("input.default-value",a).each(function(){this.value=""});return true} function initResetDefault(){$("input.default-value").bind("focus",function(){if(!this.isReseted){this.defaultValue=this.value;this.value="";$(this).removeClass("default-value");this.isReseted=true}return true}).bind("change",function(){return this.isContentIsChanged=true}).bind("blur",function(){if(this.isReseted&&!this.isContentIsChanged&&this.defaultValue){this.value=this.defaultValue;$(this).addClass("default-value");this.isReseted=false}return true}).each(function(){if(!this.form.isSetReset){$(this.form).bind("submit", function(){$("input.default-value",this).each(function(){this.value=""});return true});this.form.isSetReset=true}})}if(window.addEventListener)window.addEventListener("load",initResetDefault,false);else window.attachEvent&&window.attachEvent("onload",initResetDefault); var popup_html_editor_text,debug=function(){var a=false;return function(){if(typeof window.$=="undefined")return false;if(!a){a=$(document.createElement("DIV")).css({position:"absolute",border:"1px solid black",backgroundColor:"white",display:"none",top:"0px",left:"0px",width:"200px",height:"200px",overflow:"auto",padding:"5px",margin:"0px"}).get(0);document.body.appendChild(a);a.defaultOpacity=0.9;a.ttl=0;a._extend_create=false;a._ttlTO=false;a._rowsLength=0;a.html=function(c,d){this._getBox().innerHTML= c;this.show();this.startTTL(arguments.length>1?d:this.ttl)};a.add=function(c,d){this._getBox().innerHTML+=c+"<br />\n";this.show();this.startTTL(arguments.length>1?d:this.ttl)};a.row=function(c){var d=$("div:eq("+c+")",this._getBox()).get(0);if(!d){for(var e=this._rowsLength;e<c+1;e++){d=this._getBox().appendChild(document.createElement("DIV"));d.remove=this._removeRow;d.html=this._htmlRow;d.add=this._addRow;d.box=this}this._rowsLength=c+1}return d};a._removeRow=function(){if(this.parentNode){this.box._rowsLength--; this.parentNode.removeChild(this)}};a._htmlRow=function(c,d){this.innerHTML=c;this.box.show();this.box.startTTL(arguments.length>1?d:this.parentNode.ttl)};a._addRow=function(c,d){this.innerHTML+=c;this.box.show();this.box.startTTL(arguments.length>1?d:this.parentNode.ttl)};a.clean=function(){this._rowsLength=0;this._getBox().innerHTML=""};a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.opacity=function(c){c=parseFloat(c);if(isNaN(c)||c<0||c>1)return false;c= Math.round(c*100)/100;if($.browser.msie)this.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity = "+c*100+")";else this.style.opacity=c;return true};a.startTTL=function(c){this._ttlTO&&clearTimeout(this._ttlTO);if(c<=0)return false;var d=this;this._ttlTO=setTimeout(function(){d.hide()},c*1E3);return true};a.extend=function(){if(this._extend_create)return true;for(var c=document.getElementsByTagName("SCRIPT"),d,e=false,f=0;f<c.length&&!e;f++)if(c[f].src&&(d=c[f].src.match(/^(.+\/)common.js/)))e= d[1];if(!e)return false;c=document.createElement("SCRIPT");c.src=e+"debug.js";document.body.appendChild(c);return this._extend_create=true};a.is_extended=function(){return this._extend_create&&typeof window._debug_is_extended!="undefined"&&_debug_is_extended};a._getBox=function(){return this};a.defaultOpacity>0&&a.defaultOpacity<=1&&a.opacity(a.defaultOpacity)}if(typeof window.debug_panel_ext_methods!="undefined"&&debug_panel_ext_methods){for(var b=0;b<debug_panel_ext_methods.length;b++)a[debug_panel_ext_methods[b]]= debug_panel_ext[debug_panel_ext_methods[b]];typeof debug_panel_ext.init!="undefined"&&debug_panel_ext.init.call(a);debug_panel_ext=debug_panel_ext_methods=false}return a}}();function change_width_iefix(){$("td div button").each(function(){$(this).width("auto").width($(this).width())})}function popup(a,b,c){window.open(a,"popup","width="+b+",height="+c+",toolbar=no,status=no,scrollbars=yes,resizable=no,menubar=no,location=no,direction=no")};
