var Forum={addLoadEvent:function(fn)
{var x=window.onload;window.onload=(x&&typeof x=='function')?function(){x();fn()}:fn;},hasClass:function(n,x)
{return(new RegExp('\\b'+x+'\\b')).test(n.className)},addClass:function(n,x)
{if(Forum.hasClass(n,x))return false;else n.className+=' '+x;return true;},removeClass:function(n,x)
{if(!Forum.hasClass(n,x))return false;x=new RegExp('\\s*\\b'+x+'\\b','g');n.className=n.className.replace(x,'');return true;},blink:function(n,i)
{if(typeof i=='undefined')i=2;var x=n.style.visibility;if(i&&x!='hidden')
{n.style.visibility='hidden';setTimeout(function(){n.style.visibility=x},200);setTimeout(function(){Forum.blink(n,i-1)},400);}},onScreen:function(n)
{function pageYOffset()
{var y=-1;if(self.pageYOffset)y=self.pageYOffset;else if(document.documentElement&&document.documentElement.scrollTop)
y=document.documentElement.scrollTop;else if(document.body)y=document.body.scrollTop;return y;}
function innerHeight()
{var y=-1;if(self.innerHeight)y=self.innerHeight;else if(document.documentElement&&document.documentElement.clientHeight)
y=document.documentElement.clientHeight;else if(document.body)y=document.body.clientHeight;return y;}
function nodeYOffset(n)
{var y=n.offsetTop;n=n.offsetParent;return n?y+=nodeYOffset(n):y;}
var screenTop=pageYOffset();var screenBottom=screenTop+innerHeight();var nodeTop=nodeYOffset(n);var nodeBottom=nodeTop+n.clientHeight;return nodeTop>=screenTop&&nodeBottom<screenBottom;},map:function(fn,arr)
{for(var i=0,len=arr.length;i<len;i++)
{arr[i]=fn(arr[i])}
return arr;},find:function(fn,arr)
{for(var i=0,len=arr.length;i<len;i++)
{if(fn(arr[i]))return i;}
return-1;},arrayOfMatched:function(fn,arr)
{matched=[];for(var i=0,len=arr.length;i<len;i++)
{if(fn(arr[i]))matched.push(arr[i])}
return matched;},flatten:function(arr)
{flt=[];for(var i=0,len=arr.length;i<len;i++)
{if(typeof arr[i]=='object'&&arr.length)
{flt.concat(Forum.flatten(arr[i]))
alert('length1!!'+arr.length);}
else flt.push(arr[i])}
return flt},validateForm:function(form)
{var elements=form.elements;var fn=function(x){return x.name&&x.name.indexOf('req_')==0};var nodes=Forum.arrayOfMatched(fn,elements);fn=function(x){return/^\s*$/.test(x.value)};var empty=Forum.find(fn,nodes);if(empty>-1)
{var n=document.getElementById('req-msg');Forum.removeClass(n,'req-warn');var newlyAdded=Forum.addClass(n,'req-error');if(!Forum.onScreen(n))
{n.scrollIntoView();setTimeout(function(){Forum.blink(n)},500);}
else if(!newlyAdded)Forum.blink(n);if(Forum.onScreen(nodes[empty]))nodes[empty].focus();return false;}
return true;},doQuickjumpRedirect:function(url,forum_names)
{var selected_forum_id=document.getElementById('qjump-select')[document.getElementById('qjump-select').selectedIndex].value;url=url.replace('$1',selected_forum_id);url=url.replace('$2',forum_names[selected_forum_id]);document.location=url;return false;},toggleCheckboxes:function(curForm)
{var inputlist=curForm.getElementsByTagName("input");for(i=0;i<inputlist.length;i++)
{if(inputlist[i].getAttribute("type")=='checkbox'&&inputlist[i].disabled==false)
inputlist[i].checked=!inputlist[i].checked;}
return false;},attachValidateForm:function()
{var forms=document.forms;for(var i=0,len=forms.length;i<len;i++)
{var elements=forms[i].elements;var fn=function(x){return x.name&&x.name.indexOf('req_')==0};if(Forum.find(fn,elements)>-1)
{fn=function(x){return x.type&&(x.type=='submit'&&x.name!='cancel')};var nodes=Forum.arrayOfMatched(fn,elements)
var formRef=forms[i];fn=function(){return Forum.validateForm(formRef)};nodes=Forum.map(function(x){x.onclick=fn},nodes);}}},attachWindowOpen:function()
{if(!document.getElementsByTagName)return;var nodes=document.getElementsByTagName('a');for(var i=0;i<nodes.length;i++)
{if(Forum.hasClass(nodes[i],'exthelp'))
nodes[i].onclick=function(){window.open(this.href);return false;};}},autoFocus:function()
{var nodes=document.getElementById('afocus');if(!nodes||window.location.hash.replace(/#/g,''))return;nodes=nodes.all?nodes.all:nodes.getElementsByTagName('*');var fn=function(x){return x.tagName.toUpperCase()=='TEXTAREA'||(x.tagName.toUpperCase()=='INPUT'&&(x.type=='text')||(x.type=='password'))};var n=Forum.find(fn,nodes);if(n>-1)nodes[n].focus();}}
Forum.addLoadEvent(Forum.attachValidateForm);Forum.addLoadEvent(Forum.attachWindowOpen);Forum.addLoadEvent(Forum.autoFocus);
var selNode=null;function getSelectedText()
{try
{var result=undefined;if(document.selection)
{selNode=document.selection.createRange().parentElement();var testNode=selNode;var flag=1;while(flag==1)
{if((testNode.parentNode.nodeName=='BLOCKQUOTE'))
testNode=testNode.parentNode.parentNode;else if((testNode.parentNode.nodeName=='LI'))
testNode=testNode.parentNode;else if((testNode.parentNode.nodeName=='UL'))
testNode=testNode.parentNode;else if((testNode.nodeName=='CODE'))
testNode=testNode.parentNode.parentNode;else if((testNode.nodeName=='CITE'))
testNode=testNode.parentNode;else if((testNode.nodeName=='EM'))
testNode=testNode.parentNode;else if((testNode.nodeName=='STRONG'))
testNode=testNode.parentNode;else if((testNode.nodeName=='SPAN'))
testNode=testNode.parentNode;else
flag=0;}
if((testNode.parentNode.className=='entry-content')&&(testNode.className!='sig-content'))
result=document.selection.createRange().text;}
else if(document.getSelection)
{selNode=window.getSelection().anchorNode.parentNode;var testNode=selNode;var flag=1;while(flag==1)
{if((testNode.parentNode.nodeName=='BLOCKQUOTE'))
testNode=testNode.parentNode.parentNode;else if((testNode.parentNode.nodeName=='LI'))
testNode=testNode.parentNode;else if((testNode.parentNode.nodeName=='UL'))
testNode=testNode.parentNode;else if((testNode.nodeName=='CODE'))
testNode=testNode.parentNode.parentNode;else if((testNode.nodeName=='CITE'))
testNode=testNode.parentNode;else if((testNode.nodeName=='EM'))
testNode=testNode.parentNode;else if((testNode.nodeName=='STRONG'))
testNode=testNode.parentNode;else if((testNode.nodeName=='SPAN'))
testNode=testNode.parentNode;else
flag=0;}
if((testNode.parentNode.className=='entry-content')&&(testNode.className!='sig-content'))
result=document.getSelection();}
else if(window.getSelection)
{selNode=window.getSelection().anchorNode.parentNode;var testNode=selNode;var flag=1;while(flag==1)
{if((testNode.parentNode.nodeName=='BLOCKQUOTE'))
testNode=testNode.parentNode.parentNode;else if((testNode.parentNode.nodeName=='LI'))
testNode=testNode.parentNode;else if((testNode.parentNode.nodeName=='UL'))
testNode=testNode.parentNode;else if((testNode.nodeName=='CODE'))
testNode=testNode.parentNode.parentNode;else if((testNode.nodeName=='CITE'))
testNode=testNode.parentNode;else if((testNode.nodeName=='EM'))
testNode=testNode.parentNode;else if((testNode.nodeName=='STRONG'))
testNode=testNode.parentNode;else if((testNode.nodeName=='SPAN'))
testNode=testNode.parentNode;else
flag=0;}
if((testNode.parentNode.className=='entry-content')&&(testNode.className!='sig-content'))
result=window.getSelection();}
else
return result;}
catch(err)
{result=undefined;}
return result;}
function QuickQuote(qid_param)
{var selected_text=getSelectedText();var quick_post_value=document.getElementsByName('req_message');if(selected_text==undefined||selected_text=='')
quick_post_value[0].value+='[quote='+pun_quote_authors[qid_param]+']'+ParseMessage(pun_quote_posts[qid_param])+'[/quote]';else
{var post_content=ContentCleaning(ParseMessage(pun_quote_posts[qid_param]));var clean_selected_text=ContentCleaning(selected_text.toString());if(post_content.indexOf(clean_selected_text)!=-1)
quick_post_value[0].value+='[quote='+pun_quote_authors[qid_param]+']'+selected_text+'[/quote]';else
quick_post_value[0].value+='[quote='+pun_quote_authors[qid_param]+']'+ParseMessage(pun_quote_posts[qid_param])+'[/quote]';}}
function Reply(qid_param,quote_link)
{var selected_text=getSelectedText().toString();if(selected_text==undefined||selected_text=='')
return;var post_content=ContentCleaning(ParseMessage(pun_quote_posts[qid_param]));var clean_selected_text=ContentCleaning(selected_text);var pun_quote_form=document.getElementById('pun_quote_form');if(post_content.indexOf(clean_selected_text)!=-1)
{document.getElementById('post_msg').value=selected_text;pun_quote_form.action=document.getElementById('pun_quote_url').value.replace('$2',qid_param.toString());pun_quote_form.submit();}
else
location=quote_link.href;}
function ParseMessage(string)
{var search_arr=new Array(/&amp;/g,/&quot;/g,/&#039;/g,/&lt;/g,/&gt;/g);var replace_arr=new Array('&','"','\'','<','>');for(var replace_num=0;replace_num<search_arr.length;replace_num++)
string=string.replace(search_arr[replace_num],replace_arr[replace_num]);return string;}
function ContentCleaning(string)
{string=string.replace(/(\n\r|\n|\r){1,}/gi,' ');string=string.replace(/^\s+|\s+$/g,'');string=string.replace(/\s{1,}/gi,' ');return string;}
function insert_text(open,close)
{msgfield=(document.all)?document.all.req_message:((document.getElementById('afocus')!=null)?(document.getElementById('afocus').req_message):(document.getElementsByName('req_message')[0]));if(document.selection&&document.selection.createRange)
{msgfield.focus();sel=document.selection.createRange();sel.text=open+sel.text+close;msgfield.focus();}
else if(msgfield.selectionStart||msgfield.selectionStart=='0')
{var startPos=msgfield.selectionStart;var endPos=msgfield.selectionEnd;msgfield.value=msgfield.value.substring(0,startPos)+open+msgfield.value.substring(startPos,endPos)+close+msgfield.value.substring(endPos,msgfield.value.length);msgfield.selectionStart=msgfield.selectionEnd=endPos+open.length+close.length;msgfield.focus();}
else
{msgfield.value+=open+close;msgfield.focus();}
return;}
function viewThanks(_1){viewer=window.open(_1,"PREV","width=300,height=300,toolbar=no,status=no,scrollbars=no,menubar=no,resizable=no");viewer.focus();return false;}function apk_thanks(_2,_3,id,ut,pt){var _7;if($T("thanks"+id)){sendRequestThanks("user="+_2+"&user_t="+_3+"&post="+id);}if($T("u"+id)){$T("u"+id).innerHTML=ut+1;}else{_7=Thanks+"1\n\n";}if($T("n"+id)){$T("n"+id).innerHTML=pt+1;}else{if(_7){_7=_7+ThanksPost+"1\n\n";}else{_7=ThanksPost+"1\n\n";}}if(_7){$T("t"+id).innerHTML=_7;}$T("button_t"+id).innerHTML=ThanksSaid;}var ie=/msie/i.test(navigator.userAgent);function sendRequestThanks(_8){if(ie){httpThanks=getHTTPObjectThanks();}httpThanks.open("POST",base_url_thanks+"/extensions/thanks/thanks.php",true);httpThanks.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");httpThanks.send(_8);}function getHTTPObjectThanks(){var _9;if(!_9&&typeof XMLHttpRequest!="undefined"){try{_9=new XMLHttpRequest();}catch(e){_9=false;}}return _9;}function $T(_a){return document.getElementById(_a);}var httpThanks=getHTTPObjectThanks();
var rector=3,stopit=0,a=1;function init(which){stopit=0;shake=which;shake.style.left=0;shake.style.top=0;}
function rattleimage(){if((!document.all&&!document.getElementById)||stopit==1)return;if(a==1)shake.style.top=parseInt(shake.style.top)+rector+"px";else if(a==2)shake.style.left=parseInt(shake.style.left)+rector+"px";else if(a==3)shake.style.top=parseInt(shake.style.top)-rector+"px";else shake.style.left=parseInt(shake.style.left)-rector+"px";if(a<4)a++;else a=1;setTimeout("rattleimage()",50)}
function stoprattle(which){stopit=1;which.style.left=0;which.style.top=0}
startX=parseInt(screen.width/2)+396;startY=parseInt(screen.height/2)-110;
function iecompattest(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function links(){ns=(navigator.appName.indexOf("Netscape")!=-1)||window.opera;d=document;el=d.getElementById("avatar");barheight=el.offsetHeight;function ml(id){el.style.cssText="visibility:visible;width:80px";if(d.layers)el.style=el;el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};el.y=ns?pageYOffset+innerHeight:iecompattest().scrollTop+iecompattest().clientHeight;el.x=startX;el.y-=startY;return el;}
window.stayTopLeft=function(){var pY=ns?pageYOffset+innerHeight-barheight:iecompattest().scrollTop+iecompattest().clientHeight-barheight;ftlObj.y+=(pY-startY-ftlObj.y)/8;ftlObj.sP(ftlObj.x,ftlObj.y);setTimeout("stayTopLeft()",10);}
ftlObj=ml("avatar");stayTopLeft();link=document.getElementsByTagName("a");for(i=0;i<link.length;i++){link[i].style.position="relative";link[i].onmouseover=function(){init(this);rattleimage()};link[i].onmouseout=function(){stoprattle(this);top.focus()}}}
if(window.addEventListener)window.addEventListener("load",links,false);else if(window.attachEvent)window.attachEvent("onload",links);else if(document.getElementById)window.onload=links
