function d(a){return document.getElementById(a)}function unmaskPassword(h){var a=document.getElementById(h);var g=document.getElementById(h+"unmask");try{if(g.checked){var c=document.createElement('<input type="text" name="'+a.name+'">')}else{var c=document.createElement('<input type="password" name="'+a.name+'">')}c.attributes["class"].nodeValue=a.attributes["class"].nodeValue}catch(f){var c=document.createElement("input");c.setAttribute("name",a.name);if(g.checked){c.setAttribute("type","text")}else{c.setAttribute("type","password")}c.setAttribute("class",a.getAttribute("class"))}c.id=a.id;c.size=a.size;c.onblur=a.onblur;c.onchange=a.onchange;c.value=a.value;a.parentNode.replaceChild(c,a)}function addClass(c,a){if(hasClass(c,a)){return}c.className+=" "+a}function removeClass(g,c){if(g.className==null){return}var f=g.className.split(" ");var a=[];var h=false;for(var e=0;e<f.length;e++){if(f[e]!=c){if(f[e]){a.push(f[e])}}else{h=true}}if(h){g.className=a.join(" ")}}function hasClass(f,a){if(f==null||f.className==null){return false}var e=f.className.split(" ");for(var c=0;c<e.length;c++){if(e[c]==a){return true}}return false}function setFocus(a){a=document.getElementById(a);if(a){a.focus()}}function highlight(a){a.focus();a.select()}function isNullorEmpty(a){if(a&&a.toString().length>0){return false}else{return true}}function _rc(f,e,a,c){if(isNullorEmpty(f.value)||isNullorEmpty(e.value)||f.value!=e.value){removeClass(f,a);addClass(f,c);removeClass(e,a);addClass(e,c);f.focus();return false}else{removeClass(f,c);addClass(f,a);removeClass(e,c);addClass(e,a);return true}}function _rcl(j,h,e,g,c,k){var f=d(c);var a=d(k);if(isNullorEmpty(j.value)||isNullorEmpty(h.value)||j.value!=h.value){removeClass(j,e);addClass(j,g);removeClass(h,e);addClass(h,g);if(f){f.style.color="red"}if(a){a.style.color="red"}j.focus();return false}else{removeClass(j,g);addClass(j,e);removeClass(h,g);addClass(h,e);if(f){f.style.color="black"}if(a){a.style.color="black"}return true}}function _rvl(g,a,e,f){var c=d(f);if(isNullorEmpty(g.value)){removeClass(g,a);addClass(g,e);if(c){c.style.color="red"}g.focus();return false}else{removeClass(g,e);addClass(g,a);if(c){c.style.color="black"}return true}}function _rv(e,a,c){if(isNullorEmpty(e.value)){removeClass(e,a);addClass(e,c);e.focus();return false}else{removeClass(e,c);addClass(e,a);return true}}function showAd(f,a){var c=document.getElementById(a);var e=document.getElementById(f);if(c&&e){c.innerHTML=e.innerHTML}}function _ri(g,h,a,c){var e=unescape(g.value);var f=new RegExp(h);match=f.exec(e);if(match==null||match[0]==""){removeClass(g,a);addClass(g,c);return false}else{removeClass(g,c);addClass(g,a);return true}}function createXmlHttp(){if(window.XMLHttpRequest){var a=new XMLHttpRequest();if(a.readyState!=null&&typeof(a.onreadystatechange)!="undefined"){return a}}else{try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}return null}function displayHTML(c){var a=pbform.txtCustomCode.value;win=window.open(", ","popup","toolbar = no, status = no");win.document.write(""+a+"")}function checkme(){var a=document.getElementById("agrValidator");if(!document.signup.ChkTerms.checked){if(a){a.style.display="block";return false}}else{if(a){a.style.display="none";return true}}}function agreement(){window.open("Agreement.aspx","Persianblog","width=530,height=600,toolbar=no,scrollbars=yes");return false}var IE4=document.all;var NS6=document.getElementById&&!document.all;var disappearDelay=500;function DynamicHide(a,c){if((IE4&&!a.contains(c.toElement))||(NS6&&c.currentTarget!=c.relatedTarget&&!NS6_Contains(c.currentTarget,c.relatedTarget))){InitTimer(a)}}function HideObject(c){var a=document.getElementById(c);if(typeof a!="undefined"){if(IE4||NS6){a.style.visibility="hidden";a.style.display="none"}}}function ReleaseTimer(a){if(typeof a!="undefined"){if(typeof a.HideTimer!="undefined"){clearTimeout(a.HideTimer)}}}function InitTimer(a){if(typeof a!="undefined"){var c='HideObject( "'+a.getAttribute("id")+'" )';a.HideTimer=setTimeout(c,disappearDelay)}}function NS6_Contains(e,c){while(c.parentNode){if((c=c.parentNode)==e){return true}}return false}function ToggleSendToFriend(){sendToFriendForm=document.getElementById("SendToFriendForm");sendToFriendButton=document.getElementById("SendToFriendButton");if(sendToFriendForm.style.visibility=="hidden"){sendToFriendForm.style.visibility="visible";sendToFriendForm.style.display="block"}else{sendToFriendForm.style.visibility="hidden";sendToFriendForm.style.display="none"}sendToFriendForm.style.left=getposOffset(sendToFriendButton,"left")-(sendToFriendForm.offsetWidth/2)+(sendToFriendButton.offsetWidth/2);sendToFriendForm.style.top=getposOffset(sendToFriendButton,"top")+sendToFriendButton.offsetHeight}function ToggleAddComment(){commentMenu=document.getElementById("CommentMenu");commentButton=document.getElementById("CommentButton");commentMenu.style.left=getposOffset(commentButton,"left");commentMenu.style.top=getposOffset(commentButton,"top")+commentButton.offsetHeight;if(commentMenu.style.visibility=="hidden"){commentMenu.style.visibility="visible";commentMenu.style.display="block"}else{commentMenu.style.visibility="hidden";commentMenu.style.display="none"}}function ToggleGalleryThumbnail(a){largeThumbDiv=document.getElementById("SecondaryThumbDiv"+a);smallThumb=document.getElementById("SmallThumb"+a);if(largeThumbDiv.className=="secondaryThumbnailHidden"){largeThumbDiv.className="secondaryThumbnailPopup";largeThumbDiv.style.left=getposOffset(smallThumb,"left")-((largeThumbDiv.offsetWidth-smallThumb.offsetWidth)/2)+"px";largeThumbDiv.style.top=getposOffset(smallThumb,"top")-((largeThumbDiv.offsetHeight-smallThumb.offsetHeight)/2)+"px";setTimeout(function(){largeThumbDiv.style.visibility="visible"},5)}else{largeThumbDiv.className="secondaryThumbnailHidden"}}function ToggleRateMenu(){rateMenu=document.getElementById("RateMenu");rateButton=document.getElementById("RateButton");rateMenu.style.left=getposOffset(rateButton,"left");rateMenu.style.top=getposOffset(rateButton,"top")+rateButton.offsetHeight;if(rateMenu.style.visibility=="hidden"){rateMenu.style.visibility="visible";rateMenu.style.display="block"}else{rateMenu.style.visibility="hidden";rateMenu.style.display="none"}if(window.event){event.cancelBubble=true}ReleaseTimer(rateMenu)}function ToggleRatePostMenu(a){rateButton=a.parentNode;rateMenu=rateButton.nextSibling.nextSibling;if((rateButton.id!="RateButton")||(rateMenu.id!="RateMenu")){return}rateMenu.style.left=getposOffset(rateButton,"left");rateMenu.style.top=getposOffset(rateButton,"top")+rateButton.offsetHeight;if(rateMenu.style.visibility=="hidden"){rateMenu.style.visibility="visible";rateMenu.style.display="block"}else{rateMenu.style.visibility="hidden";rateMenu.style.display="none"}if(window.event){event.cancelBubble=true}ReleaseTimer(rateMenu)}function ToggleSearchMenu(){searchMenu=document.getElementById("SearchMenu");searchButton=document.getElementById("SearchButton");searchMenu.style.left=getposOffset(searchButton,"left");searchMenu.style.top=getposOffset(searchButton,"top")+searchButton.offsetHeight;if(searchMenu.style.visibility=="hidden"){searchMenu.style.visibility="visible";searchMenu.style.display="block"}else{searchMenu.style.visibility="hidden";searchMenu.style.display="none"}}function getposOffset(f,e){var c=(e=="left")?f.offsetLeft:f.offsetTop;var a=f.offsetParent;while(a!=null){c=(e=="left")?c+a.offsetLeft:c+a.offsetTop;a=a.offsetParent}return c}function ToggleMenuOnOff(a){var c=document.getElementById(a);if(c.style.display=="none"){c.style.display="block"}else{c.style.display="none"}}function OpenWindow(a){window.open(a,"_Child","toolbar=no,scrollbars=yes,resizable=yes,width=400,height=400")}function OpenPostWindow(a){window.open(a,"_Child","resizable=yes,width=500,height=700")}function PlayMovie(a){if(IE4){var f=document.getElementById("PlayerPreview"+a);var c=document.getElementById("Player"+a);var e=document.getElementById("PlayerLink"+a);if(c.playState==2){c.controls.play();e.className="CommonVideoPauseButton";e.href="#";e.onclick=new Function("PauseMovie("+a+"); return false;")}else{if(c.playState!=3){f.style.display="none";c.style.display="inline";c.uiMode="none";c.controls.play();window.setTimeout("UpdateMovieState("+a+");",249)}}}}function StopMovie(a){if(IE4){var c=document.getElementById("Player"+a);var e=document.getElementById("PlayerLink"+a);if(c.playState>1){c.controls.stop();e.style.visibility="visible";e.className="CommonVideoPlayButton";e.href="#";e.onclick=new Function("PlayMovie("+a+"); return false;")}}}function PauseMovie(a){if(IE4){var f=document.getElementById("PlayerPreview"+a);var c=document.getElementById("Player"+a);var e=document.getElementById("PlayerLink"+a);if(c.playState!=2){c.controls.pause();e.className="CommonVideoPlayButton";e.href="#";e.onclick=new Function("PlayMovie("+a+"); return false;")}}}function UpdateMovieState(a){if(IE4){var e=document.getElementById("Player"+a);var c=document.getElementById("PlayerStatus"+a);var f=document.getElementById("PlayerLink"+a);if(e.playState<=1||e.playState==10){var g=document.getElementById("PlayerPreview"+a);var f=document.getElementById("PlayerLink"+a);g.style.display="inline";e.style.display="none";f.style.visibility="visible";f.className="CommonVideoPlayButton";f.href="#";f.onclick=new Function("PlayMovie("+a+"); return false;");c.innerHTML="00:00 / "+e.currentMedia.durationString}else{c.innerHTML=e.controls.currentPositionString+" / "+e.currentMedia.durationString;if(e.playState!=2){if(e.controls.isAvailable("Pause")){f.className="CommonVideoPauseButton";f.href="#";f.onclick=new Function("PauseMovie("+a+"); return false;")}else{f.className="CommonVideoPlayButton";f.href="#";f.onclick=new Function("return false;")}}else{f.className="CommonVideoPlayButton";f.href="#";f.onclick=new Function("PlayMovie("+a+"); return false;")}window.setTimeout("UpdateMovieState("+a+");",999)}}}function MakeKeepAliveRequest(){if(!KeepAliveUrl){return}if(KeepAliveTimer!=null){window.clearTimeout(KeepAliveTimer)}var a=null;if(typeof XMLHttpRequest!="undefined"){a=new XMLHttpRequest()}else{try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){}}}try{a.open("GET",KeepAliveUrl,false,"","");a.send(null)}catch(c){}KeepAliveTimer=window.setTimeout(MakeKeepAliveRequest,599999)}function DetermineKeepAliveUrl(){var a=document.getElementsByTagName("SCRIPT");var e;var c;for(e=0;e<a.length;e++){c=a[e].src.toLowerCase();if(c.indexOf("utility/global.js")!=-1){return c.replace("utility/global.js","utility/keepalive.aspx")}}return null}var KeepAliveUrl=DetermineKeepAliveUrl();var KeepAliveTimer=window.setTimeout(MakeKeepAliveRequest,599999);function ShowEditBlock(a){a.className="CommonContentPartBorderOn"}function HideEditBlock(a){a.className="CommonContentPartBorderOff"}function getCookie(e){var c=""+document.cookie;var f=c.indexOf(e);if(c==""||f==-1){return""}var a=c.indexOf(";",f);if(a==-1){a=c.length}return unescape(c.substring(f+e.length+1,a))}function setCookie(c,a){document.cookie=c+"="+escape(a)+";path=/;"}function setCookieForever(c,a){document.cookie=c+"="+escape(a)+";path=/;expires=Fri, 1 Jan 2010 00:00:00 GMT;"}function inLineEditOn(a){a.className="CommonInlineEditOn"}function inLineEditOff(a){a.className="CommonInlineEditOff"}function Ajax_GetXMLHttpRequest(){if(window.XMLHttpRequest){return new XMLHttpRequest()}else{if(window.Ajax_XMLHttpRequestProgID){return new ActiveXObject(window.Ajax_XMLHttpRequestProgID)}else{var c=["Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];for(var f=0;f<c.length;++f){var g=c[f];try{var a=new ActiveXObject(g);window.Ajax_XMLHttpRequestProgID=g;return a}catch(h){}}}}return null}function Ajax_CallBack(type,id,method,args,clientCallBack,debugRequestText,debugResponseText,debugErrors,includeControlValuesWithCallBack,url){var x=Ajax_GetXMLHttpRequest();var result=null;if(!x){result={value:null,error:"NOXMLHTTP"};if(debugErrors){alert("error: "+result.error)}if(clientCallBack){clientCallBack(result)}return result}x.open("POST",url,clientCallBack?true:false);x.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");if(clientCallBack){x.onreadystatechange=function(){var result=null;if(x.readyState!=4){return}if(debugResponseText){alert(x.responseText)}try{var result=eval("("+x.responseText+")");if(debugErrors&&result.error){alert("error: "+result.error)}}catch(err){if(window.confirm("The following error occured while processing an AJAX request: "+err.message+"\n\nWould you like to see the response?")){var w=window.open();w.document.open("text/plain");w.document.write(x.responseText);w.document.close()}result=new Object();result.error="An AJAX error occured.  The response is invalid."}clientCallBack(result)}}var encodedData="Ajax_CallBackType="+type;if(id){encodedData+="&Ajax_CallBackID="+id.split("$").join(":")}encodedData+="&Ajax_CallBackMethod="+method;if(args){for(var i in args){encodedData+="&Ajax_CallBackArgument"+i+"="+encodeURIComponent(args[i])}}if(includeControlValuesWithCallBack&&document.forms.length>0){var form=document.forms[0];for(var i=0;i<form.length;++i){var element=form.elements[i];if(element.name){var elementValue=null;if(element.nodeName=="INPUT"){var inputType=element.getAttribute("TYPE").toUpperCase();if(inputType=="TEXT"||inputType=="PASSWORD"||inputType=="HIDDEN"){elementValue=element.value}else{if(inputType=="CHECKBOX"||inputType=="RADIO"){if(element.checked){elementValue=element.value}}}}else{if(element.nodeName=="SELECT"){elementValue=element.value}else{if(element.nodeName=="TEXTAREA"){elementValue=element.value}}}if(elementValue){encodedData+="&"+element.name+"="+encodeURIComponent(elementValue)}}}}if(debugRequestText){alert(encodedData)}x.send(encodedData);if(!clientCallBack){if(debugResponseText){alert(x.responseText)}result=eval("("+x.responseText+")");if(debugErrors&&result.error){alert("error: "+result.error)}}delete x;return result}function $(){var e=new Array();for(var c=0;c<arguments.length;c++){var a=arguments[c];if(typeof a=="string"){a=document.getElementById(a)}if(arguments.length==1){return a}e.push(a)}return e}var Element={toggle:function(){for(var c=0;c<arguments.length;c++){var a=$(arguments[c]);a.style.display=(a.style.display=="none"?"":"none")}},hide:function(){for(var c=0;c<arguments.length;c++){var a=$(arguments[c]);a.style.display="none"}},show:function(){for(var c=0;c<arguments.length;c++){var a=$(arguments[c]);a.style.display=""}},remove:function(a){a=$(a);a.parentNode.removeChild(a)},getHeight:function(a){a=$(a);return a.offsetHeight}};function initBtn(c){var a=document.getElementById(c);if(a){a.onmouseover=function(){this.style.backgroundPosition="0px -23px"};a.onmouseout=function(){this.style.backgroundPosition="0px 0px"}}}function initBtns(){var a=document.getElementsByTagName("input");for(i=0;i<a.length;i++){b=a[i];if(b&&b.parentNode&&b.parentNode.className&&(b.parentNode.className=="bt2"||b.parentNode.className=="bt1")){b.onmouseover=function(){this.style.backgroundPosition="0px -23px"};b.onmouseout=function(){this.style.backgroundPosition="0px 0px"}}}}function refreshCMD(){var a=document.getElementById("dvCMD");var c=document.getElementById("cmdCount");if(commands>0){c.innerHTML=commands;a.style.visibility="visible"}else{commands=0;c.innerHTML=commands;a.style.visibility="hidden"}};
