var Check=0;var Before;var maxlimit=250;var Text;var ent;var posx=0;var posy=0;var offsetX=16;var offsetY=16;var popUp=false;var testObj;var doneArray=new Array(20);var pres=0;var commentid;var wid;var clicked=false;var done=0;var reply=0;var upPath;var usr_uid;var usr_msg;var arrHint=new Array();var catExp=new Array();var catCount=0;var imagesPath="templates/Default/images/form/";var selectRightWidthSimple=19;var selectRightWidthScroll=2;var selectMaxHeight=200;var textareaTopPadding=10;var textareaSidePadding=10;var NF=new Array();var isIE=false;var resizeTest=1;var arrHint=new Array();function FindAdmin()
{if(document.getElementById("admin_username").value==""||document.getElementById("admin_username").value==null)
return false;document.getElementById("loader").style.display="table-cell";var URL='index.php?act=main&do=do_admin&username='+document.getElementById("admin_username").value;Request('GET',URL,'AdminResult');return false;}
function bookmark(url,title)
{if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4)){window.external.AddFavorite(url,title);}else if(navigator.appName=="Netscape"){window.sidebar.addPanel(title,url,"");}else{alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");}}
function Email()
{var to=escape(document.getElementById("email").value);var url="../index.php?act=user&mode=email&wid="+wid+"&recipient="+to;var html=Request("GET",url,"FinishedEmail");return false;}
function FinishedEmail()
{alert(responseHTML);}
function AdminResult()
{document.getElementById("admin_id").innerHTML=responseHTML;}
function addLoadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func;}else{window.onload=function(){oldonload();func();}}}
function setCookie(c_name,value,expiredays)
{var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+
((expiredays==null)?"":";expires="+exdate.toGMTString())+";path=/;";}
function getCookie(c_name)
{if(document.cookie.length>0)
{c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1)
{c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}
function prepareInputsForHints(){var inputs=document.getElementsByTagName("input");for(var i=0;i<inputs.length;i++){if(inputs[i].parentNode.getElementsByTagName("span")[0]){inputs[i].onfocus=function(){this.parentNode.getElementsByTagName("span")[0].style.display="inline";}
inputs[i].onblur=function(){this.parentNode.getElementsByTagName("span")[0].style.display="none";}}}
var selects=document.getElementsByTagName("select");for(var k=0;k<selects.length;k++){if(selects[k].parentNode.getElementsByTagName("span")[0]){selects[k].onfocus=function(){this.parentNode.getElementsByTagName("span")[0].style.display="inline";}
selects[k].onblur=function(){this.parentNode.getElementsByTagName("span")[0].style.display="none";}}}}
addLoadEvent(prepareInputsForHints);function in_array(needle,haystack,argStrict){var key='',strict=!!argStrict;if(strict){for(key in haystack){if(haystack[key]===needle){return true;}}}else{for(key in haystack){if(haystack[key]==needle){return true;}}}
return false;}
function NFInit(){if(!document.getElementById('nf')){return;}
try{document.execCommand('BackgroundImageCache',false,true);}catch(e){}
if(!document.getElementById){return false;}
NFDo('start');}
function NFDo(what){var niceforms=document.getElementsByTagName('form');var identifier=new RegExp('(^| )'+'niceform'+'( |$)');if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var ieversion=new Number(RegExp.$1);if(ieversion<7){return false;}
isIE=true;}
for(var q=0;q<niceforms.length;q++){if(identifier.test(niceforms[q].className)){if(what=="start"){NF[q]=new niceform(niceforms[q]);niceforms[q].start();}
else{niceforms[q].unload();NF[q]="";}}}}
function NFFix(){NFDo('stop');NFDo('start');}
function niceform(nf){nf._inputText=new Array();nf._inputRadio=new Array();nf._inputCheck=new Array();nf._inputSubmit=new Array();nf._inputFile=new Array();nf._textarea=new Array();nf._select=new Array();nf._multiselect=new Array();nf.add_inputText=function(obj){this._inputText[this._inputText.length]=obj;inputText(obj);}
nf.add_inputRadio=function(obj){this._inputRadio[this._inputRadio.length]=obj;inputRadio(obj);}
nf.add_inputCheck=function(obj){this._inputCheck[this._inputCheck.length]=obj;inputCheck(obj);}
nf.add_inputSubmit=function(obj){this._inputSubmit[this._inputSubmit.length]=obj;inputSubmit(obj);}
nf.add_inputFile=function(obj){this._inputFile[this._inputFile.length]=obj;inputFile(obj);}
nf.add_textarea=function(obj){this._textarea[this._textarea.length]=obj;textarea(obj);}
nf.add_select=function(obj){this._select[this._select.length]=obj;selects(obj);}
nf.add_multiselect=function(obj){this._multiselect[this._multiselect.length]=obj;multiSelects(obj);}
nf.start=function(){var allInputs=this.getElementsByTagName('input');for(var w=0;w<allInputs.length;w++){switch(allInputs[w].type){case"text":case"password":{this.add_inputText(allInputs[w]);break;}
case"radio":{this.add_inputRadio(allInputs[w]);break;}
case"checkbox":{this.add_inputCheck(allInputs[w]);break;}
case"submit":case"reset":case"button":{this.add_inputSubmit(allInputs[w]);break;}
case"file":{this.add_inputFile(allInputs[w]);break;}}}
var allButtons=this.getElementsByTagName('button');for(var w=0;w<allButtons.length;w++){this.add_inputSubmit(allButtons[w]);}
var allTextareas=this.getElementsByTagName('textarea');for(var w=0;w<allTextareas.length;w++){this.add_textarea(allTextareas[w]);}
var allSelects=this.getElementsByTagName('select');for(var w=0;w<allSelects.length;w++){if(allSelects[w].size=="1"){this.add_select(allSelects[w]);}
else{this.add_multiselect(allSelects[w]);}}
for(w=0;w<this._inputText.length;w++){this._inputText[w].init();}
for(w=0;w<this._inputRadio.length;w++){this._inputRadio[w].init();}
for(w=0;w<this._inputCheck.length;w++){this._inputCheck[w].init();}
for(w=0;w<this._inputSubmit.length;w++){this._inputSubmit[w].init();}
for(w=0;w<this._inputFile.length;w++){this._inputFile[w].init();}
for(w=0;w<this._textarea.length;w++){this._textarea[w].init();}
for(w=0;w<this._select.length;w++){this._select[w].init(w);}
for(w=0;w<this._multiselect.length;w++){this._multiselect[w].init(w);}}
nf.unload=function(){for(w=0;w<this._inputText.length;w++){this._inputText[w].unload();}
for(w=0;w<this._inputRadio.length;w++){this._inputRadio[w].unload();}
for(w=0;w<this._inputCheck.length;w++){this._inputCheck[w].unload();}
for(w=0;w<this._inputSubmit.length;w++){this._inputSubmit[w].unload();}
for(w=0;w<this._inputFile.length;w++){this._inputFile[w].unload();}
for(w=0;w<this._textarea.length;w++){this._textarea[w].unload();}
for(w=0;w<this._select.length;w++){this._select[w].unload();}
for(w=0;w<this._multiselect.length;w++){this._multiselect[w].unload();}}}
function inputText(el){el.oldClassName=el.className;el.left=document.createElement('img');el.left.src=imagesPath+"0.png";el.left.className="NFTextLeft";el.right=document.createElement('img');el.right.src=imagesPath+"0.png";el.right.className="NFTextRight";el.dummy=document.createElement('div');el.dummy.className="NFTextCenter";el.onfocus=function(){if(in_array(el.id,arrHint)){document.getElementById("hint_"+el.id).style.display='inherit';}
this.dummy.className="NFTextCenter NFh";this.left.className="NFTextLeft NFh";this.right.className="NFTextRight NFh";}
el.onblur=function(){if(in_array(el.id,arrHint)){document.getElementById("hint_"+el.id).style.display='none';}
this.dummy.className="NFTextCenter";this.left.className="NFTextLeft";this.right.className="NFTextRight";}
el.init=function(){this.parentNode.insertBefore(this.left,this);this.parentNode.insertBefore(this.right,this.nextSibling);this.dummy.appendChild(this);this.right.parentNode.insertBefore(this.dummy,this.right);this.className="NFText";}
el.unload=function(){this.parentNode.parentNode.appendChild(this);this.parentNode.removeChild(this.left);this.parentNode.removeChild(this.right);this.parentNode.removeChild(this.dummy);this.className=this.oldClassName;}}
function inputRadio(el){el.oldClassName=el.className;el.dummy=document.createElement('div');if(el.checked){el.dummy.className="NFRadio NFh";}
else{el.dummy.className="NFRadio";}
el.dummy.ref=el;if(isIE==false){el.dummy.style.left=findPosX(el)+'px';el.dummy.style.top=findPosY(el)+'px';}
else{el.dummy.style.left=findPosX(el)+4+'px';el.dummy.style.top=findPosY(el)+4+'px';}
el.dummy.onclick=function(){if(!this.ref.checked){var siblings=getInputsByName(this.ref.name);for(var q=0;q<siblings.length;q++){siblings[q].checked=false;siblings[q].dummy.className="NFRadio";}
this.ref.checked=true;this.className="NFRadio NFh";}}
el.onclick=function(){if(this.checked){var siblings=getInputsByName(this.name);for(var q=0;q<siblings.length;q++){siblings[q].dummy.className="NFRadio";}
this.dummy.className="NFRadio NFh";}}
el.onfocus=function(){this.dummy.className+=" NFfocused";}
el.onblur=function(){this.dummy.className=this.dummy.className.replace(/ NFfocused/g,"");}
el.init=function(){this.parentNode.insertBefore(this.dummy,this);el.className="NFhidden";}
el.unload=function(){this.parentNode.removeChild(this.dummy);this.className=this.oldClassName;}}
function inputCheck(el){el.oldClassName=el.className;el.dummy=document.createElement('img');el.dummy.src=imagesPath+"0.png";if(el.checked){el.dummy.className="NFCheck NFh";}
else{el.dummy.className="NFCheck";}
el.dummy.ref=el;if(isIE==false){el.dummy.style.left=findPosX(el)+'px';el.dummy.style.top=findPosY(el)+'px';}
else{el.dummy.style.left=findPosX(el)+4+'px';el.dummy.style.top=findPosY(el)+4+'px';}
el.dummy.onclick=function(){if(!this.ref.checked){this.ref.checked=true;this.className="NFCheck NFh";}
else{this.ref.checked=false;this.className="NFCheck";}}
el.onclick=function(){if(this.checked){this.dummy.className="NFCheck NFh";}
else{this.dummy.className="NFCheck";}}
el.onfocus=function(){this.dummy.className+=" NFfocused";}
el.onblur=function(){this.dummy.className=this.dummy.className.replace(/ NFfocused/g,"");}
el.init=function(){this.parentNode.insertBefore(this.dummy,this);el.className="NFhidden";}
el.unload=function(){this.parentNode.removeChild(this.dummy);this.className=this.oldClassName;}}
function inputSubmit(el){el.oldClassName=el.className;el.left=document.createElement('img');el.left.className="NFButtonLeft";el.left.src=imagesPath+"0.png";el.right=document.createElement('img');el.right.src=imagesPath+"0.png";el.right.className="NFButtonRight";el.onmouseover=function(){this.className="NFButton NFh";this.left.className="NFButtonLeft NFh";this.right.className="NFButtonRight NFh";}
el.onmouseout=function(){this.className="NFButton";this.left.className="NFButtonLeft";this.right.className="NFButtonRight";}
el.init=function(){this.parentNode.insertBefore(this.left,this);this.parentNode.insertBefore(this.right,this.nextSibling);this.className="NFButton";}
el.unload=function(){this.parentNode.removeChild(this.left);this.parentNode.removeChild(this.right);this.className=this.oldClassName;}}
function inputFile(el){el.oldClassName=el.className;el.dummy=document.createElement('div');el.dummy.className="NFFile";el.file=document.createElement('div');el.file.className="NFFileNew";el.center=document.createElement('div');el.center.className="NFTextCenter";el.clone=document.createElement('input');el.clone.type="text";el.clone.className="NFText";el.clone.ref=el;el.left=document.createElement('img');el.left.src=imagesPath+"0.png";el.left.className="NFTextLeft";el.button=document.createElement('img');el.button.src=imagesPath+"0.png";el.button.className="NFFileButton";el.button.ref=el;el.button.onclick=function(){this.ref.click();}
el.init=function(){var top=this.parentNode;if(this.previousSibling){var where=this.previousSibling;}
else{var where=top.childNodes[0];}
top.insertBefore(this.dummy,where);this.dummy.appendChild(this);this.center.appendChild(this.clone);this.file.appendChild(this.center);this.file.insertBefore(this.left,this.center);this.file.appendChild(this.button);this.dummy.appendChild(this.file);this.className="NFhidden";this.relatedElement=this.clone;}
el.unload=function(){this.parentNode.parentNode.appendChild(this);this.parentNode.removeChild(this.dummy);this.className=this.oldClassName;}
el.onchange=el.onmouseout=function(){this.relatedElement.value=this.value;}
el.onfocus=function(){this.left.className="NFTextLeft NFh";this.center.className="NFTextCenter NFh";this.button.className="NFFileButton NFh";}
el.onblur=function(){this.left.className="NFTextLeft";this.center.className="NFTextCenter";this.button.className="NFFileButton";}
el.onselect=function(){this.relatedElement.select();this.value='';}}
function textarea(el){el.oldClassName=el.className;el.height=el.offsetHeight-textareaTopPadding;el.width=el.offsetWidth-textareaSidePadding;el.topLeft=document.createElement('img');el.topLeft.src=imagesPath+"0.png";el.topLeft.className="NFTextareaTopLeft";el.topRight=document.createElement('div');el.topRight.className="NFTextareaTop";el.bottomLeft=document.createElement('img');el.bottomLeft.src=imagesPath+"0.png";el.bottomLeft.className="NFTextareaBottomLeft";el.bottomRight=document.createElement('div');el.bottomRight.className="NFTextareaBottom";el.left=document.createElement('div');el.left.className="NFTextareaLeft";el.right=document.createElement('div');el.right.className="NFTextareaRight";el.init=function(){var top=this.parentNode;if(this.previousSibling){var where=this.previousSibling;}
else{var where=top.childNodes[0];}
top.insertBefore(el.topRight,where);top.insertBefore(el.right,where);top.insertBefore(el.bottomRight,where);this.topRight.appendChild(this.topLeft);this.right.appendChild(this.left);this.right.appendChild(this);this.bottomRight.appendChild(this.bottomLeft);el.style.width=el.topRight.style.width=el.bottomRight.style.width=el.width+'px';el.style.height=el.left.style.height=el.right.style.height=el.height+'px';this.className="NFTextarea";}
el.unload=function(){this.parentNode.parentNode.appendChild(this);this.parentNode.removeChild(this.topRight);this.parentNode.removeChild(this.bottomRight);this.parentNode.removeChild(this.right);this.className=this.oldClassName;this.style.width=this.style.height="";}
el.onfocus=function(){this.topLeft.className="NFTextareaTopLeft NFh";this.topRight.className="NFTextareaTop NFhr";this.left.className="NFTextareaLeftH";this.right.className="NFTextareaRightH";this.bottomLeft.className="NFTextareaBottomLeft NFh";this.bottomRight.className="NFTextareaBottom NFhr";}
el.onblur=function(){this.topLeft.className="NFTextareaTopLeft";this.topRight.className="NFTextareaTop";this.left.className="NFTextareaLeft";this.right.className="NFTextareaRight";this.bottomLeft.className="NFTextareaBottomLeft";this.bottomRight.className="NFTextareaBottom";}}
function selects(el){el.oldClassName=el.className;el.dummy=document.createElement('div');el.dummy.className="NFSelect";el.dummy.style.width=el.offsetWidth+'px';el.dummy.ref=el;el.left=document.createElement('img');el.left.src=imagesPath+"0.png";el.left.className="NFSelectLeft";el.right=document.createElement('div');el.right.className="NFSelectRight";el.txt=document.createTextNode(el.options[0].text);el.bg=document.createElement('div');el.bg.className="NFSelectTarget";el.bg.style.display="none";el.opt=document.createElement('ul');el.opt.className="NFSelectOptions";el.dummy.style.left=findPosX(el)+'px';el.dummy.style.top=findPosY(el)+'px';el.opts=new Array(el.options.length);el.init=function(pos){this.dummy.appendChild(this.left);this.right.appendChild(this.txt);this.dummy.appendChild(this.right);this.bg.appendChild(this.opt);this.dummy.appendChild(this.bg);for(var q=0;q<this.options.length;q++){this.opts[q]=new option(this.options[q],q);this.opt.appendChild(this.options[q].li);this.options[q].lnk.onclick=function(){this._onclick();this.ref.dummy.getElementsByTagName('div')[0].innerHTML=this.ref.options[this.pos].text;this.ref.options[this.pos].selected="selected";for(var w=0;w<this.ref.options.length;w++){this.ref.options[w].lnk.className="";}
this.ref.options[this.pos].lnk.className="NFOptionActive";}}
if(this.options.selectedIndex){this.dummy.getElementsByTagName('div')[0].innerHTML=this.options[this.options.selectedIndex].text;this.options[this.options.selectedIndex].lnk.className="NFOptionActive";}
this.dummy.style.zIndex=999-pos;this.parentNode.insertBefore(this.dummy,this);this.className="NFhidden";}
el.unload=function(){this.parentNode.removeChild(this.dummy);this.className=this.oldClassName;}
el.dummy.onclick=function(){var allDivs=document.getElementsByTagName('div');for(var q=0;q<allDivs.length;q++){if((allDivs[q].className=="NFSelectTarget")&&(allDivs[q]!=this.ref.bg)){allDivs[q].style.display="none";}}
if(this.ref.bg.style.display=="none"){this.ref.bg.style.display="block";}
else{this.ref.bg.style.display="none";}
if(this.ref.opt.offsetHeight>selectMaxHeight){this.ref.bg.style.width=this.ref.offsetWidth-selectRightWidthScroll+33+'px';this.ref.opt.style.width=this.ref.offsetWidth-selectRightWidthScroll+'px';}
else{this.ref.bg.style.width=this.ref.offsetWidth-selectRightWidthSimple+33+'px';this.ref.opt.style.width=this.ref.offsetWidth-selectRightWidthSimple+'px';}}
el.bg.onmouseout=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if((reltg.nodeName=='A')||(reltg.nodeName=='LI')||(reltg.nodeName=='UL'))return;if((reltg.nodeName=='DIV')||(reltg.className=='NFSelectTarget'))return;else{this.style.display="none";}}
el.dummy.onmouseout=function(e){if(!e)var e=window.event;e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();var reltg=(e.relatedTarget)?e.relatedTarget:e.toElement;if((reltg.nodeName=='A')||(reltg.nodeName=='LI')||(reltg.nodeName=='UL'))return;if((reltg.nodeName=='DIV')||(reltg.className=='NFSelectTarget'))return;else{this.ref.bg.style.display="none";}}
el.onfocus=function(){this.dummy.className+=" NFfocused";}
el.onblur=function(){this.dummy.className=this.dummy.className.replace(/ NFfocused/g,"");}
el.onkeydown=function(e){if(!e)var e=window.event;var thecode=e.keyCode;var active=this.selectedIndex;switch(thecode){case 40:if(active<this.options.length-1){for(var w=0;w<this.options.length;w++){this.options[w].lnk.className="";}
var newOne=active+1;this.options[newOne].selected="selected";this.options[newOne].lnk.className="NFOptionActive";this.dummy.getElementsByTagName('div')[0].innerHTML=this.options[newOne].text;}
return false;break;case 38:if(active>0){for(var w=0;w<this.options.length;w++){this.options[w].lnk.className="";}
var newOne=active-1;this.options[newOne].selected="selected";this.options[newOne].lnk.className="NFOptionActive";this.dummy.getElementsByTagName('div')[0].innerHTML=this.options[newOne].text;}
return false;break;default:break;}}}
function multiSelects(el){el.oldClassName=el.className;el.height=el.offsetHeight;el.width=el.offsetWidth;el.topLeft=document.createElement('img');el.topLeft.src=imagesPath+"0.png";el.topLeft.className="NFMultiSelectTopLeft";el.topRight=document.createElement('div');el.topRight.className="NFMultiSelectTop";el.bottomLeft=document.createElement('img');el.bottomLeft.src=imagesPath+"0.png";el.bottomLeft.className="NFMultiSelectBottomLeft";el.bottomRight=document.createElement('div');el.bottomRight.className="NFMultiSelectBottom";el.left=document.createElement('div');el.left.className="NFMultiSelectLeft";el.right=document.createElement('div');el.right.className="NFMultiSelectRight";el.init=function(){var top=this.parentNode;if(this.previousSibling){var where=this.previousSibling;}
else{var where=top.childNodes[0];}
top.insertBefore(el.topRight,where);top.insertBefore(el.right,where);top.insertBefore(el.bottomRight,where);this.topRight.appendChild(this.topLeft);this.right.appendChild(this.left);this.right.appendChild(this);this.bottomRight.appendChild(this.bottomLeft);el.style.width=el.topRight.style.width=el.bottomRight.style.width=el.width+'px';el.style.height=el.left.style.height=el.right.style.height=el.height+'px';el.className="NFMultiSelect";}
el.unload=function(){this.parentNode.parentNode.appendChild(this);this.parentNode.removeChild(this.topRight);this.parentNode.removeChild(this.bottomRight);this.parentNode.removeChild(this.right);this.className=this.oldClassName;this.style.width=this.style.height="";}
el.onfocus=function(){this.topLeft.className="NFMultiSelectTopLeft NFh";this.topRight.className="NFMultiSelectTop NFhr";this.left.className="NFMultiSelectLeftH";this.right.className="NFMultiSelectRightH";this.bottomLeft.className="NFMultiSelectBottomLeft NFh";this.bottomRight.className="NFMultiSelectBottom NFhr";}
el.onblur=function(){this.topLeft.className="NFMultiSelectTopLeft";this.topRight.className="NFMultiSelectTop";this.left.className="NFMultiSelectLeft";this.right.className="NFMultiSelectRight";this.bottomLeft.className="NFMultiSelectBottomLeft";this.bottomRight.className="NFMultiSelectBottom";}}
function option(el,no){el.li=document.createElement('li');el.lnk=document.createElement('a');el.lnk.href="javascript:;";el.lnk.ref=el.parentNode;el.lnk.pos=no;el.lnk._onclick=el.onclick||function(){};el.txt=document.createTextNode(el.text);el.lnk.appendChild(el.txt);el.li.appendChild(el.lnk);}
function findPosY(obj){var posTop=0;return obj.offsetTop;do{posTop+=obj.offsetTop;}while(obj=obj.offsetParent);return posTop;}
function findPosX(obj){var posLeft=0;return obj.offsetLeft;do{posLeft+=obj.offsetLeft;}while(obj=obj.offsetParent);alert(posLeft);return posLeft;}
function getInputsByName(name){var inputs=document.getElementsByTagName("input");var w=0;var results=new Array();for(var q=0;q<inputs.length;q++){if(inputs[q].name==name){results[w]=inputs[q];++w;}}
return results;}
var existingLoadEvent=window.onload||function(){};var existingResizeEvent=window.onresize||function(){};var xyz=0;window.onload=function(){xyz++;if(xyz<10){existingLoadEvent();NFInit();}}
window.onresize=function(){if(resizeTest!=document.documentElement.clientHeight){existingResizeEvent();NFFix();}
resizeTest=document.documentElement.clientHeight;}
function initFade(){testObj=document.getElementById("testDIV");for(var i=0;i<11;i++){setTimeout('setOpacity('+i+')',100*i);}
return false;}
function checkAll(field)
{obj=document.getElementsByTagName('input');for(i=0;i<obj.length;i++)
if(obj[i].name==field)
obj[i].checked=true;}
function uncheckAll(field)
{obj=document.getElementsByTagName('input');for(i=0;i<obj.length;i++)
if(obj[i].name==field)
obj[i].checked=false;}
function DeleteLink(message)
{if(document.getElementById("mass").value=="delete")
{if(confirm(message))
return true;else return false;}else return false;}
function detectDone()
{done++;var _ifrWall=document.getElementById("ifrWall");var html=_ifrWall.contentWindow.document.body.innerHTML;if(html.indexOf('File name:')!=-1){uploadedWall();}else{setTimeout('detectDone()',10);}}
function AddTags()
{if(document.getElementById("wallTags").value=='')
{var Title=document.getElementById("wallTitle").value;var Tags='';var tmpSplit=Title.split(" ");var x=0;if(!min_length){var min_length=3;}
for(x=0;x<tmpSplit.length;x++){if(tmpSplit[x].length>min_length)
Tags+=tmpSplit[x]+", ";}
Tags=Tags.substring(0,Tags.length-2).toLowerCase();document.getElementById("wallTags").value=Tags;}}
function Upload(Path)
{upPath=Path;var _ifrWall=document.getElementById("ifrWall");var loader=_ifrWall.contentWindow.document.getElementById("loader");var btnUpload=document.getElementById("subWall");if(_ifrWall.contentWindow.document.getElementById("wallpaper")){_ifrWall.contentWindow.document.getElementById("wallpaper").onchange=function(event)
{var filPhoto=_ifrWall.contentWindow.document.getElementById("wallpaper");if(filPhoto.value.length==0){alert('Please select a file.');return;}
_ifrWall.contentWindow.document.getElementById("wallSubmit").submit();var test=false;loader.style.display="inline";detectDone();}}}
function Submit()
{document.getElementById("warning").style.display="block";if(clicked==false){clicked=true;return true;}else return false;}
function setOpacity(value)
{testObj.style.opacity=value/10;testObj.style.filter='alpha(opacity='+value*10+')';}
function uploadedWall()
{var tmp=document.getElementById("hWall");var _rhtml=document.getElementById("ifrWall").contentWindow.document.body.innerHTML;document.getElementById('path').value=document.getElementById("ifrWall").contentWindow.document.getElementById('rpath').value;document.getElementById("hiddenWall").innerHTML=document.getElementById("ifrWall").contentWindow.document.body.innerHTML;document.getElementById("hiddenWall").style.display="block";if(tmp!=null)document.getElementById("hWall").style.display="block";;var src=document.getElementById("ifrWall").src;document.getElementById("ifrWall").src=src;var _html=document.getElementById("addWall");document.getElementById("subWall").disabled=false;if(_html.innerHTML.indexOf('Note')==-1)
_html.innerHTML=_html.innerHTML+'<div style="margin-left:1px; font-size:11px;"><strong>Note:</strong> reuploading will override the existing wallpaper.</div>';if(_rhtml.indexOf('name="path" value="')>=0)
document.getElementById("wall_hidden").value=Between(_rhtml,'name="path" value="','"');}
function Between(Source,Start,End)
{var tmp=new Array(4);tmp[1]=Source.substring(Source.indexOf(Start)+Start.length);tmp[2]=tmp[1].substring(tmp[1].indexOf(End));tmp[3]=tmp[1].replace(tmp[2],'');return tmp[3];}
function Comment()
{document.getElementById("loader").style.display="inline";var comment=escape(document.getElementById("textComment").value);var url="../index.php?act=comment&wid="+wid+"&c="+comment+"&reply="+reply;var html=Request("GET",url,"FinishedComment");}
function UserComment()
{var comment=escape(document.getElementById("reply_textarea").value);var url="../index.php?act=user&mode=user_comment&uid="+usr_uid+"&message="+usr_msg;var html=Request("GET",url,"FinishedUserComment");}
function FinishedUserComment()
{fpage=1;if(responseHTML!='')alert(responseHTML);var url="../index.php?act=user&mode=show_comments&page=1&uid="+usr_uid;Request("GET",url,"FinishedLoad");return false;}
function FinishedComment()
{var url="../index.php?act=comment&mode=load&wid="+wid+"&page=1";Request("GET",url,"FinishedLoad");document.getElementById("textComment").value="";}
function fadeOpacity(value)
{testObj.style.opacity=1-(value/10);testObj.style.filter='alpha(opacity='+(1-value*10)+')';}
function fadeOpac(id)
{testObj=document.getElementById("creport_"+id);for(var i=0;i<11;i++){setTimeout('fadeOpacity('+(i)+')',100*i);}}
function Reply(id)
{reply=id;var handle=document.getElementById("replyHidden");document.getElementById("commentInt").innerHTML=reply;handle.style.display="";return false;}
function CancelReply()
{reply=0;var handle=document.getElementById("replyHidden");document.getElementById("commentInt").innerHTML=reply;handle.style.display="none";return false;}
function Report(id)
{commentid=id;var url="../index.php?act=comment&mode=report&cid="+id;Request("GET",url,"FinishedReport");return false;}
function FinishedReport()
{testObj=document.getElementById("creport_"+commentid);for(var i=0;i<11;i++){setTimeout('setOpacity('+(i)+')',100*i);}
setTimeout('fadeOpac('+commentid+')',2000);setTimeout('testObj.style.display = ""',100);return false;}
function LoadComments(page)
{var url="../index.php?act=comment&mode=load&wid="+wid+"&page="+page;Request("GET",url,"FinishedLoad");return false;}
function FinishedLoad()
{document.getElementById("loader").style.display="none";document.getElementById("comments").innerHTML=responseHTML;}
function ShowHideComment(id)
{var handle=document.getElementById("CommentHidden_"+id);var display=handle.style.display;if(display=="none")
{document.getElementById("HSC_"+id).innerHTML="Hide";handle.style.display="";}else
{handle.style.display="none";document.getElementById("HSC_"+id).innerHTML="Show";}
return false;}
function Rate(cid,val)
{var negChange=document.getElementById("classNegComment_"+cid,"");var posChange=document.getElementById("classPosComment_"+cid,"");var handle=document.getElementById("CommentRating_"+cid);var x;for(x=0;x<=20;x++)
{if(doneArray[x]==cid)
{return false;}}
doneArray[pres]=cid;pres=pres+1;handle.style.display="none";if(val=='n')
{var add=-1;}else if(val=='p')
{var add=1;}
var cur=document.getElementById("CommentRating_"+cid).innerHTML;handle.innerHTML="";var newval=Math.round(cur)+add;var cur=document.getElementById("CommentRating_"+cid).innerHTML=newval;if(cur<0)
{handle.style.color="#FF3333";handle.style.fontWeight="bold";}else if(cur==0)
{handle.style.color="black";handle.style.fontWeight=100;}else if(cur>0)
{handle.style.color="#77AB49";handle.style.fontWeight="bold";}
handle.style.display="";testObj=document.getElementById("CommentRating_"+cid);for(var i=0;i<11;i++){setTimeout('setOpacity('+(i)+')',100*i);}
var url='../index.php?act=comment&mode=rate&val='+val+'&cid='+cid;Request("GET",url,"FinishedRate");if(val=='n'){negChange.className="negSelected";posChange.className="posStationary";}else{negChange.className="negStationary";posChange.className="posSelected";}
return false;}
function FinishedRate()
{return true;}
function Expand(name,path,plus,minus,count)
{var x;if(count==0)
{var img=document.getElementById(name+".img");var pos=img.src.match(plus);if(pos==plus)
{img.src=path+minus;setCookie('cat_'+name,1,7);}else
{img.src=path+plus;setCookie('cat_'+name,0,7);}}else
{for(x=0;x<count;x++)
{var elementStyle=document.getElementById(name+"_"+x);var img=document.getElementById(name+".img");elementStyle=elementStyle.style;if(elementStyle.display=="none")
{elementStyle.display="block";img.src=path+minus;setCookie('cat_'+name,1,7);}else
{elementStyle.display="none";img.src=path+plus;setCookie('cat_'+name,0,7);}}}
return false;}
function getXmlHttpRequestObject(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){return new ActiveXObject("Microsoft.XMLHTTP");}else{}}
function UpdateChar()
{field=document.getElementById("textComment");if(field.value.length>maxlimit){field.value=field.value.substring(0,maxlimit);}else{document.getElementById("charCount").innerHTML=maxlimit-field.value.length;}}
function HideShow()
{var Box=document.getElementById("commentsToggle");var Similar=document.getElementById("commentsTitle");if(Check==0)
{Before=Box.innerHTML;Similar.className="commentsTitlePlus";Text=document.getElementById("textComment").value;Box.innerHTML="<center><a href='#' style='color: #0033CC;' onClick='return HideShow();'>Click to expand</a></center>";Check=1;}else
{Similar.className="commentsTitle";Box.innerHTML=Before;document.getElementById("textComment").value=Text;Check=0;}
return false;}
function dealText()
{document.getElementById('imgURL').select();copy('imgURL');}
function copy(inElement)
{if(inElement.createTextRange)
{var range=inElement.createTextRange();if(range&&BodyLoaded==1)
range.execCommand('Copy');}else
{var flashcopier='flashcopier';if(!document.getElementById(flashcopier))
{var divholder=document.createElement('div');divholder.id=flashcopier;document.body.appendChild(divholder);}
document.getElementById(flashcopier).innerHTML='';var divinfo='<embed src="swf/_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement.value)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';document.getElementById(flashcopier).innerHTML=divinfo;}}
function getElementsByClassName(classname,node){if(!node)node=document.getElementsByTagName("body")[0];var a=[];var re=new RegExp('\\b'+classname+'\\b');var els=node.getElementsByTagName("*");for(var i=0,j=els.length;i<j;i++){if(re.test(els[i].className)){a.push(els[i]);return els[i];}}}
function insertAtCursor(myField,myValue){if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=myValue;}
else if(myField.selectionStart||myField.selectionStart=='0'){var startPos=myField.selectionStart;var endPos=myField.selectionEnd;myField.value=myField.value.substring(0,startPos)
+myValue
+myField.value.substring(endPos,myField.value.length);}else{myField.value+=myValue;}
return false;}
function init()
{return;}
function doText(t,e){popUp=true;ent.innerHTML=t;}
function doClear(){popUp=false;ent.style.left=-100;ent.style.top=-100;ent.innerHTML="";}
function ChangeImage(id)
{var x;for(x=1;x<=5;x++)
{document['rating_'+x].src=Path+Template+"images/star2.png";if(x<=id)
document['rating_'+x].src=Path+Template+"images/star1.png";else if(x<=Rating)
document['rating_'+x].src=Path+Template+"images/star3.png";}}
function ImageOff()
{var x;for(x=1;x<=5;x++)
{if(x<=Rating)
document['rating_'+x].src=Path+Template+"images/star3.png";else
document['rating_'+x].src=Path+Template+"images/star2.png";}}
function Return()
{document.getElementById("Rating").className="RatingDone";}
function SubmitVote(wid,val)
{document.getElementById("Rating").className="RatingLoading";var html=Request("GET","../index.php?act=vote&wid="+wid+"&val="+val,"Return");Rating=val;}
function Filter(cid,path)
{var sort=document.getElementById("sort").value;var order=document.getElementById("order").value;var time=document.getElementById("time").value;var url=path+'index.php?act=categories&action=create_sid&sort='+sort+'&order='+order+'&time='+time+'&cat='+cid;Request('GET',url,'fResponse');}
function fResponse()
{var id=responseHTML;document.location=ucat+rpath+"filter/index"+id+".html";}
