var _mouseOnParent=[],_mouseOnSub=[],enTable=new Array("A","B","V","G","D","E","YO","ZH","Z","I","Y","K","L","M","N","O","P","R","S","T","U","F","H","TS","TCH","SH","CSH","","YI","","YE","YU","YA","a","b","v","g","d","e","yo","zh","z","i","y","k","l","m","n","o","p","r","s","t","u","f","h","ts","tch","sh","csh","","yi","","ye","yu","ya"),ruTable=new Array("\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd",
"\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd","\ufffd");
function translit_string(a,b){var c=new String("");for(i=0;i<a.length;i++)for(j=0;j<ruTable.length;j++)if(a.charAt(i)==ruTable[j])c+=enTable[j];if(c=="")c=a;newstr=c.replace(/\s/gi,"_");if(b=="lo")return newstr.toLowerCase();if(b=="up")return newstr.toUpperCase();if(b=="nat")return newstr}function translitRT(a,b,c,d){var e=a.elements[b];a=a.elements[c];e||(e=document.getElementById(b));a||(a=document.getElementById(c));if(d)a.value=translit_string(e.value,"nat")}
function translitRTLo(a,b,c,d){var e=a.elements[b];a=a.elements[c];e||(e=document.getElementById(b));a||(a=document.getElementById(c));if(d)a.value=translit_string(e.value,"lo")}function translitRTUp(a,b,c,d){var e=a.elements[b];a=a.elements[c];e||(e=document.getElementById(b));a||(a=document.getElementById(c));if(d)a.value=translit_string(e.value,"up")}
function bCheckFlashPlayer(a){var b=6,c=false;if(a!="")b=a;if(navigator.plugins)if(navigator.plugins["Shockwave Flash"]){a=navigator.plugins["Shockwave Flash"].description;c=parseInt(a.charAt(a.indexOf(".")-1))>=b}else navigator.userAgent.indexOf("MSIE")!=-1&&navigator.userAgent.indexOf("Win")!=-1&&document.write('<script language="vbscript">\nif ScriptEngineMajorVersion >= 2 then\non error resume next\nflash = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+b+'"))\nend if\n<\/script>');if(c==
false)if(confirm("FLASH not installed. Go to macromedia flash plugin homepage now?")==true)document.location="http://www.macromedia.com/go/getflashplayer";return c}function updateform(a){var b=a+"nums",c=document.getElementById(a+"list");b=document.getElementById(b).value;if(b>15)alert("too much!!!!");else{c.innerHTML="";for(i=0;i<b;i++)c.innerHTML+='<tr><td><label For="'+a+'[]">N<u>o</u>&nbsp;'+(i+1)+'&nbsp;</label></td><td><Input Type="file" Name="'+a+'[]" class="texter"></td></tr>'}}
function checkList(a){a=document.getElementById(a+"nums");var b=a.value;a.innerHTML="$voteas"+idx}function set_parent(a,b){document.getElementById("parent").value=a;if(a!=0)document.getElementById("parent_null").value=b;else document.getElementById("parent_null").value=""}
function edit_item(a,b,c){document.getElementById("mode").value="edit";document.getElementById("name").value=c;document.getElementById("selfer").value=a;document.getElementById("parent").value=b;document.getElementById("subfrm").value="Edit"}function delitem(a,b,c){if(confirm(c)){document.getElementById(a+"_"+b).value="";c=document.getElementById(a+"link_"+b);c.style.display="none";c=document.getElementById(a+"linkp_"+b);c.style.display="none"}}function void_0(a){return a}function noop(){}
function CleanField(a){document.getElementById(a).value=""}function recalc(){lent=recalc.arguments;var a=0;for(j=0;j<lent.length;j++){document.getElementById("cost["+lent[j]+"]").value=parseFloat(document.getElementById("price["+lent[j]+"]").value)*parseFloat(document.getElementById("quant["+lent[j]+"]").value);a+=parseFloat(document.getElementById("cost["+lent[j]+"]").value)}document.getElementById("totl").value=a}
function swapImage(a,b){document.getElementById(b).src=a;for(i=0;i<_mouseOnParent.length;i++)if(_mouseOnParent[i]&&_mouseOnSub[i]==false){_mouseOnParent[i]=false;hideFloatSubmenu(i)}}function emoticon(a,b){a=document.getElementById(a);b=" "+b+" ";if(a.createTextRange&&a.caretPos){a=a.caretPos;a.text=a.text.charAt(a.text.length-1)==" "?a.text+b+" ":a.text+b}else a.value+=b}
function bbcode(a,b){var c=false,d=false;if(navigator.userAgent.toLowerCase().indexOf("firefox")>0)c=true;a=document.getElementById(a);var e,f,g;if(c==true){if(a.selectionStart!=undefined){e=a.value.substr(0,a.selectionStart);f=a.value.substr(a.selectionStart,a.selectionEnd-a.selectionStart);g=a.value.substr(a.selectionEnd);if(f.length>0)d=true}}else{isWin=false;if(window.getSelection){f=a.value.substring(a.selectionStart,a.selectionEnd);d=true}else if(document.getSelection)f=document.getSelection();
else if(document.selection)f=document.selection.createRange().text;if(isWin==false){c=a.value.indexOf(f);if(c>=0){g=a.value.indexOf(f)+f.length;e=a.value.substr(0,c);g=a.value.substr(g,a.value.length);d=true}}}if(d==true){switch(b){case "bold":startTag="[b]";endTag="[/b]";break;case "italic":startTag="[i]";endTag="[/i]";break;case "underline":startTag="[u]";endTag="[/u]";break;case "strikethrough":startTag="[s]";endTag="[/s]";break;case "xlink":if(b=prompt("LINK","")){startTag="[url="+b+"]";endTag=
"[/url]"}else endTag=startTag="";break;case "ximg":if(b=prompt("IMAGE LINK","")){startTag="[img="+b+"]";endTag="[/img]"}else endTag=startTag="";break}a.value=e+startTag+f+endTag+g}else alert("No text selected.\nNo tags added")}function HideElement(a,b){document.getElementById(a).style.display=b==true?"none":"";return false}
function SwapHideMode(a){var b=document.getElementById(a);a=document.getElementById(a+"_img");if(b.style.display!="none"){b.style.display="none";a.src="/"+LIB_ROOT+"/images/nolines_plus.gif"}else{b.style.display="";a.src="/"+LIB_ROOT+"/images/nolines_minus.gif"}return false}
function SwapHideModeLined(a){var b=document.getElementById(a);a=document.getElementById(a+"_img");if(b.style.display==""){b.style.display="none";a.src="/"+LIB_ROOT+"/images/plus.gif"}else{b.style.display="";a.src="/"+LIB_ROOT+"/images/minus.gif"}return false}
function URLEncode(a){for(var b="",c=0;c<a.length;c++){var d=a.charAt(c);if(d==" ")b+="+";else if("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ufffd\ufffd\ufffd\ufffd\ufffd\u0168\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd-_.!~*'()".indexOf(d)!=-1)b+=
d;else{var e=d.charCodeAt(0);if(e>255){alert("Unicode Character '"+d+"' cannot be encoded using standard URL encoding.\n(URL encoding only supports 8-bit characters.)\nA space (+) will be substituted.");b+="+"}else{b+="%";b+="0123456789ABCDEF".charAt(e>>4&15);b+="0123456789ABCDEF".charAt(e&15)}}}return b}
function URLDecode(a){for(var b="",c=0;c<a.length;){var d=a.charAt(c);if(d=="+"){b+=" ";c++}else if(d=="%")if(c<a.length-2&&"0123456789ABCDEFabcdef".indexOf(a.charAt(c+1))!=-1&&"0123456789ABCDEFabcdef".indexOf(a.charAt(c+2))!=-1){b+=unescape(a.substr(c,3));c+=3}else{alert("Bad escape combination near ..."+a.substr(c));b+="%[ERROR]";c++}else{b+=d;c++}}return b}function GetElementLeft(a){var b=a.offsetLeft;for(a=a.offsetParent;a!=null;){b+=a.offsetLeft;a=a.offsetParent}return b}
function GetElementTop(a){var b=a.offsetTop;for(a=a.offsetParent;a!=null;){b+=a.offsetTop;a=a.offsetParent}return b}function showFloatSubmenu(a){var b=document.getElementById(a),c=document.getElementById("submenu_"+a);if(b&&c){_mouseOnParent[a]=true;c.style.left=GetElementLeft(b)+b.width;c.style.top=GetElementTop(b);c.style.offsetLeft=GetElementLeft(b)+b.width;c.style.offsetTop=GetElementTop(b);c.style.visibility="visible"}}
function onSubMenu(a){_mouseOnParent[a]=false;_mouseOnSub[a]=true;showFloatSubmenu(a)}function leaveSubMenu(a){_mouseOnParent[a]=false;_mouseOnSub[a]=false;hideFloatSubmenu(a)}function hideFloatSubmenu(a){for(i=0;i<_mouseOnParent.length;i++)if(_mouseOnParent[i]){document.getElementById("submenu_"+i).style.visibility="hidden";_mouseOnSub[i]=false}var b=document.getElementById("submenu_"+a);if(b&&_mouseOnParent[a]==false){b.style.visibility="hidden";_mouseOnSub[a]=false}}
function explode(a,b){var c={0:""};if(arguments.length!=2||typeof arguments[0]=="undefined"||typeof arguments[1]=="undefined")return null;if(a===""||a===false||a===null)return false;if(typeof a=="function"||typeof a=="object"||typeof b=="function"||typeof b=="object")return c;if(a===true)a="1";return b.toString().split(a.toString())}
function explode(a,b){var c={0:""};if(arguments.length!=2||typeof arguments[0]=="undefined"||typeof arguments[1]=="undefined")return null;if(a===""||a===false||a===null)return false;if(typeof a=="function"||typeof a=="object"||typeof b=="function"||typeof b=="object")return c;if(a===true)a="1";return b.toString().split(a.toString())}
function getCheckedValue(a){if(!a)return"undef";var b=a.length;if(b==undefined)return a.checked?a.value:"";for(var c=0;c<b;c++)if(a[c].checked)return a[c].value;return""}function convertor(a){return encodeURIComponent(a)}function noop(){}
function reloadACount(a,b){a=document.getElementById(a);b=document.getElementById(b);if(parseInt(a.value)<0)alert("\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd");else if(parseInt(a.value)>5)alert("\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd 5");else{b.innerHTML=
"";for(i=0;i<a.value;i++)b.innerHTML+="\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd "+(i+1)+'&nbsp;<input type="text" name="answer[]" class="btn" id="answ'+(i+1)+'" value=""><br><Br>'}}loaded=0;
function getWindowWidth(){var a=0,b=0;if(typeof window.innerWidth=="number")a=window.innerWidth;else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))a=document.documentElement.clientWidth;else if(document.body&&(document.body.clientWidth||document.body.clientHeight))a=document.body.clientWidth;return a}
function getWindowHeight(){var a=0;a=0;if(typeof window.innerWidth=="number")a=window.innerHeight;else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight))a=document.documentElement.clientHeight;else if(document.body&&(document.body.clientWidth||document.body.clientHeight))a=document.body.clientHeight;return a}
function im_replace(a,b,c){if(a!=c)if(b){if(document.images&&loaded==1)document.images["im"+a].src=img[a]+".gif"}else if(document.images&&loaded==1)document.images["im"+a].src=img[a]+"_.gif"}
function showGaleryImage(a,b,c,d,e){var f=document.getElementById(e),g=document.getElementById(d);f.innerHTML='<a href="javascript:void(0);" onclick="closeGaleryImage(\''+e+"','"+d+'\');"><img src="'+a+'" border="0"></a>';a=0;if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1)a=20;f.style.left=Math.round(document.body.clientWidth/2-b/2-5);f.style.top=Math.round(document.body.clientHeight/2-c/2-5);g.style.width=document.body.clientWidth-10-a;g.style.Height=document.body.clientHeight-10-a;g.style.left=
5;g.style.top=5;g.style.visibility="visible";f.style.visibility="visible";return false}function closeGaleryImage(a,b){b=document.getElementById(b);a=document.getElementById(a);a.innerHTML="";a.style.visibility="hidden";b.style.visibility="hidden";return false}
var tooltip,tipcss,mouseX,mouseY,dom=document.getElementById?true:false,ns5=!document.all&&dom||window.opera?true:false,ie5=navigator.userAgent.indexOf("MSIE")>-1&&dom?true:false,ie4=document.all&&!dom?true:false,nodyn=!ns5&&!ie4&&!ie5&&!dom?true:false,tipWidth=160,tipFontColor="#000000",tipBgColor="#FFFFFF",tipBorderColor="#BB00BB",tipBorderWidth=3,tipBorderStyle="ridge",tipPadding=4,startStr='<img src="',midStr='" border="0"><Br>',endStr="",origWidth,origHeight;if(nodyn)event="nope";
var t1,t2,tipOn=false,tipFollowMouse=true,offX=20,offY=12,tipFontFamily="Verdana, arial, helvetica, sans-serif",tipFontSize="8pt";function trackMouse(a){standardbody=document.compatMode=="CSS1Compat"?document.documentElement:document.body;mouseX=ns5?a.pageX:window.event.clientX+document.body.scrollLeft;mouseY=ns5?a.pageY:window.event.clientY+document.body.scrollTop;tipOn&&positionTip(a)}
function doTooltip(a,b,c,d){if(tooltip){t1&&clearTimeout(t1);t2&&clearTimeout(t2);tipOn=true;curBgColor=tipBgColor;curFontColor=tipFontColor;a=startStr+a+midStr+'<span style="font-family:'+tipFontFamily+"; font-size:"+tipFontSize+"; color:"+curFontColor+';">'+b+"</span>";tipcss.backgroundColor=curBgColor;tooltip.innerHTML=a;try{tooltip.innerHTML=a}catch(e){alert(e.message)}if(tipFollowMouse)t1=setTimeout("tipcss.visibility='visible'",100);else positionTip(c)}}
function positionTip(a){if(!tipFollowMouse){standardbody=document.compatMode=="CSS1Compat"?document.documentElement:document.body;mouseX=ns5?a.pageX:window.event.clientX+document.body.scrollLeft;mouseY=ns5?a.pageY:window.event.clientY+document.body.scrollTop}a=ie4||ie5?tooltip.clientWidth:tooltip.offsetWidth;var b=ie4||ie5?tooltip.clientHeight:tooltip.offsetHeight,c=ns5?window.innerHeight-20+window.pageYOffset:document.body.clientHeight+document.body.scrollTop;tipcss.left=mouseX+offX+a>(ns5?window.innerWidth-
20+window.pageXOffset:document.body.clientWidth+document.body.scrollLeft)?mouseX-(a+offX)+"px":mouseX+offX+"px";tipcss.top=mouseY+offY+b>c?c-(b+offY)+"px":mouseY+offY+"px";window.status="POS: "+mouseX+":"+mouseY+" == "+tipcss.left+":"+tipcss.top;if(!tipFollowMouse)tipcss.visibility="visible"}function hideTip(){if(tooltip){t2=setTimeout("tipcss.visibility='hidden'",100);tipcss.visibility="hidden";tipOn=false}}
function initTip(){if(!nodyn){tooltip=ie4?document.all.tipDiv:ie5||ns5?document.getElementById("tipDiv"):null;tipcss=tooltip.style;if(ie4||ie5||ns5){tipcss.width=tipWidth+"px";tipcss.fontFamily=tipFontFamily;tipcss.fontSize=tipFontSize;tipcss.color=tipFontColor;tipcss.backgroundColor=tipBgColor;tipcss.borderColor=tipBorderColor;tipcss.borderWidth=tipBorderWidth+"px";tipcss.padding=tipPadding+"px";tipcss.borderStyle=tipBorderStyle}if(tooltip&&tipFollowMouse)document.onmousemove=trackMouse}}
function selectMode(a,b,c,d){c=a.elements[c];d=a.elements[d];if(a.elements[b].checked==true){d.style.display="block";c.style.display="none"}else{d.style.display="none";c.style.display="block"}}function setCheckboxes(a,b){a=document.forms[a].elements["selected_item[]"];var c=typeof a.length!="undefined"?a.length:0;if(c)for(var d=0;d<c;d++)a[d].checked=b;else a.checked=b;return true}
function selectAll(a,b){a=document.getElementById(a).options;var c=typeof a.length!="undefined"?a.length:0;if(c)for(var d=0;d<c;d++)a[d].selected=b;else a.selected=b;return true}function setCheckboxesEx(a,b){b=document.forms[a].elements[b];a=document.forms[a].elements["selected_item[]"];var c=typeof a.length!="undefined"?a.length:0;if(c)for(var d=0;d<c;d++)a[d].checked=b.checked;else a.checked=b.checked;return true}
function onlyDigits(a,b){a=document.forms[a].elements[b];if(b=typeof a.value.length!="undefined"?a.value.length:0){nnil=new String("0");ordnil=nnil.charCodeAt(0);nnine=new String("9");ordnine=nnine.charCodeAt(0);ndot=new String(".");orddot=ndot.charCodeAt(0);for(var c=0;c<b;c++){var d=a.value.charAt(c),e=a.value.charCodeAt(c);l=new String(a.value);myReg=new RegExp(d,"gi");if((e<ordnil||e>ordnine)&&e!=orddot)a.value=l.replace(myReg,"")}}}
function onlyDigitsID(a){a=document.getElementById(a);var b=typeof a.value.length!="undefined"?a.value.length:0;if(b){nnil=new String("0");ordnil=nnil.charCodeAt(0);nnine=new String("9");ordnine=nnine.charCodeAt(0);ndot=new String(".");orddot=ndot.charCodeAt(0);for(var c=0;c<b;c++){var d=a.value.charAt(c),e=a.value.charCodeAt(c);l=new String(a.value);myReg=new RegExp(d,"gi");if((e<ordnil||e>ordnine)&&e!=orddot)a.value=l.replace(myReg,"")}}}
function chSelectState(a,b,c){document.forms[a].elements[b].disabled=c}function chSelectStatewithText(a,b,c,d){c=document.forms[a].elements[c];document.forms[a].elements[b].disabled=d;c.disabled=!d}
function checkEmpty(a){for(i=0;i<a.elements.length;i++)if(a.elements[i].type=="text")if(a.elements[i].value==""){alert("Должны быть заполнены все обязательные поля!");return false}return true}
function chkemp(){lent=chkemp.arguments;if(lent.length!=0){var a=lent[0];for(i=0;i<a.elements.length;i++)if(a.elements[i].type=="text")for(j=1;j<lent.length;j++)if(a.elements[i].name==lent[j])if(a.elements[i].value==""){alert("Должны быть заполнены все обязательные поля!");return false}if(document.getElementById(lent[lent.length-1]).value==""){alert("Должны быть заполнены все обязательные поля!");
return false}return true}}
function chkempID(){lent=chkempID.arguments;if(lent.length!=0){for(i=0;i<chkempID.arguments.length;i++){var a=document.getElementById(chkempID.arguments[i]);if(a.type=="text")for(j=1;j<lent.length;j++){if(a.id==lent[j])if(a.value==""){alert("Должны быть заполнены все обязательные поля!");return false}}else if(a.type=="select-one"){if(a.value=="-1"){alert("Должны быть заполнены все обязательные поля!");return false}}else if(a.type==
"textarea")if(a.value==""){alert("Должны быть заполнены все обязательные поля!");return false}}if(document.getElementById(lent[lent.length-1]).value==""){alert("Должны быть заполнены все обязательные поля!");return false}return true}}
function submForminNewWin(a,b,c,d){var e="";for(i=0;i<a.elements.length;i++)e+=a.elements[i].name+"="+a.elements[i].value+"&";w1=window.open(b+"?"+e,"","toolbar=no, width="+c+", height="+d+", location=no, status=yes, menubar=yes, scrollbars=yes, resizable=yes");return false}function changeSelectItem(a,b){a.submit();return true}function noop(){}function filterChildBox(a,b,c){b=document.getElementById(b);var d=document.getElementById(c);ajSearchBrandsByClass(a,b.value,c)}
function gotoSelectItem(a,b){a=document.getElementById(a);document.location=b+"_item/"+a.value+"/";return true}function changeFieldVisible(a,b,c,d,e){a=document.getElementById(b);if(document.getElementById(c).type=="select-one"){val="pelt.selectedIndex";pval=parseInt(d)}else{val="pelt.value";pval=escape(d)}str="var result = "+val+e+pval+";";eval(str);a.style.display=result?"block":"none"}
function changeFieldEnableByCheckbox(a,b,c,d){a=document.getElementById(a);b=document.getElementById(b);a.disabled=!b.checked}function changeFieldEnable(a,b,c,d,e){b=document.forms[a].elements[b];if(document.forms[a].elements[c].type=="select-one"){val="pelt.selectedIndex";pval=parseInt(d)}else{val="pelt.value";pval=escape(d)}str="var result = "+val+e+pval+";";eval(str);b.disabled=result?true:false}
function setExtLink(a,b){a=document.getElementById(a);b=document.getElementById(b);if(a.type=="checkbox")b.readonly=!a.checked}function clearField(a){a=document.getElementById(a);if(a.type=="text")a.value=""}
function checkPasswordStrength(a,b){b=document.getElementById(a);a=document.getElementById("pline_"+a);a.src=b.value.length<5?"http://static1.beautyrate.ru/images/common/red_pline.gif":b.value.length>=5&&b.value.length<=8?"http://static2.beautyrate.ru/images/common/yellow_pline.gif":"http://static0.beautyrate.ru/images/common/green_pline.gif";a.width=8*(b.value.length+1);a.Height=8}
function checkPasswordIdentity(a,b,c,d){var e=document.getElementById(a);b=document.getElementById(b);a=document.getElementById("img_"+a);if(e.value==b.value){a.src="http://static5.beautyrate.ru/images/common/passok.gif";a.alt=c}else{a.src="http://static1.beautyrate.ru/images/common/passno.gif";a.alt=d}}
function resetPasswdCheckers(a){for(i=0;i<a.elements.length;i++)if(a.elements[i].type=="password"){var b=document.getElementById("pline_"+a.elements[i].name);if(b){b.src="http://static0.beautyrate.ru/images/common/passline.gif";b.width=1;b.Height=8}if(b=document.getElementById("img_"+a.elements[i].name))b.src="http://static3.beautyrate.ru/images/common/passno.gif"}}function resetPasswdIdentity(a){document.getElementById("img_"+a).src="http://static4.beautyrate.ru/images/common/passno.gif"}
function deleteDictToLink(a){var b=document.getElementById(a);a=document.getElementById(a+"null");if((a.type=="select-one"||a.type=="select-multiple")&&a.options){a.options[a.options.selectedIndex]=null;b.value="";for(i=0;i<a.options.length;i++)b.value+=","+a.options[i].value}}function intValue(a){return a==false?0:1}
function showCodeBlock(a,b,c,d){c=document.getElementById(c);d=0;if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1)d=20;c.style.width=a;c.style.Height=b;c.style.left=Math.round(document.body.clientWidth/2);c.style.top=Math.round(document.body.clientHeight-b/2-d-5);c.style.visibility="visible";return false}function closeCodeBlock(a){document.getElementById(a).style.visibility="hidden";return false}function setCursor(a){document.body.style.cursor=a=="HAND"?"hand":"default"}
function switchCBState(a,b){b=document.getElementById(b);a=document.getElementsByName(a);if(typeof a.length!="undefined"?a.length:0)for(var c=0;c<a.length;c++)a[c].checked=b.checked};
pad = function(l, s, t)
{
  if ((l -= this.length) > 0)
  {
    if (!s) s = " ";//по умолчанию строка заполнитель - пробел
    if (t==null) t = 1;//по умолчанию тип заполнения справа
  
    s = s.repeat(Math.ceil(l / s.length));
    var i = t==0 ? l : (t == 1? 0 : Math.floor(l / 2));
    s= s.substr(0, i) + this + s.substr(0, l - i);
  
    return s;
  }
  else return this;
}

//повторить заданную строку n раз
repeat = function(n)
{
  return new Array( n + 1 ).join(this);
}
cut = function(from,what)
{
	
	return from.replace(whar,'');
}
function ltrim(str) { 
	for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
	return str.substring(k, str.length);
}
function rtrim(str) {
	for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
	return str.substring(0,j+1);
}
function trim(str) {
	return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
	var whitespaceChars = " \t\n\r\f";
	return (whitespaceChars.indexOf(charToCheck) != -1);
}

