
function getScrollBarWidth(){var inner=document.createElement("p");Element.setStyle(inner,{width:"100%",height:"200px"});var outer=document.createElement("div");Element.setStyle(outer,{position:"absolute",top:"0px",left:"0px",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"});outer.appendChild(inner);document.body.appendChild(outer);var w1=inner.offsetWidth;outer.style.overflow="scroll";var w2=inner.offsetWidth;if(w1==w2)w2=outer.clientWidth;document.body.removeChild(outer);return(w1-w2);};function escapeHTML(str){var div=document.createElement('div');var text=document.createTextNode(str);div.appendChild(text);return div.innerHTML;}
function xParentNode(ele,n)
{while(ele&&n--){ele=ele.parentNode;}
return ele;}
function updateFilterCats(){globalHideModal();var url='/Q/Special:Search&ajax=1&action=getfilter&trunks='+search_trunks+'&search='+search_term;$('notin').innerHTML=' ';$('topics_hint').innerHTML="Loading...";$('topics_hint').setStyle({color:"#000000",textDecoration:"none",cursor:"default"});var pere=new PeriodicalExecuter(function(pe){if($('topics_hint').innerHTML=="Loading..."){$('topics_hint').innerHTML="Loading.";}
else{$('topics_hint').innerHTML+='.';}},1);new Ajax.Request(url,{method:"get",onSuccess:function(transport){pere.stop();$('topics_hint').setStyle({color:"#003399",textDecoration:"underline",cursor:"pointer"});eval(transport.responseText.trim());},onException:function(requester,except){pere.stop();$('topics_hint').setStyle({color:"#003399",textDecoration:"underline",cursor:"pointer"});alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");}});}
var trunks=null;function updateTopicsJSON(){top_container=document.getElementById("searchform");top_container.trunks.value=JSON.stringify(trunks);}
function submitCategories(){void(0);}
function openTopic(topic_id,link){var div=$("t"+topic_id);if(xDef(link)&&typeof(link)=="object"&&link.length>0)
for(var i=0;i<link.length;i++){if($("t"+link[i])&&$("t"+link[i]).innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)){div.innerHTML=$("t"+link[i]).innerHTML;$("t"+link[i]).innerHTML="";div.style.display="block";nodes=new Array();table=$("t"+link[i]);while(!table.parentNode.id||table.parentNode.id!="t0"){if(table.parentNode.id&&table.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=table.parentNode.id;}
table=table.parentNode;}
nodes[nodes.length]="t0";var mobj=trunks;for(var i2=nodes.length-1;i2>=0;i2--){if(mobj[nodes[i2]]){mobj=mobj[nodes[i2]].subs;if(mobj["t"+link[i]]){mobj=mobj["t"+link[i]];break;}}
else{mobj=null;break;}}
if(mobj!=null){nodes=new Array();table=$("t"+topic_id);while(!table.parentNode.id||table.parentNode.id!="t0"){if(table.parentNode.id&&table.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=table.parentNode.id;}
table=table.parentNode;}
nodes[nodes.length]="t0";var mobj2=trunks;for(var i2=nodes.length-1;i2>=0;i2--){if(mobj2[nodes[i2]]&&nodes[i2-1]&&mobj2[nodes[i2]].subs[nodes[i2-1]]){mobj2=mobj2[nodes[i2]].subs;}
else if(mobj2[nodes[i2]]&&nodes[i2-1]){mobj2[nodes[i2]].subs[nodes[i2-1]]=new Object();if(mobj2[nodes[i2]].all==1){mobj2[nodes[i2]].subs[nodes[i2-1]].sel=1;mobj2[nodes[i2]].subs[nodes[i2-1]].all=1;mobj2[nodes[i2]].subs[nodes[i2-1]].subs=new Object();}
else{mobj2[nodes[i2]].subs[nodes[i2-1]].sel=0;mobj2[nodes[i2]].subs[nodes[i2-1]].all=0;mobj2[nodes[i2]].subs[nodes[i2-1]].subs=new Object();}
mobj2=mobj2[nodes[i2]].subs;}
else if(mobj2[nodes[i2]]){mobj2=mobj2[nodes[i2]].subs;}}
if(mobj2["t"+topic_id]){mobj2["t"+topic_id].all=mobj.all;mobj2["t"+topic_id].sel=mobj.sel;mobj2["t"+topic_id].subs=eval('('+JSON.stringify(mobj.subs)+')');mobj2["t"+topic_id].open=true;}
else{mobj2["t"+topic_id]=new Object();mobj2["t"+topic_id].all=mobj.all;mobj2["t"+topic_id].sel=mobj.sel;mobj2["t"+topic_id].subs=eval('('+JSON.stringify(mobj.subs)+')');mobj2["t"+topic_id].open=true;}
mobj.subs=new Object();mobj.open=false;}
return;}}
if(div.innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)){div.style.display="block";return;}
showPWsmall();var html="";var xmlHTTP=getXMLHTTP();if(xmlHTTP){var url="/Q/Special:Search&gettopictree="+topic_id;document.body.style.cursor='wait';xmlHTTP.open("POST",url,false);xmlHTTP.send(null);var responseText=xmlHTTP.responseText.trim();if(responseText!="None"){div.innerHTML=responseText;div.style.display="block";divs=div.getElementsByTagName('div');for(var i=0;i<divs.length;i++){if(divs[i]&&divs[i].getAttribute('islink')&&divs[i].getAttribute('islink')!=0){links=eval('('+divs[i].getAttribute('islink')+')');if(links&&links.length>0){for(var i2=0;i2<links.length;i2++){if($("i"+links[i2])){id=divs[i].id.replace(/[^0-9]+/i,'');if($("i"+links[i2]).value==1){check($("i"+id),$("c"+id),false,true);}
else{uncheck($("i"+id),$("c"+id),false,true);}}}}}}}
document.body.style.cursor='auto';}
else{alert("Your browser is not supported by this web-site.\nPlease update to a newer version.");}
hidePWsmall();}
function fillCategoriesDialog(){$('categories_popup').parentNode.style.cursor="wait";$('categories_popup').innerHTML="<div style='font-size: 12px; padding-left: 13px;'>"+"Please wait..."+"<div style='padding-top: 180px; text-align: center; margin-left: -13px;'><img src='"+wgStaticFilesServer+"/templates/icons/ajax-loader3.gif' border=0 alt="+"Please wait..."+" /></div></div>";var url='/Q/Special:Search&ajax=1&act=selcats';new Ajax.Request(url,{method:"get",onSuccess:function(transport){var responseText=transport.responseText.trim();$('categories_popup').parentNode.style.cursor="default";disableScrollBars();$('categories_popup').style.fontSize="12px";jQuery('#categories_popup').html(""+responseText+"");resizeButtonsGroup('cat_popup_btns_res_top');resizeButtonsGroup('cat_popup_btns_res_bot');trunks=eval('('+document.forms['searchform'].trunks.value+')');selectTopicsFromJSON(trunks,true);},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");popup_elem.destroyModal();globalHideModal();xModalDialog.instances["select_topics"]=null;disableScrollBars();}});}
function closeTopic(topic_id){$("t"+topic_id).style.display="none";}
function subTopics(topic_id,link){if($("t"+topic_id).innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)&&$("t"+topic_id).style.display!="none"){closeTopic(topic_id);if($("subsel"+topic_id))
$("subsel"+topic_id).parentNode.removeChild($("subsel"+topic_id));}
else{if(xDef(link)&&typeof(link)=="object"&&link.length>0)
openTopic(topic_id,link);else
openTopic(topic_id);nodes=new Array();table=$("t"+topic_id);while(!table.parentNode.id||table.parentNode.id!="t0"){if(table.parentNode.id&&table.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=table.parentNode.id;}
table=table.parentNode;}
nodes[nodes.length]="t0";var mobj=trunks;for(var i=nodes.length-1;i>=0;i--){if(mobj[nodes[i]]&&nodes[i-1]&&mobj[nodes[i]].subs[nodes[i-1]])
mobj=mobj[nodes[i]].subs;else
break;}
selectTopicsFromJSON(mobj,false);}}
function selectTopicsFromJSONclone(id){if(typeof(id)!='undefined'){var nodes=new Array();var table=$("t"+id);while(!table.parentNode.id||table.parentNode.id!="t0"){if(table.parentNode.id&&table.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=table.parentNode.id;}
table=table.parentNode;}
nodes[nodes.length]="t0";var mobj=trunks;for(var i=nodes.length-1;i>=0;i--){if(mobj[nodes[i]]&&nodes[i-1]&&mobj[nodes[i]].subs[nodes[i-1]])
mobj=mobj[nodes[i]].subs;else
break;}
selectTopicsFromJSON(mobj,false);}
else{selectTopicsFromJSON(trunks,false);}
if(trunks.t0.all==0&&JSON.stringify(trunks.t0.subs).match(/^[\{\}\s]+$/i)){var buttons=jQuery("#catsform").find("a.btn");buttons.each(function(index){if(index==0||index==2){jQuery(this).disableBtn();}});}
else{var buttons=jQuery("#catsform").find("a.btn");buttons.each(function(index){if(index==0||index==2){jQuery(this).enableBtn();}});}}
function clearTrunks(chkd){if(chkd==1){trunks.t0.all=1;trunks.t0.subs=new Object();}
else{trunks.t0.all=0;trunks.t0.subs=new Object();}
selectTopicsFromJSONclone();}
function rebuildSubSelection(topic_id){if($("subsel"+topic_id))
$("subsel"+topic_id).parentNode.removeChild($("subsel"+topic_id));spans=new Array();divs=$("t"+topic_id).getElementsByTagName("div");for(var i=0;i<divs.length;i++){if(divs[i].id&&divs[i].id.match(/^t[0-9]+$/i))
spans[spans.length]=divs[i];}
if($("i"+topic_id).value==1){var display=false;for(i=0;i<spans.length;i++){if($("i"+spans[i].id.replace(/[^0-9]+/i,'')).value==0){display=true;break;}}
if(display){jQuery("#t"+topic_id).before("<span id='subsel"+topic_id+"'>&nbsp;&nbsp;<a href='javascript:checkAll($(\"t"+topic_id+"\"), true);' style='font-size: 10px; color: #A0A0A0; font-weight: bold;'>"+"Select subcategories"+"</a></span>");}}
else{var display=false;for(i=0;i<spans.length;i++){if($("i"+spans[i].id.replace(/[^0-9]+/i,'')).value==1){display=true;break;}}
if(display){jQuery("#t"+topic_id).before("<span id='subsel"+topic_id+"'>&nbsp;&nbsp;<a href='javascript:uncheckAll($(\"t"+topic_id+"\"), true);' style='font-size: 10px; color: #A0A0A0; font-weight: bold;'>"+"Deselect subcategories"+"</a></span>");}}
var node="";var nd=$("t"+topic_id);while(!nd.parentNode.id||nd.parentNode.id!="t0"){if(nd.parentNode.id&&nd.parentNode.id.match(/t[0-9]+/i)){node=nd.parentNode.id.replace(/[^0-9]+/i,'');break;}
nd=nd.parentNode;}
if(node!="")
rebuildSubSelection(node);}
function isChecked(img){if($("i"+img.id.replace(/[^0-9]+/i,'')).value=="1")
return true;else
return false;}
function uncheckJSON(nodes,tops){if(nodes.length==1){tops[nodes[nodes.length-1]].sel=0;return tops;}
if(tops[nodes[nodes.length-1]].all==0&&(tops[nodes[nodes.length-1]].subs.length==0||!tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]]))
return tops;if(tops[nodes[nodes.length-1]].all==0){nodes_nxt=nodes.slice(0);nodes_nxt.splice(nodes_nxt.length-1,1);if(nodes_nxt.length==1&&JSON.stringify(tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].subs).match(/^[\{\}\s]+$/i)&&tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].all==0)
delete tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]];else{tops[nodes[nodes.length-1]].subs=uncheckJSON(nodes_nxt,tops[nodes[nodes.length-1]].subs);if(tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].sel==0&&JSON.stringify(tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].subs).match(/^[\{\}\s]+$/i)&&tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].all==0){delete tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]];}}
return tops;}
if(tops[nodes[nodes.length-1]].subs.length==0){tops[nodes[nodes.length-1]].subs=new Object();}
if(!tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]]){tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]]=new Object();tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].sel=1;tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].all=1;tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].subs=new Object();}
nodes_nxt=nodes.slice(0);nodes_nxt.splice(nodes_nxt.length-1,1);tops[nodes[nodes.length-1]].subs=uncheckJSON(nodes_nxt,tops[nodes[nodes.length-1]].subs);return tops;}
function uncheck(input,img,open,refresh,openmrr){if(typeof(open)=='undefined')
open=true;if(typeof(refresh)=='undefined')
refresh=true;if(typeof(openmrr)=='undefined')
openmrr=false;input.value="0";img.src=wgStaticFilesServer+"/templates/icons/no_chk.gif";topic_id=input.name.replace(/[^0-9]+/i,'');if(open&&(!$("t"+topic_id).innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)||($("t"+topic_id).innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)&&$("t"+topic_id).style.display=="none")))
if($("t"+topic_id)&&$("t"+topic_id).getAttribute('islink')&&$("t"+topic_id).getAttribute('islink')!=0)
openTopic(topic_id,eval('('+$("t"+topic_id).getAttribute('islink')+')'));else
openTopic(topic_id);if(refresh){nodes=new Array();nodes[nodes.length]="t"+topic_id;while(!input.parentNode.id||input.parentNode.id!="t0"){if(input.parentNode.id&&input.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=input.parentNode.id;}
input=input.parentNode;}
nodes[nodes.length]="t0";trunks=uncheckJSON(nodes,trunks);}
rebuildSubSelection(topic_id);if($('t'+topic_id)&&$('t'+topic_id).getAttribute('islink')&&$('t'+topic_id).getAttribute('islink')!=0&&openmrr){links=eval('('+$('t'+topic_id).getAttribute('islink')+')');if(links&&links.length>0){for(var i=0;i<links.length;i++){if($("i"+links[i])){uncheck($("i"+links[i]),$("c"+links[i]),false,true);}}}}}
function checkJSON(nodes,tops){if(nodes.length==1){tops[nodes[nodes.length-1]].sel=1;return tops;}
if(tops[nodes[nodes.length-1]].all==1&&(tops[nodes[nodes.length-1]].subs.length==0||!tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]]))
return tops;if(tops[nodes[nodes.length-1]].all==1){nodes_nxt=nodes.slice(0);nodes_nxt.splice(nodes_nxt.length-1,1);if(nodes_nxt.length==1&&JSON.stringify(tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].subs).match(/^[\{\}\s]+$/i)&&tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].all==1)
delete tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]];else{tops[nodes[nodes.length-1]].subs=checkJSON(nodes_nxt,tops[nodes[nodes.length-1]].subs);if(tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].sel==1&&JSON.stringify(tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].subs).match(/^[\{\}\s]+$/i)&&tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].all==1){delete tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]];}}
return tops;}
if(tops[nodes[nodes.length-1]].subs.length==0){tops[nodes[nodes.length-1]].subs=new Object();}
if(!tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]]){tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]]=new Object();tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].sel=0;tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].all=0;tops[nodes[nodes.length-1]].subs[nodes[nodes.length-2]].subs=new Object();}
nodes_nxt=nodes.slice(0);nodes_nxt.splice(nodes_nxt.length-1,1);tops[nodes[nodes.length-1]].subs=checkJSON(nodes_nxt,tops[nodes[nodes.length-1]].subs);return tops;}
function check(input,img,open,refresh,openmrr){if(typeof(open)=='undefined')
open=true;if(typeof(refresh)=='undefined')
refresh=true;if(typeof(openmrr)=='undefined')
openmrr=false;input.value="1";img.src=wgStaticFilesServer+"/templates/icons/chk.gif";topic_id=input.name.replace(/[^0-9]+/i,'');if(open&&(!$("t"+topic_id).innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)||($("t"+topic_id).innerHTML.replace(/(<([^>]+)>)/ig,"").match(/[a-z]+/i)&&$("t"+topic_id).style.display=="none")))
if($("t"+topic_id)&&$("t"+topic_id).getAttribute('islink')&&$("t"+topic_id).getAttribute('islink')!=0)
openTopic(topic_id,eval('('+$("t"+topic_id).getAttribute('islink')+')'));else
openTopic(topic_id);if(refresh){nodes=new Array();nodes[nodes.length]="t"+topic_id;while(!input.parentNode.id||input.parentNode.id!="t0"){if(input.parentNode.id&&input.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=input.parentNode.id;}
input=input.parentNode;}
nodes[nodes.length]="t0";trunks=checkJSON(nodes,trunks);}
rebuildSubSelection(topic_id);if($('t'+topic_id)&&$('t'+topic_id).getAttribute('islink')&&$('t'+topic_id).getAttribute('islink')!=0&&openmrr){links=eval('('+$('t'+topic_id).getAttribute('islink')+')');if(links&&links.length>0){for(var i=0;i<links.length;i++){if($("i"+links[i])){check($("i"+links[i]),$("c"+links[i]),false,true);}}}}}
function checkAll(table,incsubs,refresh){if(typeof(incsubs)!='undefined'&&incsubs==true){var topic_id=table.id.replace(/[^0-9]+/i,'');var str_trunks=JSON.stringify(trunks);if(str_trunks.indexOf('"t'+topic_id+'":{"sel":1,"all":0,"subs":')>=0||(str_trunks.indexOf('"t'+topic_id+'":{"sel":1,"all":1,"subs":')>=0&&str_trunks.indexOf('"t'+topic_id+'":{"sel":1,"all":1,"subs":{}')==-1)||(str_trunks.indexOf('"t'+topic_id)==-1)||str_trunks.indexOf('"t'+topic_id+'":{"sel":0,"all":0,"subs":{}')>=0){if(str_trunks.indexOf('"t'+topic_id)==-1){if($("i"+topic_id).value==1){uncheck($("i"+topic_id),$("c"+topic_id),false,true);}
else{check($("i"+topic_id),$("c"+topic_id),false,true);}}
nodes=new Array();while(!table.parentNode.id||table.parentNode.id!="t0"){if(table.parentNode.id&&table.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=table.parentNode.id;}
table=table.parentNode;}
var mobj=trunks.t0.subs;for(var i=nodes.length-1;i>=0;i--){mobj=mobj[nodes[i]].subs;}
mobj["t"+topic_id].subs=new Object();mobj["t"+topic_id].all=1;checkAll($("t"+topic_id));if(str_trunks.indexOf('"t'+topic_id)==-1){if($("i"+topic_id).value==1){uncheck($("i"+topic_id),$("c"+topic_id),false,true);}
else{check($("i"+topic_id),$("c"+topic_id),false,true);}}}
if($("subsel"+topic_id))
$("subsel"+topic_id).parentNode.removeChild($("subsel"+topic_id));jQuery("#t"+topic_id).before("<span id='subsel"+topic_id+"'>&nbsp;&nbsp;<a href='javascript:uncheckAll($(\"t"+topic_id+"\"), true);' style='font-size: 10px; color: #A0A0A0; font-weight: bold;'>"+"Deselect subcategories"+"</a></span>");var allsubs_desel=true;var divs=$("t0").getElementsByTagName("input");for(var i=0;i<divs.length;i++){if(divs[i].id&&divs[i].id.match(/^i[0-9]+$/i)&&divs[i].value==1){allsubs_desel=false;break;}}
if(!allsubs_desel){var buttons=jQuery("#catsform").find("a.btn");buttons.each(function(index){if(index==0||index==2){jQuery(this).enableBtn();}});}}
else{inputs=table.getElementsByTagName('input');if(typeof(refresh)=='undefined')
refresh=true;for(i=0;i<inputs.length;i++){if(inputs[i].name.match(/i[0-9]+/i))
check(inputs[i],$('c'+inputs[i].name.replace(/[^0-9]+/i,'')+''),false,refresh);}}}
function uncheckAll(table,incsubs,refresh){if(typeof(incsubs)!='undefined'&&incsubs==true){var topic_id=table.id.replace(/[^0-9]+/i,'');var str_trunks=JSON.stringify(trunks);if(str_trunks.indexOf('"t'+topic_id+'":{"sel":0,"all":1,"subs":')>=0||(str_trunks.indexOf('"t'+topic_id+'":{"sel":0,"all":0,"subs":')>=0&&str_trunks.indexOf('"t'+topic_id+'":{"sel":0,"all":0,"subs":{}')==-1)||(str_trunks.indexOf('"t'+topic_id)==-1)||str_trunks.indexOf('"t'+topic_id+'":{"sel":1,"all":1,"subs":{}')>=0){if(str_trunks.indexOf('"t'+topic_id)==-1){if($("i"+topic_id).value==1){uncheck($("i"+topic_id),$("c"+topic_id),false,true);}
else{check($("i"+topic_id),$("c"+topic_id),false,true);}}
nodes=new Array();while(!table.parentNode.id||table.parentNode.id!="t0"){if(table.parentNode.id&&table.parentNode.id.match(/t[0-9]+/i)){nodes[nodes.length]=table.parentNode.id;}
table=table.parentNode;}
var mobj=trunks.t0.subs;for(var i=nodes.length-1;i>=0;i--){mobj=mobj[nodes[i]].subs;}
mobj["t"+topic_id].subs=new Object();mobj["t"+topic_id].all=0;uncheckAll($("t"+topic_id));if(str_trunks.indexOf('"t'+topic_id)==-1){if($("i"+topic_id).value==1){uncheck($("i"+topic_id),$("c"+topic_id),false,true);}
else{check($("i"+topic_id),$("c"+topic_id),false,true);}}}
if($("subsel"+topic_id))
$("subsel"+topic_id).parentNode.removeChild($("subsel"+topic_id));jQuery("#t"+topic_id).before("<span id='subsel"+topic_id+"'>&nbsp;&nbsp;<a href='javascript:checkAll($(\"t"+topic_id+"\"), true);' style='font-size: 10px; color: #A0A0A0; font-weight: bold;'>"+"Select subcategories"+"</a></span>");var allsubs_desel=true;var divs=$("t0").getElementsByTagName("input");for(var i=0;i<divs.length;i++){if(divs[i].id&&divs[i].id.match(/^i[0-9]+$/i)&&divs[i].value==1){allsubs_desel=false;break;}}
if((trunks.t0.all==0&&JSON.stringify(trunks.t0.subs).match(/^[\{\}\s]+$/i))||allsubs_desel){var buttons=jQuery("#catsform").find("a.btn");buttons.each(function(index){if(index==0||index==2){jQuery(this).disableBtn();}});}}
else{inputs=table.getElementsByTagName('input');if(typeof(refresh)=='undefined')
refresh=true;for(i=0;i<inputs.length;i++){if(inputs[i].name.match(/i[0-9]+/i))
uncheck(inputs[i],$('c'+inputs[i].name.replace(/[^0-9]+/i,'')+''),false,refresh);}}}
function selectTopicsFromJSON(topics,open){for(var topic in topics){if(topic.replace(/[^0-9]+/i,"")=="")
continue;subs_length=0;for(var sub in topics[topic]["subs"]){if(sub.match(/t[0-9]+/i)){subs_length++;break;}}
if(typeof(open)=='undefined'||open!==false)
open=true;topic_id=topic.replace(/[^0-9]+/i,"");if(topics[topic]["sel"]=="1"&&topic!="t0"){var topen;if((open||subs_length>0)&&(!xDef(topics[topic]["open"])||topics[topic]["open"]))
topen=true;else
topen=false;check($("i"+topic_id),$("c"+topic_id),topen,false);}
else if(topic!="t0"){var topen;if((open||subs_length>0)&&(!xDef(topics[topic]["open"])||topics[topic]["open"]))
topen=true;else
topen=false;uncheck($("i"+topic_id),$("c"+topic_id),topen,false);}
if(topics[topic]["all"]=="1"){if($(topic))
checkAll($(topic),false,false);}
else{if($(topic))
uncheckAll($(topic),false,false);}
if(subs_length>0){selectTopicsFromJSON(topics[topic].subs,open);}}}
function clone(myObj){if(typeof(myObj)!='object')return myObj;if(myObj==null)return myObj;var myNewObj=new Object();for(var i in myObj){if(i=="mArticleID"||i=="mTitle"||i=="canEditQ"||i=="isAnswered"||i=="isSysop"||i=="numAlts"||i=="isProtected"||i=="all"||i=="subs"||i=="sel"||i.match(/^t[0-9]+$/i))
myNewObj[i]=clone(myObj[i]);}
return myNewObj;}
function setSearchTabs(){jQuery('#AdvancedSearchMenu a').click(function(){searchTabs(jQuery(this),jQuery(this).attr('class'));});var hashTag=document.location.hash;if(hashTag!=""&&hashTag.substring(0,3)!="#?="){var subHashTag=document.location.hash.substring(1);searchTabs(jQuery('.'+subHashTag),subHashTag);}}
function showTopicsHint(id){var jElem=jQuery("#"+id);popup_elem.build(jElem,230,0);if(categories_list.length==0){popup_elem.makeTooltip("Click here to choose categories to include or exclude in your search");}else{popup_elem.makeTooltip("Click here to edit the list of categories you\'re searching in");}
popup_elem.moveFromElemX(-20);var moveY=($('tooltip_elem'))?-($('tooltip_elem').getHeight()):-45;popup_elem.moveFromElemY(moveY);}
function selectAllCats(){categories_list=[];$('topics_hint').innerHTML="all categories";$('searchform').trunks.value='{"t0":{"sel":1,"all":1,"subs":[]}}';$('notin').innerHTML="";search_trunks=URLEncodeEmail($('searchform').trunks.value);navGo(1);}
function check_searchA(elem){btnElm=jQuery('#searchanswersform').find("a.btn:first");if(jQuery(elem).val().length>2){btnElm.enableBtn();}else{btnElm.disableBtn();}}
function check_searchRA(elem){btnElm=jQuery('form[name=raSearch]').find("a.btn:first");if(jQuery(elem).val().length>0){btnElm.enableBtn();}else{btnElm.disableBtn();}}
function check_searchM(elem){btnElm=jQuery('#userNameSearch').find("a.btn:first");if(jQuery(elem).val().length>2){btnElm.enableBtn();}else{btnElm.disableBtn();}}
function check_searchQ(elem){return false;}
function searchTabs(link,id){jQuery('#selected').attr('id','');jQuery(link).attr('id','selected');jQuery("#"+current_id).hide();text_id=jQuery('#text_'+id);jQuery(text_id).val(jQuery('#text_'+current_id).val());checkID="check_"+id+'(text_id)';jQuery("#"+id).show();eval(checkID);current_id=id;}
handleEnterKeyOnForms("searchform");handleEnterKeyOnForms("searchanswersform");handleEnterKeyOnForms("userNameSearch");var isIE=navigator.userAgent.toLowerCase().indexOf("msie")>-1;var isMoz=document.implementation&&document.implementation.createDocument;var isSafari=((navigator.userAgent.toLowerCase().indexOf('safari')!=-1)&&(navigator.userAgent.toLowerCase().indexOf('mac')!=-1))?true:false;function curvyCorners()
{if(typeof(arguments[0])!="object")throw newCurvyError("First parameter of curvyCorners() must be an object.");if(typeof(arguments[1])!="object"&&typeof(arguments[1])!="string")throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name.");if(typeof(arguments[1])=="string")
{var startIndex=0;var boxCol=getElementsByClass(arguments[1]);}
else
{var startIndex=1;var boxCol=arguments;}
var curvyCornersCol=new Array();if(arguments[0].validTags)
var validElements=arguments[0].validTags;else
var validElements=["div"];for(var i=startIndex,j=boxCol.length;i<j;i++)
{var currentTag=boxCol[i].tagName.toLowerCase();if(inArray(validElements,currentTag)!==false)
{curvyCornersCol[curvyCornersCol.length]=new curvyObject(arguments[0],boxCol[i]);}}
this.objects=curvyCornersCol;this.applyCornersToAll=function()
{for(var x=0,k=this.objects.length;x<k;x++)
{this.objects[x].applyCorners();}}}
function curvyObject()
{this.box=arguments[1];this.settings=arguments[0];this.topContainer=null;this.bottomContainer=null;this.masterCorners=new Array();this.contentDIV=null;var boxHeight=get_style(this.box,"height","height");var boxWidth=get_style(this.box,"width","width");var borderWidth=get_style(this.box,"borderTopWidth","border-top-width");var borderColour=get_style(this.box,"borderTopColor","border-top-color");var boxColour=get_style(this.box,"backgroundColor","background-color");var backgroundImage=get_style(this.box,"backgroundImage","background-image");var boxPosition=get_style(this.box,"position","position");var boxPadding=get_style(this.box,"paddingTop","padding-top");this.boxHeight=parseInt(((boxHeight!=""&&boxHeight!="auto"&&boxHeight.indexOf("%")==-1)?boxHeight.substring(0,boxHeight.indexOf("px")):this.box.scrollHeight));this.boxWidth=parseInt(((boxWidth!=""&&boxWidth!="auto"&&boxWidth.indexOf("%")==-1)?boxWidth.substring(0,boxWidth.indexOf("px")):this.box.scrollWidth));this.borderWidth=parseInt(((borderWidth!=""&&borderWidth.indexOf("px")!==-1)?borderWidth.slice(0,borderWidth.indexOf("px")):0));this.boxColour=format_colour(boxColour);this.boxPadding=parseInt(((boxPadding!=""&&boxPadding.indexOf("px")!==-1)?boxPadding.slice(0,boxPadding.indexOf("px")):0));this.borderColour=format_colour(borderColour);this.borderString=this.borderWidth+"px"+" solid "+this.borderColour;this.backgroundImage=((backgroundImage!="none")?backgroundImage:"");this.boxContent=this.box.innerHTML;if(boxPosition!="absolute")this.box.style.position="relative";this.box.style.padding="0px";if(isIE&&boxWidth=="auto"&&boxHeight=="auto")this.box.style.width="100%";if(this.settings.autoPad==true&&this.boxPadding>0)
this.box.innerHTML="";this.applyCorners=function()
{for(var t=0;t<2;t++)
{switch(t)
{case 0:if(this.settings.tl||this.settings.tr)
{var newMainContainer=document.createElement("DIV");newMainContainer.style.width="100%";newMainContainer.style.fontSize="1px";newMainContainer.style.overflow="hidden";newMainContainer.style.position="absolute";newMainContainer.style.paddingLeft=this.borderWidth+"px";newMainContainer.style.paddingRight=this.borderWidth+"px";var topMaxRadius=Math.max(this.settings.tl?this.settings.tl.radius:0,this.settings.tr?this.settings.tr.radius:0);newMainContainer.style.height=topMaxRadius+"px";newMainContainer.style.top=0-topMaxRadius+"px";newMainContainer.style.left=0-this.borderWidth+"px";this.topContainer=this.box.appendChild(newMainContainer);}
break;case 1:if(this.settings.bl||this.settings.br)
{var newMainContainer=document.createElement("DIV");newMainContainer.style.width="100%";newMainContainer.style.fontSize="1px";newMainContainer.style.overflow="hidden";newMainContainer.style.position="absolute";newMainContainer.style.paddingLeft=this.borderWidth+"px";newMainContainer.style.paddingRight=this.borderWidth+"px";var botMaxRadius=Math.max(this.settings.bl?this.settings.bl.radius:0,this.settings.br?this.settings.br.radius:0);newMainContainer.style.height=botMaxRadius+"px";newMainContainer.style.bottom=0-botMaxRadius+"px";newMainContainer.style.left=0-this.borderWidth+"px";this.bottomContainer=this.box.appendChild(newMainContainer);}
break;}}
if(this.topContainer)this.box.style.borderTopWidth="0px";if(this.bottomContainer)this.box.style.borderBottomWidth="0px";var corners=["tr","tl","br","bl"];for(var i in corners)
{if(i>-1<4)
{var cc=corners[i];if(!this.settings[cc])
{if(((cc=="tr"||cc=="tl")&&this.topContainer!=null)||((cc=="br"||cc=="bl")&&this.bottomContainer!=null))
{var newCorner=document.createElement("DIV");newCorner.style.position="relative";newCorner.style.fontSize="1px";newCorner.style.overflow="hidden";if(this.backgroundImage=="")
newCorner.style.backgroundColor=this.boxColour;else
newCorner.style.backgroundImage=this.backgroundImage;switch(cc)
{case"tl":newCorner.style.height=topMaxRadius-this.borderWidth+"px";newCorner.style.marginRight=this.settings.tr.radius-(this.borderWidth*2)+"px";newCorner.style.borderLeft=this.borderString;newCorner.style.borderTop=this.borderString;newCorner.style.left=-this.borderWidth+"px";break;case"tr":newCorner.style.height=topMaxRadius-this.borderWidth+"px";newCorner.style.marginLeft=this.settings.tl.radius-(this.borderWidth*2)+"px";newCorner.style.borderRight=this.borderString;newCorner.style.borderTop=this.borderString;newCorner.style.backgroundPosition="-"+(topMaxRadius+this.borderWidth)+"px 0px";newCorner.style.left=this.borderWidth+"px";break;case"bl":newCorner.style.height=botMaxRadius-this.borderWidth+"px";newCorner.style.marginRight=this.settings.br.radius-(this.borderWidth*2)+"px";newCorner.style.borderLeft=this.borderString;newCorner.style.borderBottom=this.borderString;newCorner.style.left=-this.borderWidth+"px";newCorner.style.backgroundPosition="-"+(this.borderWidth)+"px -"+(this.boxHeight+(botMaxRadius+this.borderWidth))+"px";break;case"br":newCorner.style.height=botMaxRadius-this.borderWidth+"px";newCorner.style.marginLeft=this.settings.bl.radius-(this.borderWidth*2)+"px";newCorner.style.borderRight=this.borderString;newCorner.style.borderBottom=this.borderString;newCorner.style.left=this.borderWidth+"px"
newCorner.style.backgroundPosition="-"+(botMaxRadius+this.borderWidth)+"px -"+(this.boxHeight+(botMaxRadius+this.borderWidth))+"px";break;}}}
else
{if(this.masterCorners[this.settings[cc].radius])
{var newCorner=this.masterCorners[this.settings[cc].radius].cloneNode(true);}
else
{var newCorner=document.createElement("DIV");newCorner.style.height=this.settings[cc].radius+"px";newCorner.style.width=this.settings[cc].radius+"px";newCorner.style.position="absolute";newCorner.style.fontSize="1px";newCorner.style.overflow="hidden";var borderRadius=parseInt(this.settings[cc].radius-this.borderWidth);for(var intx=0,j=this.settings[cc].radius;intx<j;intx++)
{if((intx+1)>=borderRadius)
var y1=-1;else
var y1=(Math.floor(Math.sqrt(Math.pow(borderRadius,2)-Math.pow((intx+1),2)))-1);if(borderRadius!=j)
{if((intx)>=borderRadius)
var y2=-1;else
var y2=Math.ceil(Math.sqrt(Math.pow(borderRadius,2)-Math.pow(intx,2)));if((intx+1)>=j)
var y3=-1;else
var y3=(Math.floor(Math.sqrt(Math.pow(j,2)-Math.pow((intx+1),2)))-1);}
if((intx)>=j)
var y4=-1;else
var y4=Math.ceil(Math.sqrt(Math.pow(j,2)-Math.pow(intx,2)));if(y1>-1)this.drawPixel(intx,0,this.boxColour,100,(y1+1),newCorner,-1,this.settings[cc].radius);if(borderRadius!=j)
{for(var inty=(y1+1);inty<y2;inty++)
{if(this.settings.antiAlias)
{if(this.backgroundImage!="")
{var borderFract=(pixelFraction(intx,inty,borderRadius)*100);if(borderFract<30)
{this.drawPixel(intx,inty,this.borderColour,100,1,newCorner,0,this.settings[cc].radius);}
else
{this.drawPixel(intx,inty,this.borderColour,100,1,newCorner,-1,this.settings[cc].radius);}}
else
{var pixelcolour=BlendColour(this.boxColour,this.borderColour,pixelFraction(intx,inty,borderRadius));this.drawPixel(intx,inty,pixelcolour,100,1,newCorner,0,this.settings[cc].radius,cc);}}}
if(this.settings.antiAlias)
{if(y3>=y2)
{if(y2==-1)y2=0;this.drawPixel(intx,y2,this.borderColour,100,(y3-y2+1),newCorner,0,0);}}
else
{if(y3>=y1)
{this.drawPixel(intx,(y1+1),this.borderColour,100,(y3-y1),newCorner,0,0);}}
var outsideColour=this.borderColour;}
else
{var outsideColour=this.boxColour;var y3=y1;}
if(this.settings.antiAlias)
{for(var inty=(y3+1);inty<y4;inty++)
{this.drawPixel(intx,inty,outsideColour,(pixelFraction(intx,inty,j)*100),1,newCorner,((this.borderWidth>0)?0:-1),this.settings[cc].radius);}}}
this.masterCorners[this.settings[cc].radius]=newCorner.cloneNode(true);}
if(cc!="br")
{for(var t=0,k=newCorner.childNodes.length;t<k;t++)
{var pixelBar=newCorner.childNodes[t];var pixelBarTop=parseInt(pixelBar.style.top.substring(0,pixelBar.style.top.indexOf("px")));var pixelBarLeft=parseInt(pixelBar.style.left.substring(0,pixelBar.style.left.indexOf("px")));var pixelBarHeight=parseInt(pixelBar.style.height.substring(0,pixelBar.style.height.indexOf("px")));if(cc=="tl"||cc=="bl"){pixelBar.style.left=this.settings[cc].radius-pixelBarLeft-1+"px";}
if(cc=="tr"||cc=="tl"){pixelBar.style.top=this.settings[cc].radius-pixelBarHeight-pixelBarTop+"px";}
switch(cc)
{case"tr":pixelBar.style.backgroundPosition="-"+Math.abs((this.boxWidth-this.settings[cc].radius+this.borderWidth)+pixelBarLeft)+"px -"+Math.abs(this.settings[cc].radius-pixelBarHeight-pixelBarTop-this.borderWidth)+"px";break;case"tl":pixelBar.style.backgroundPosition="-"+Math.abs((this.settings[cc].radius-pixelBarLeft-1)-this.borderWidth)+"px -"+Math.abs(this.settings[cc].radius-pixelBarHeight-pixelBarTop-this.borderWidth)+"px";break;case"bl":pixelBar.style.backgroundPosition="-"+Math.abs((this.settings[cc].radius-pixelBarLeft-1)-this.borderWidth)+"px -"+Math.abs((this.boxHeight+this.settings[cc].radius+pixelBarTop)-this.borderWidth)+"px";break;}}}}
if(newCorner)
{switch(cc)
{case"tl":if(newCorner.style.position=="absolute")newCorner.style.top="0px";if(newCorner.style.position=="absolute")newCorner.style.left="0px";if(this.topContainer)this.topContainer.appendChild(newCorner);break;case"tr":if(newCorner.style.position=="absolute")newCorner.style.top="0px";if(newCorner.style.position=="absolute")newCorner.style.right="0px";if(this.topContainer)this.topContainer.appendChild(newCorner);break;case"bl":if(newCorner.style.position=="absolute")newCorner.style.bottom="0px";if(newCorner.style.position=="absolute")newCorner.style.left="0px";if(this.bottomContainer)this.bottomContainer.appendChild(newCorner);break;case"br":if(newCorner.style.position=="absolute")newCorner.style.bottom="0px";if(newCorner.style.position=="absolute")newCorner.style.right="0px";if(this.bottomContainer)this.bottomContainer.appendChild(newCorner);break;}}}}
var radiusDiff=new Array();radiusDiff["t"]=Math.abs(this.settings.tl.radius-this.settings.tr.radius)
radiusDiff["b"]=Math.abs(this.settings.bl.radius-this.settings.br.radius);for(z in radiusDiff)
{if(z=="t"||z=="b")
{if(radiusDiff[z])
{var smallerCornerType=((this.settings[z+"l"].radius<this.settings[z+"r"].radius)?z+"l":z+"r");var newFiller=document.createElement("DIV");newFiller.style.height=radiusDiff[z]+"px";newFiller.style.width=this.settings[smallerCornerType].radius+"px"
newFiller.style.position="absolute";newFiller.style.fontSize="1px";newFiller.style.overflow="hidden";newFiller.style.backgroundColor=this.boxColour;switch(smallerCornerType)
{case"tl":newFiller.style.bottom="0px";newFiller.style.left="0px";newFiller.style.borderLeft=this.borderString;this.topContainer.appendChild(newFiller);break;case"tr":newFiller.style.bottom="0px";newFiller.style.right="0px";newFiller.style.borderRight=this.borderString;this.topContainer.appendChild(newFiller);break;case"bl":newFiller.style.top="0px";newFiller.style.left="0px";newFiller.style.borderLeft=this.borderString;this.bottomContainer.appendChild(newFiller);break;case"br":newFiller.style.top="0px";newFiller.style.right="0px";newFiller.style.borderRight=this.borderString;this.bottomContainer.appendChild(newFiller);break;}}
var newFillerBar=document.createElement("DIV");newFillerBar.style.position="relative";newFillerBar.style.fontSize="1px";newFillerBar.style.overflow="hidden";newFillerBar.style.backgroundColor=this.boxColour;newFillerBar.style.backgroundImage=this.backgroundImage;switch(z)
{case"t":if(this.topContainer)
{if(this.settings.tl.radius&&this.settings.tr.radius)
{newFillerBar.style.height=topMaxRadius-this.borderWidth+"px";newFillerBar.style.marginLeft=this.settings.tl.radius-this.borderWidth+"px";newFillerBar.style.marginRight=this.settings.tr.radius-this.borderWidth+"px";newFillerBar.style.borderTop=this.borderString;if(this.backgroundImage!="")
newFillerBar.style.backgroundPosition="-"+(topMaxRadius+this.borderWidth)+"px 0px";this.topContainer.appendChild(newFillerBar);}
this.box.style.backgroundPosition="0px -"+(topMaxRadius-this.borderWidth)+"px";}
break;case"b":if(this.bottomContainer)
{if(this.settings.bl.radius&&this.settings.br.radius)
{newFillerBar.style.height=botMaxRadius-this.borderWidth+"px";newFillerBar.style.marginLeft=this.settings.bl.radius-this.borderWidth+"px";newFillerBar.style.marginRight=this.settings.br.radius-this.borderWidth+"px";newFillerBar.style.borderBottom=this.borderString;if(this.backgroundImage!="")
newFillerBar.style.backgroundPosition="-"+(botMaxRadius+this.borderWidth)+"px -"+(this.boxHeight+(topMaxRadius+this.borderWidth))+"px";this.bottomContainer.appendChild(newFillerBar);}}
break;}}}
if(this.settings.autoPad==true&&this.boxPadding>0)
{var contentContainer=document.createElement("DIV");contentContainer.style.position="relative";contentContainer.innerHTML=this.boxContent;contentContainer.className="autoPadDiv";var topPadding=Math.abs(topMaxRadius-this.boxPadding);var botPadding=Math.abs(botMaxRadius-this.boxPadding);if(topMaxRadius<this.boxPadding)
contentContainer.style.paddingTop=topPadding+"px";if(botMaxRadius<this.boxPadding)
contentContainer.style.paddingBottom=botMaxRadius+"px";contentContainer.style.paddingLeft=this.boxPadding+"px";contentContainer.style.paddingRight=this.boxPadding+"px";this.contentDIV=this.box.appendChild(contentContainer);}}
this.drawPixel=function(intx,inty,colour,transAmount,height,newCorner,image,cornerRadius)
{var pixel=document.createElement("DIV");pixel.style.height=height+"px";pixel.style.width="1px";pixel.style.position="absolute";pixel.style.fontSize="1px";pixel.style.overflow="hidden";var topMaxRadius=Math.max(this.settings["tr"].radius,this.settings["tl"].radius);if(image==-1&&this.backgroundImage!="")
{pixel.style.backgroundImage=this.backgroundImage;pixel.style.backgroundPosition="-"+(this.boxWidth-(cornerRadius-intx)+this.borderWidth)+"px -"+((this.boxHeight+topMaxRadius+inty)-this.borderWidth)+"px";}
else
{pixel.style.backgroundColor=colour;}
if(transAmount!=100)
setOpacity(pixel,transAmount);pixel.style.top=inty+"px";pixel.style.left=intx+"px";newCorner.appendChild(pixel);}}
function insertAfter(parent,node,referenceNode)
{parent.insertBefore(node,referenceNode.nextSibling);}
function BlendColour(Col1,Col2,Col1Fraction)
{var red1=parseInt(Col1.substr(1,2),16);var green1=parseInt(Col1.substr(3,2),16);var blue1=parseInt(Col1.substr(5,2),16);var red2=parseInt(Col2.substr(1,2),16);var green2=parseInt(Col2.substr(3,2),16);var blue2=parseInt(Col2.substr(5,2),16);if(Col1Fraction>1||Col1Fraction<0)Col1Fraction=1;var endRed=Math.round((red1*Col1Fraction)+(red2*(1-Col1Fraction)));if(endRed>255)endRed=255;if(endRed<0)endRed=0;var endGreen=Math.round((green1*Col1Fraction)+(green2*(1-Col1Fraction)));if(endGreen>255)endGreen=255;if(endGreen<0)endGreen=0;var endBlue=Math.round((blue1*Col1Fraction)+(blue2*(1-Col1Fraction)));if(endBlue>255)endBlue=255;if(endBlue<0)endBlue=0;return"#"+IntToHex(endRed)+IntToHex(endGreen)+IntToHex(endBlue);}
function IntToHex(strNum)
{base=strNum/16;rem=strNum%16;base=base-(rem/16);baseS=MakeHex(base);remS=MakeHex(rem);return baseS+''+remS;}
function MakeHex(x)
{if((x>=0)&&(x<=9))
{return x;}
else
{switch(x)
{case 10:return"A";case 11:return"B";case 12:return"C";case 13:return"D";case 14:return"E";case 15:return"F";}}}
function pixelFraction(x,y,r)
{var pixelfraction=0;var xvalues=new Array(1);var yvalues=new Array(1);var point=0;var whatsides="";var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x,2)));if((intersect>=y)&&(intersect<(y+1)))
{whatsides="Left";xvalues[point]=0;yvalues[point]=intersect-y;point=point+1;}
var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y+1,2)));if((intersect>=x)&&(intersect<(x+1)))
{whatsides=whatsides+"Top";xvalues[point]=intersect-x;yvalues[point]=1;point=point+1;}
var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(x+1,2)));if((intersect>=y)&&(intersect<(y+1)))
{whatsides=whatsides+"Right";xvalues[point]=1;yvalues[point]=intersect-y;point=point+1;}
var intersect=Math.sqrt((Math.pow(r,2)-Math.pow(y,2)));if((intersect>=x)&&(intersect<(x+1)))
{whatsides=whatsides+"Bottom";xvalues[point]=intersect-x;yvalues[point]=0;}
switch(whatsides)
{case"LeftRight":pixelfraction=Math.min(yvalues[0],yvalues[1])+((Math.max(yvalues[0],yvalues[1])-Math.min(yvalues[0],yvalues[1]))/2);break;case"TopRight":pixelfraction=1-(((1-xvalues[0])*(1-yvalues[1]))/2);break;case"TopBottom":pixelfraction=Math.min(xvalues[0],xvalues[1])+((Math.max(xvalues[0],xvalues[1])-Math.min(xvalues[0],xvalues[1]))/2);break;case"LeftBottom":pixelfraction=(yvalues[0]*xvalues[1])/2;break;default:pixelfraction=1;}
return pixelfraction;}
function rgb2Hex(rgbColour)
{try{var rgbArray=rgb2Array(rgbColour);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);var hexColour="#"+IntToHex(red)+IntToHex(green)+IntToHex(blue);}
catch(e){alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");}
return hexColour;}
function rgb2Array(rgbColour)
{var rgbValues=rgbColour.substring(4,rgbColour.indexOf(")"));var rgbArray=rgbValues.split(", ");return rgbArray;}
function setOpacity(obj,opacity)
{opacity=(opacity==100)?99.999:opacity;if(isSafari&&obj.tagName!="IFRAME")
{var rgbArray=rgb2Array(obj.style.backgroundColor);var red=parseInt(rgbArray[0]);var green=parseInt(rgbArray[1]);var blue=parseInt(rgbArray[2]);obj.style.backgroundColor="rgba("+red+", "+green+", "+blue+", "+opacity/100+")";}
else if(typeof(obj.style.opacity)!="undefined")
{obj.style.opacity=opacity/100;}
else if(typeof(obj.style.MozOpacity)!="undefined")
{obj.style.MozOpacity=opacity/100;}
else if(typeof(obj.style.filter)!="undefined")
{obj.style.filter="alpha(opacity:"+opacity+")";}
else if(typeof(obj.style.KHTMLOpacity)!="undefined")
{obj.style.KHTMLOpacity=opacity/100;}}
function inArray(array,value)
{for(var i=0;i<array.length;i++){if(array[i]===value)return i;}
return false;}
function inArrayKey(array,value)
{for(key in array){if(key===value)return true;}
return false;}
function addEvent(elm,evType,fn,useCapture){if(elm.addEventListener){elm.addEventListener(evType,fn,useCapture);return true;}
else if(elm.attachEvent){var r=elm.attachEvent('on'+evType,fn);return r;}
else{elm['on'+evType]=fn;}}
function removeEvent(obj,evType,fn,useCapture){if(obj.removeEventListener){obj.removeEventListener(evType,fn,useCapture);return true;}else if(obj.detachEvent){var r=obj.detachEvent("on"+evType,fn);return r;}else{alert("Handler could not be removed");}}
function format_colour(colour)
{var returnColour="#ffffff";if(colour!=""&&colour!="transparent")
{if(colour.substr(0,3)=="rgb")
{returnColour=rgb2Hex(colour);}
else if(colour.length==4)
{returnColour="#"+colour.substring(1,2)+colour.substring(1,2)+colour.substring(2,3)+colour.substring(2,3)+colour.substring(3,4)+colour.substring(3,4);}
else
{returnColour=colour;}}
return returnColour;}
function get_style(obj,property,propertyNS)
{try
{if(obj.currentStyle)
{var returnVal=eval("obj.currentStyle."+property);}
else
{if(isSafari&&obj.style.display=="none")
{obj.style.display="";var wasHidden=true;}
var returnVal=document.defaultView.getComputedStyle(obj,'').getPropertyValue(propertyNS);if(isSafari&&wasHidden)
{obj.style.display="none";}}}
catch(e)
{}
return returnVal;}
function getElementsByClass(searchClass,node,tag)
{var classElements=new Array();if(node==null)
node=document;if(tag==null)
tag='*';var els=node.getElementsByTagName(tag);var elsLen=els.length;var pattern=new RegExp("(^|\s)"+searchClass+"(\s|$)");for(i=0,j=0;i<elsLen;i++)
{if(pattern.test(els[i].className))
{classElements[j]=els[i];j++;}}
return classElements;}
function newCurvyError(errorMessage)
{return new Error("curvyCorners Error:\n"+errorMessage)}
var capitalOne_round8={tl:{radius:8},tr:{radius:8},bl:{radius:8},br:{radius:8},antiAlias:true,autoPad:false};function capitalOneround(id){if(document.getElementById(id)){cornersObj=new curvyCorners(capitalOne_round8,document.getElementById(id));cornersObj.applyCornersToAll();}}
function roundCorners(){capitalOneround('capitalOne');capitalOneround('question_title');capitalOneround('question_tools');Event.stopObserving(window,"load",cursorToBox);}
function getElementsByClassName(classname){var elements=document.getElementsByTagName('*');classname=classname.toLowerCase();var allClassElements=new Array();for(var i=0;i<elements.length;i++)
{if(isMatching(elements[i].className.toLowerCase(),classname)){allClassElements.push(elements[i]);}}
return allClassElements;}
var Prototype={Version:'1.6.0.2',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/')>-1,Gecko:navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement('div').__proto__&&document.createElement('div').__proto__!==document.createElement('form').__proto__},ScriptFragment:'<script[^>]*>([\\S\\s]*?)<\/script>',JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}};if(Prototype.Browser.MobileSafari)
Prototype.BrowserFeatures.SpecificElementExtensions=false;var Class={create:function(){var parent=null,properties=$A(arguments);if(Object.isFunction(properties[0]))
parent=properties.shift();function klass(){this.initialize.apply(this,arguments);}
Object.extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){var subclass=function(){};subclass.prototype=parent.prototype;klass.prototype=new subclass;parent.subclasses.push(klass);}
for(var i=0;i<properties.length;i++)
klass.addMethods(properties[i]);if(!klass.prototype.initialize)
klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass;}};Class.Methods={addMethods:function(source){var ancestor=this.superclass&&this.superclass.prototype;var properties=Object.keys(source);if(!Object.keys({toString:true}).length)
properties.push("toString","valueOf");for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var method=value,value=Object.extend((function(m){return function(){return ancestor[m].apply(this,arguments)};})(property).wrap(method),{valueOf:function(){return method},toString:function(){return method.toString()}});}
this.prototype[property]=value;}
return this;}};var Abstract={};Object.extend=function(destination,source){for(var property in source)
destination[property]=source[property];return destination;};Object.extend(Object,{inspect:function(object){try{if(Object.isUndefined(object))return'undefined';if(object===null)return'null';return object.inspect?object.inspect():String(object);}catch(e){if(e instanceof RangeError)return'...';throw e;}},toJSON:function(object){var type=typeof object;switch(type){case'undefined':case'function':case'unknown':return;case'boolean':return object.toString();}
if(object===null)return'null';if(object.toJSON)return object.toJSON();if(Object.isElement(object))return;var results=[];for(var property in object){var value=Object.toJSON(object[property]);if(!Object.isUndefined(value))
results.push(property.toJSON()+': '+value);}
return'{'+results.join(', ')+'}';},toQueryString:function(object){return $H(object).toQueryString();},toHTML:function(object){return object&&object.toHTML?object.toHTML():String.interpret(object);},keys:function(object){var keys=[];for(var property in object)
keys.push(property);return keys;},values:function(object){var values=[];for(var property in object)
values.push(object[property]);return values;},clone:function(object){return Object.extend({},object);},isElement:function(object){return object&&object.nodeType==1;},isArray:function(object){return object!=null&&typeof object=="object"&&'splice'in object&&'join'in object;},isHash:function(object){return object instanceof Hash;},isFunction:function(object){return typeof object=="function";},isString:function(object){return typeof object=="string";},isNumber:function(object){return typeof object=="number";},isUndefined:function(object){return typeof object=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var names=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return names.length==1&&!names[0]?[]:names;},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}},bindAsEventListener:function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args));}},curry:function(){if(!arguments.length)return this;var __method=this,args=$A(arguments);return function(){return __method.apply(this,args.concat($A(arguments)));}},delay:function(){var __method=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return __method.apply(__method,args);},timeout);},wrap:function(wrapper){var __method=this;return function(){return wrapper.apply(this,[__method.bind(this)].concat($A(arguments)));}},methodize:function(){if(this._methodized)return this._methodized;var __method=this;return this._methodized=function(){return __method.apply(null,[this].concat($A(arguments)));};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+'-'+
(this.getUTCMonth()+1).toPaddedString(2)+'-'+
this.getUTCDate().toPaddedString(2)+'T'+
this.getUTCHours().toPaddedString(2)+':'+
this.getUTCMinutes().toPaddedString(2)+':'+
this.getUTCSeconds().toPaddedString(2)+'Z"';};var Try={these:function(){var returnValue;for(var i=0,length=arguments.length;i<length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1');};var PeriodicalExecuter=Class.create({initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},execute:function(){this.callback(this);},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();}finally{this.currentlyExecuting=false;}}}});Object.extend(String,{interpret:function(value){return value==null?'':String(value);},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,{gsub:function(pattern,replacement){var result='',source=this,match;replacement=arguments.callee.prepareReplacement(replacement);while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length);}else{result+=source,source='';}}
return result;},sub:function(pattern,replacement,count){replacement=this.gsub.prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0)return match[0];return replacement(match);});},scan:function(pattern,iterator){this.gsub(pattern,iterator);return String(this);},truncate:function(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?'...':truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this);},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'');},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},normalize_space:function(){return this.replace(/^\s*|\s(?=\s)|\s*$/g,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script)});},escapeHTML:function(){var self=arguments.callee;self.text.data=this;return self.div.innerHTML;},unescapeHTML:function(){var div=new Element('div');div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject('',function(memo,node){return memo+node.nodeValue}):div.childNodes[0].nodeValue):'';},toQueryParams:function(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match)return{};return match[1].split(separator||'&').inject({},function(hash,pair){if((pair=pair.split('='))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join('='):pair[0];if(value!=undefined)value=decodeURIComponent(value);if(key in hash){if(!Object.isArray(hash[key]))hash[key]=[hash[key]];hash[key].push(value);}
else hash[key]=value;}
return hash;});},toArray:function(){return this.split('');},succ:function(){return this.slice(0,this.length-1)+
String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(count){return count<1?'':new Array(count+1).join(this);},camelize:function(){var parts=this.split('-'),len=parts.length;if(len==1)return parts[0];var camelized=this.charAt(0)=='-'?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++)
camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1);return camelized;},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase();},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();},dasherize:function(){return this.gsub(/_/,'-');},inspect:function(useDoubleQuotes){var escapedString=this.gsub(/[\x00-\x1f\\]/,function(match){var character=String.specialChar[match[0]];return character?character:'\\u00'+match[0].charCodeAt().toPaddedString(2,16);});if(useDoubleQuotes)return'"'+escapedString.replace(/"/g,'\\"')+'"';return"'"+escapedString.replace(/'/g,'\\\'')+"'";},toJSON:function(){return this.inspect(true);},unfilterJSON:function(filter){return this.sub(filter||Prototype.JSONFilter,'#{1}');},isJSON:function(){var str=this;if(str.blank())return false;str=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);},evalJSON:function(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON())return eval('('+json+')');}catch(e){}
throw new SyntaxError('Badly formed JSON string: '+this.inspect());},include:function(pattern){return this.indexOf(pattern)>-1;},startsWith:function(pattern){return this.indexOf(pattern)===0;},endsWith:function(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d;},empty:function(){return this=='';},blank:function(){return/^\s*$/.test(this);},interpolate:function(object,pattern){return new Template(this,pattern).evaluate(object);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE)Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');},unescapeHTML:function(){return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');}});String.prototype.gsub.prepareReplacement=function(replacement){if(Object.isFunction(replacement))return replacement;var template=new Template(replacement);return function(match){return template.evaluate(match)};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement('div'),text:document.createTextNode('')});with(String.prototype.escapeHTML)div.appendChild(text);var Template=Class.create({initialize:function(template,pattern){this.template=template.toString();this.pattern=pattern||Template.Pattern;},evaluate:function(object){if(Object.isFunction(object.toTemplateReplacements))
object=object.toTemplateReplacements();return this.template.gsub(this.pattern,function(match){if(object==null)return'';var before=match[1]||'';if(before=='\\')return match[2];var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null)return before;while(match!=null){var comp=match[1].startsWith('[')?match[2].gsub('\\\\]',']'):match[1];ctx=ctx[comp];if(null==ctx||''==match[3])break;expr=expr.substring('['==match[3]?match[1].length:match[0].length);match=pattern.exec(expr);}
return before+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(iterator,context){var index=0;iterator=iterator.bind(context);try{this._each(function(value){iterator(value,index++);});}catch(e){if(e!=$break)throw e;}
return this;},eachSlice:function(number,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var index=-number,slices=[],array=this.toArray();while((index+=number)<array.length)
slices.push(array.slice(index,index+number));return slices.collect(iterator,context);},all:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=true;this.each(function(value,index){result=result&&!!iterator(value,index);if(!result)throw $break;});return result;},any:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result=false;this.each(function(value,index){if(result=!!iterator(value,index))
throw $break;});return result;},collect:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator,context){iterator=iterator.bind(context);var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(filter,iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var results=[];if(Object.isString(filter))
filter=new RegExp(filter);this.each(function(value,index){if(filter.match(value))
results.push(iterator(value,index));});return results;},include:function(object){if(Object.isFunction(this.indexOf))
if(this.indexOf(object)!=-1)return true;var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inGroupsOf:function(number,fillWith){fillWith=Object.isUndefined(fillWith)?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number)slice.push(fillWith);return slice;});},inject:function(memo,iterator,context){iterator=iterator.bind(context);this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args);});},max:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value>=result)
result=value;});return result;},min:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var result;this.each(function(value,index){value=iterator(value,index);if(result==null||value<result)
result=value;});return result;},partition:function(iterator,context){iterator=iterator?iterator.bind(context):Prototype.K;var trues=[],falses=[];this.each(function(value,index){(iterator(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value){results.push(value[property]);});return results;},reject:function(iterator,context){iterator=iterator.bind(context);var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator,context){iterator=iterator.bind(context);return this.map(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.map();},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){return iterator(collections.pluck(index));});},size:function(){return this.toArray().length;},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(iterable){if(!iterable)return[];if(iterable.toArray)return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;}
if(Prototype.Browser.WebKit){$A=function(iterable){if(!iterable)return[];if(!(Object.isFunction(iterable)&&iterable=='[object NodeList]')&&iterable.toArray)return iterable.toArray();var length=iterable.length||0,results=new Array(length);while(length--)results[length]=iterable[length];return results;};}
Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0,length=this.length;i<length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(Object.isArray(value)?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(sorted){return this.inject([],function(array,value,index){if(0==index||(sorted?array.last()!=value:!array.include(value)))
array.push(value);return array;});},intersect:function(array){return this.uniq().findAll(function(item){return array.detect(function(value){return item===value});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';},toJSON:function(){var results=[];this.each(function(object){var value=Object.toJSON(object);if(!Object.isUndefined(value))results.push(value);});return'['+results.join(', ')+']';}});if(Object.isFunction(Array.prototype.forEach))
Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(item,i){i||(i=0);var length=this.length;if(i<0)i=length+i;for(;i<length;i++)
if(this[i]===item)return i;return-1;};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(item);return(n<0)?n:i-n-1;};Array.prototype.toArray=Array.prototype.clone;function $w(string){if(!Object.isString(string))return[];string=string.strip();return string?string.split(/\s+/):[];}
if(Prototype.Browser.Opera){Array.prototype.concat=function(){var array=[];for(var i=0,length=this.length;i<length;i++)array.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)
array.push(arguments[i][j]);}else{array.push(arguments[i]);}}
return array;};}
Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;},toPaddedString:function(length,radix){var string=this.toString(radix||10);return'0'.times(length-string.length)+string;},toJSON:function(){return isFinite(this)?this.toString():'null';}});$w('abs round ceil floor').each(function(method){Number.prototype[method]=Math[method].methodize();});function $H(object){return new Hash(object);};var Hash=Class.create(Enumerable,(function(){function toQueryPair(key,value){if(Object.isUndefined(value))return key;return key+'='+encodeURIComponent(String.interpret(value));}
return{initialize:function(object){this._object=Object.isHash(object)?object.toObject():Object.clone(object);},_each:function(iterator){for(var key in this._object){var value=this._object[key],pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},set:function(key,value){return this._object[key]=value;},get:function(key){return this._object[key];},unset:function(key){var value=this._object[key];delete this._object[key];return value;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},index:function(value){var match=this.detect(function(pair){return pair.value===value;});return match&&match.key;},merge:function(object){return this.clone().update(object);},update:function(object){return new Hash(object).inject(this,function(result,pair){result.set(pair.key,pair.value);return result;});},toQueryString:function(){return this.map(function(pair){var key=encodeURIComponent(pair.key),values=pair.value;if(values&&typeof values=='object'){if(Object.isArray(values))
return values.map(toQueryPair.curry(key)).join('&');}
return toQueryPair(key,values);}).join('&');},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;while(this.include(value)){iterator(value);value=value.succ();}},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responder){if(!this.include(responder))
this.responders.push(responder);},unregister:function(responder){this.responders=this.responders.without(responder);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(Object.isFunction(responder[callback])){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(options){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:'',evalJSON:true,evalJS:true};Object.extend(this.options,options||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters))
this.options.parameters=this.options.parameters.toQueryParams();else if(Object.isHash(this.options.parameters))
this.options.parameters=this.options.parameters.toObject();}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,url,options){$super(options);this.transport=Ajax.getTransport();this.request(url);},request:function(url){this.url=url;this.method=this.options.method;var params=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){params['_method']=this.method;this.method='post';}
this.parameters=params;if(params=Object.toQueryString(params)){if(this.method=='get')
this.url+=(this.url.include('?')?'&':'?')+params;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))
params+='&_=';}
try{var response=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(response);Ajax.Responders.dispatch('onCreate',this,response);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||params):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)
this.onStateChange();}
catch(e){this.dispatchException(e);}},onStateChange:function(){var readyState=this.transport.readyState;if(readyState>1&&!((readyState==4)&&this._complete))
this.respondToReadyState(this.transport.readyState);},setRequestHeaders:function(){var headers={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){headers['Content-type']=this.options.contentType+
(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)
headers['Connection']='close';}
if(typeof this.options.requestHeaders=='object'){var extras=this.options.requestHeaders;if(Object.isFunction(extras.push))
for(var i=0,length=extras.length;i<length;i+=2)
headers[extras[i]]=extras[i+1];else
$H(extras).each(function(pair){headers[pair.key]=pair.value});}
for(var name in headers)
this.transport.setRequestHeader(name,headers[name]);},success:function(){var status=this.getStatus();return!status||(status>=200&&status<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0}},respondToReadyState:function(readyState){var state=Ajax.Request.Events[readyState],response=new Ajax.Response(this);if(state=='Complete'){try{this._complete=true;(this.options['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON);}catch(e){this.dispatchException(e);}
var contentType=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&this.isSameOrigin()&&contentType&&contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
this.evalResponse();}
try{(this.options['on'+state]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on'+state,this,response,response.headerJSON);}catch(e){this.dispatchException(e);}
if(state=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction;}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[0]=='#{protocol}//#{domain}#{port}'.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?':'+location.port:''}));},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null;}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Response=Class.create({initialize:function(request){this.request=request;var transport=this.transport=request.transport,readyState=this.readyState=transport.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(transport.responseText);this.headerJSON=this._getHeaderJSON();}
if(readyState==4){var xml=transport.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||'';}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader('X-JSON');if(!json)return null;json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var options=this.request.options;if(!options.evalJSON||(options.evalJSON!='force'&&!(this.getHeader('Content-type')||'').include('application/json'))||this.responseText.blank())
return null;try{return this.responseText.evalJSON(options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,container,url,options){this.container={success:(container.success||container),failure:(container.failure||(container.success?null:container))};options=Object.clone(options);var onComplete=options.onComplete;options.onComplete=(function(response,json){this.updateContent(response.responseText);if(Object.isFunction(onComplete))onComplete(response,json);}).bind(this);$super(url,options);},updateContent:function(responseText){var receiver=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)responseText=responseText.stripScripts();if(receiver=$(receiver)){if(options.insertion){if(Object.isString(options.insertion)){var insertion={};insertion[options.insertion]=responseText;receiver.insert(insertion);}
else options.insertion(receiver,responseText);}
else receiver.update(responseText);}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(response){if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=response.responseText;}
this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(element){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)
elements.push($(arguments[i]));return elements;}
if(Object.isString(element))
element=document.getElementById(element);return Element.extend(element);}
if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(expression,parentElement){var results=[];var query=document.evaluate(expression,$(parentElement)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=query.snapshotLength;i<length;i++)
results.push(Element.extend(query.snapshotItem(i)));return results;};}
if(!window.Node)var Node={};if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}
(function(){var element=this.Element;this.Element=function(tagName,attributes){attributes=attributes||{};tagName=tagName.toLowerCase();var cache=Element.cache;if(Prototype.Browser.IE&&attributes.name){tagName='<'+tagName+' name="'+attributes.name+'">';delete attributes.name;return Element.writeAttribute(document.createElement(tagName),attributes);}
if(!cache[tagName])cache[tagName]=Element.extend(document.createElement(tagName));return Element.writeAttribute(cache[tagName].cloneNode(false),attributes);};Object.extend(this.Element,element||{});}).call(window);Element.cache={};Element.Methods={visible:function(element){return $(element).style.display!='none';},toggle:function(element){element=$(element);Element[Element.visible(element)?'hide':'show'](element);return element;},hide:function(element){$(element).style.display='none';return element;},show:function(element){$(element).style.display='';return element;},remove:function(element){element=$(element);element.parentNode.removeChild(element);return element;},update:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;},replace:function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();else if(!Object.isElement(content)){content=Object.toHTML(content);var range=element.ownerDocument.createRange();range.selectNode(element);content.evalScripts.bind(content).defer();content=range.createContextualFragment(content.stripScripts());}
element.parentNode.replaceChild(content,element);return element;},insert:function(element,insertions){element=$(element);if(Object.isString(insertions)||Object.isNumber(insertions)||Object.isElement(insertions)||(insertions&&(insertions.toElement||insertions.toHTML)))
insertions={bottom:insertions};var content,insert,tagName,childNodes;for(var position in insertions){content=insertions[position];position=position.toLowerCase();insert=Element._insertionTranslations[position];if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){insert(element,content);continue;}
content=Object.toHTML(content);tagName=((position=='before'||position=='after')?element.parentNode:element).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,content.stripScripts());if(position=='top'||position=='after')childNodes.reverse();childNodes.each(insert.curry(element));content.evalScripts.bind(content).defer();}
return element;},wrap:function(element,wrapper,attributes){element=$(element);if(Object.isElement(wrapper))
$(wrapper).writeAttribute(attributes||{});else if(Object.isString(wrapper))wrapper=new Element(wrapper,attributes);else wrapper=new Element('div',wrapper);if(element.parentNode)
element.parentNode.replaceChild(wrapper,element);wrapper.appendChild(element);return wrapper;},inspect:function(element){element=$(element);var result='<'+element.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(pair){var property=pair.first(),attribute=pair.last();var value=(element[property]||'').toString();if(value)result+=' '+attribute+'='+value.inspect(true);});return result+'>';},recursivelyCollect:function(element,property){element=$(element);var elements=[];while(element=element[property])
if(element.nodeType==1)
elements.push(Element.extend(element));return elements;},ancestors:function(element){return $(element).recursivelyCollect('parentNode');},descendants:function(element){return $(element).select("*");},firstDescendant:function(element){element=$(element).firstChild;while(element&&element.nodeType!=1)element=element.nextSibling;return $(element);},immediateDescendants:function(element){if(!(element=$(element).firstChild))return[];while(element&&element.nodeType!=1)element=element.nextSibling;if(element)return[element].concat($(element).nextSiblings());return[];},previousSiblings:function(element){return $(element).recursivelyCollect('previousSibling');},nextSiblings:function(element){return $(element).recursivelyCollect('nextSibling');},siblings:function(element){element=$(element);return element.previousSiblings().reverse().concat(element.nextSiblings());},match:function(element,selector){if(Object.isString(selector))
selector=new Selector(selector);return selector.match($(element));},up:function(element,expression,index){element=$(element);if(arguments.length==1)return $(element.parentNode);var ancestors=element.ancestors();return Object.isNumber(expression)?ancestors[expression]:Selector.findElement(ancestors,expression,index);},down:function(element,expression,index){element=$(element);if(arguments.length==1)return element.firstDescendant();return Object.isNumber(expression)?element.descendants()[expression]:element.select(expression)[index||0];},previous:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(element));var previousSiblings=element.previousSiblings();return Object.isNumber(expression)?previousSiblings[expression]:Selector.findElement(previousSiblings,expression,index);},next:function(element,expression,index){element=$(element);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(element));var nextSiblings=element.nextSiblings();return Object.isNumber(expression)?nextSiblings[expression]:Selector.findElement(nextSiblings,expression,index);},select:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element,args);},adjacent:function(){var args=$A(arguments),element=$(args.shift());return Selector.findChildElements(element.parentNode,args).without(element);},identify:function(element){element=$(element);var id=element.readAttribute('id'),self=arguments.callee;if(id)return id;do{id='anonymous_element_'+self.counter++}while($(id));element.writeAttribute('id',id);return id;},readAttribute:function(element,name){element=$(element);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name])return t.values[name](element,name);if(t.names[name])name=t.names[name];if(name.include(':')){return(!element.attributes||!element.attributes[name])?null:element.attributes[name].value;}}
return element.getAttribute(name);},writeAttribute:function(element,name,value){element=$(element);var attributes={},t=Element._attributeTranslations.write;if(typeof name=='object')attributes=name;else attributes[name]=Object.isUndefined(value)?true:value;for(var attr in attributes){name=t.names[attr]||attr;value=attributes[attr];if(t.values[attr])name=t.values[attr](element,value);if(value===false||value===null)
element.removeAttribute(name);else if(value===true)
element.setAttribute(name,name);else element.setAttribute(name,value);}
return element;},getHeight:function(element){return $(element).getDimensions().height;},getWidth:function(element){return $(element).getDimensions().width;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;var elementClassName=element.className;return(elementClassName.length>0&&(elementClassName==className||new RegExp("(^|\\s)"+className+"(\\s|$)").test(elementClassName)));},addClassName:function(element,className){if(!(element=$(element)))return;if(!element.hasClassName(className))
element.className+=(element.className?' ':'')+className;return element;},removeClassName:function(element,className){if(!(element=$(element)))return;element.className=element.className.replace(new RegExp("(^|\\s+)"+className+"(\\s+|$)"),' ').strip();return element;},toggleClassName:function(element,className){if(!(element=$(element)))return;return element[element.hasClassName(className)?'removeClassName':'addClassName'](className);},cleanWhitespace:function(element){element=$(element);var node=element.firstChild;while(node){var nextNode=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue))
element.removeChild(node);node=nextNode;}
return element;},empty:function(element){return $(element).innerHTML.blank();},descendantOf:function(element,ancestor){element=$(element),ancestor=$(ancestor);var originalAncestor=ancestor;if(element.compareDocumentPosition)
return(element.compareDocumentPosition(ancestor)&8)===8;if(element.sourceIndex&&!Prototype.Browser.Opera){var e=element.sourceIndex,a=ancestor.sourceIndex,nextAncestor=ancestor.nextSibling;if(!nextAncestor){do{ancestor=ancestor.parentNode;}
while(!(nextAncestor=ancestor.nextSibling)&&ancestor.parentNode);}
if(nextAncestor&&nextAncestor.sourceIndex)
return(e>a&&e<nextAncestor.sourceIndex);}
while(element=element.parentNode)
if(element==originalAncestor)return true;return false;},scrollTo:function(element){element=$(element);var pos=element.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return element;},getStyle:function(element,style){element=$(element);style=style=='float'?'cssFloat':style.camelize();var value=element.style[style];if(!value){var css=document.defaultView.getComputedStyle(element,null);value=css?css[style]:null;}
if(style=='opacity')return value?parseFloat(value):1.0;return value=='auto'?null:value;},getOpacity:function(element){return $(element).getStyle('opacity');},setStyle:function(element,styles){element=$(element);var elementStyle=element.style,match;if(Object.isString(styles)){element.style.cssText+=';'+styles;return styles.include('opacity')?element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]):element;}
for(var property in styles)
if(property=='opacity')element.setOpacity(styles[property]);else
elementStyle[(property=='float'||property=='cssFloat')?(Object.isUndefined(elementStyle.styleFloat)?'cssFloat':'styleFloat'):property]=styles[property];return element;},setOpacity:function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;return element;},getDimensions:function(element){element=$(element);var display=$(element).getStyle('display');if(display!='none'&&display!=null)
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;var originalDisplay=els.display;els.visibility='hidden';els.position='absolute';els.display='block';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display=originalDisplay;els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}
return element;},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}
return element;},makeClipping:function(element){element=$(element);if(element._overflow)return element;element._overflow=Element.getStyle(element,'overflow')||'auto';if(element._overflow!=='hidden')
element.style.overflow='hidden';return element;},undoClipping:function(element){element=$(element);if(!element._overflow)return element;element.style.overflow=element._overflow=='auto'?'':element._overflow;element._overflow=null;return element;},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){if(element.tagName=='BODY')break;var p=Element.getStyle(element,'position');if(p!=='static')break;}}while(element);return Element._returnOffset(valueL,valueT);},absolutize:function(element){element=$(element);if(element.getStyle('position')=='absolute')return;var offsets=element.positionedOffset();var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';element.style.left=left+'px';element.style.width=width+'px';element.style.height=height+'px';return element;},relativize:function(element){element=$(element);if(element.getStyle('position')=='relative')return;element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;return element;},cumulativeScrollOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return Element._returnOffset(valueL,valueT);},getOffsetParent:function(element){if(element.offsetParent)return $(element.offsetParent);if(element==document.body)return $(element);while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return $(element);return $(document.body);},viewportOffset:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body&&Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{if(!Prototype.Browser.Opera||element.tagName=='BODY'){valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}}while(element=element.parentNode);return Element._returnOffset(valueL,valueT);},clonePosition:function(element,source){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});source=$(source);var p=source.viewportOffset();element=$(element);var delta=[0,0];var parent=null;if(Element.getStyle(element,'position')=='absolute'){parent=element.getOffsetParent();delta=parent.viewportOffset();}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)element.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)element.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)element.style.width=source.offsetWidth+'px';if(options.setHeight)element.style.height=source.offsetHeight+'px';return element;}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:'class',htmlFor:'for'},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(proceed,element,style){switch(style){case'left':case'top':case'right':case'bottom':if(proceed(element,'position')==='static')return null;case'height':case'width':if(!Element.visible(element))return null;var dim=parseInt(proceed(element,style),10);if(dim!==element['offset'+style.capitalize()])
return dim+'px';var properties;if(style==='height'){properties=['border-top-width','padding-top','padding-bottom','border-bottom-width'];}
else{properties=['border-left-width','padding-left','padding-right','border-right-width'];}
return properties.inject(dim,function(memo,property){var val=proceed(element,property);return val===null?memo:memo-parseInt(val,10);})+'px';default:return proceed(element,style);}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(proceed,element,attribute){if(attribute==='title')return element.title;return proceed(element,attribute);});}
else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!=='static')return proceed(element);element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});$w('positionedOffset viewportOffset').each(function(method){Element.Methods[method]=Element.Methods[method].wrap(function(proceed,element){element=$(element);var position=element.getStyle('position');if(position!=='static')return proceed(element);var offsetParent=element.getOffsetParent();if(offsetParent&&offsetParent.getStyle('position')==='fixed')
offsetParent.setStyle({zoom:1});element.setStyle({position:'relative'});var value=proceed(element);element.setStyle({position:position});return value;});});Element.Methods.getStyle=function(element,style){element=$(element);style=(style=='float'||style=='cssFloat')?'styleFloat':style.camelize();var value=element.style[style];if(!value&&element.currentStyle)value=element.currentStyle[style];if(style=='opacity'){if(value=(element.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))
if(value[1])return parseFloat(value[1])/100;return 1.0;}
if(value=='auto'){if((style=='width'||style=='height')&&(element.getStyle('display')!='none'))
return element['offset'+style.capitalize()]+'px';return null;}
return value;};Element.Methods.setOpacity=function(element,value){function stripAlpha(filter){return filter.replace(/alpha\([^\)]*\)/gi,'');}
element=$(element);var currentStyle=element.currentStyle;if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=='normal'))
element.style.zoom=1;var filter=element.getStyle('filter'),style=element.style;if(value==1||value===''){(filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute('filter');return element;}else if(value<0.00001)value=0;style.filter=stripAlpha(filter)+'alpha(opacity='+(value*100)+')';return element;};Element._attributeTranslations={read:{names:{'class':'className','for':'htmlFor'},values:{_getAttr:function(element,attribute){return element.getAttribute(attribute,2);},_getAttrNode:function(element,attribute){var node=element.getAttributeNode(attribute);return node?node.value:"";},_getEv:function(element,attribute){attribute=element.getAttribute(attribute);return attribute?attribute.toString().slice(23,-2):null;},_flag:function(element,attribute){return $(element).hasAttribute(attribute)?attribute:null;},style:function(element){return element.style.cssText.toLowerCase();},title:function(element){return element.title;}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:'cellPadding',cellspacing:'cellSpacing'},Element._attributeTranslations.read.names),values:{checked:function(element,value){element.checked=!!value;},style:function(element,value){element.style.cssText=value?value:'';}}};Element._attributeTranslations.has={};$w('colSpan rowSpan vAlign dateTime accessKey tabIndex '+'encType maxLength readOnly longDesc').each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);}
else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value;return element;};}
else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(element,value){element=$(element);element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value;if(value==1)
if(element.tagName=='IMG'&&element.width){element.width++;element.width--;}else try{var n=document.createTextNode(' ');element.appendChild(n);element.removeChild(n);}catch(e){}
return element;};Element.Methods.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return Element._returnOffset(valueL,valueT);};}
if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content))return element.update().insert(content);content=Object.toHTML(content);var tagName=element.tagName.toUpperCase();if(tagName in Element._insertionTranslations.tags){$A(element.childNodes).each(function(node){element.removeChild(node)});Element._getContentFromAnonymousElement(tagName,content.stripScripts()).each(function(node){element.appendChild(node)});}
else element.innerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
if('outerHTML'in document.createElement('div')){Element.Methods.replace=function(element,content){element=$(element);if(content&&content.toElement)content=content.toElement();if(Object.isElement(content)){element.parentNode.replaceChild(content,element);return element;}
content=Object.toHTML(content);var parent=element.parentNode,tagName=parent.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var nextSibling=element.next();var fragments=Element._getContentFromAnonymousElement(tagName,content.stripScripts());parent.removeChild(element);if(nextSibling)
fragments.each(function(node){parent.insertBefore(node,nextSibling)});else
fragments.each(function(node){parent.appendChild(node)});}
else element.outerHTML=content.stripScripts();content.evalScripts.bind(content).defer();return element;};}
Element._returnOffset=function(l,t){var result=[l,t];result.left=l;result.top=t;return result;};Element._getContentFromAnonymousElement=function(tagName,html){var div=new Element('div'),t=Element._insertionTranslations.tags[tagName];if(t){div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild});}else div.innerHTML=html;return $A(div.childNodes);};Element._insertionTranslations={before:function(element,node){element.parentNode.insertBefore(node,element);},top:function(element,node){element.insertBefore(node,element.firstChild);},bottom:function(element,node){element.appendChild(node);},after:function(element,node){element.parentNode.insertBefore(node,element.nextSibling);},tags:{TABLE:['<table>','</table>',1],TBODY:['<table><tbody>','</tbody></table>',2],TR:['<table><tbody><tr>','</tr></tbody></table>',3],TD:['<table><tbody><tr><td>','</td></tr></tbody></table>',4],SELECT:['<select>','</select>',1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(element,attribute){attribute=Element._attributeTranslations.has[attribute]||attribute;var node=$(element).getAttributeNode(attribute);return node&&node.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement('div').__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement('div').__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}
Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions)
return Prototype.K;var Methods={},ByTag=Element.Methods.ByTag;var extend=Object.extend(function(element){if(!element||element._extendedByPrototype||element.nodeType!=1||element==window)return element;var methods=Object.clone(Methods),tagName=element.tagName,property,value;if(ByTag[tagName])Object.extend(methods,ByTag[tagName]);for(property in methods){value=methods[property];if(Object.isFunction(value)&&!(property in element))
element[property]=value.methodize();}
element._extendedByPrototype=Prototype.emptyFunction;return element;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(Methods,Element.Methods);Object.extend(Methods,Element.Methods.Simulated);}}});extend.refresh();return extend;})();Element.hasAttribute=function(element,attribute){if(element.hasAttribute)return element.hasAttribute(attribute);return Element.Methods.Simulated.hasAttribute(element,attribute);};Element.addMethods=function(methods){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!methods){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)});}
if(arguments.length==2){var tagName=methods;methods=arguments[1];}
if(!tagName)Object.extend(Element.Methods,methods||{});else{if(Object.isArray(tagName))tagName.each(extend);else extend(tagName);}
function extend(tagName){tagName=tagName.toUpperCase();if(!Element.Methods.ByTag[tagName])
Element.Methods.ByTag[tagName]={};Object.extend(Element.Methods.ByTag[tagName],methods);}
function copy(methods,destination,onlyIfAbsent){onlyIfAbsent=onlyIfAbsent||false;for(var property in methods){var value=methods[property];if(!Object.isFunction(value))continue;if(!onlyIfAbsent||!(property in destination))
destination[property]=value.methodize();}}
function findDOMClass(tagName){var klass;var trans={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(trans[tagName])klass='HTML'+trans[tagName]+'Element';if(window[klass])return window[klass];klass='HTML'+tagName+'Element';if(window[klass])return window[klass];klass='HTML'+tagName.capitalize()+'Element';if(window[klass])return window[klass];window[klass]={};window[klass].prototype=document.createElement(tagName).__proto__;return window[klass];}
if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}
if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var klass=findDOMClass(tag);if(Object.isUndefined(klass))continue;copy(T[tag],klass.prototype);}}
Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={};};document.viewport={getDimensions:function(){var dimensions={};var B=Prototype.Browser;$w('width height').each(function(d){var D=d.capitalize();dimensions[d]=(B.WebKit&&!document.evaluate)?self['inner'+D]:(B.Opera)?document.body['client'+D]:document.documentElement['client'+D];});return dimensions;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};var Selector=Class.create({initialize:function(expression){this.expression=expression.strip();this.compileMatcher();},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath)return false;var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty")))
return false;if((/(\[[\w-]*?:|:checked)/).test(this.expression))
return false;return true;},compileMatcher:function(){if(this.shouldUseXPath())
return this.compileXPathMatcher();var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}
this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join('\n'));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}
this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break;}}}
this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath)return document._getElementsByXPath(this.xpath,root);return this.matcher(root);},match:function(element){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],'');}else{return this.findElements(document).include(element);}}}}
var match=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](element,matches)){match=false;break;}}
return match;},toString:function(){return this.expression;},inspect:function(){return"#<Selector:"+this.expression.inspect()+">";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:'/following-sibling::*',tagName:function(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m);},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{'=':"[@#{1}='#{3}']",'!=':"[@#{1}!='#{3}']",'^=':"[starts-with(@#{1}, '#{3}')]",'$=':"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",'*=':"[contains(@#{1}, '#{3}')]",'~=':"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",'|=':"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{'first-child':'[not(preceding-sibling::*)]','last-child':'[not(following-sibling::*)]','only-child':'[not(preceding-sibling::* or following-sibling::*)]','empty':"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",'checked':"[@checked]",'disabled':"[@disabled]",'enabled':"[not(@disabled)]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var exclusion=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);exclusion.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break;}}}
return"[not("+exclusion.join(" and ")+")]";},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m);},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m);},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m);},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m);},nth:function(fragment,m){var mm,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(mm=formula.match(/^(\d+)$/))
return'['+fragment+"= "+mm[1]+']';if(mm=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-")mm[1]=-1;var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:fragment,a:a,b:b});}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m);},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(element,matches){return matches[1].toUpperCase()==element.tagName.toUpperCase();},className:function(element,matches){return Element.hasClassName(element,matches[1]);},id:function(element,matches){return element.id===matches[1];},attrPresence:function(element,matches){return Element.hasAttribute(element,matches[1]);},attr:function(element,matches){var nodeValue=Element.readAttribute(element,matches[1]);return nodeValue&&Selector.operators[matches[2]](nodeValue,matches[5]||matches[6]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)
a.push(node);return a;},mark:function(nodes){var _true=Prototype.emptyFunction;for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=_true;return nodes;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node._countedByPrototype=undefined;return nodes;},index:function(parentNode,reverse,ofType){parentNode._countedByPrototype=Prototype.emptyFunction;if(reverse){for(var nodes=parentNode.childNodes,i=nodes.length-1,j=1;i>=0;i--){var node=nodes[i];if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}}else{for(var i=0,j=1,nodes=parentNode.childNodes;node=nodes[i];i++)
if(node.nodeType==1&&(!ofType||node._countedByPrototype))node.nodeIndex=j++;}},unique:function(nodes){if(nodes.length==0)return nodes;var results=[],n;for(var i=0,l=nodes.length;i<l;i++)
if(!(n=nodes[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;results.push(Element.extend(n));}
return Selector.handlers.unmark(results);},descendant:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName('*'));return results;},child:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++){for(var j=0,child;child=node.childNodes[j];j++)
if(child.nodeType==1&&child.tagName!='!')results.push(child);}
return results;},adjacent:function(nodes){for(var i=0,results=[],node;node=nodes[i];i++){var next=this.nextElementSibling(node);if(next)results.push(next);}
return results;},laterSibling:function(nodes){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
h.concat(results,Element.nextSiblings(node));return results;},nextElementSibling:function(node){while(node=node.nextSibling)
if(node.nodeType==1)return node;return null;},previousElementSibling:function(node){while(node=node.previousSibling)
if(node.nodeType==1)return node;return null;},tagName:function(nodes,root,tagName,combinator){var uTagName=tagName.toUpperCase();var results=[],h=Selector.handlers;if(nodes){if(combinator){if(combinator=="descendant"){for(var i=0,node;node=nodes[i];i++)
h.concat(results,node.getElementsByTagName(tagName));return results;}else nodes=this[combinator](nodes);if(tagName=="*")return nodes;}
for(var i=0,node;node=nodes[i];i++)
if(node.tagName.toUpperCase()===uTagName)results.push(node);return results;}else return root.getElementsByTagName(tagName);},id:function(nodes,root,id,combinator){var targetNode=$(id),h=Selector.handlers;if(!targetNode)return[];if(!nodes&&root==document)return[targetNode];if(nodes){if(combinator){if(combinator=='child'){for(var i=0,node;node=nodes[i];i++)
if(targetNode.parentNode==node)return[targetNode];}else if(combinator=='descendant'){for(var i=0,node;node=nodes[i];i++)
if(Element.descendantOf(targetNode,node))return[targetNode];}else if(combinator=='adjacent'){for(var i=0,node;node=nodes[i];i++)
if(Selector.handlers.previousElementSibling(targetNode)==node)
return[targetNode];}else nodes=h[combinator](nodes);}
for(var i=0,node;node=nodes[i];i++)
if(node==targetNode)return[targetNode];return[];}
return(targetNode&&Element.descendantOf(targetNode,root))?[targetNode]:[];},className:function(nodes,root,className,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);return Selector.handlers.byClassName(nodes,root,className);},byClassName:function(nodes,root,className){if(!nodes)nodes=Selector.handlers.descendant([root]);var needle=' '+className+' ';for(var i=0,results=[],node,nodeClassName;node=nodes[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==className||(' '+nodeClassName+' ').include(needle))
results.push(node);}
return results;},attrPresence:function(nodes,root,attr,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var results=[];for(var i=0,node;node=nodes[i];i++)
if(Element.hasAttribute(node,attr))results.push(node);return results;},attr:function(nodes,root,attr,value,operator,combinator){if(!nodes)nodes=root.getElementsByTagName("*");if(nodes&&combinator)nodes=this[combinator](nodes);var handler=Selector.operators[operator],results=[];for(var i=0,node;node=nodes[i];i++){var nodeValue=Element.readAttribute(node,attr);if(nodeValue===null)continue;if(handler(nodeValue,value))results.push(node);}
return results;},pseudo:function(nodes,name,value,root,combinator){if(nodes&&combinator)nodes=this[combinator](nodes);if(!nodes)nodes=root.getElementsByTagName("*");return Selector.pseudos[name](nodes,value,root);}},pseudos:{'first-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node);}
return results;},'last-child':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node);}
return results;},'only-child':function(nodes,value,root){var h=Selector.handlers;for(var i=0,results=[],node;node=nodes[i];i++)
if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))
results.push(node);return results;},'nth-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root);},'nth-last-child':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true);},'nth-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,false,true);},'nth-last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,formula,root,true,true);},'first-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,false,true);},'last-of-type':function(nodes,formula,root){return Selector.pseudos.nth(nodes,"1",root,true,true);},'only-of-type':function(nodes,formula,root){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](nodes,formula,root),formula,root);},getIndices:function(a,b,total){if(a==0)return b>0?[b]:[];return $R(1,total).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0)memo.push(i);return memo;});},nth:function(nodes,formula,root,reverse,ofType){if(nodes.length==0)return[];if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(nodes);for(var i=0,node;node=nodes[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,reverse,ofType);indexed.push(node.parentNode);}}
if(formula.match(/^\d+$/)){formula=Number(formula);for(var i=0,node;node=nodes[i];i++)
if(node.nodeIndex==formula)results.push(node);}else if(m=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var indices=Selector.pseudos.getIndices(a,b,nodes.length);for(var i=0,node,l=indices.length;node=nodes[i];i++){for(var j=0;j<l;j++)
if(node.nodeIndex==indices[j])results.push(node);}}
h.unmark(nodes);h.unmark(indexed);return results;},'empty':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node);}
return results;},'not':function(nodes,selector,root){var h=Selector.handlers,selectorType,m;var exclusions=new Selector(selector).findElements(root);h.mark(exclusions);for(var i=0,results=[],node;node=nodes[i];i++)
if(!node._countedByPrototype)results.push(node);h.unmark(exclusions);return results;},'enabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(!node.disabled)results.push(node);return results;},'disabled':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.disabled)results.push(node);return results;},'checked':function(nodes,value,root){for(var i=0,results=[],node;node=nodes[i];i++)
if(node.checked)results.push(node);return results;}},operators:{'=':function(nv,v){return nv==v;},'!=':function(nv,v){return nv!=v;},'^=':function(nv,v){return nv.startsWith(v);},'$=':function(nv,v){return nv.endsWith(v);},'*=':function(nv,v){return nv.include(v);},'~=':function(nv,v){return(' '+nv+' ').include(' '+v+' ');},'|=':function(nv,v){return('-'+nv.toUpperCase()+'-').include('-'+v.toUpperCase()+'-');}},split:function(expression){var expressions=[];expression.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){expressions.push(m[1].strip());});return expressions;},matchElements:function(elements,expression){var matches=$$(expression),h=Selector.handlers;h.mark(matches);for(var i=0,results=[],element;element=elements[i];i++)
if(element._countedByPrototype)results.push(element);h.unmark(matches);return results;},findElement:function(elements,expression,index){if(Object.isNumber(expression)){index=expression;expression=false;}
return Selector.matchElements(elements,expression||'*')[index||0];},findChildElements:function(element,expressions){expressions=Selector.split(expressions.join(','));var results=[],h=Selector.handlers;for(var i=0,l=expressions.length,selector;i<l;i++){selector=new Selector(expressions[i].strip());h.concat(results,selector.findElements(element));}
return(l>1)?h.unique(results):results;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++)
if(node.tagName!=="!")a.push(node);return a;},unmark:function(nodes){for(var i=0,node;node=nodes[i];i++)
node.removeAttribute('_countedByPrototype');return nodes;}});}
function $$(){return Selector.findChildElements(document,$A(arguments));}
var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(elements,options){if(typeof options!='object')options={hash:!!options};else if(Object.isUndefined(options.hash))options.hash=true;var key,value,submitted=false,submit=options.submit;var data=elements.inject({},function(result,element){if(!element.disabled&&element.name){key=element.name;value=$(element).getValue();if(value!=null&&(element.type!='submit'||(!submitted&&submit!==false&&(!submit||key==submit)&&(submitted=true)))){if(key in result){if(!Object.isArray(result[key]))result[key]=[result[key]];result[key].push(value);}
else result[key]=value;}}
return result;});return options.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,options){return Form.serializeElements(Form.getElements(form),options);},getElements:function(form){return $A($(form).getElementsByTagName('*')).inject([],function(elements,child){if(Form.Element.Serializers[child.tagName.toLowerCase()])
elements.push(Element.extend(child));return elements;});},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)return $A(inputs).map(Element.extend);for(var i=0,matchingInputs=[],length=inputs.length;i<length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(Element.extend(input));}
return matchingInputs;},disable:function(form){form=$(form);Form.getElements(form).invoke('disable');return form;},enable:function(form){form=$(form);Form.getElements(form).invoke('enable');return form;},findFirstElement:function(form){var elements=$(form).getElements().findAll(function(element){return'hidden'!=element.type&&!element.disabled;});var firstByIndex=elements.findAll(function(element){return element.hasAttribute('tabIndex')&&element.tabIndex>=0;}).sortBy(function(element){return element.tabIndex}).first();return firstByIndex?firstByIndex:elements.find(function(element){return['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,options){form=$(form),options=Object.clone(options||{});var params=options.parameters,action=form.readAttribute('action')||'';if(action.blank())action=window.location.href;options.parameters=form.serialize(true);if(params){if(Object.isString(params))params=params.toQueryParams();Object.extend(options.parameters,params);}
if(form.hasAttribute('method')&&!options.method)
options.method=form.method;return new Ajax.Request(action,options);}};Form.Element={focus:function(element){$(element).focus();return element;},select:function(element){$(element).select();return element;}};Form.Element.Methods={serialize:function(element){element=$(element);if(!element.disabled&&element.name){var value=element.getValue();if(value!=undefined){var pair={};pair[element.name]=value;return Object.toQueryString(pair);}}
return'';},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();return Form.Element.Serializers[method](element);},setValue:function(element,value){element=$(element);var method=element.tagName.toLowerCase();Form.Element.Serializers[method](element,value);return element;},clear:function(element){$(element).value='';return element;},present:function(element){return $(element).value!='';},activate:function(element){element=$(element);try{element.focus();if(element.select&&(element.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(element.type)))
element.select();}catch(e){}
return element;},disable:function(element){element=$(element);element.blur();element.disabled=true;return element;},enable:function(element){element=$(element);element.disabled=false;return element;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(element,value){switch(element.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element,value);default:return Form.Element.Serializers.textarea(element,value);}},inputSelector:function(element,value){if(Object.isUndefined(value))return element.checked?element.value:null;else element.checked=!!value;},textarea:function(element,value){if(Object.isUndefined(value))return element.value;else element.value=value;},select:function(element,index){if(Object.isUndefined(index))
return this[element.type=='select-one'?'selectOne':'selectMany'](element);else{var opt,value,single=!Object.isArray(index);for(var i=0,length=element.length;i<length;i++){opt=element.options[i];value=this.optionValue(opt);if(single){if(value==index){opt.selected=true;return;}}
else opt.selected=index.include(value);}}},selectOne:function(element){var index=element.selectedIndex;return index>=0?this.optionValue(element.options[index]):null;},selectMany:function(element){var values,length=element.length;if(!length)return null;for(var i=0,values=[];i<length;i++){var opt=element.options[i];if(opt.selected)values.push(this.optionValue(opt));}
return values;},optionValue:function(opt){return Element.extend(opt).hasAttribute('value')?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,element,frequency,callback){$super(callback,frequency);this.element=$(element);this.lastValue=this.getValue();},execute:function(){var value=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(value)?this.lastValue!=value:String(this.lastValue)!=String(value)){this.callback(this.element,value);this.lastValue=value;}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=Class.create({initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;default:Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element);}});if(!window.Event)var Event={};Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(event){var element;switch(event.type){case'mouseover':element=event.fromElement;break;case'mouseout':element=event.toElement;break;default:return null;}
return Element.extend(element);}});Event.Methods=(function(){var isButton;if(Prototype.Browser.IE){var buttonMap={0:1,1:4,2:2};isButton=function(event,code){return event.button==buttonMap[code];};}else if(Prototype.Browser.WebKit){isButton=function(event,code){switch(code){case 0:return event.which==1&&!event.metaKey;case 1:return event.which==1&&event.metaKey;default:return false;}};}else{isButton=function(event,code){return event.which?(event.which===code+1):(event.button===code);};}
return{isLeftClick:function(event){return isButton(event,0)},isMiddleClick:function(event){return isButton(event,1)},isRightClick:function(event){return isButton(event,2)},element:function(event){var node=Event.extend(event).target;return Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node);},findElement:function(event,expression){var element=Event.element(event);if(!expression)return element;var elements=[element].concat(element.ancestors());return Selector.findElement(elements,expression,0);},pointer:function(event){return{x:event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft)),y:event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(event){return Event.pointer(event).x},pointerY:function(event){return Event.pointer(event).y},stop:function(event){Event.extend(event);event.preventDefault();event.stopPropagation();event.stopped=true;}};})();Event.extend=(function(){var methods=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){Object.extend(methods,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(event){if(!event)return false;if(event._extendedByPrototype)return event;event._extendedByPrototype=Prototype.emptyFunction;var pointer=Event.pointer(event);Object.extend(event,{target:event.srcElement,relatedTarget:Event.relatedTarget(event),pageX:pointer.x,pageY:pointer.y});return Object.extend(event,methods);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,methods);return Prototype.K;}})();Object.extend(Event,(function(){var cache=Event.cache;function getEventID(element){if(element._prototypeEventID)return element._prototypeEventID[0];arguments.callee.id=arguments.callee.id||1;return element._prototypeEventID=[++arguments.callee.id];}
function getDOMEventName(eventName){if(eventName&&eventName.include(':'))return"dataavailable";return eventName;}
function getCacheForID(id){return cache[id]=cache[id]||{};}
function getWrappersForEventName(id,eventName){var c=getCacheForID(id);return c[eventName]=c[eventName]||[];}
function createWrapper(element,eventName,handler){var id=getEventID(element);var c=getWrappersForEventName(id,eventName);if(c.pluck("handler").include(handler))return false;var wrapper=function(event){if(!Event||!Event.extend||(event.eventName&&event.eventName!=eventName))
return false;Event.extend(event);handler.call(element,event);};wrapper.handler=handler;c.push(wrapper);return wrapper;}
function findWrapper(id,eventName,handler){var c=getWrappersForEventName(id,eventName);return c.find(function(wrapper){return wrapper.handler==handler});}
function destroyWrapper(id,eventName,handler){var c=getCacheForID(id);if(!c[eventName])return false;c[eventName]=c[eventName].without(findWrapper(id,eventName,handler));}
function destroyCache(){for(var id in cache)
for(var eventName in cache[id])
cache[id][eventName]=null;}
if(window.attachEvent){window.attachEvent("onunload",destroyCache);}
return{observe:function(element,eventName,handler){element=$(element);var name=getDOMEventName(eventName);var wrapper=createWrapper(element,eventName,handler);if(!wrapper)return element;if(element.addEventListener){element.addEventListener(name,wrapper,false);}else{element.attachEvent("on"+name,wrapper);}
return element;},stopObserving:function(element,eventName,handler){element=$(element);var id=getEventID(element),name=getDOMEventName(eventName);if(!handler&&eventName){getWrappersForEventName(id,eventName).each(function(wrapper){element.stopObserving(eventName,wrapper.handler);});return element;}else if(!eventName){Object.keys(getCacheForID(id)).each(function(eventName){element.stopObserving(eventName);});return element;}
var wrapper=findWrapper(id,eventName,handler);if(!wrapper)return element;if(element.removeEventListener){element.removeEventListener(name,wrapper,false);}else{element.detachEvent("on"+name,wrapper);}
destroyWrapper(id,eventName,handler);return element;},fire:function(element,eventName,memo){element=$(element);if(element==document&&document.createEvent&&!element.dispatchEvent)
element=document.documentElement;var event;if(document.createEvent){event=document.createEvent("HTMLEvents");event.initEvent("dataavailable",true,true);}else{event=document.createEventObject();event.eventType="ondataavailable";}
event.eventName=eventName;event.memo=memo||{};if(document.createEvent){element.dispatchEvent(event);}else{element.fireEvent(event.eventType,event);}
return Event.extend(event);}};})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var timer;function fireContentLoadedEvent(){if(document.loaded)return;if(timer)window.clearInterval(timer);document.fire("dom:loaded");document.loaded=true;}
if(document.addEventListener){if(Prototype.Browser.WebKit){timer=window.setInterval(function(){if(/loaded|complete/.test(document.readyState))
fireContentLoadedEvent();},0);Event.observe(window,"load",fireContentLoadedEvent);}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(element,content){return Element.insert(element,{before:content});},Top:function(element,content){return Element.insert(element,{top:content});},Bottom:function(element,content){return Element.insert(element,{bottom:content});},After:function(element,content){return Element.insert(element,{after:content});}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=Element.cumulativeScrollOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=Element.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(element){Position.prepare();return Element.absolutize(element);},relativize:function(element){Position.prepare();return Element.relativize(element);},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(source,target,options){options=options||{};return Element.clonePosition(target,source,options);}};if(!document.getElementsByClassName)document.getElementsByClassName=function(instanceMethods){function iter(name){return name.blank()?null:"[contains(concat(' ', @class, ' '), ' "+name+" ')]";}
instanceMethods.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(element,className){className=className.toString().strip();var cond=/\s/.test(className)?$w(className).map(iter).join(''):iter(className);return cond?document._getElementsByXPath('.//*'+cond,element):[];}:function(element,className){className=className.toString().strip();var elements=[],classNames=(/\s/.test(className)?$w(className):null);if(!classNames&&!className)return elements;var nodes=$(element).getElementsByTagName('*');className=' '+className+' ';for(var i=0,child,cn;child=nodes[i];i++){if(child.className&&(cn=' '+child.className+' ')&&(cn.include(className)||(classNames&&classNames.all(function(name){return!name.toString().blank()&&cn.include(' '+name+' ');}))))
elements.push(Element.extend(child));}
return elements;};return function(className,parentElement){return $(parentElement||document.body).getElementsByClassName(className);};}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set($A(this).concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set($A(this).without(classNameToRemove).join(' '));},toString:function(){return $A(this).join(' ');}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();var stopCursorToBox=function(){cursorToBox=function(){void(0);};};function getParent(id){if(typeof allCategoriesTree[id]=="undefined")
return 0;var parentID=allCategoriesTree[id].p;return parentID;}
function getName(id){var name=allCategoriesTree[id].n;return name;}
function getAncestors(id){var parentID=getParent(id);var Ancestors=new Array();while(parentID>0){var name=getName(parentID);Ancestors.push(parentID);parentID=getParent(parentID);}
return Ancestors;}
function getChildren(id){var children=new Array();for(key in allCategoriesTree){var parentID=getParent(key);if(parentID==id){children.push(key);}}
if(Current.Browser.WebKit)
return children;else
return children.sort(stringsCompare);}
function stringsCompare(a,b){var s1=allCategoriesTree[a].n;var s2=allCategoriesTree[b].n;return s1.localeCompare(s2);}
function showChildrenCats(id,divid,divObj){var obj;if(divObj)
obj=divObj;else
obj=document.getElementById('cats_t'+divid);if(obj!=null&&obj.innerHTML!=''){obj.style.display='block';var img=obj.parentNode.childNodes[0].childNodes[0];img.src=wgStaticFilesServer+"/templates/icons/topics-arrow-on.gif";var linkobj=jQuery('#cats_t'+id)[0];if(id!=divid&&linkobj!=null){linkobj.innerHTML=obj.innerHTML;linkobj.style.display='block';}
return 1;}
var children=getChildren(id);var tbl="<table>";var max=children.length;var src=wgStaticFilesServer+"/templates/icons/no_chk.gif";for(var i=0;i<max;i++){var key=children[i];if((key==wikiAnswersLocalID&&!isSuper())||(key==2380&&!isSuper())||(key==uncategorizedID&&!isSuper())||(key==2092&&exsitsInJson(qcats,2092)))continue;var name=getName(key).replace(/\\/g,'');var hasChildren=(typeof allCategoriesTree[key].c!='undefined'&&allCategoriesTree[key].c>0)?true:false;var style="";tbl+="<tr><td style='margin: 0px; padding: 3px 3px 3px 10px; vertical-align: top;'>"
tbl+="<input name='i"+key+"' value='1' id='i"+key+"' type='hidden'>";tbl+="<img isTopCat='0' alt='Select/Deselect' title='Select/Deselect' onclick='toggleCheck(this);' src='"+src+"' class='c"+key+"'";tbl+="style='cursor: pointer; display: block; margin-top: 1px;' width='12' border='0' height='12'></td>";tbl+="<td style='margin: 0px; padding: 3px; width: 100%;'>";if(hasChildren){tbl+="<span style='white-space:nowrap;color:#003399;cursor:pointer;' class='cat"+key+"' onclick='showHideChildren(this);return false;'>";tbl+="<img border='0' src='"+wgStaticFilesServer+"/templates/icons/topics-arrow-off.gif?v=28333' class='arrowImg'/>";tbl+=name+"</span>";}
else
tbl+="<span class='cat"+key+"' style='white-space: nowrap;color:black;'>"+name.replace(/\\/g,'')+"</span>";tbl+="<div id='cats_t"+key+"' style='margin: 0px; padding: 3px 0px 0px; width: 100%; display: none;'>";tbl+="</div></td></tr>";}
tbl+="</table>";if(obj!=null&&max>0){obj.style.display='block';var img=obj.parentNode.childNodes[0].childNodes[0];img.src=wgStaticFilesServer+"/templates/icons/topics-arrow-on.gif";obj.innerHTML=tbl;}}
function showHideChildren(obj){var divNode=obj.parentNode.getElementsByTagName('div')[0];if(divNode!=null&&divNode.innerHTML!=""&&divNode.style.display=='block'){divNode.style.display='none';var img=obj.childNodes[0];img.src=wgStaticFilesServer+"/templates/icons/topics-arrow-off.gif";}else if(divNode!=null&&divNode.innerHTML!=""&&divNode.style.display=='none'){divNode.style.display='block';var img=obj.childNodes[0];img.src=wgStaticFilesServer+"/templates/icons/topics-arrow-on.gif";}else{var id=obj.className.replace("cat","");var link=allCategoriesTree[id].l;if(link>0)
showChildrenCats(link,id,divNode);else
showChildrenCats(id,id,divNode);}
setTimeout("repaintPage()",1);}
function printMainTree(){var tbl="<table>";var src=wgStaticFilesServer+"/templates/icons/no_chk.gif";for(n in topCatsJason){key=topCatsJason[n];if(key==wikiAnswersLocalID&&!isSuper())continue;var hasChildren=(typeof allCategoriesTree[key].c!='undefined'&&allCategoriesTree[key].c>0)?true:false;var parentID=getParent(key);if(key>0&&parentID==0){var name=getName(key).replace(/\\/g,'');tbl+="<tr><td style='margin: 0px; padding: 3px 3px 3px 10px; vertical-align: top;'>"
tbl+="<input name='i"+key+"' value='1' id='i"+key+"' type='hidden'>";tbl+="<img isTopCat='1' alt='Select/Deselect'";if(key!=wikiAnswersLocalID||(typeof isAdmin!='undefined'&&isAdmin))
tbl+=" onclick='toggleCheck(this);'";tbl+=" title='Select/Deselect' src='"+src+"' class='c"+key+"' style='"+((key!=wikiAnswersLocalID||(typeof isAdmin!='undefined'&&isAdmin))?"cursor: pointer;":"")+"display: block; margin-top: 1px;' width='12' border='0' height='12'>";tbl+="</td>";tbl+="<td style='margin: 0px; padding: 3px; width: 100%;'>";if(hasChildren){tbl+="<span style='white-space:nowrap;color:#003399;cursor:pointer;' class='cat"+key+"' onclick='showHideChildren(this);return false;'>";tbl+="<img border='0' src='"+wgStaticFilesServer+"/templates/icons/topics-arrow-off.gif?v=28333' class='arrowImg'/>";tbl+=name+"</span>";}
else{tbl+="<span style='white-space:nowrap;color:#003399;' class='cat"+key+"'>";tbl+=name+"</span>";}
tbl+="<div id='cats_t"+key+"' style='margin: 0px; padding: 3px 0px 0px; width: 100%; display: none;'>";tbl+="</div></td></tr>";}}
tbl+="</table>";fillMainList(tbl);setTimeout("repaintPage()",1);}
function showParentMirrors(parent){var strMirrors=(typeof allCategoriesTree[parent].m=='undefined')?"":allCategoriesTree[parent].m.trim();if(strMirrors!=""){var arrMirrors=strMirrors.split(",");var max=arrMirrors.length;for(var i=0;i<max;i++){showSubTree(arrMirrors[i]);copyOriginalToMirror(parent,arrMirrors[i]);}}}
function checkMirrors(orig){var strMirrors=(typeof allCategoriesTree[orig].m=='undefined')?"":allCategoriesTree[orig].m.trim();var arrMirrors=strMirrors.split(",");var max=arrMirrors.length;for(var i=0;i<max;i++){showSubTree(arrMirrors[i]);var parent=getParent(arrMirrors[i]);markParent(parent,arrMirrors[i]);copyOriginalToMirror(orig,arrMirrors[i]);showParentMirrors(parent);}}
function markParent(parent,child){var decs=getDecs("cats_t"+parent);var decsLen=decs.length;for(var x=0;x<decsLen;x++){if(decs[x].className=="c"+child)
checkCat(decs[x]);}}
function copyOriginalToMirror(orig,mirror){var mirrorObj=jQuery('#cats_t'+mirror)[0];var origObj=jQuery('#cats_t'+orig)[0];var childs=(typeof allCategoriesTree[orig].c=='undefined')?0:allCategoriesTree[orig].c;if(mirrorObj!=null&&origObj!=null&&childs>0){mirrorObj.innerHTML=origObj.innerHTML;mirrorObj.style.display='block';}}
function getDecs(id){var obj=document.getElementById(id);if(obj!=null){return obj.getElementsByTagName('*');}
else{return[];}}
function showSubTree(id){var ancestors=getAncestors(id);var max=ancestors.length;var toOpen=new Array();for(var i=0;i<max;i++){var obj=document.getElementById('cats_t'+ancestors[i]);if(obj!=null&&obj.style.display=='none'){showChildrenCats(ancestors[i],ancestors[i],obj);break;}else{toOpen.push(ancestors[i]);}}
max=toOpen.length;for(var x=max-1;x>=0;x--){showChildrenCats(toOpen[x],toOpen[x],null);}}
var isFirstTime=true;function showFaytSel(id,fromfayt){var len=selectedCatsArr.length;if(fromfayt){if(window.location.href.match(/newqAdded/i)!=null)
_hbLink('FAYT_cat');else
_hbLink('FAYT_recat');}
if(isFirstTime||(len<limit&&isSelected(id))){hideMsg();if(jwgData.config.useCatchAllCategory){if(isCatchallSelected(id)&&len>0){showMsg("You can\'t select a Catch-All category unless you deselect other categories.");return;}
if(isCatchallinAlreadySelected()){showMsg("You can\'t select another category unless you deselect the Catch-All category first.");return;}}
updateSuggested(id,1);showSubTree(id);markSelected(id);scrollTo(id);}else if(len>=limit){showLimit();}
updateCurrentCats();setTimeout("repaintPage()",1);}
function addToselectedlist(id){var orig=(typeof allCategoriesTree[id]=="undefined"||allCategoriesTree[id].l==0)?id:allCategoriesTree[id].l;if(selectedCatsArr.indexOf(orig,0,1)<0)
selectedCatsArr.push(orig);}
function isSelected(id){var obj=document.getElementById('cats_t'+id);if(obj!=null){var img=obj.parentNode.parentNode.childNodes[0].childNodes[1];var src=img.src;if(src.match(/no_chk\.gif/gi)==null)
return false;}
return true;}
function scrollTo(id){var obj=jQuery("#cats_t"+id)[0];var dtop=313;if(obj!=null){if(obj.style.display=='block'){dtop=getObjXY(obj)[1];}else if(obj.style.display=='none'){obj.style.display='block';dtop=getObjXY(obj)[1];obj.style.display='none';}}
var scrOfY=0;if(document.body&&document.body.scrollTop){scrOfY=document.body.scrollTop;}else if(document.documentElement&&document.documentElement.scrollTop){scrOfY=document.documentElement.scrollTop;}
var scroll=dtop-313-scrOfY;if(isNewQuestion&&jQuery('#suggestedcats').length>0)
scroll=dtop-400-scrOfY;if(jQuery("#brwscat").length>0)
setTimeout("scrollBrwscat("+scroll+")",0);}
function scrollBrwscat(scroll){var brwscat=document.getElementById('brwscat');if(brwscat!=null)
brwscat.scrollTop=scroll;}
function markSelected(id){var obj=document.getElementById('cats_t'+id);if(obj!=null){var img=obj.parentNode.parentNode.childNodes[0].childNodes[1];if(img!=null){img.src=wgStaticFilesServer+"/templates/icons/chk.gif";var span=img.parentNode.parentNode.childNodes[1].childNodes[0];span.style.backgroundColor='#f7941d';span.style.color='white';var cname=img.className;var curid=cname.replace("c","");curid=allCategoriesTree[curid].l>0?allCategoriesTree[curid].l:curid;addToselectedlist(curid);if(!isFirstTime)
deselectParents(img);var divNode=img.parentNode.parentNode.getElementsByTagName('div')[0];showChildrenCats(curid,curid,divNode);var deselectAlllspan=jQuery('#deselectAll')[0];if(deselectAlllspan!=null&&deselectAlllspan.style.color!='#003399'){deselectAlllspan.style.display='none';}
setTimeout("repaintPage()",1);}}}
function deselectParents(img){var parent=img.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[0].childNodes[1];while(typeof parent!='undefined'&&parent!=null&&typeof parent.getAttribute("isTopCat")!="undefined"){if(parent.src.match(/no_chk\.gif/gi)==null){var cname=parent.className;var curid=cname.replace("c","");curid=allCategoriesTree[curid].l>0?allCategoriesTree[curid].l:curid;uncheckCat(parent);deselectLinks(curid);}
if(parent.getAttribute("isTopCat")=="1")
return false;parent=parent.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[0].childNodes[1];}}
function deselectChilds(img){var childs=img.parentNode.parentNode.getElementsByTagName('img');var max=childs.length;for(var i=0;i<max;i++){if(childs[i]!=img&&childs[i].src.match(/chk\.gif/gi)!=null&&childs[i].src.match(/no_chk\.gif/gi)==null){var cname=childs[i].className;var curid=cname.replace("c","");curid=allCategoriesTree[curid].l>0?allCategoriesTree[curid].l:curid;uncheckCat(childs[i]);deselectLinks(curid);}}}
function checkCat(img){if(typeof(img)!="undefined"&&img!=null){img.src=wgStaticFilesServer+"/templates/icons/chk.gif";var span=img.parentNode.parentNode.childNodes[1].childNodes[0];span.style.backgroundColor='#f7941d';span.style.color='white';var cname=img.className;var curid=cname.replace("c","");curid=(allCategoriesTree[curid].l!=null&&allCategoriesTree[curid].l>0)?allCategoriesTree[curid].l:curid;addToselectedlist(curid);updateSuggested(curid,1);var divNode=img.parentNode.parentNode.getElementsByTagName('div')[0];showChildrenCats(curid,curid,divNode);deselectParents(img);var deselectAlllspan=jQuery('#deselectAll')[0];if(deselectAlllspan!=null&&deselectAlllspan.style.color!='#003399'){deselectAlllspan.style.display='none';}
updateCurrentCats();setTimeout("repaintPage()",1);}}
function uncheckCat(img){var len=selectedCatsArr.length;if(img!=null){img.src=wgStaticFilesServer+"/templates/icons/no_chk.gif";var span=img.parentNode.parentNode.childNodes[1].childNodes[0];span.style.backgroundColor='white';var cname=img.className;var curid=cname.replace("c","");curid=allCategoriesTree[curid].l>0?allCategoriesTree[curid].l:curid;var hasChildren=(typeof allCategoriesTree[curid].c!='undefined'&&allCategoriesTree[curid].c>0)?true:false;if(hasChildren)
span.style.color='#003399';else
span.style.color='black';selectedCatsArr.remove(curid);updateSuggested(curid,0);if(len==0){var deselectAlllspan=jQuery('#deselectAll')[0];if(deselectAlllspan!=null){deselectAlllspan.style.display='block';}}
if(((len>=0&&jwgData.config.useCatchAllCategory)||len==0)&&len<=limit){hideMsg();}
updateCurrentCats();setTimeout("repaintPage()",1);}}
function updateCurrentCats(){var currentCatsTbl=jQuery('#currentCatsTbl')[0];if(currentCatsTbl!=null){var str="<table width=\"100%\">";var max=selectedCatsArr.length;for(var i=0;i<max;i++){str+="<tr><td width='15'><input type='checkbox' name='suggestedCat' value='"+selectedCatsArr[i]+"' onclick='cuSuggested(this);' checked></td><td><span>"+allCategoriesTree[selectedCatsArr[i]].n.replace(/\\/g,'')+"</span></td></tr>";}
str+="</table>";currentCatsTbl.innerHTML=str;}
updateHeight();}
function toggleCheck(img){var src=img.src;var cname=img.className;var curid=cname.replace("c","");var len=selectedCatsArr.length;if(src.match(/no_chk\.gif/gi)!=null){if(len<limit){hideMsg();if(jwgData.config.useCatchAllCategory){if(isCatchallSelected(curid)&&len>0){showMsg("You can\'t select a Catch-All category unless you deselect other categories.");return;}
if(isCatchallinAlreadySelected()){showMsg("You can\'t select another category unless you deselect the Catch-All category first.");return;}}
checkCat(img);}else{showLimit();}}else{selectedCatsArr.remove(curid);uncheckCat(img);deselectLinks(curid);}}
var limit=3;function deselectLinks(id){var decs=getDecs("catTree");var origlink=allCategoriesTree[id].l;var max=decs.length;for(var i=0;i<max;i++){if(decs[i].tagName.toLowerCase()=='img'&&decs[i].src.match(/\/chk\.gif/i)!=null){var cname=decs[i].className;var curid=cname.replace("c","");var curlink=allCategoriesTree[curid].l;if(curid==id||(curlink>0&&id==curlink)||(origlink>0&&curid==origlink)||(curlink>0&&origlink>0&&curlink==origlink)){uncheckCat(decs[i]);}}}}
function deselectAll(){printMainTree();var deselectAlllspan=jQuery('#deselectAll')[0];if(deselectAlllspan!=null){deselectAlllspan.style.display='block';}
var suggestedcats=jQuery('#suggestedTree')[0];if(suggestedcats!=null){var elements=suggestedcats.getElementsByTagName('input');var max=elements.length;for(var i=0;i<max;i++){elements[i].checked=false;}}
selectedCatsArr=new Array();var errbox2=jQuery('#errorMsgBox2')[0];errbox2.innerHTML="";updateCurrentCats();updateHeight();}
function getAllSAelected(){var max=selectedCatsArr.length;var allSelectedStr="";for(var i=0;i<max;i++){if(i>0)allSelectedStr+=",";allSelectedStr+=selectedCatsArr[i];}
return allSelectedStr;}
var baseHeight=500;var targetElement=null;function callRecat(qTitle,obj){RecategorizeCats(qTitle);targetElement=obj;}
function RecategorizeCats(qTitle){var recategorizePopUp=jQuery('#catsWindow')[0];baseHeight=500;if(typeof(recategorizePopUp)!='undefined'){return 1;}
IncludeJS('catsjs',location.protocol+"//"+location.host+'/Q/Special:Cats&act=getList&ts='+topicTreeChangeTime+'&s='+isSuper());if(qTitle&&qTitle!="")
qTitle=qTitle.replace(/_/g," ");var url=location.protocol+"//"+location.host+"/Q/Special:Cats&ajax=1&act=selcats&question="+encodeURI(qTitle);jQuery.ajax({url:url,data:"",success:function(resp){fillCats(resp);}});if(jwgData.config.useCatchAllCategory){if(catchAllArray&&catchAllArray.length==0){setcatchAllArray();}}
var catsWindow=document.createElement('div');catsWindow.id="catsWindow";var bodyNode=document.body;var tarnsBg=document.createElement('div');catsWindow.innerHTML="<div id='ajaxLoaderImg'></div>";tarnsBg.id="tarnsBg";if(bodyNode!=null&&catsWindow!=null)
{if(tarnsBg!=null)bodyNode.appendChild(tarnsBg);bodyNode.appendChild(catsWindow);var scrOfY=0;var scrOfX=0;if(document.body&&document.body.scrollTop){scrOfY=document.body.scrollTop;scrOfX=document.body.scrollLeft;}else if(document.documentElement&&document.documentElement.scrollTop){scrOfY=document.documentElement.scrollTop;scrOfX=document.documentElement.scrollLeft;}
if(isIE6()){var hiddenIframe=document.createElement('iframe');hiddenIframe.id="hiddenIframe";bodyNode.appendChild(hiddenIframe);}
if(typeof(window.innerHeight)=='number'){var visibleAreaH=window.innerHeight;var visibleAreaW=window.innerWidth;}else{var visibleAreaH=document.documentElement.clientHeight;var visibleAreaW=document.documentElement.clientWidth;}
var leftalign=((visibleAreaW-442)/2)+scrOfX;if(visibleAreaH>500){baseHeight=visibleAreaH-25;if(Current.Browser.IE)
baseHeight=visibleAreaH-25;else
baseHeight=visibleAreaH-40;}else{baseHeight=475;}
if(window.location.href.match(/newqAdded/i)!=null)
baseHeight=baseHeight-15;jQuery(catsWindow).css({"height":baseHeight+"px","top":scrOfY+10+"px","left":leftalign+"px"});jQuery('#hiddenIframe').css({"height":baseHeight+"px","top":scrOfY+"px","left":leftalign+"px"});}
questionTitle=qTitle;}
var questionTitle=null;var isLoaded=false;function onKeyPressEvent(e){if(jQuery('#catsWindow').length==0)
return true;if(!e)var e=window.event;var tg=(window.event&&document.all)?e.srcElement:e.target;var keynum=((e.which)||(e.keyCode));if(tg.id=="textInputId"&&(jQuery('#suggestions').length>0&&jQuery('#suggestions')[0].style.display!="none")){return true;}
else if(keynum==13){clickonfayt+="oldEvt";return doRecatogorize(questionTitle);}}
var isNewQuestion=false;function fillMainList(tbl){var catTree=document.getElementById('catTree');if(catTree!=null)
catTree.innerHTML=tbl;else
setTimeout("fillMainList('"+tbl+"')",100);}
function moveFoCusTo(id){if(jQuery("#"+id).length>0){jQuery("#"+id).focus();jQuery("#"+id).focus();}
else
setTimeout("moveFoCusTo('"+id+"')",100);}
var checkIfCatsRecievedInterval=null;function fillCats(str){str=str.trim();if(str.indexOf("errormsg:")==0){eval(str.substring(9));return;}
if(jQuery('#catsWindow').length!=0){jQuery('#catsWindow').append(str);eval(jQuery("#firstcats").html());if(qcats!=null&&qcats[0]==uncategorizedID){isNewQuestion=true;}}
checkIfCatsRecievedInterval=setInterval("checkIfCatsRecieved()",1);}
function checkIfCatsRecieved(){if(typeof(allCategoriesTree)!="undefined"&&allCategoriesTree!=null&&typeof(qcats)!="undefined"&&qcats!=null){clearInterval(checkIfCatsRecievedInterval);showCatsList();}}
function repaintPage(){updateHeight();if(jQuery('#brwscat').length>0&&(Current.Browser.Opera||Current.Browser.WebKit)){jQuery('#brwscat')[0].scrollTop+=1;jQuery('#brwscat')[0].scrollTop-=1;}}
function closeWindow(clickedBtn){if(!isLoaded)return false;if(selectedCatsArr.indexOf(uncategorizedID,0,1)>-1&&selectedCatsArr.length>1){selectedCatsArr.remove(uncategorizedID);}
if(selectedCatsArr.indexOf(2092,0,1)>-1&&selectedCatsArr.length>1){selectedCatsArr.remove(2092);}
if(selectedCatsArr.indexOf(412,0,1)>-1&&selectedCatsArr.length>1){selectedCatsArr.remove(412);}
var catsList=jQuery('#catsList')[0];if(qcats!=null&&qcats[0]==uncategorizedID){var allsel=getSelectedSuggestedCats();if(allsel.length>0){var firstRecat=0;if(window.location.href.match(/newqAdded/i)!=null){firstRecat=1;_hbLink('NewQ_cated');}
var url=location.protocol+"//"+location.host+"/Q/"+encodeURI(questionTitle)+"&action=editfaq&newcats="+allsel+"&fromatlas=brute&firstRecat="+firstRecat;jQuery.ajax({url:url,data:"",type:"POST",success:function(resp){updateErrMsg(resp);}});}
else{if(window.location.href.match(/newqAdded/i)!=null)_hbLink('NewQ_notcated');resetRectParams('Close');}}else{if(window.location.href.match(/newqAdded/i)!=null)_hbLink('NewQ_notcated');resetRectParams('Close');}}
recatPopupClosed=true;function resetRectParams(clickedBtn){wssAutoRecat(clickedBtn);var catsWindow=jQuery('#catsWindow')[0];var tarnsBg=jQuery('#tarnsBg')[0];var hiddenIframe=jQuery('#hiddenIframe')[0];var bodyNode=document.body;if(bodyNode!=null)
{if(catsWindow!=null)bodyNode.removeChild(catsWindow);if(hiddenIframe!=null)bodyNode.removeChild(hiddenIframe);if(tarnsBg!=null)bodyNode.removeChild(tarnsBg);bodyNode.style.overflow="";recatPopupClosed=true;}
if(typeof ANSW!="undefined")
ANSW.AnswerTipEnabled=true;if(clickedBtn!="Close"){if(clickedBtn=="Save"&&window.location.href.match(/\/FAQ\/(\d+)/i)!=null){var currentCat=window.location.href.match(/\/FAQ\/(\d+)/i);if(targetElement!=null&&currentCat!=null&&selectedCatsArr.indexOf(currentCat[1],0,1)<0)
targetElement.style.display='none';}else if(targetElement!=null&&targetElement.id.match(/q_item_div/)!=null){var currentCat=window.location.href.match(/tid=(\d+)/i);if(currentCat!=null&&selectedCatsArr.indexOf(currentCat[1],0,1)<0)
targetElement.style.display='none';}else if(targetElement!=null&&window.location.href.match(/\/FAQ\/(\d+)/i)==null&&targetElement.parentNode!=null&&selectedCatsArr.length>0&&selectedCatsArr[0]!=uncategorizedID&&clickedBtn=="Save"){selectedCatsArr=selectedCatsArr.sort(sortByNumber);targetElement.parentNode.innerHTML="In:"+" <a target=\"_blank\" href=\"/Q/FAQ/"+selectedCatsArr[0]+"\" style=\"font-weight:normal;color: rgb(127, 127, 127);\">"+allCategoriesTree[selectedCatsArr[0]].n+"</a>";}
selectedCatsArr=new Array();if(window.location.href.match(/newqAdded/i)!=null){var href=window.location.href.replace("&newqAdded=1","").replace(/&action=editfaq&email=WatchUpds&link=Recat/,"");window.location.href=href;}}
selectedCatsArr=new Array();qcats=null;isLoaded=false;isNewQuestion=false;questionTitle=null;isFirstTime=true;targetElement=null;}
function sortByNumber(a,b)
{return a-b;}
function doRecatogorize(qTitle){if((document.all&&!isIE6())||clickonfayt=="oldEvt"||clickonfayt=="changeCatoldEvt"){var savebtn=jQuery('#buttonsTbl').length?jQuery('#buttonsTbl').find("a.btn"):null;if(savebtn==null||savebtn.isDisabledBtn()){return false;}
if(selectedCatsArr.indexOf(uncategorizedID,0,1)>-1&&selectedCatsArr.length>1){selectedCatsArr.remove(uncategorizedID);}
if(selectedCatsArr.indexOf(2092,0,1)>-1&&selectedCatsArr.length>1){selectedCatsArr.remove(2092);}
if(selectedCatsArr.indexOf(412,0,1)>-1&&selectedCatsArr.length>1){selectedCatsArr.remove(412);}
var allsel=getAllSAelected();if(allsel.length==0){allsel=uncategorizedID;}
var firstRecat=0;if(window.location.href.match(/newqAdded/i)!=null){firstRecat=1;_hbLink('NewQ_cated');}
var fromatlas=getCatsFromAtlas(allsel);var url=location.protocol+"//"+location.host+"/Q/"+encodeURI(qTitle)+"&action=editfaq&newcats="+allsel+"&fromatlas="+fromatlas+"&firstRecat="+firstRecat;jQuery.ajax({url:url,data:"",type:"POST",success:function(resp){updateErrMsg(resp);}});}else{clickonfayt="";}}
function getCatsFromAtlas(selectedCats){var suggestedcats=jQuery('#suggestedTree')[0];var fromatlas="";var suggestedcats=jQuery('#suggestedTree')[0];if(suggestedcats!=null){var elements=suggestedcats.getElementsByTagName('input');var max=elements.length;for(var i=0;i<max;i++){if(selectedCats.indexOf(elements[i].value,0,1)>-1){if(fromatlas!="")fromatlas+=",";fromatlas+=elements[i].value;}}}
return fromatlas;}
function getSelectedNames(){var max=selectedCatsArr.length;var str="";for(var i=0;i<max;i++){if(typeof allCategoriesTree[selectedCatsArr[i]]!='undefined'){if(str!="")str+=",";str+=allCategoriesTree[selectedCatsArr[i]].n;}}
if(str=="")
str="None";return str;}
function wssAutoRecat(clickedBtn){var wss="{"+getSelectedNames()+"}{"+getSuggestedCats()+"}{"+questionTitle+"}{"+getUserName()+"}";var cv=_hbEvent(cv);_hbSet("cv.c13",wss+"|"+clickedBtn);_hbLink("AutoRect");}
function getSelectedSuggestedCats(){var suggestedcats=jQuery('#suggestedTree')[0];var str="";selectedCatsArr=new Array();if(suggestedcats!=null){var elements=suggestedcats.getElementsByTagName('input');var max=elements.length;for(var i=0;i<max;i++){if(elements[i].className=='SelectedAutoSuggest'){if(str!="")str+=",";str+=elements[i].value;addToselectedlist(elements[i].value)}}}
return str;}
function checkSelectedSuggestedCats(){var suggestedcats=jQuery('#suggestedTree')[0];if(suggestedcats!=null){var elements=suggestedcats.getElementsByTagName('input');var max=elements.length;for(var i=0;i<max;i++){if(elements[i].className!='notSelectedAS'){elements[i].checked=true;cuSuggested(elements[i]);}else if(elements[i].checked!=true){elements[i].checked=false;}}}}
function getSuggestedCats(){var suggestedcats=jQuery('#suggestedTree')[0];var str="";if(suggestedcats!=null){var elements=suggestedcats.getElementsByTagName('span');var max=elements.length;for(var i=0;i<max;i++){if(i>0)str+=",";str+=elements[i].innerHTML;}}
if(str=="")
str="None suggested";return str;}
var catsElem=null;function updateErrMsg(str){if(window.location.href.match(/newqAdded/i)!=null){var href=window.location.href.replace("&newqAdded=1","").replace(/&action=editfaq&email=WatchUpds&link=Recat/,"");wssAutoRecat('Save');window.location.href=href;}
var catsList=jQuery('#catsList')[0];var max=selectedCatsArr.length;var str="";if(max==0&&catsElem==null){str="<a name='&lid=in_catlink' href='/Q/FAQ/"+uncategorizedID+"'>"+allCategoriesTree[uncategorizedID].n+"</a>";}
for(var i=0;i<max;i++){if(i==0){str+="<a name='&lid=in_catlink' href='/Q/FAQ/"+selectedCatsArr[i]+"'>"+allCategoriesTree[selectedCatsArr[i]].n.replace(/\\/g,'')+"</a>";if(isCatchallSelected(selectedCatsArr[i])){updateUI();}}
else str+=", <a name='&lid=in_catlink' href='/Q/FAQ/"+selectedCatsArr[i]+"'>"+allCategoriesTree[selectedCatsArr[i]].n.replace(/\\/g,'')+"</a>";}
if(catsList!=null&&str!=""){catsList.innerHTML=str+" ";}else if(catsElem!=null&&window.location.href.match(/(Special\:RecentQ|Special\:RecentA|Special\:watchlist|Special\:recentchanges)/i)!=null){if(max>0)
str="<b>"+"In:"+" </b>"+str;else{str="<a style=\"font-weight:bold;\"title=\""+questionTitle+"\" href=\"Categorize Question\" onclick=\"_hbLink('in_categorize');catsElem=this.parentNode;RecategorizeCats('"+questionTitle.replace("'","\\'")+"');return false;\">"+"Categorize"+"</a>";}
catsElem.innerHTML=str.replace(/, /gi," | ")+" ";}
resetRectParams('Save');clickonfayt="";}
function updateHeight(isCatchAllMsg){var errbox2=jQuery('#errorMsgBox2')[0];var selTopics=jQuery("#catsWindow")[0];var brwscat=jQuery('#brwscat')[0];if(brwscat!=null){var tableHeight=baseHeight-230;var currentCats=jQuery('#currentCats')[0];if(currentCats!=null){tableHeight=baseHeight-240-currentCats.offsetHeight;if(window.location.href.match(/newqAdded/i)!=null)
tableHeight=baseHeight-260-currentCats.offsetHeight;}else if(window.location.href.match(/newqAdded/i)!=null){tableHeight=baseHeight-250;}
var catTree_h=jQuery("#catTree").height();if(catTree_h>tableHeight)
brwscat.style.height=tableHeight+"px";else
brwscat.style.height=10+catTree_h+"px";var msgDivHeight=39;if(typeof isCatchAllMsg!='undefined')
msgDivHeight+=20;if(errbox2.innerHTML!=""){if(brwscat!=null)brwscat.style.height=brwscat.offsetHeight-msgDivHeight+'px';errbox2.style.display='block';}else if(errbox2.innerHTML==""&&errbox2.style.display=='block'){errbox2.style.display='none';if(brwscat!=null)brwscat.style.height=brwscat.offsetHeight+msgDivHeight+'px';}
if(catTree_h<tableHeight){var newheight=baseHeight-(tableHeight-catTree_h)+15;jQuery("#catsWindow").css({"height":newheight+"px"});}else{jQuery("#catsWindow").css({"height":baseHeight+"px"});}}
var len=selectedCatsArr.length;if(len==0){jQuery('#deselectAll').show();}
setTimeout("repaintPage()",1);}
function showMsg(msg){jQuery('#errorMsgBox2').html(msg);updateHeight(1);}
function showLimit(){var LIMIT=limit;jQuery('#errorMsgBox2').html("&nbsp; You\'ve already selected "+LIMIT+" categories");updateHeight();}
function hideMsg(){jQuery('#errorMsgBox2').html("");updateHeight();}
var qcats=null;var selectedCatsArr=new Array();function showCatsList(){printMainTree();catscancelBtn=jQuery('#catscancelBtn')[0];if(catscancelBtn){catscancelBtn.style.visibility='visible';}
var catsform=jQuery('#catsform')[0];var ajaxLoader=jQuery('#ajaxLoaderImg')[0];if(ajaxLoader!=null)
ajaxLoader.style.display='none';if(catsform!=null)
catsform.style.visibility='visible';fitTitle();if(!isNewQuestion){for(key in qcats){showFaytSel(qcats[key],0);}}else{jQuery('#catsWindow')[0].className='recatNewQuestion';var suggestedcats=jQuery('#suggestedcats')[0];var closeimg=jQuery('#closeimg')[0];if(closeimg!=null&&window.location.href.match(/newqAdded/i)!=null)
closeimg.style.visibility='hidden';if(window.location.href.match(/newqAdded/i)!=null){var oldText=jQuery('#topTitle').html();jQuery('#topTitle').html('<span style="font-size: 16px; color: black; margin-left: 5px;">Thank you for submitting your question</span><br/>'+oldText);jQuery('#topTitle').html(jQuery('#topTitle').html().replace("Categories for","Categorize"));}}
checkSelectedSuggestedCats();var brwscat=jQuery('#brwscat')[0];if(brwscat!=null){var tableHeight=baseHeight-230;var currentCats=jQuery('#currentCats')[0];if(currentCats!=null){tableHeight=baseHeight-240-currentCats.offsetHeight;if(window.location.href.match(/newqAdded/i)!=null)
tableHeight=baseHeight-260-currentCats.offsetHeight;}else if(window.location.href.match(/newqAdded/i)!=null){tableHeight=baseHeight-250;}
brwscat.style.height=tableHeight+"px";}
updateHeight();var inputRecat=jQuery('#textInputId')[0];if(inputRecat!=null)
inputRecat.focus();isLoaded=true;if(typeof ANSW=="undefined"){ANSW=new Object();}
ANSW.AnswerTipEnabled=false;isFirstTime=false;recatPopupClosed=false;}
function truncateString(id,len){var p=jQuery("#"+id)[0];if(p){var trunc=p.innerHTML;trunc=trunc.replace(/\.\.\.$/gi,'');if(trunc.length>len){trunc=trunc.substring(0,len);trunc=trunc.replace(/\w+$/,'');p.innerHTML=trunc+"...";}}}
function updateSuggested(id,removeORadd){var orig=(typeof allCategoriesTree[id]=="undefined"||allCategoriesTree[id].l==0)?id:allCategoriesTree[id].l;var suggestedcatsObj=jQuery('#suggestedcats')[0];if(suggestedcatsObj!=null){var suggestedCats=suggestedcatsObj.getElementsByTagName('input');var max=suggestedCats.length;for(var i=0;i<max;i++){if(suggestedCats[i].value==id){if(removeORadd==1)
suggestedCats[i].checked=true;else
suggestedCats[i].checked=false;cuSuggested(suggestedCats[i]);}}}}
function isSuggestionChecked(){var suggestedcatsObj=jQuery('#suggestedcats')[0];var isSChecked=false;if(suggestedcatsObj!=null){var suggestedCats=suggestedcatsObj.getElementsByTagName('input');var max=suggestedCats.length;for(var i=0;i<max;i++){if(suggestedCats[i].checked==true){cuSuggested(suggestedCats[i]);isSChecked=true;}}}
return isSChecked;}
function cuSuggested(obj){if(obj.checked){var len=selectedCatsArr.length;if(isFirstTime||(len>=0&&len<limit)||selectedCatsArr.indexOf(obj.value,0,1)>-1){addToselectedlist(obj.value);showSubTree(obj.value);markSelected(obj.value);scrollTo(obj.value);}else{obj.checked=false;showLimit();}
updateCurrentCats();setTimeout("repaintPage()",1);}else{selectedCatsArr.remove(obj.value);var len=selectedCatsArr.length;if(len==0){var deselectAlllspan=jQuery('#deselectAll')[0];if(deselectAlllspan!=null){deselectAlllspan.style.display='block';}}
else if(len>0&&len<=limit){hideMsg();}
deselectLinks(obj.value);updateCurrentCats();setTimeout("repaintPage()",1);}}
function fitTitle(){fitStringToWidth('truncateme',17);}
function fitStringToWidth(id,height){var obj=jQuery("#"+id)[0];if(obj!=null){var result=obj.innerHTML;var temp="";obj.style.display='block';if(obj.offsetHeight>height){while(obj.offsetHeight>17){temp=obj.innerHTML;obj.innerHTML=temp.substring(0,temp.length-2);}
if(result.length>obj.innerHTML.length){var str=obj.innerHTML;str=str.substring(0,str.length-4);result=str.replace(/\s+[^\s]*?\s*$/gi,"...");}}
obj.style.display='inline';obj.innerHTML=result;}}
catchAllArray=new Array();function setcatchAllArray(){var url=location.protocol+"//"+location.host+'/Q/Special:Cats&act=getCatchall';jQuery.ajax({url:url,data:"",type:"GET",success:function(resp){eval(resp);},error:function(requester,except){statusMessageShow("Error in Catchall category list");}});}
function isCatchallinAlreadySelected(){var len1=selectedCatsArr.length;var len2=catchAllArray.length;for(i=0;i<len1;i++){for(j=0;j<len2;j++){if(selectedCatsArr[i]==catchAllArray[j])
return true;}}
return false;}
function isCatchallSelected(id){var len=catchAllArray.length;for(i=0;i<len;i++){if(id==catchAllArray[i])
return true;}
return false;}
jQuery(document).keypress(onKeyPressEvent);function IncludeJS(sId,fileUrl)
{if(!document.getElementById(sId)){var HeadElement=document.getElementsByTagName('HEAD').item(0);var externalJScript=document.createElement("script");externalJScript.language="javascript";externalJScript.type="text/javascript";externalJScript.id=sId;externalJScript.src=fileUrl;HeadElement.appendChild(externalJScript);}}
var faytBoxId='faytBoxIdDefault';var lastOpenedItem="";var currentOpenedItem="";var clickonfayt="";var suggestionsHeight=0;var filledFaytList=false;var characterWrapLength=0;var selectedId=null;var templateName;var numOfItems=0;function HideLast(){if(lastOpenedItem=="suggestions"||lastOpenedItem==faytBoxId){var obj=jQuery("#"+lastOpenedItem)[0];if(obj!=null){obj.innerHTML='';obj.style.display='none';operaRefresh();}}
else if(currentOpenedItem!=lastOpenedItem){var obj=document.getElementById(lastOpenedItem);if(obj!=null)
obj.style.display='none';}
lastOpenedItem=currentOpenedItem;currentOpenedItem="";}
function selectItem(id,listid,inid){var newSelected=jQuery("#"+id)[0];var inputObj=jQuery("#"+inid)[0];var listObj1=jQuery("#"+listid)[0];if(newSelected!=null&&inputObj!=null){inputObj.value=newSelected.innerHTML.replace(/<\/?b>/gi,"");}
if(selectedId&&inputObj!=null){inputObj.name=selectedId.replace(/\_(.*)/,"");}
if(templateName&&templateName=="topics.tpl"){goToCat();}}
function changeColor(element,keynum){parentElement=jQuery(element).offsetParent()[0];parentHeight=parentElement.offsetHeight;parentScrollTop=parentElement.scrollTop;elementScrollTop=jQuery(element)[0].offsetTop;nsiblingScrollTop=(jQuery(element).next()[0]!=null)?jQuery(element).next()[0].offsetTop:null;if(keynum==40){if((nsiblingScrollTop>(parentScrollTop+parentHeight))||nsiblingScrollTop==null){parentElement.scrollTop=elementScrollTop;}}
else if(keynum==38){if(elementScrollTop<parentScrollTop){parentElement.scrollTop=nsiblingScrollTop-parentHeight;}}
var oldSelected=selectedId!=null&&jQuery("#"+selectedId).length>0?jQuery("#"+selectedId)[0]:null;if(oldSelected!=null){oldSelected.style.backgroundColor="";oldSelected.style.color="black";}
selectedId=element.id;if(element!=null){element.style.backgroundColor="#316ac5";element.style.color="white";}}
function startType(e,obj,faytlist){if(!e)var e=window.event;var keynum=((e.which)||(e.keyCode));var listObj=jQuery("#"+faytlist)[0];var firstItem=listObj.childNodes[0];if(keynum==13){if(listObj.style.display!='none'&&selectedId!=null){selectByclick(selectedId,faytlist,obj.id);}
return false;}
else{var str=obj.value.trim();str=str.replace(/[^A-Za-z0-9\- \u00c0-\u00ff]/g,'');getListFromServer(keynum,str,faytlist);}
if(jQuery('#textInputId')[0]&&jQuery('#textInputId')[0].value.replace(/ /g,'').length<=1&&keynum!=40&&keynum!=38)listObj.scrollTop=0;}
function startType2(e,obj,faytlist){if(!e)var e=window.event;var keynum=((e.which)||(e.keyCode));var listObj=jQuery("#"+faytlist)[0];if(keynum==13){if(listObj.style.display!='none'&&selectedId!=null)
selectByclick(selectedId,faytlist,obj.id);return false;}
else if(keynum==40){var firstItem=listObj.childNodes[0];if(!selectedId&&firstItem!=null)
changeColor(firstItem);else if(selectedId!=null){var index=jQuery("div#"+faytlist+" span").index(jQuery("#"+selectedId)[0]);var num=index+1;var nextElement=listObj.getElementsByTagName('span')[num];if(nextElement!=null)
changeColor(nextElement,keynum);}}
else if(keynum==38&&selectedId!=null){var index=jQuery("div#"+faytlist+" span").index(jQuery("#"+selectedId)[0]);var num=index-1;if(num>-1){var nextElement=listObj.getElementsByTagName('span')[num];if(typeof nextElement!="undefined"&&nextElement!=null){changeColor(nextElement,keynum);}}}
else listObj.scrollTop=0;}
function selectByclick(id,listid,inid){var listObj=jQuery("#"+listid)[0];var tin=jQuery("#"+inid)[0];clickonfayt="changeCat";selectItem(id,listid,inid);if(listObj!=null)listObj.innerHTML="";selectedId=null;if(inid=="textInputId"&&tin!=null){showFaytSel(tin.name,1);if(jQuery('#searchscat')[0])tin.value="";}
hide_fnc=function(elem){jQuery(elem).hide();};hide_fnc.defer(listObj);}
var checkIfArrReceived=null;function getListFromServer(keynum,text,listid){text=text.trim();if(text==""){HideLast();}
if(typeof(allCategoriesTree)!="undefined"&&text!=""&&keynum!=40&&keynum!=13&&keynum!=38){fillFaytList(text);}else if(typeof(allCategoriesTree)=="undefined"){if(checkIfArrReceived){clearInterval(checkIfArrReceived);}
checkIfArrReceived=setInterval("getListFromServer("+keynum+",'"+text.replace(/\'/g,"\\\'")+"','"+listid+"')",500);}}
function fillFaytList(text){var listObj3=jQuery('#suggestions')[0];var optionsList="";var optionsListAr=new Array();var firstLetterIndex=0;var i=0;var longCats=0;var re="/((^|\\b)("+text+")(.*))/i";re=eval(re);var suggestionOption="";for(key in allCategoriesTree){if((key==uncategorizedID&&!isSuper()&&window.location.href.match(/\/Q\/FAQ\/?$/i)==null)||(key==catchAllId&&!isSuper())||(key==2380&&!isSuper())||(key==wikiAnswersLocalID&&(typeof isAdmin=='undefined'||!isAdmin))||(key==2092&&exsitsInJson(qcats,2092)))
continue;if(key>0&&allCategoriesTree[key].l==0&&allCategoriesTree[key].n.match(re)!=null){if(allCategoriesTree[key].n.toLowerCase().indexOf(text.toLowerCase())==0){optionsListAr.splice(firstLetterIndex,0,"<span class=\"suggestion\" id=\""+key+"_"+i+"\" name=\""+key+"\" onmouseover=\"changeColor(this);\" onclick=\"selectByclick(this.id,'suggestions','textInputId')\" >"+highlightText(re,allCategoriesTree[key].n).replace(/\\/g,'')+"</span>");firstLetterIndex++;}
else{optionsListAr[i]="<span class=\"suggestion\" id=\""+key+"_"+i+"\" name=\""+key+"\" onmouseover=\"changeColor(this);\" onclick=\"selectByclick(this.id,'suggestions','textInputId')\" >"+highlightText(re,allCategoriesTree[key].n).replace(/\\/g,'')+"</span>";}
i++;if(allCategoriesTree[key].n.length>getCharacterWrapLength())
longCats++;}}
optionsList=optionsListAr.join("");numOfItems=i+longCats;if(optionsList!=""&&listObj3!=null){listObj3.innerHTML=optionsList;var itmHeight=numOfItems*16+4;suggestionsHeight=(suggestionsHeight>0)?suggestionsHeight:jQuery(listObj3).height();listObj3.style.height=Math.min(itmHeight,suggestionsHeight)+"px";if(itmHeight<suggestionsHeight){listObj3.style.overflowY="hidden";}
else{listObj3.style.overflowY="auto";}
listObj3.style.display="block";lastOpenedItem="suggestions";}else if(listObj3!=null){listObj3.innerHTML="";listObj3.style.display="none";}
selectedId=null;}
function highlightText(re,txt){return txt.replace(re,"<b>$3</b>$4");}
function getCharacterWrapLength(){if(characterWrapLength==0){characterWrapLength=(jQuery('#searchscat')[0]!=null)?43:51;}
return characterWrapLength;}
attachEventToFunction(document,"click",HideLast);function goToCat(){filledFaytList=false;getFaytAttempts=0;var catId=jQuery('#textInputId')[0].name;var catIdName=jQuery('#textInputId')[0].value.length;if((!catId&&catIdName<=0)||(catId&&catIdName<=0)){_hbLink('BrowseCatPgFAYT',wssStatus+"_Blank");return false;}
if(!catId&&catIdName>0){checkCatList();}
if(catId){_hbLink('BrowseCatPgFAYT',wssStatus+"_Match");window.location.href=goToURL+catId;}}
function checkCatList(){var suggestions=jQuery('#suggestions')[0];if(suggestions.childNodes.length!=0){for(i=0;i<suggestions.childNodes.length;i++){var matchSuggest=suggestions.childNodes[i].innerHTML.toLowerCase();matchSuggest=matchSuggest.replace(/<\/?b>/gi,"");inputValue=jQuery('#textInputId')[0].value.toLowerCase();if(matchSuggest==inputValue){suggestId=suggestions.childNodes[i].id;suggestId=suggestId.replace(/_\d+/,"");_hbLink('BrowseCatPgFAYT',wssStatus+"_Match");window.location.href=goToURL+suggestId;return;}}}
if(!filledFaytList&&getFaytAttempts<20){getFaytAttempts++;setTimeout('checkCatList();',200);}else{_hbLink('BrowseCatPgFAYT',wssStatus+"_NoMatch");jQuery('#favcatMessage').css({"color":"red"});jQuery('#favcatMessage').html("Oops! We couldn\'t find that category. Start typing and then choose one from the list.");}}
var listpics=new Array(wgStaticFilesServer+'/templates/icons/shadowAlpha.png',wgStaticFilesServer+'/templates/icons/shadow_small.gif',wgStaticFilesServer+'/templates/icons/ajax-loader.gif',wgStaticFilesServer+'/templates/icons/ajax-loader2.gif',wgStaticFilesServer+'/templates/icons/x_on.png',wgStaticFilesServer+'/templates/icons/x.png');imagePreload=new ImagePreloader(listpics);search_page=1;search_over_id=null;maxSearchLength=1200;function showLimitnHint(id){var jElem=jQuery("#"+id);popup_elem.build(jElem,260,0);popup_elem.makeTooltip("Click here to choose between answered, unanswered or all questions");popup_elem.moveFromElemX(-12);var moveY=($('tooltip_elem'))?-($('tooltip_elem').getHeight()):-40;popup_elem.moveFromElemY(moveY);}
function goSelectType(id){var jElem=jQuery("#"+id);popup_elem.build(jElem,150,88,true);var limitn_value=$('searchform').limitn.value;if(limitn_value=="old")
popup_elem.addMenuItem("Answered",true,"","left");else
popup_elem.addMenuItem("Answered",false,'selectType("old");',"left");if(limitn_value=="new")
popup_elem.addMenuItem('Unanswered',true,"","left");else
popup_elem.addMenuItem('Unanswered',false,'selectType("new");',"left");popup_elem.addMenuLine();if(limitn_value=="all"||limitn_value=="")
popup_elem.addMenuItem("All",true,"","left");else
popup_elem.addMenuItem("All",false,'selectType("all");',"left");popup_elem.makeMenu();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);}
function selectType(type){switch(type){case"old":{$("searchform").limitn.value="old";$("limitn_link").innerHTML="Answered";break;}
case"new":{$("searchform").limitn.value="new";$("limitn_link").innerHTML='Unanswered';break;}
case"all":{$("searchform").limitn.value="all";$("limitn_link").innerHTML="All";break;}
default:{$("searchform").limitn.value="all";$("limitn_link").innerHTML="All";break;}}
search_limitn=$("searchform").limitn.value;navGo(1);}
function showSearchHint(id){var jElem=jQuery("#"+id);popup_elem.build(jElem,160,0);popup_elem.makeTooltip("Click here to change the search term");popup_elem.moveFromElemX(0);var moveY=($('tooltip_elem'))?-($('tooltip_elem').getHeight()):-40;popup_elem.moveFromElemY(moveY);}
past_searches=[];function changeSearchBox(id){var jElem=jQuery("#"+id);past_searches[past_searches.length]=($("search_link").innerHTML.replace(/"/g,"&quot;"));popup_elem.build(jElem,0,0,true);popup_elem.addCustomMenuItem("<form id='searchtextform' name='searchtextform' method='post' action='javascript:changeSearchTerm();' enctype='application/x-www-form-urlencoded' style='padding: 0px; margin: 0px; white-space: nowrap;' onsubmit='Event.stop(event); if(checkSearchTerm(this.searchterm)) changeSearchTerm();'><table cellpadding=0 cellspacing=0 border=0><tr><td style='vertical-align: top;'><input type=text name=\"searchterm\" value=\""+(past_searches[past_searches.length-1])+"\" size=25 style='border: #B2C5CC 1px solid; padding: 2px; height: 18px;' onchange='checkSearchTerm(this);' onkeydown='checkSearchTerm(this);' onkeyup='checkSearchTerm(this);' onclick='Event.stop(event);' maxlength='"+maxSearchLength+"'></td><td style='vertical-align: middle;'>&nbsp;&nbsp;<a class=\"btn smallstd grey\" href=\"javascript:void(0);\" onclick=\"if(!jQuery(this).isDisabledBtn()){Event.stop(event); if(checkSearchTerm($('searchtextform').searchterm)) changeSearchTerm();}else{xPreventDefault();return false}\" alt=\"Go\" title=\"Go\"><span><span><font style=\"white-space:nowrap;\"><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"><font>&nbsp;Go&nbsp;</font><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"></font></span></span></a></td></tr></table></form>","left");popup_elem.addMenuLine();popup_elem.addMenuItem("<font style='color: #767676; font-weight: bold;'>"+"Previous searches:"+"</font>",true,"","left");past_searches=past_searches.uniq();for(i=past_searches.length-1;i>=0;i--){if(past_searches[i]==past_searches[i-1])continue;cap=past_searches[i].substring(0,33);if(cap!=past_searches[i])cap+=" ...";popup_elem.addMenuItem(cap,false,"$(\"searchtextform\").searchterm.value = \""+past_searches[i].replace(/'/g,"&#39;").replace(/(")|(&quot;)/g,"\\\"")+"\"; if(checkSearchTerm($(\"searchtextform\").searchterm)) changeSearchTerm();","left");}
popup_elem.makeMenu();popup_elem.realignBySize();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);setTimeout("$('searchtextform').searchterm.focus();",300);}
function checkSearchTerm(elem){if(jQuery('#searchtextform').length>0){btnElm=jQuery('#searchtextform').find("a.btn:first");whichForm=document.forms['searchtextform'];}else{btnElm=jQuery('#searchform').find("a.btn:first");whichForm=document.forms['searchform'];whichForm.action="/Q/Special:Search&search="+encodeURIComponent(encodeURIComponent(whichForm.search.value))+((whichForm.limitn.value!='old')?"&limitn="+encodeURIComponent(whichForm.limitn.value):"");if(elem.value==0){whichForm.notextsearch.value=1;}else{whichForm.notextsearch.value=0;}}
if(elem.value.length>2||elem.value==0){btnElm.enableBtn();}else{btnElm.disableBtn();return false;}
return true;}
function changeSearchTerm(){var newsearch=$('searchtextform').searchterm.value;newsearch=newsearch.substring(0,maxSearchLength);$("searchform").search.value=escapeHTML(newsearch);$("search_link").innerHTML=escapeHTML(newsearch);search_term=encodeURIComponent(encodeURIComponent(newsearch));if($("br_container")){$("br_container").parentNode.removeChild($("br_container"));if($("recategorize_desc"))
$("recategorize_desc").parentNode.removeChild($("recategorize_desc"));if($("br_topictree"))
$("br_topictree").parentNode.removeChild($("br_topictree"));if($("status"))
$("status").parentNode.removeChild($("status"));br_returnOldNRQ();}
br_topic_selection=null;br_topic_cselection=null;if($('br_container')||$('recategorize_desc')){navGo(1,false,"openBatchRecat");}
else{navGo(1,false);}
$('search_link').focus();setTimeout("hideTooltip();",300);}
var categories_list=[];function showListCat(id){var jElem=jQuery("#"+id);var statusmesg=$('statusmesg');if(statusmesg){statusmesg.innerHTML='';statusmesg.style.display="none";}
if(categories_list.length==0){popup_elem.build(jElem,'',31,true);popup_elem.addMenuButton("Choose categories",false,'goSelectCat();');popup_elem.makeMenu();popup_elem.realignBySize();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);}
else if(categories_list.length==1){popup_elem.build(jElem,0,0,true);popup_elem.addMenuButton("Edit categories",false,'goSelectCat();');popup_elem.addMenuLine();popup_elem.addMenuItem("All",false,"selectAllCats();","left");popup_elem.makeMenu();popup_elem.realignBySize();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);}
else if(categories_list.length>1){menuHeight=0;menuWidth=0;popup_elem.build(jElem,menuWidth,menuHeight,true);for(i=0;i<categories_list.length;i++){if(i<3){popup_elem.addLinkMenuItem(categories_list[i].title,false,"/Q/FAQ/"+categories_list[i].id,"left",true);}
else{popup_elem.addLinkMenuItem("See all "+categories_list.length+" categories",false,"javascript:showAllCats();","left",false,true);break;}}
popup_elem.addMenuLine();popup_elem.addMenuButton("Edit categories",false,'goSelectCat();');popup_elem.addMenuLine();popup_elem.addMenuItem("All",false,"selectAllCats();","left");popup_elem.makeMenu();popup_elem.realignBySize();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);}}
function showAllCats(){popup_elem.build(popup_elem.elem,0,0,true);for(i=0;i<categories_list.length;i++){popup_elem.addLinkMenuItem(categories_list[i].title,false,"/Q/FAQ/"+categories_list[i].id,"left",true);}
if(categories_list.length>12){popup_elem.makeLongMenu();popup_elem.clearMenu();popup_elem.addLinkMenuItem("Show short list",false,"javascript:hideAllCats();","left",false,true);popup_elem.addMenuLine();popup_elem.addMenuButton("Edit categories",false,'goSelectCat();');popup_elem.addMenuLine();popup_elem.addMenuItem("All",false,"selectAllCats();","left");var html="";for(i=0;i<popup_elem.menuItems.length;i++){html+=popup_elem.menuItems[i];}
popup_elem.innerHTML+=html;popup_elem.innerHTML+="</div></td></tr></table>";popup_elem.fill(popup_elem.innerHTML);popup_elem.realignBySize();}
else{popup_elem.addLinkMenuItem("Show short list",false,"javascript:hideAllCats();","left",false,true);popup_elem.addMenuLine();popup_elem.addMenuButton("Edit categories",false,'goSelectCat();');popup_elem.addMenuLine();popup_elem.addMenuItem("All",false,"selectAllCats();","left");popup_elem.makeMenu();popup_elem.realignBySize();}
var need_hide_float=false;var cur_br_tt_scroll_top=0;if($('br_tt'))
cur_br_tt_scroll_top=parseInt(xScrollTop($('br_tt')));if($('br_container')&&(!$('br_container').style.display||$('br_container').style.display!="none")){need_hide_float=true;br_hide_float_container();}
popup_elem.makeModal(true);var fade=new Fadomatic(xModalDialog.grey,100,0,0,1);fade.fadeIn();if(need_hide_float){br_show_float_container();}
if($('br_tt'))
$('br_tt').scrollTop=cur_br_tt_scroll_top;popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);disableScrollBars();}
function hideAllCats(){showListCat('topics_hint');}
function showSelLimit(){popup_elem.build($('limit_selection'),50,(specialName=="EditAlternates")?119:97,true);if(search_total-search_offset>20){if(search_limit==20)
popup_elem.addMenuItem("20",true,"","");else
popup_elem.addMenuItem("20",false,'changeLimit(20);',"");if(search_limit==50)
popup_elem.addMenuItem("50",true,"","");else
popup_elem.addMenuItem("50",false,'changeLimit(50);',"");if(search_total-search_offset>50){if(search_limit==100)
popup_elem.addMenuItem("100",true,"","");else
popup_elem.addMenuItem("100",false,'changeLimit(100);',"");if(search_total-search_offset>100){if(search_limit==250)
popup_elem.addMenuItem("250",true,"","");else
popup_elem.addMenuItem("250",false,'changeLimit(250);',"");if(specialName=="EditAlternates"){if(search_total-search_offset>250){if(search_limit==500)
popup_elem.addMenuItem("500",true,"","");else
popup_elem.addMenuItem("500",false,'changeLimit(500);',"");}
else{popup_elem.addMenuItem("500",true,"","");}}}
else{popup_elem.addMenuItem("250",true,"","");if(specialName=="EditAlternates")
popup_elem.addMenuItem("500",true,"","");}}
else{popup_elem.addMenuItem("100",true,"","");popup_elem.addMenuItem("250",true,"","");if(specialName=="EditAlternates")
popup_elem.addMenuItem("500",true,"","");}}
else{if(search_limit==20)
popup_elem.addMenuItem("20",true,"","");else
popup_elem.addMenuItem("20",false,'changeLimit(20);',"");popup_elem.addMenuItem("50",true,"","");popup_elem.addMenuItem("100",true,"","");popup_elem.addMenuItem("250",true,"","");if(specialName=="EditAlternates")
popup_elem.addMenuItem("500",true,"","");}
popup_elem.makeMenu();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(20);}
search_limit=0;navGoComplete=false;function navGo(page,force_reload,callBack){var is_recat=false;if($('br_container')||$('recategorize_desc')){is_recat=true;if(xDef(callBack)&&callBack=="updateFilterCats")
callBack="updateFilterCats(); openBatchRecat";else
callBack="openBatchRecat";if($('br_tt')&&$('br_tree_catselected')){br_topic_selection=$('br_tt').innerHTML;br_topic_cselection=$('br_tree_catselected').innerHTML;}}
if(!xDef(callBack)){callBack="";}
showModalWait();var url='/Q/Special:'+specialName+'&ajax=1&action=getres&limit='+search_limit+'&offset='+((page-1)*search_limit)+((typeof search_term!='undefined')?'&search='+search_term:'')+''+((typeof search_limitn!='undefined')?'&limitn='+search_limitn:'')+''+((typeof search_trunks!='undefined')?'&trunks='+search_trunks:'')+''+((typeof search_tid!='undefined')?'&tid='+search_tid:'')+''+((typeof search_userType!='undefined')?'&userType='+search_userType:'')+((typeof search_actionType!='undefined')?'&actionType='+search_actionType:'')+((typeof search_standingPoint!='undefined')?'&sp='+search_standingPoint:'')+((typeof search_sp_offset!='undefined')?'&spOffset='+search_sp_offset:'')+((typeof search_maxKR!='undefined')?'&maxKR='+search_maxKR:'');var qs=new Querystring(location.pathname);if(specialName=="BatchRevert"){var start=qs.contains("start")?"&start="+qs.get("start"):"";var end=qs.contains("end")?"&end="+qs.get("end"):"";var userName=qs.contains("user")?"&user="+qs.get("user"):(qs.contains("ip")?"&ip="+qs.get("ip"):"&user="+0);url+=userName+start+end;}
if(specialName=="Changes"){var con=qs.contains("con")?"&con="+qs.get("con"):"";var cv=qs.contains("cv")?"&cv="+qs.get("cv"):"";url+=con+cv;}
if(specialName=="Contributions"){var target=qs.contains("target")?"&target="+qs.get("target"):"";url+=target;}
if(specialName=="NeedsImprovement"){var tid=qs.contains("tid")?"&tid="+qs.get("tid"):"";var nisearchform=$('searchform');if(nisearchform!=null){var search_edited=nisearchform.edited.value;var search_nimask=nisearchform.nimask.value;var search_flaggedby=(nisearchform.flaggedby.value=="me")?userId:nisearchform.flaggedby.value;}
var edited=typeof search_edited!='undefined'?'&edited='+search_edited:'';var nimask=typeof search_nimask!='undefined'?'&nimask='+search_nimask:'';var flaggedby=typeof search_flaggedby!='undefined'?'&flaggedby='+search_flaggedby:'';url+=tid+edited+nimask+flaggedby;}
if(specialName=="EditAlternates"){url=''+(Object.values(qs.params)[0])+'&ajax=1&action=editalternates&limit='+search_limit+'&offset='+((page-1)*search_limit)+''+((mergeto)?"&mergeto="+mergeto:'');if($('batchform'))
$('batchform').action=''+(Object.values(qs.params)[0])+'&action=editalternates&offset='+((page-1)*search_limit)+''+((mergeto)?"&mergeto="+mergeto:'');}
if(specialName=="RecentA"){var catid=qs.contains("catid")?"&catid="+qs.get("catid"):"";url+=catid;}
new Ajax.Request(url,{parameters:"",onSuccess:function(transport){$('ajax_results').innerHTML=transport.responseText;if($('ga_300x250')&&$('googleAjaxAd'))$('ga_300x250').replace($('googleAjaxAd').select('[id=ga_300x250]')[0]);search_offset=(page-1)*search_limit;if($('cur_page'))
search_page=parseInt($('cur_page').innerHTML);else
search_page=1;if($('cur_total'))
search_total=parseInt($('cur_total').innerHTML);search_over_id=null;br_selected_questions=[];if(callBack=="")
globalHideModal();if(callBack=="openBatchRecat"&&transport.responseText.startsWith("<div")){if($("br_container"))$("br_container").remove();if($("br_topictree"))$("br_topictree").remove();}
if(callBack!="")
eval(callBack+"();");navGoComplete=true;},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");globalHideModal();}});}
function navGoLast(){navGo(Math.ceil(search_total/search_limit));}
function navGoTop(){navGo(1);}
function navGoPrev(){navGo(search_page-1);}
function navGoNext(){navGo(search_page+1);}
function changeLimit(limit,callBack){if($('read_only_message')&&callBack&&callBack=="openBatchRecat"){showReadOnlyMessage();return;}
showModalWait();var is_recat=false;if($('br_container')||$('recategorize_desc')){is_recat=true;callBack="openBatchRecat";if($('br_tt')&&$('br_tree_catselected')){br_topic_selection=$('br_tt').innerHTML;br_topic_cselection=$('br_tree_catselected').innerHTML;}}
search_offset=Math.floor(search_offset/limit)*limit;var url='/Q/Special:'+specialName+'&ajax=1&action=getres&limit='+limit+'&offset='+search_offset+((typeof search_term!='undefined')?'&search='+search_term:'')+''+((typeof search_limitn!='undefined')?'&limitn='+search_limitn:'')+''+((typeof search_trunks!='undefined')?'&trunks='+search_trunks:'')+''+((typeof search_tid!='undefined')?'&tid='+search_tid:'')+''+((typeof search_userType!='undefined')?'&userType='+search_userType:'')+((typeof search_actionType!='undefined')?'&actionType='+search_actionType:'');var qs=new Querystring(location.pathname);if(specialName=="NeedsImprovement"){var tid=qs.contains("tid")?"&tid="+qs.get("tid"):"";var nisearchform=$('searchform');if(nisearchform!=null){var search_edited=nisearchform.edited.value;var search_nimask=nisearchform.nimask.value;var search_flaggedby=(nisearchform.flaggedby.value=="me")?userId:nisearchform.flaggedby.value;}
var edited=typeof search_edited!='undefined'?'&edited='+search_edited:'';var nimask=typeof search_nimask!='undefined'?'&nimask='+search_nimask:'';var flaggedby=typeof search_flaggedby!='undefined'?'&flaggedby='+search_flaggedby:'';url+=tid+edited+nimask+flaggedby;}
if(specialName=="BatchRevert"){var start=qs.contains("start")?"&start="+qs.get("start"):"";var end=qs.contains("end")?"&end="+qs.get("end"):"";var userName=qs.contains("user")?qs.get("user"):0;url+="&user="+userName+start+end;}
if(specialName=="Changes"){var con=qs.contains("con")?"&con="+qs.get("con"):"";var cv=qs.contains("cv")?"&cv="+qs.get("cv"):"";url+=con+cv;}
if(specialName=="Contributions"){var target=qs.contains("target")?"&target="+qs.get("target"):"";url+=target;}
if(specialName=="recentchanges"){var cv=qs.contains("cv")?"&cv="+qs.get("cv"):"";url+=cv;}
if(specialName=="EditAlternates"){url=''+(Object.values(qs.params)[0])+'&ajax=1&action=editalternates&limit='+limit+'&offset='+search_offset+''+((mergeto)?"&mergeto="+mergeto:'');if($('batchform'))
$('batchform').action=''+(Object.values(qs.params)[0])+'&action=editalternates&offset='+search_offset+''+((mergeto)?"&mergeto="+mergeto:'');}
if(specialName=="RecentA"){var catid=qs.contains("catid")?"&catid="+qs.get("catid"):"";url+=catid;}
limitSelectionLoaded=false;new Ajax.Request(url,{parameters:"",onSuccess:function(transport){$('ajax_results').innerHTML=transport.responseText;search_limit=limit;if($('cur_page'))
search_page=parseInt($('cur_page').innerHTML);else
search_page=1;search_over_id=null;br_selected_questions=[];limitSelectionLoaded=true;if(xDef(callBack)&&callBack!=""){eval(callBack+"();");}
else{globalHideModal();}},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");globalHideModal();}});}
function RoundQuestion(q){if($('br_tree'))return;var cornersObj=new curvyCorners({tl:{radius:10},tr:false,bl:false,br:{radius:10},antiAlias:true,autoPad:false},q);cornersObj.applyCornersToAll();}
function nonRoundQuestion(q,article_id){if(xDef(article_id)&&article_id!=article_object.mArticleID){if(q){q.style.backgroundColor="#FFFFFF";while(xFirstChild(q,"div")){q.removeChild(xFirstChild(q,"div"));}}
hideQTools(article_id);}}
article_object=null;function showQTools(elem,article_json_object){article_object=eval('('+article_json_object+')');if(!$("ttip_"+article_object.mArticleID)){if(search_over_id&&search_over_id!=article_object.mArticleID){nonRoundQuestion($('q_item_div_'+search_over_id),search_over_id);}
if($('br_tree'))
return;div=document.createElement("div");div.id="ttip_"+article_object.mArticleID;div.innerHTML="<a class=\"btn smallstdmenu\" href=\"javascript:void(0);\" onclick=\"if(!jQuery(this).isDisabledBtn()){setTimeout('openQT("+article_object.mArticleID+", true);', 50);}else{xPreventDefault();return false}\" alt=\"Menu\" title=\"Menu\"><span><span><font style=\"white-space:nowrap;\"><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"><font>&nbsp;Menu<font style=\"font-size: 9px;\">&nbsp;&#9660;</font>&nbsp;</font><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"></font></span></span></a>";jQuery(div).css({position:"relative",top:"-3px",left:"2px",width:(jQuery(div).find("a.btn").getBtnWidth()+2)+"px",height:"18px",padding:"0",margin:"0",zIndex:"48"});jQuery("#q_item_"+article_object.mArticleID).children(":first").prepend(div).css({height:"18px",width:(jQuery(div).find("a.btn").getBtnWidth()+2)+"px",margin:"0 0 6px 6px"});}}
function hideQTools(article_id){if(div=$("ttip_"+article_id)){div.parentNode.removeChild(div);hideTooltip();}}
stf_article=null;function featureQuestion(article_id){if(stf_article.mArticleID==article_id&&typeof(stf_article.isSysop)!='undefined'){popup_elem.buildModal("feature_result",0,0);popup_elem.fill("<div style='margin: 0px; padding: 0px; font-size: 16px; vertical-align: top; width: 0px; height: 0px; text-align: left; border: #8E8E8E 2px solid; background: #FFFFFF;'><div id='feature_result_popup' style='margin: 0px; padding: 0px;'>&nbsp;</div></div>");$("feature_result").setStyle({overflow:'visible',backgroundColor:'transparent'});var cornersObj=new curvyCorners({tl:{radius:10},tr:{radius:10},bl:{radius:10},br:{radius:10},antiAlias:true,autoPad:false},$('feature_result_popup').parentNode);cornersObj.applyCornersToAll();disableScrollBars();appearSlow("feature_result",15,15,225,225,"fillFeatureResult");}}
function addToWatchlist(article_id){if(stf_article.mArticleID==article_id&&typeof(stf_article.canEditQ)!='undefined'){popup_elem.buildModal("watchlist_result",0,0);popup_elem.fill("<div style='margin: 0px; padding: 0px; font-size: 16px; vertical-align: top; width: 0px; height: 0px; text-align: left; border: #8E8E8E 2px solid; background: #FFFFFF;'><div id='watchlist_result_popup' style='margin: 0px; padding: 0px;'>&nbsp;</div></div>");$("watchlist_result").setStyle({overflow:'visible',backgroundColor:'transparent'});var cornersObj=new curvyCorners({tl:{radius:10},tr:{radius:10},bl:{radius:10},br:{radius:10},antiAlias:true,autoPad:false},$('watchlist_result_popup').parentNode);cornersObj.applyCornersToAll();disableScrollBars();appearSlow("watchlist_result",15,15,225,225,"fillWatchlistResult");}}
function fillFeatureResult(){$('feature_result_popup').parentNode.style.cursor="wait";$('feature_result_popup').innerHTML="<div style='font-size: 12px; padding-left: 13px;'>Please wait...<div style='padding-top: 80px; text-align: center; margin-left: -13px;'><img src='"+wgStaticFilesServer+"/templates/icons/ajax-loader3.gif' border=0 alt='Please wait...' /></div></div>";var url="/Q/"+stf_article.mTitle+"&action=feature&ajaxonly=1";var data="";new Ajax.Request(url,{parameters:data,onSuccess:function(transport){$('feature_result_popup').parentNode.style.cursor="default";$('feature_result_popup').style.fontSize="12px";responseText=transport.responseText.trim();if(responseText=="OK"){var URL="<a href='http://"+location.host+"/Q/Special:FeaturedQuestions'>";$('feature_result_popup').innerHTML="<div style='padding-top: 60px; text-align: center; font-size: 16px;'><b>"+"This question<br>has been added<br>to "+URL+" featured"+"</a>.</b><br><br><br><br><a class=\"btn smallstd\" href=\"javascript:void(0);\" onclick=\"if(!jQuery(this).isDisabledBtn()){closeFeaturePopup();}else{xPreventDefault();return false}\" alt=\"Ok\" title=\"Ok\"><span><span><font style=\"white-space:nowrap;\"><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"><font>&nbsp;Ok&nbsp;</font><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"></font></span></span></a></div>";}
else{$('feature_result_popup').innerHTML="<div style='padding-top: 60px; text-align: center; font-size: 16px;'><b>"+"Error occured!<br>Please try again."+"</b><br><br><br><br><br><a class=\"btn smallstd\" href=\"javascript:void(0);\" onclick=\"if(!jQuery(this).isDisabledBtn()){closeFeaturePopup();}else{xPreventDefault();return false}\" alt=\"Ok\" title=\"Ok\"><span><span><font style=\"white-space:nowrap;\"><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"><font>&nbsp;Ok&nbsp;</font><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"></font></span></span></a></div>";}},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");popup_elem.destroyModal();globalHideModal();xModalDialog.instances["feature_result"]=null;}});}
function fillWatchlistResult(){$('watchlist_result_popup').parentNode.style.cursor="wait";$('watchlist_result_popup').innerHTML="<div style='font-size: 12px; padding-left: 13px;'>Please wait...<div style='padding-top: 80px; text-align: center; margin-left: -13px;'><img src='"+wgStaticFilesServer+"/templates/icons/ajax-loader3.gif' border=0 alt='Please wait...' /></div></div>";var url="/Q/"+stf_article.mTitle+"&action=watch&ajaxonly=1";var data="";new Ajax.Request(url,{parameters:data,onSuccess:function(transport){$('watchlist_result_popup').parentNode.style.cursor="default";$('watchlist_result_popup').style.fontSize="12px";var responseText=transport.responseText.trim();if(responseText.indexOf('OK:')===0){var URL="<a href='http://"+location.host+"/Q/Special:watchlist'>";$('watchlist_result_popup').innerHTML="<div style='padding-top: 60px; text-align: center; font-size: 16px;'><b>"+"This question<br>has been added<br>to "+URL+"your watchlist"+"</a>.</b><br><br><br><br><a class=\"btn smallstd\" href=\"javascript:void(0);\" onclick=\"if(!jQuery(this).isDisabledBtn()){closeWatchlistPopup();}else{xPreventDefault();return false}\" alt=\"Ok\" title=\"Ok\"><span><span><font style=\"white-space:nowrap;\"><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"><font>&nbsp;Ok&nbsp;</font><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"></font></span></span></a></div>";}
else{$('watchlist_result_popup').innerHTML="<div style='padding-top: 60px; text-align: center; font-size: 16px;'><b>"+"Error occured!<br>Please try again."+"</b><br><br><br><br><br><a class=\"btn smallstd\" href=\"javascript:void(0);\" onclick=\"if(!jQuery(this).isDisabledBtn()){closeWatchlistPopup();}else{xPreventDefault();return false}\" alt=\"Ok\" title=\"Ok\"><span><span><font style=\"white-space:nowrap;\"><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"><font>&nbsp;Ok&nbsp;</font><input type=\"image\" value=\"\" src=\"http://en.site2.answcdn.com/templates/images/blank.gif?v=73119\" style=\"display:inline;width:1px;height:1px;\" tabindex=\"-1\"></font></span></span></a></div>";}},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");popup_elem.destroyModal();globalHideModal();xModalDialog.instances["watchlist_result"]=null;}});}
var closeWatchlistPopup=closeFeaturePopup=br_closeRecategorizePopup=function(){popup_elem.destroyModal();globalHideModal();xModalDialog.instances["watchlist_result"]=null;xModalDialog.instances["feature_result"]=null;xModalDialog.instances["recategorize_questions"]=null;}
function trash_q(title_q){showModalWait();var url="/Q/"+title_q+"&action=movefaq&topic_id=2380&wpSave=1&new_list=2380&wpTopicID=2380";new Ajax.Request(url,{parameters:"",onSuccess:function(transport){navGo(search_page,true);},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");globalHideModal();}});}
function untrash_q(title_q){showModalWait();var url="/Q/"+title_q+"&action=untrash_question";new Ajax.Request(url,{parameters:"",onSuccess:function(transport){navGo(search_page,true);},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");globalHideModal();}});}
var navGoReal=null;var empty_func=function(){void(0);};function new_login_watchlist(article_id){navGoReal=navGo;navGo=function(a,b,c){navGo=navGoReal;navGo(search_page,true,c+"('globalHideModal(); addToWatchlist("+article_id+"); empty_func'); empty_func");};new_login();hideTooltip();}
function openQT(article_id,isModal){if(article_object.mArticleID==article_id&&typeof(article_object.canEditQ)!='undefined'){if(!$("menu_ttip_"+article_id)){var elem=$('ttip_'+article_id);if(elem){sw=0;sh=0;popup_elem.build(elem,sw,sh,true);popup_elem.addLinkMenuItem("Open",false,"http://"+location.host+"/Q/"+article_object.mTitle+"","left",true,"","open");var editOrAddAnswer=(article_object.isAnswered!=0)?"Edit answer":"Add answer";if((((article_object.perms&WA_ACTION_EDIT_ANSWER)||(article_object.loggedInPerms&WA_ACTION_EDIT_ANSWER))&&(article_object.isAnswered==0||jwgData.isloggedin))!=0)
popup_elem.addLinkMenuItem(editOrAddAnswer,false,"http://"+location.host+"/Q/"+article_object.mTitle+"&action=edit"+((article_object.isAnswered==0)?"&section=new":"")+"","left",true,"","editAnswer");else
popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>Edit answer</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>"+((article_object.perms&WA_ACTION_EDIT_ANSWER)?"[<a href=\"javascript:void(0);\" style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]":"&nbsp;")+"</small></td></tr></table>","left");if(!jwgData.config.useCatchAllCategory){if((article_object.isHarmful!=0)||(!(article_object.perms&WA_ACTION_EDIT_QUESTION_TOPICS)&&!(article_object.loggedInPerms&WA_ACTION_EDIT_QUESTION_TOPICS)))
popup_elem.addLinkMenuItem("Edit categories",true,"","left",true);else if(article_object.perms&WA_ACTION_EDIT_QUESTION_TOPICS)
popup_elem.addLinkMenuItem("Edit categories",false,"javascript:catsElem=$(\"catsElem"+article_object.mArticleID+"\");recategorizeQ(\""+article_object.mTitle+"\",$(\"q_item_div_"+article_object.mArticleID+"\"));","left",false,"","edit");else
popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>Edit categories</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>[<a href='javascript:void(0);' style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]</small></td></tr></table>","left");}else{if((article_object.isHarmful!=0)||(!(article_object.perms&WA_ACTION_EDIT_QUESTION_TOPICS_NEW)&&!(article_object.loggedInPerms&WA_ACTION_EDIT_QUESTION_TOPICS_NEW)))
popup_elem.addLinkMenuItem("Edit categories",true,"","left",true);else if(article_object.perms&WA_ACTION_EDIT_QUESTION_TOPICS_NEW)
popup_elem.addLinkMenuItem("Edit categories",false,"javascript:catsElem=$(\"catsElem"+article_object.mArticleID+"\");recategorizeQ(\""+article_object.mTitle+"\",$(\"q_item_div_"+article_object.mArticleID+"\"));","left",false,"","edit");else
popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>Edit categories</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>[<a href='javascript:void(0);' style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]</small></td></tr></table>","left");}
if(article_object.perms&WA_ACTION_EDIT_ALTERNATES){var link_title="Edit alternates";if(article_object.isSysop==1&&article_object.numAlts>0){link_title+=" ["+article_object.numAlts+"]";}
popup_elem.addLinkMenuItem(link_title,false,"http://"+location.host+"/Q/"+article_object.mTitle+"&action=editalternates","left",true,"","editAlternates");}
else if(article_object.loggedInPerms&WA_ACTION_EDIT_ALTERNATES){popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>"+"Edit alternates"+"</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>[<a href='javascript:void(0);' style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]</small></td></tr></table>","left");}else{popup_elem.addLinkMenuItem("Edit alternates",true,"","left",true);}
if(article_object.perms&WA_ACTION_EDIT_RELATED_LINKS){popup_elem.addLinkMenuItem("Add related links",false,"http://"+location.host+"/Q/"+article_object.mTitle+"&action=editrelatedlink","left",true,"","relatedLinks");}else{popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>"+"Add related links"+"</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>[<a href=\"javascript:void(0);\" style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]</small></td></tr></table>","left");}
if(article_object.perms&WA_ACTION_EDIT_RELATED_QUESTIONS){popup_elem.addLinkMenuItem("Add related questions",false,"http://"+location.host+"/Q/"+article_object.mTitle+"&action=editrelatedq","left",true,"","relatedQuestions");}else{popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>"+"Add related questions"+"</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>[<a href=\"javascript:void(0);\" style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]</small></td></tr></table>","left");}
if(article_object.isSysop==1){if(article_object.perms&WA_ACTION_FEATURE_QUESTION){popup_elem.addLinkMenuItem("Feature",false,"javascript:featureQuestion("+article_object.mArticleID+"); hideTooltip();","left",false);}else{popup_elem.addLinkMenuItem("Feature",true,"","left",true);}
stf_article=clone(article_object);}
if(article_object.isSysop==1){if(article_object.isHarmful==0){var isAnswered=article_object.isAnswered==0?0:1;if(article_object.perms&WA_ACTION_TRASH_QUESTION){var trashMergeCall="javascript:TrashMergeFromSERP.start(\""+article_object.mTitle+"\",0,"+isAnswered+","+article_id+");";popup_elem.addLinkMenuItem("Trash",false,trashMergeCall,"left",false);}else{popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>"+"Trash"+"</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>"+((article_object.loggedInPerms&WA_ACTION_TRASH_QUESTION)?"[<a href=\"javascript:void(0);\" style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]":"&nbsp;")+"</small></td></tr></table>","left");}}
else{if(article_object.perms&WA_ACTION_UNTRASH_QUESTION){popup_elem.addLinkMenuItem("Untrash",false,"javascript:untrash_q(\""+URLEncodeEmail(article_object.mTitle)+"\");","left",false);}else{popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>"+"Untrash"+"</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>"+((article_object.loggedInPerms&WA_ACTION_UNTRASH_QUESTION)?"[<a href=\"javascript:void(0);\" style='color: #0000FF;' onclick='new_login();'>"+"Sign in"+"</a>]":"&nbsp;")+"</small></td></tr></table>","left");}}}
if(article_object.canEditQ==1)
popup_elem.addCustomMenuItem("<p style='white-space: nowrap; text-align: left; color: #99CB04; margin: 0px; padding: 4px;'><a href=\"javascript:void(0);\" onclick='Event.stop(event); moreQT("+article_id+((isModal)?",true":",false")+");' style='font-weight: bold; color: #99CB04;'>"+"more..."+"</a></p>","left");menuBtnW=jQuery("#ttip_"+article_id).find("a.btn").getBtnWidth()+8;popup_elem.makeMenu('menu_ttip_'+article_id);menu_links=popup_elem.menuItems;popup_elem.realignBySize();popup_elem.menuItems=menu_links;jQuery('#tooltip_elem').show();sw=$('menu_ttip_'+article_id).getWidth();popup_elem.moveFromElemX(menuBtnW-sw);popup_elem.moveFromElemY(23);while((parseInt($('tooltip_elem').style.top)+$('tooltip_elem').offsetHeight+30)>(xScrollTop()+xClientHeight())){if(window.document.documentElement&&xDef(window.document.documentElement.scrollTop)&&(!navigator.vendor||!navigator.vendor.match(/apple|Google/i))){window.document.documentElement.scrollTop=xScrollTop()+5;}
else if((window.document.body&&xDef(window.document.body.scrollTop))||(navigator.vendor&&navigator.vendor.match(/apple|Google/i))){window.document.body.scrollTop=xScrollTop()+5;}}
if(isModal){var need_hide_float=false;var cur_br_tt_scroll_top=0;if($('br_tt'))
cur_br_tt_scroll_top=parseInt(xScrollTop($('br_tt')));if($('br_container')&&(!$('br_container').style.display||$('br_container').style.display!="none")){need_hide_float=true;br_hide_float_container();}
var fade=new Fadomatic(xModalDialog.grey,100,0,0,1);fade.fadeIn();if(need_hide_float)
br_show_float_container();if($('br_tt'))
$('br_tt').scrollTop=cur_br_tt_scroll_top;}
popup_elem.moveFromElemX(menuBtnW-sw);popup_elem.moveFromElemY(23);$('menu_ttip_'+article_id).select("td").each(function(td,idx){if(idx%2==0){$(td).setStyle({width:"100%"});}});}}}
else{closeQT(article_id);}}
function moreQT(article_id,isModal){if($("menu_ttip_"+article_object.mArticleID)){var elem=$('ttip_'+article_object.mArticleID);if(elem){sw=0;sh=0;menu_links=popup_elem.menuItems;menu_links.pop();popup_elem.build(elem,sw,sh,true);popup_elem.menuItems=menu_links;if(article_object.isSysop==1){if(article_object.perms&WA_ACTION_MERGE_SECONDARY_QUESTION)
popup_elem.addLinkMenuItem("Merge",false,"http://"+location.host+"/Q/Special:MergeQuestions&wpSecondary="+article_object.mTitle+"","left",true,"","merge");else
popup_elem.addLinkMenuItem("Merge",true,"","left",false);if(article_object.perms&WA_ACTION_SPLIT_QUESTION)
popup_elem.addLinkMenuItem("Split",false,"http://"+location.host+"/Q/"+article_object.mTitle+"&action=split","left",true,"","split");else
popup_elem.addLinkMenuItem("Split",true,"","left",false);}
if(article_object.perms&WA_ACTION_WATCH_QUESTION){popup_elem.addLinkMenuItem("Get updates",false,"javascript:addToWatchlist("+article_id+"); hideTooltip();","left",false);stf_article=clone(article_object);}
else{popup_elem.addCustomMenuItem("<table cellpadding=0 cellspacing=0 border=0><tr><td style='padding: 4px; margin: 0px; color: #A0A0A0; text-align: left; white-space: nowrap; width: auto;'>Watch</td><td style='padding: 4px; margin: 0px; width: 50px; text-align: right; white-space: nowrap;'><small style='color: #0000FF; white-space: nowrap;'>"+((article_object.loggedInPerms&WA_ACTION_WATCH_QUESTION)?"[<a href='javascript:void(0);' style='color: #0000FF;' onclick='new_login_watchlist("+article_id+");'>"+"Sign in"+"</a>]":"&nbsp;")+"</small></td></tr></table>","left");stf_article=clone(article_object);}
if(article_object.perms&WA_ACTION_DISCUSS_QUESTION){popup_elem.addLinkMenuItem("Discuss",false,"http://"+location.host+"/Q/Discuss:"+article_object.mTitle+"","left",true,"","discuss");}
stf_article=clone(article_object);menuBtnW=jQuery("#ttip_"+article_id).find("a.btn").getBtnWidth()+8;popup_elem.makeMenu('menu_ttip_'+article_object.mArticleID);jQuery('#tooltip_elem').show();sw=$('menu_ttip_'+article_id).getWidth();popup_elem.realignBySize();if(isModal){var need_hide_float=false;var cur_br_tt_scroll_top=0;if($('br_tt'))
cur_br_tt_scroll_top=parseInt(xScrollTop($('br_tt')));if($('br_container')&&(!$('br_container').style.display||$('br_container').style.display!="none")){need_hide_float=true;br_hide_float_container();}
var fade=new Fadomatic(xModalDialog.grey,100,0,0,1);fade.fadeIn();if(need_hide_float){br_show_float_container();}
if($('br_tt'))
$('br_tt').scrollTop=cur_br_tt_scroll_top;}
popup_elem.moveFromElemX(menuBtnW-sw);popup_elem.moveFromElemY(23);var scroll_pos={oldp:xScrollTop(),newp:xScrollTop()+5};while((parseInt($('tooltip_elem').style.top)+$('tooltip_elem').offsetHeight+30)>(xScrollTop()+xClientHeight())&&(scroll_pos.oldp<scroll_pos.newp)){scroll_pos.oldp=xScrollTop();if(window.document.documentElement&&xDef(window.document.documentElement.scrollTop)&&(!navigator.vendor||!navigator.vendor.match(/apple/i))){window.document.documentElement.scrollTop=xScrollTop()+5;}
else if((window.document.body&&xDef(window.document.body.scrollTop))||(navigator.vendor&&navigator.vendor.match(/apple/i))){window.document.body.scrollTop=xScrollTop()+5;}
scroll_pos.newp=xScrollTop();}
$('menu_ttip_'+article_id).select("td").each(function(td,idx){if(idx%2==0){$(td).setStyle({width:"100%"});}});}}}
function closeQT(article_id){if(article_object){if(typeof(article_id)=='undefined')
article_id=article_object.mArticleID;}}
var br_returnOldNRQ=function(){nonRoundQuestion=function(q,article_id){if(xDef(article_id)&&article_id!=article_object.mArticleID){q.style.backgroundColor="#FFFFFF";while(xFirstChild(q,"div")){q.removeChild(xFirstChild(q,"div"));}
hideQTools(article_id);}};};function getBatchRecat(callBack){if(!xDef(callBack))
callBack="";var url='/Q/Special:BatchRecategorize&ajax=1&action=getbatch';new Ajax.Request(url,{parameters:"",onSuccess:function(transport){if(callBack=="")
globalHideModal();eval(transport.responseText);if(callBack!="")
eval(callBack+"();");},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");globalHideModal();}});}
function closeHelp(){popup_elem.destroyModal();globalHideModal();xModalDialog.instances["recat_help"]=null;enableScrollBars();enableScrollerAfterModal();}
function recategorizeQ(question,elemToHide){hideTooltip();popup_elem.removeModal();callRecat(question.replace(/_/g," "),elemToHide);}
function br_positionFixedScroll(e){if(br_topictree_is_fixed){var targ;if(!e)var e=window.event;if(e.target)targ=e.target;else if(e.srcElement)targ=e.srcElement;var wheelData=e.detail?e.detail*-1:e.wheelDelta/40;while(targ&&targ.id!='container'){targ=targ.parentNode;if(targ&&targ.id=='br_tree_body'){return;}}
var tmp_div=document.documentElement;if(wheelData<0){if(tmp_div.scrollTop<tmp_div.scrollHeight){if(tmp_div.scrollTop+40<=tmp_div.scrollHeight){if(tmp_div.scrollTop+xClientHeight()!=tmp_div.scrollHeight)
jQuery('#br_topictree').css({'top':xTop('br_topictree')+40+"px"});tmp_div.scrollTop=tmp_div.scrollTop+40;}
else{tmp_div.scrollTop=tmp_div.scrollHeight-tmp_div.scrollTop;}}}
else{if(tmp_div.scrollTop>0){if(tmp_div.scrollTop-40>=0){jQuery('#br_topictree').css({'top':xTop('br_topictree')-40+"px"});tmp_div.scrollTop=tmp_div.scrollTop-40;}
else{jQuery('#br_topictree').css({'top':br_cur_top_pos+"px"});tmp_div.scrollTop=0;}}}}};function br_scroll_timeout_function(){var br_topictree=jQuery('#br_topictree');if(br_topictree_is_fixed&&br_topictree.length!=0){br_topictree.css({"top":(br_cur_top_pos+xScrollTop())+'px'});br_scroll_timeout=setTimeout("br_scroll_timeout_function();",200);}
else{clearTimeout(br_scroll_timeout);}};function br_fixIE6(){var br_topictree=jQuery('#br_topictree');br_topictree.css({"position":"absolute"});br_topictree_is_fixed=true;br_cur_top_pos=xTop('br_topictree');br_topictree.css({'top':(xTop('br_topictree')+xScrollTop())+"px"});document.body.attachEvent("onmousewheel",br_positionFixedScroll);br_scroll_timeout=setTimeout("br_scroll_timeout_function();",200);};var topMenu=jQuery.browser.msie?25:23;function showHint(elem,hintText){popup_elem.build(elem,260,40);popup_elem.makeTooltip(hintText);popup_elem.moveFromElemX(-12);popup_elem.moveFromElemY(-40);}
function goSelectType(elem){var jElem=jQuery("#"+elem);search_userTypeObj=jQuery("#searchform input[name=userType]").val();search_ActionTypeObj=jQuery("#searchform input[name=actionType]").val();var height=108;if(search_ActionTypeObj=="autoflags")
height+=50;popup_elem.build(jElem,0,height,true);if(search_userTypeObj=="reg"||search_ActionTypeObj=="autoflags")
popup_elem.addMenuItem("Members",true,"","left");else
popup_elem.addMenuItem("Members",false,'selectType("reg");',"left");if(search_userTypeObj=="newUser"||search_ActionTypeObj=="autoflags")
popup_elem.addMenuItem("New members",true,"","left");else
popup_elem.addMenuItem("New members",false,'selectType("newUser");',"left");if(search_userTypeObj=="guest"||search_ActionTypeObj=="autoflags")
popup_elem.addMenuItem("Guests",true,"","left");else
popup_elem.addMenuItem("Guests",false,'selectType("guest");',"left");if(search_ActionTypeObj=="autoflags"){if(search_userTypeObj=="dingoBot")
popup_elem.addMenuItem("DingoBot",true,"","left");else
popup_elem.addMenuItem("DingoBot",false,'selectType("dingoBot");',"left");if(search_userTypeObj=="unflaggingstrength")
popup_elem.addMenuItem("UnflaggingStrength",true,"","left");else
popup_elem.addMenuItem("UnflaggingStrength",false,'selectType("unflaggingstrength");',"left");}
popup_elem.addMenuLine();if(search_userTypeObj==""||search_userType=="all")
popup_elem.addMenuItem("All users",true,"","left");else
popup_elem.addMenuItem("All users",false,'selectType("all");',"left");popup_elem.makeMenu();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(topMenu);}
function selectType(type){var htmlText="";switch(type){case"reg":htmlText="members&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"guest":htmlText="guests&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"newUser":htmlText="new members&nbsp;&nbsp;";break;case"dingoBot":htmlText="DingoBot";break;case"unflaggingstrength":htmlText="UnflaggingStrength";break;default:type="all";htmlText="all users&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
jQuery("#searchform input[name=userType]").val(type);jQuery("#userType_link").html(htmlText+"&nbsp;&nbsp;&nbsp;&#9660;");search_userType=jQuery("#searchform input[name=userType]").val();hideTooltip();}
function goActionSelectType(elem){var jElem=jQuery("#"+elem);var qs=new Querystring(location.pathname);target=qs.contains("cv")?qs.get("cv"):(qs.contains("target")?qs.get("target"):"siteWide");con=target.split(":")[0];height=235;popup_elem.build(jElem,0,height,true);search_ActionTypeObj=jQuery('#searchform input[name=actionType]').val();if(search_ActionTypeObj=="all"||search_ActionTypeObj==""||search_ActionTypeObj=="0")
popup_elem.addMenuItem("All actions",true,"","left");else
popup_elem.addMenuItem("All actions",false,'selectActionType("all");',"left");popup_elem.addMenuLine();if(search_ActionTypeObj=="askedQ"||con=="topicID")
popup_elem.addMenuItem("Questions (asked)",true,"","left");else
popup_elem.addMenuItem("Questions (asked)",false,'selectActionType("askedQ");',"left");if(search_ActionTypeObj=="editedQ")
popup_elem.addMenuItem("Questions (edited)",true,"","left");else
popup_elem.addMenuItem("Questions (edited)",false,'selectActionType("editedQ");',"left");if(search_ActionTypeObj=="newA")
popup_elem.addMenuItem("Answers (new)",true,"","left");else
popup_elem.addMenuItem("Answers (new)",false,'selectActionType("newA");',"left");if(search_ActionTypeObj=="editedA")
popup_elem.addMenuItem("Answers (edited)",true,"","left");else
popup_elem.addMenuItem("Answers (edited)",false,'selectActionType("editedA");',"left");if(search_ActionTypeObj=="alt")
popup_elem.addMenuItem("Alternates",true,"","left");else
popup_elem.addMenuItem("Alternates",false,'selectActionType("alt");',"left");if(search_ActionTypeObj=="cat")
popup_elem.addMenuItem("Categorization",true,"","left");else
popup_elem.addMenuItem("Categorization",false,'selectActionType("cat");',"left");if(search_ActionTypeObj=="rellinks")
popup_elem.addMenuItem("Related links",true,"","left");else
popup_elem.addMenuItem("Related links",false,'selectActionType("rellinks");',"left");if(search_ActionTypeObj=="flags")
popup_elem.addMenuItem("Flags",true,"","left");else
popup_elem.addMenuItem("Flags",false,'selectActionType("flags");',"left");popup_elem.addCustomMenuItem("<p style='white-space: nowrap; text-align: left; color: #99CB04; margin: 0px; padding: 4px;'><a href=\"javascript:void(0);\" onclick='event.preventDefault();event.stopPropagation();showMoreActions();xPreventDefault(event); ' style='font-weight: bold; color: #99CB04;'>more...</a></p>","left");popup_elem.makeMenu();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(topMenu);}
function showMoreActions(){menu_links=popup_elem.menuItems;menu_links.pop();height=360;if(isSuper())
height+=25;popup_elem.build(popup_elem.elem,0,height,true);popup_elem.menuItems=menu_links;if(search_ActionTypeObj=="relatedQ")
popup_elem.addMenuItem("Related questions",true,"","left");else
popup_elem.addMenuItem("Related questions",false,'selectActionType("relatedQ");',"left");if(search_ActionTypeObj=="discuss"||rcContext=="question")
popup_elem.addMenuItem("Discussion",true,"","left");else
popup_elem.addMenuItem("Discussion",false,'selectActionType("discuss");',"left");if(isSuper()){if(search_ActionTypeObj=="autoflags"||rcContext=="user")
popup_elem.addMenuItem("Autoflags",true,"","left");else
popup_elem.addMenuItem("Autoflags",false,'selectActionType("autoflags");',"left");}
if(search_ActionTypeObj=="merge"||(rcUserisSuper!="1"&&rcContext=="user"))
popup_elem.addMenuItem("Merges",true,"","left");else
popup_elem.addMenuItem("Merges",false,'selectActionType("merge");',"left");if(search_ActionTypeObj=="revert"||(rcUserisSuper!="1"&&rcContext=="user"))
popup_elem.addMenuItem("Reverts",true,"","left");else
popup_elem.addMenuItem("Reverts",false,'selectActionType("revert");',"left");if(search_ActionTypeObj=="batchrevert"||(rcUserisSuper!="1"&&rcContext=="user"))
popup_elem.addMenuItem("Batch reverts",true,"","left");else
popup_elem.addMenuItem("Batch reverts",false,'selectActionType("batchrevert");',"left");if(search_ActionTypeObj=="protect"||(rcUserisSuper!="1"&&rcContext=="user"))
popup_elem.addMenuItem("Protects",true,"","left");else
popup_elem.addMenuItem("Protects",false,'selectActionType("protect");',"left");if(search_ActionTypeObj=="feature"||(rcUserisSuper!="1"&&rcContext=="user"))
popup_elem.addMenuItem("Feature",true,"","left");else
popup_elem.addMenuItem("Feature",false,'selectActionType("feature");',"left");popup_elem.makeMenu();popup_elem.moveFromElemX(5);popup_elem.moveFromElemY(topMenu);}
function selectActionType(type){var htmlText="";switch(type){case"askedQ":htmlText="questions (asked)&nbsp;";break;case"editedQ":htmlText="questions (edited)";break;case"newA":htmlText="answers (new)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"editedA":htmlText="answers (edited)&nbsp;&nbsp;";break;case"alt":htmlText="alternates&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"cat":htmlText="categorization&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"rellinks":htmlText="related links&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"flags":htmlText="flags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"autocat":htmlText="autocategorization";break;case"autoflags":htmlText="autoflags&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"merge":htmlText="merges&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"revert":htmlText="reverts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"batchrevert":htmlText="batch reverts&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"protect":htmlText="protects&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"feature":htmlText="feature&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"relatedQ":htmlText="related questions&nbsp;";break;case"discuss":htmlText="discussion&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"edits":htmlText="edits&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"organization":htmlText="organization&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;case"community":htmlText="community&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";break;default:type="all";htmlText="all actions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";}
jQuery('#searchform input[name=actionType]').val(type);jQuery('#actionType_link').html(htmlText+"&nbsp;&nbsp;&nbsp;&#9660;");if(type=="unflaggingstrength"||type=="dingoBot"){search_userType="all";jQuery('#searchform input[name=userType]').val("all");jQuery("#userType_link").html("all users&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+"&nbsp;&nbsp;&nbsp;&#9660;");}
search_actionType=type;hideTooltip();}
function loadFiltersParams(){var qs=new Querystring(location.pathname);var url="/Q/Special:"+specialName;jQuery('#searchform input[name=userType]').val(qs.contains("userType")?qs.get("userType"):"all");jQuery('#searchform input[name=actionType]').val(qs.contains("actionType")?qs.get("actionType"):"all");}
article_object=null;showQTools=function(elem,article_json_object){article_object=eval('('+article_json_object+')');if(jQuery("#ttip_"+article_object.mArticleID).length==0){if(search_over_id&&search_over_id!=article_object.mArticleID){nonRoundQuestion(jQuery('#q_item_div_'+search_over_id)[0],search_over_id);}
if(jQuery('#br_tree').length>0)
return;}}
function goToChanges(){var qs=new Querystring(location.pathname);var url="/Q/Special:"+specialName;var actionType=specialName=="RecentA"?"AnsNew":search_actionType;var userType=(typeof(rcContext)!='undefined'&&rcContext=="user")?"":"_"+search_userType;var lid="FIL_"+actionType+userType;_hbLink(lid,userStatus);var cv=qs.contains("cv")?"&cv="+qs.get("cv"):(qs.contains("catid")?"&catid="+qs.get("catid"):"");url+=cv+(qs.contains("target")?"&target="+qs.get("target"):"")+"&userType="+search_userType+"&actionType="+search_actionType;window.location.href=url;}
function goToEditWatchlist(){window.location.href="/Q/Special:watchlist&magic=yes";}
function goToBatchRevert(){var qs=new Querystring(location.pathname);var user=0;var target=qs.contains("target")?qs.get("target"):"";if(target!=""){con=target.split(":")[0];user=target.split(":")[1];}
window.location.href="/Q/Special:BatchRevert&"+con.toLowerCase()+"="+user;}
function recommendUser(userName,elem){var url='/Q/User:'+userName+'&action=recommenduser';new Ajax.Request(url,{parameters:"",onSuccess:function(transport){var recElem=jQuery("#"+elem);if(recElem.length>0)
recElem.html('[<span style="color:red;"><a href="/Q/UserDiscuss:'+userName+'#Add">Send Feedback</a></span>]');},onException:function(requester,except){alert("Your browser is not supported.\n\nPlease upgrade in order to use this function.");}});}
counter=0;function updateCurrentSP(page,counter){if(jQuery("#pageTS").length>0&&counter<3){page=search_page;new_sp=jQuery("#pageTS").html();var m=new_sp.match(/([^~]+)~([^~]+)~(\d{1,2})~(\d{1,5})/);if(m){var n_page=page+1;if(!visitedPagesArr[n_page]){visitedPagesArr[n_page]={};visitedPagesArr[n_page]['first']=m[2];visitedPagesArr[n_page]['firstOffset']=m[3]-0;if(page==1&&!visitedPagesArr[page]){visitedPagesArr[1]={};visitedPagesArr[1]['first']=m[1];visitedPagesArr[1]['firstOffset']=0;}}
search_maxKR=m[4];search_total=search_maxKR;}}
else
setTimeout("updateCurrentSP("+page+","+(counter+1)+");",200);}
function updateClosestSP(page){var iOffset=0;for(var i=page;i>0;i--){if(visitedPagesArr[i]){search_standingPoint=visitedPagesArr[i]['first'];search_sp_offset=visitedPagesArr[i]['firstOffset'];break;}
iOffset+=search_limit;}
search_sp_offset+=iOffset;}
function changenavGo(){func=navGo.toString();func=func.replace(/function ([^{])*{/i,"");func=func.replace(/}$/i,"");func="{updateClosestSP(page);"+func+"setTimeout(\"updateCurrentSP.defer(\"+page+\",0);\",1000)}";navGo=new Function("page","force_reload","callBack",func);}
function unSetVisitedPagesArr(){visitedPagesArr.clear();search_maxKR=0;jQuery("#pageTS").remove();}
function changeChangeLimit(){func=changeLimit.toString();func=func.replace(/function ([^{])*{/i,"");func=func.replace(/}$/i,"");func="{unSetVisitedPagesArr();"+func+"setTimeout(\"updateCurrentSP.defer(\"+search_page+\",0);\",1000)}";changeLimit=new Function("limit","callBack",func);}
jQuery(window).load(function(){changenavGo();changeChangeLimit();loadFiltersParams();});function DOMAlert(settings)
{var that,modalWindow,iframe,alertWindow,dropShadow,titleBar,title,ricon,licon,contentArea,buttonArea,okButton,okText,yesButton,cancelButton,noButton,cancelText,checkBox,defaultCallback,okCallback,cancelCallback,noCallback,yesCallback;that=this;this.settings=settings;this.html={};this.isIE6=(document.all&&window.external&&(typeof document.documentElement.style.maxHeight==='undefined'))?true:false;this.settings.skin=this.settings.skin?this.settings.skin:'default';if(!this.settings.ok)
{defaultCallback=function()
{that.close();};this.settings.ok={text:'OK',value:true,onclick:defaultCallback};}
modalWindow=document.createElement('div');modalWindow.style.height=((document.documentElement.clientHeight>document.documentElement.scrollHeight)?document.documentElement.clientHeight:document.documentElement.scrollHeight)+'px';modalWindow.style.width=document.documentElement.scrollWidth+'px';modalWindow.style.background='url('+wgStaticFilesServer+'/templates/images/blank.gif)';modalWindow.style.position='absolute';modalWindow.style.left='0px';modalWindow.style.top='0px';modalWindow.style.zIndex=997;modalWindow.style.visibility='hidden';document.body.appendChild(modalWindow);this.html.modalWindow=modalWindow;if(this.isIE6)
{iframe=document.createElement('iframe');iframe.style.position='absolute';iframe.style.visibility='hidden';iframe.style.zIndex=996;iframe.frameBorder=0;iframe.style.position='absolute';document.body.appendChild(iframe);this.html.iframe=iframe;}
alertWindow=document.createElement('div');alertWindow.className=this.settings.skin+'_alertWindow';alertWindow.style.position='absolute';alertWindow.style.zIndex=999;alertWindow.setAttribute("id","cs_alert");if(this.settings.width)
{alertWindow.style.width=this.settings.width+'px';}
document.body.appendChild(alertWindow);alertWindow.style.visibility='hidden';this.html.alertWindow=alertWindow;titleBar=document.createElement('div');titleBar.className=this.settings.skin+'_titleBar';alertWindow.appendChild(titleBar);this.html.titleBar=titleBar;ricon=document.createElement('div');ricon.className=this.settings.skin+'_titleBarRightIcon';ricon.style.cssFloat='right';ricon.style.styleFloat='right';closeCallback=function(){that.close();};mouseover=function(){this.style.background="transparent url("+wgStaticFilesServer+"/templates/icons/close-button1.gif) no-repeat";};mouseout=function(){this.style.background="transparent url("+wgStaticFilesServer+"/templates/icons/close-button2.gif) no-repeat";};ricon.onclick=closeCallback;ricon.onmouseover=mouseover;ricon.onmouseout=mouseout;titleBar.appendChild(ricon);this.html.ricon=ricon;licon=document.createElement('div');licon.className=this.settings.skin+'_titleBarLeftIcon';licon.style.cssFloat='left';licon.style.styleFloat='left';titleBar.appendChild(licon);this.html.licon=licon;title=document.createElement('span');title.innerHTML=this.settings.title;titleBar.appendChild(title);this.html.title=title;contentArea=document.createElement('div');contentArea.className=this.settings.skin+'_contentArea';contentArea.innerHTML=this.settings.text;if(this.settings.height)
{contentArea.style.height=this.settings.height+'px';}
alertWindow.appendChild(contentArea);this.html.contentArea=contentArea;buttonArea=document.createElement('div');buttonArea.className=this.settings.skin+'_buttonArea';alertWindow.appendChild(buttonArea);this.html.buttonArea=buttonArea;if(!this.settings.yes)
{if(this.settings.ok.text=='OK'){btnDOM=document.createElement("a");jQuery(btnDOM).addClass("btn std");btnDOM.setAttribute("href","javascript:void(0);");btnDOM.setAttribute("style","std");jQuery(btnDOM).click(function(){if(!jQuery(this).isDisabledBtn()){}else{xPreventDefault();return false;}});btnDOM.setAttribute("onclick","void(0);");btnDOM.setAttribute("alt","OK");btnDOM.setAttribute("title","OK");btnDOMSpan1=document.createElement("span");btnDOMSpan2=document.createElement("span");btnDOMFont=document.createElement("font");btnDOMFont.setAttribute("style","white-space: nowrap;");btnDOMInput=document.createElement("input");btnDOMInput.setAttribute("type","image");btnDOMInput.setAttribute("value","");btnDOMInput.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMInput.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMInput.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMInput);btnDOMFont2=document.createElement("font");btnDOMFont2.innerHTML="&nbsp;OK&nbsp;";btnDOMFont.appendChild(btnDOMFont2);btnDOMFontInput2=document.createElement("input");btnDOMFontInput2.setAttribute("type","image");btnDOMFontInput2.setAttribute("value","");btnDOMFontInput2.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMFontInput2.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMFontInput2.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMFontInput2);btnDOMSpan2.appendChild(btnDOMFont);btnDOMSpan1.appendChild(btnDOMSpan2);btnDOM.appendChild(btnDOMSpan1);}
else{btnDOM=document.createElement("a");jQuery(btnDOM).addClass("btn std");btnDOM.setAttribute("href","javascript:void(0);");btnDOM.setAttribute("style","std");jQuery(btnDOM).click(function(){if(!jQuery(this).isDisabledBtn()){}else{xPreventDefault();return false;}});btnDOM.setAttribute("onclick","void(0);");btnDOM.setAttribute("alt","Confirm");btnDOM.setAttribute("title","Confirm");btnDOMSpan1=document.createElement("span");btnDOMSpan2=document.createElement("span");btnDOMFont=document.createElement("font");btnDOMFont.setAttribute("style","white-space: nowrap;");btnDOMInput=document.createElement("input");btnDOMInput.setAttribute("type","image");btnDOMInput.setAttribute("value","");btnDOMInput.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMInput.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMInput.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMInput);btnDOMFont2=document.createElement("font");btnDOMFont2.innerHTML="&nbsp;Confirm&nbsp;";btnDOMFont.appendChild(btnDOMFont2);btnDOMFontInput2=document.createElement("input");btnDOMFontInput2.setAttribute("type","image");btnDOMFontInput2.setAttribute("value","");btnDOMFontInput2.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMFontInput2.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMFontInput2.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMFontInput2);btnDOMSpan2.appendChild(btnDOMFont);btnDOMSpan1.appendChild(btnDOMSpan2);btnDOM.appendChild(btnDOMSpan1);}
okButton=document.createElement("span");okButton.appendChild(btnDOM);okCallback=function()
{that.settings.ok.onclick(that,that.html.checkBox?that.html.checkBox.checked:false);};okButton.onclick=okCallback;if(this.settings.checkbox)
{okButtonDiv=document.createElement('div');okButtonDiv.className=this.settings.skin+'_okButtonDiv';buttonArea.appendChild(okButtonDiv);okButtonDiv.appendChild(okButton);}
else{buttonArea.appendChild(okButton);}
this.html.okButton=okButton;this.html.okButton.style.marginRight="15px";}
if(this.settings.yes)
{btnDOM=document.createElement("a");jQuery(btnDOM).addClass("btn std");btnDOM.setAttribute("href","javascript:void(0);");btnDOM.setAttribute("style","smallstd");jQuery(btnDOM).click(function(){if(!jQuery(this).isDisabledBtn()){}else{xPreventDefault();return false;}});btnDOM.setAttribute("onclick","void(0);");btnDOM.setAttribute("alt","Yes, this is my question");btnDOM.setAttribute("title","Yes, this is my question");btnDOMSpan1=document.createElement("span");btnDOMSpan2=document.createElement("span");btnDOMFont=document.createElement("font");btnDOMFont.setAttribute("style","white-space: nowrap;");btnDOMInput=document.createElement("input");btnDOMInput.setAttribute("type","image");btnDOMInput.setAttribute("value","");btnDOMInput.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMInput.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMInput.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMInput);btnDOMFont2=document.createElement("font");btnDOMFont2.innerHTML="&nbsp;Yes, <font style=\"font-weight:normal;\">this is my question</font>&nbsp;";btnDOMFont.appendChild(btnDOMFont2);btnDOMFontInput2=document.createElement("input");btnDOMFontInput2.setAttribute("type","image");btnDOMFontInput2.setAttribute("value","");btnDOMFontInput2.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMFontInput2.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMFontInput2.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMFontInput2);btnDOMSpan2.appendChild(btnDOMFont);btnDOMSpan1.appendChild(btnDOMSpan2);btnDOM.appendChild(btnDOMSpan1);yesButton=document.createElement("span");yesButton.appendChild(btnDOM);yesCallback=function()
{that.settings.yes.onclick(that,that.settings);};yesButton.onclick=yesCallback;buttonArea.appendChild(yesButton);this.html.yesButton=yesButton;this.html.yesButton.style.marginRight="15px";}
if(this.settings.cancel)
{btnDOM=document.createElement("a");jQuery(btnDOM).addClass("btn std");btnDOM.setAttribute("href","javascript:void(0);");btnDOM.setAttribute("style","std");jQuery(btnDOM).click(function(){if(!jQuery(this).isDisabledBtn()){}else{xPreventDefault();return false;}});btnDOM.setAttribute("onclick","void(0);");btnDOM.setAttribute("alt","Cancel");btnDOM.setAttribute("title","Cancel");btnDOMSpan1=document.createElement("span");btnDOMSpan2=document.createElement("span");btnDOMFont=document.createElement("font");btnDOMFont.setAttribute("style","white-space: nowrap;");btnDOMInput=document.createElement("input");btnDOMInput.setAttribute("type","image");btnDOMInput.setAttribute("value","");btnDOMInput.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMInput.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMInput.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMInput);btnDOMFont2=document.createElement("font");btnDOMFont2.innerHTML="&nbsp;Cancel&nbsp;";btnDOMFont.appendChild(btnDOMFont2);btnDOMFontInput2=document.createElement("input");btnDOMFontInput2.setAttribute("type","image");btnDOMFontInput2.setAttribute("value","");btnDOMFontInput2.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMFontInput2.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMFontInput2.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMFontInput2);btnDOMSpan2.appendChild(btnDOMFont);btnDOMSpan1.appendChild(btnDOMSpan2);btnDOM.appendChild(btnDOMSpan1);cancelButton=document.createElement("span");cancelButton.appendChild(btnDOM);if(that.settings.cancel.onclick){cancelCallback=function()
{that.settings.cancel.onclick(that,that.settings.cancel.value);};}else{cancelCallback=closeCallback;}
cancelButton.onclick=cancelCallback;buttonArea.appendChild(cancelButton);this.html.cancelButton=cancelButton;}
if(this.settings.no)
{btnDOM=document.createElement("a");jQuery(btnDOM).addClass("btn std");btnDOM.setAttribute("href","javascript:void(0);");btnDOM.setAttribute("style","std");jQuery(btnDOM).click(function(){if(!jQuery(this).isDisabledBtn()){}else{xPreventDefault();return false;}});btnDOM.setAttribute("onclick","void(0);");btnDOM.setAttribute("alt","No, but show me this one");btnDOM.setAttribute("title","No, but show me this one");btnDOMSpan1=document.createElement("span");btnDOMSpan2=document.createElement("span");btnDOMFont=document.createElement("font");btnDOMFont.setAttribute("style","white-space: nowrap;");btnDOMInput=document.createElement("input");btnDOMInput.setAttribute("type","image");btnDOMInput.setAttribute("value","");btnDOMInput.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMInput.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMInput.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMInput);btnDOMFont2=document.createElement("font");btnDOMFont2.innerHTML="&nbsp;No, <font style=\"font-weight:normal;\">but show me this one</font>&nbsp;";btnDOMFont.appendChild(btnDOMFont2);btnDOMFontInput2=document.createElement("input");btnDOMFontInput2.setAttribute("type","image");btnDOMFontInput2.setAttribute("value","");btnDOMFontInput2.setAttribute("src","http://en.site2.answcdn.com/templates/images/blank.gif?v=73119");btnDOMFontInput2.setAttribute("style","display: inline; width: 1px; height: 1px;");btnDOMFontInput2.setAttribute("tabindex","-1");btnDOMFont.appendChild(btnDOMFontInput2);btnDOMSpan2.appendChild(btnDOMFont);btnDOMSpan1.appendChild(btnDOMSpan2);btnDOM.appendChild(btnDOMSpan1);noButton=document.createElement("span");noButton.appendChild(btnDOM);noCallback=function()
{that.settings.no.onclick(that,that.settings);};noButton.onclick=noCallback;buttonArea.appendChild(noButton);this.html.noButton=noButton;this.html.noButton.style.marginRight="15px";cancelText=document.createElement('span');cancelText.className=this.settings.skin+'_cancelText';cancelText.innerHTML="<br/><a>cancel</a>";cancelText.onclick=closeCallback;buttonArea.appendChild(cancelText);this.html.cancelText=cancelText;}
if(this.settings.checkbox)
{buttonAreaCheckbox=document.createElement('div');buttonAreaCheckbox.className=this.settings.skin+'_buttonAreaCheckbox';buttonArea.appendChild(buttonAreaCheckbox);this.html.buttonAreaCheckbox=buttonAreaCheckbox;checkBox=document.createElement('input');checkBox.type='checkbox';checkBox.className=this.settings.skin+'_checkBox';buttonAreaCheckbox.appendChild(checkBox);this.html.checkBox=checkBox;checkText=document.createElement('span');checkText.innerHTML=this.settings.checkbox;buttonAreaCheckbox.appendChild(checkText);this.html.checkText=checkText;this.html.buttonArea.style.paddingBottom="38px";this.html.contentArea.style.textAlign="left";}
dropShadow=document.createElement('div');dropShadow.className=this.settings.skin+'_dropShadow';dropShadow.style.position='absolute';dropShadow.style.zIndex=998;if(alertWindow.clientWidth)
{dropShadow.style.width=alertWindow.clientWidth+'px';}
if(alertWindow.clientHeight)
{dropShadow.style.height=alertWindow.clientHeight+'px';}
document.body.appendChild(dropShadow);dropShadow.style.visibility='hidden';this.html.dropShadow=dropShadow;this.center();}
DOMAlert.prototype.show=function(titleText,contentText)
{if(contentText)
{this.html.title.innerHTML=titleText;this.html.contentArea.innerHTML=contentText;}
if(titleText&&!contentText)
{this.html.contentArea.innerHTML=titleText;}
this.html.modalWindow.style.visibility='visible';this.html.dropShadow.style.visibility='visible';this.html.alertWindow.style.visibility='visible';if(this.html.iframe)
{this.html.iframe.style.height=this.html.alertWindow.offsetHeight;this.html.iframe.style.width=this.html.alertWindow.offsetWidth;this.html.iframe.style.visibility='visible';}
if(this.html.noButton)
{}
else if(this.html.cancelButton)
{this.html.cancelButton.focus();}
else
{this.html.okButton.focus();}};DOMAlert.prototype.hide=function()
{this.html.modalWindow.style.visibility='hidden';this.html.dropShadow.style.visibility='hidden';this.html.alertWindow.style.visibility='hidden';if(this.html.iframe)
{this.html.iframe.style.visibility='hidden';}};DOMAlert.prototype.close=function()
{var obj,prop;if(this.settings.n)
setCursor(this.settings.n,this.settings.offset);for(obj in this.html)
{if(this.html[obj].parentNode)
{if(this.html[obj].onclick)
{this.html[obj].onclick=null;}
this.html[obj].parentNode.removeChild(this.html[obj]);delete this.html[obj];}}
for(prop in this)
{if(this[prop])
{this[prop]=null;delete this[prop];}}};DOMAlert.prototype.center=function()
{var alertWindow,scrollT,scrollL,iframe;alertWindow=this.html.alertWindow;dropShadow=this.html.dropShadow;adjustForLeftNav=jQuery("#left-pod").width();adjustForLeftNav=(null===adjustForLeftNav?0:adjustForLeftNav/2);if(alertWindow.style.position==='absolute')
{scrollT=window.pageYOffset||document.documentElement.scrollTop;scrollL=window.pageXOffset||document.documentElement.scrollLeft;alertWindow.style.left=adjustForLeftNav+(self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth))/2+scrollL-alertWindow.offsetWidth/2+'px';alertWindow.style.top=(self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight))/2+scrollT-alertWindow.offsetHeight/2+'px';dropShadow.style.left=adjustForLeftNav+(self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth))/2+scrollL-dropShadow.offsetWidth/2+4+'px';dropShadow.style.top=(self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight))/2+scrollT-dropShadow.offsetHeight/2+4+'px';if(this.html.iframe)
{this.html.iframe.style.left=alertWindow.style.left;this.html.iframe.style.top=alertWindow.style.top;}}
else
{alertWindow.style.left=(self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth))/2-alertWindow.offsetWidth/2+'px';alertWindow.style.top=(self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight))/2-alertWindow.offsetHeight/2+'px';dropShadow.style.left=(self.innerWidth||(document.documentElement.clientWidth||document.body.clientWidth))/2-dropShadow.offsetWidth/2+4+'px';dropShadow.style.top=(self.innerHeight||(document.documentElement.clientHeight||document.body.clientHeight))/2-dropShadow.offsetHeight/2+4+'px';}};Fadomatic.INTERVAL_MILLIS=50;function Fadomatic(element,rate,initialOpacity,minOpacity,maxOpacity){this._element=element;this._intervalId=null;this._rate=rate;this._isFadeOut=true;this._minOpacity=0;this._maxOpacity=99;this._opacity=99;if(typeof minOpacity!='undefined'){if(minOpacity<0){this._minOpacity=0;}else if(minOpacity>99){this._minOpacity=99;}else{this._minOpacity=minOpacity;}}
if(typeof maxOpacity!='undefined'){if(maxOpacity<0){this._maxOpacity=0;}else if(maxOpacity>99){this._maxOpacity=99;}else{this._maxOpacity=maxOpacity;}
if(this._maxOpacity<this._minOpacity){this._maxOpacity=this._minOpacity;}}
if(typeof initialOpacity!='undefined'){if(initialOpacity>this._maxOpacity){this._opacity=this._maxOpacity;}else if(initialOpacity<this._minOpacity){this._opacity=this._minOpacity;}else{this._opacity=initialOpacity;}}
if(element&&typeof element.style.opacity!='undefined'){this._updateOpacity=this._updateOpacityW3c;}else if(element&&typeof element.style.filter!='undefined'){if(element.style.filter.indexOf("alpha")==-1){var existingFilters="";if(element.style.filter){existingFilters=element.style.filter+" ";}
element.style.filter=existingFilters+"alpha(opacity="+this._opacity+")";}
this._updateOpacity=this._updateOpacityMSIE;}else{this._updateOpacity=this._updateVisibility;}
this._updateOpacity();}
Fadomatic.prototype.fadeOut=function(){this._isFadeOut=true;this._beginFade();}
Fadomatic.prototype.fadeIn=function(){this._isFadeOut=false;this._beginFade();}
Fadomatic.prototype.show=function(){this.haltFade();this._opacity=this._maxOpacity;this._updateOpacity();}
Fadomatic.prototype.hide=function(){this.haltFade();this._opacity=0;this._updateOpacity();}
Fadomatic.prototype.haltFade=function(){clearInterval(this._intervalId);}
Fadomatic.prototype.resumeFade=function(){this._beginFade();}
Fadomatic.prototype._beginFade=function(){this.haltFade();var objref=this;this._intervalId=setInterval(function(){objref._tickFade();},Fadomatic.INTERVAL_MILLIS);}
Fadomatic.prototype._tickFade=function(){if(this._isFadeOut){this._opacity-=this._rate;if(this._opacity<this._minOpacity){this._opacity=this._minOpacity;this.haltFade();}}else{this._opacity+=this._rate;if(this._opacity>this._maxOpacity){this._opacity=this._maxOpacity;this.haltFade();}}
this._updateOpacity();}
Fadomatic.prototype._updateVisibility=function(){if(this._opacity>0){this._element.style.visibility='visible';}else{this._element.style.visibility='hidden';}}
Fadomatic.prototype._updateOpacityW3c=function(){this._element.style.opacity=this._opacity/100;this._updateVisibility();}
Fadomatic.prototype._updateOpacityMSIE=function(){if(this._element&&typeof(this._element.filters)!="unknown"){this._element.filters.alpha.opacity=this._opacity;this._updateVisibility();}}
Fadomatic.prototype._updateOpacity=null;function xGetElementById(e)
{if(typeof(e)=='string'&&e!=""){if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null;}
return e;}
function xMoveTo(e,x,y)
{xLeft(e,x);xTop(e,y);}
function xResizeTo(e,w,h)
{xWidth(e,w);xHeight(e,h);}
function xScrollLeft(e,bWin)
{var offset=0;if(!xDef(e)||bWin||e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){var w=window;if(bWin&&e)w=e;if(w.document.documentElement&&w.document.documentElement.scrollLeft)offset=w.document.documentElement.scrollLeft;else if(w.document.body&&xDef(w.document.body.scrollLeft))offset=w.document.body.scrollLeft;}
else{e=xGetElementById(e);if(e&&xNum(e.scrollLeft))offset=e.scrollLeft;}
return offset;}
function xScrollTop(e,bWin)
{var offset=0;if(!xDef(e)||bWin||e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){var w=window;if(bWin&&e)w=e;if(w.document.documentElement&&w.document.documentElement.scrollTop)offset=w.document.documentElement.scrollTop;else if(w.document.body&&xDef(w.document.body.scrollTop))offset=w.document.body.scrollTop;}
else{e=xGetElementById(e);if(e&&xNum(e.scrollTop))offset=e.scrollTop;}
return offset;}
function xClientWidth()
{var v=0,d=document,w=window;if((!d.compatMode||d.compatMode=='CSS1Compat')&&!w.opera&&d.documentElement&&d.documentElement.clientWidth)
{v=d.documentElement.clientWidth;}
else if(d.body&&d.body.clientWidth)
{v=d.body.clientWidth;}
else if(xDef(w.innerWidth,w.innerHeight,d.height)){v=w.innerWidth;if(d.height>w.innerHeight)v-=16;}
return v;}
function xClientHeight()
{var v=0,d=document,w=window;if((!d.compatMode||d.compatMode=='CSS1Compat')&&!w.opera&&d.documentElement&&d.documentElement.clientHeight)
{v=d.documentElement.clientHeight;}
else if(d.body&&d.body.clientHeight)
{v=d.body.clientHeight;}
else if(xDef(w.innerWidth,w.innerHeight,d.width)){v=w.innerHeight;if(d.width>w.innerWidth)v-=16;}
return v;}
function xNum()
{for(var i=0;i<arguments.length;++i){if(isNaN(arguments[i])||typeof(arguments[i])!='number')return false;}
return true;}
function xDef()
{for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])=='undefined')return false;}
return true;}
function xWidth(e,w)
{if(!(e=xGetElementById(e)))return 0;if(xNum(w)){if(w<0)w=0;else w=Math.round(w);}
else w=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){w=xClientWidth();}
else if(css&&xDef(e.offsetWidth)&&xStr(e.style.width)){if(w>=0){var pl=0,pr=0,bl=0,br=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pl=gcs(e,'padding-left',1);if(pl!==null){pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1);}
else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w;}}
w-=(pl+pr+bl+br);if(isNaN(w)||w<0)return;else e.style.width=w+'px';}
w=e.offsetWidth;}
else if(css&&xDef(e.style.pixelWidth)){if(w>=0)e.style.pixelWidth=w;w=e.style.pixelWidth;}
return w;}
function xHeight(e,h)
{if(!(e=xGetElementById(e)))return 0;if(xNum(h)){if(h<0)h=0;else h=Math.round(h);}
else h=-1;var css=xDef(e.style);if(e==document||e.tagName.toLowerCase()=='html'||e.tagName.toLowerCase()=='body'){h=xClientHeight();}
else if(css&&xDef(e.offsetHeight)&&xStr(e.style.height)){if(h>=0){var pt=0,pb=0,bt=0,bb=0;if(document.compatMode=='CSS1Compat'){var gcs=xGetComputedStyle;pt=gcs(e,'padding-top',1);if(pt!==null){pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1);}
else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h;}}
h-=(pt+pb+bt+bb);if(isNaN(h)||h<0)return;else e.style.height=h+'px';}
h=e.offsetHeight;}
else if(css&&xDef(e.style.pixelHeight)){if(h>=0)e.style.pixelHeight=h;h=e.style.pixelHeight;}
return h;}
function xTop(e,iY)
{if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.top)){if(xNum(iY))e.style.top=iY+'px';else{iY=parseInt(e.style.top);if(isNaN(iY))iY=xGetComputedStyle(e,'top',1);if(isNaN(iY))iY=0;}}
else if(css&&xDef(e.style.pixelTop)){if(xNum(iY))e.style.pixelTop=iY;else iY=e.style.pixelTop;}
return iY;}
function xLeft(e,iX)
{if(!(e=xGetElementById(e)))return 0;var css=xDef(e.style);if(css&&xStr(e.style.left)){if(xNum(iX))e.style.left=iX+'px';else{iX=parseInt(e.style.left);if(isNaN(iX))iX=xGetComputedStyle(e,'left',1);if(isNaN(iX))iX=0;}}
else if(css&&xDef(e.style.pixelLeft)){if(xNum(iX))e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}
return iX;}
function xStr(s)
{for(var i=0;i<arguments.length;++i){if(typeof(arguments[i])!='string')return false;}
return true;}
function xGetComputedStyle(e,p,i)
{if(!(e=xGetElementById(e)))return null;var s,v='undefined',dv=document.defaultView;if(dv&&dv.getComputedStyle){s=dv.getComputedStyle(e,'');if(s)v=s.getPropertyValue(p);}
else if(e.currentStyle){v=e.currentStyle[xCamelize(p)];}
else return null;return i?(parseInt(v)||0):v;}
function xCamelize(cssPropStr)
{var i,c,a=cssPropStr.split('-');var s=a[0];for(i=1;i<a.length;++i){c=a[i].charAt(0);s+=a[i].replace(c,c.toUpperCase());}
return s;}
function xDocSize()
{var b=document.body,e=document.documentElement;var esw=0,eow=0,bsw=0,bow=0,esh=0,eoh=0,bsh=0,boh=0;if(e){esw=e.scrollWidth;eow=e.offsetWidth;esh=e.scrollHeight;eoh=e.offsetHeight;}
if(b){bsw=b.scrollWidth;bow=b.offsetWidth;bsh=b.scrollHeight;boh=b.offsetHeight;}
return{w:Math.max(esw,eow,bsw,bow),h:Math.max(esh,eoh,bsh,boh)};}
function getScrollBarWidth(){var inner=document.createElement("p");inner.style.width="100%";inner.style.height="200px";var outer=document.createElement("div");outer.style.position="absolute";outer.style.top="0px";outer.style.left="0px";outer.style.visibility="hidden";outer.style.width="200px";outer.style.height="150px";outer.style.overflow="hidden";outer.appendChild(inner);document.body.appendChild(outer);var w1=inner.offsetWidth;outer.style.overflow="scroll";var w2=inner.offsetWidth;if(w1==w2)w2=outer.clientWidth;document.body.removeChild(outer);return(w1-w2);};function xModalDialog(sDialogId)
{this.dialog=xGetElementById(sDialogId);xModalDialog.instances[sDialogId]=this;var e=xModalDialog.grey;if(!e){e=document.createElement('div');e.id='xModalDialogGreyElement';e.className='xModalDialogGreyElement';xModalDialog.grey=document.body.appendChild(e);}}
function fixModalGrey(){var ds,e=xModalDialog.grey;if(e){ds=xDocSize();xMoveTo(e,0,-20+xScrollTop());xResizeTo(e,ds.w+50,xClientHeight()+50);}}
xModalDialog.prototype.show=function()
{var ds,e=xModalDialog.grey;if(e){if(!(navigator.userAgent.match(/Firefox\/[12]{1}\./i)))
jQuery('#container').css({"padding-right":getScrollBarWidth()+"px"});document.body.style.width="auto";this.dialog.greyZIndex=xGetComputedStyle(e,'z-index',1);e.style.zIndex=xGetComputedStyle(this.dialog,'z-index',1)-1;ds=xDocSize();xMoveTo(e,0,-20+xScrollTop());xResizeTo(e,xClientWidth()+50,xClientHeight()+50);if(this.dialog){xMoveTo(this.dialog,xScrollLeft()+(xClientWidth()-this.dialog.offsetWidth)/2,xScrollTop()+(xClientHeight()-this.dialog.offsetHeight)/2);}
jQuery(window).resize(fixModalGrey);if(jQuery("#container")[0]){if(jQuery(window).height()>jQuery("#container").height()){jQuery('#container').css({"height":(jQuery(window).height()-32)+"px"});}}
jQuery('#greyThing').css({"width":jQuery("#container").outerWidth(),"height":jQuery("#container").outerHeight()});}};xModalDialog.prototype.hide=function(dialogOnly)
{var e=xModalDialog.grey;if(e){var cur_br_tt_scroll_top=0;if(jQuery('#br_tt')[0])
cur_br_tt_scroll_top=parseInt(xScrollTop(jQuery('#br_tt')[0]));jQuery("#container").css({"padding-right":"0px"});enableScrollBars();document.body.style.width=xClientWidth()+"px";if(jQuery('#br_tt')[0])
jQuery('#br_tt')[0].scrollTop=cur_br_tt_scroll_top;var agt=navigator.userAgent.toLowerCase();if(agt.indexOf("safari")!=-1&&!agt.match(/\ssafari\/[5-9]{1}[3-9]{1}\d\./i))
document.body.style.width=(xClientWidth()-getScrollBarWidth())+"px";if(!dialogOnly){xResizeTo(e,10,10);xMoveTo(e,-10,-10);}
if(this&&this.dialog){e.style.zIndex=this.dialog.greyZIndex;xMoveTo(this.dialog,-this.dialog.offsetWidth,0);}
jQuery(window).unbind('resize',fixModalGrey);jQuery("#container").css({"height":"auto"});jQuery('#greyThing').css({"width":jQuery("#container").outerWidth(),"height":jQuery("#container").outerHeight()});}};xModalDialog.grey=null;xModalDialog.instances={};function xFirstChild(e,t)
{e=xGetElementById(e);var c=e?e.firstChild:null;while(c){if(c.nodeType==1&&(!t||c.nodeName.toLowerCase()==t.toLowerCase())){break;}
c=c.nextSibling;}
return c;}
function xAniLine(e,x,y,t,a,oe)
{if(!(e=xGetElementById(e)))return;var x0=xLeft(e),y0=xTop(e);x=Math.round(x);y=Math.round(y);var dx=x-x0,dy=y-y0;var fq=1/t;if(a)fq*=(Math.PI/2);var t0=new Date().getTime();var tmr=setInterval(function(){var et=new Date().getTime()-t0;if(et<t){var f=et*fq;if(a==1)f=Math.sin(f);else if(a==2)f=1-Math.cos(f);f=Math.abs(f);e.style.left=Math.round(f*dx+x0)+'px';e.style.top=Math.round(f*dy+y0)+'px';}
else{clearInterval(tmr);e.style.left=x+'px';e.style.top=y+'px';if(typeof oe=='function')oe();else if(typeof oe=='string')eval(oe);}},10);}
function xCreateDiv(s,c,id)
{var resDiv=jQuery(document.createElement('div'));if(resDiv.length>0){resDiv[0].id=id;resDiv[0].className=c;resDiv.css(s);}
return resDiv[0];}
function xPreventDefault(e)
{if(e&&e.preventDefault)e.preventDefault();else if(window.event)window.event.returnValue=false;}
function xEvent(evt)
{var e=evt||window.event;if(!e)return;this.type=e.type;this.target=e.target||e.srcElement;this.relatedTarget=e.relatedTarget;if(xDef(e.pageX)){this.pageX=e.pageX;this.pageY=e.pageY;}
else if(xDef(e.clientX)){this.pageX=e.clientX+xScrollLeft();this.pageY=e.clientY+xScrollTop();}
if(xDef(e.offsetX)){this.offsetX=e.offsetX;this.offsetY=e.offsetY;}
else if(xDef(e.layerX)){this.offsetX=e.layerX;this.offsetY=e.layerY;}
else{this.offsetX=this.pageX-xPageX(this.target);this.offsetY=this.pageY-xPageY(this.target);}
this.keyCode=e.keyCode||e.which||0;this.shiftKey=e.shiftKey;this.ctrlKey=e.ctrlKey;this.altKey=e.altKey;if(typeof e.type=='string'){if(e.type.indexOf('click')!=-1){this.button=0;}
else if(e.type.indexOf('mouse')!=-1){this.button=e.button;}}}
function xPageX(e)
{var x=0;e=xGetElementById(e);while(e){if(xDef(e.offsetLeft))x+=e.offsetLeft;e=xDef(e.offsetParent)?e.offsetParent:null;}
return x;}
function xPageY(e)
{var y=0;e=xGetElementById(e);while(e){if(xDef(e.offsetTop))y+=e.offsetTop;e=xDef(e.offsetParent)?e.offsetParent:null;}
return y;}
function xRemoveEventListener(e,eT,eL,cap)
{if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if(e.removeEventListener)e.removeEventListener(eT,eL,cap||false);else if(e.detachEvent)e.detachEvent('on'+eT,eL);else e['on'+eT]=null;}
function xAddEventListener(e,eT,eL,cap)
{if(!(e=xGetElementById(e)))return;eT=eT.toLowerCase();if(e.addEventListener)e.addEventListener(eT,eL,cap||false);else if(e.attachEvent)e.attachEvent('on'+eT,eL);else{var o=e['on'+eT];e['on'+eT]=typeof o=='function'?function(v){o(v);eL(v);}:eL;}}
function tryingToDragInput(ev){var targ=null;if(ev.target){targ=ev.target;}else if(ev.srcElement){targ=ev.srcElement;}
if(targ){if(targ.nodeType&&targ.nodeType==3){targ=targ.parentNode;}
if(targ.tagName.match(/textarea|input/i)){return true;}}
return false;}
function xEnableDrag(id,fS,fD,fE){var mx=0,my=0,el=xGetElementById(id);if(el){el.xDragEnabled=true;jQuery(el).mousedown(dragStart);}
function dragStart(e){if(el.xDragEnabled){var ev=new xEvent(e);if(tryingToDragInput(ev)){return true;}
xPreventDefault(e);mx=ev.pageX;my=ev.pageY;jQuery(document).mousemove(drag);jQuery(document).mouseup(dragEnd);if(fS){fS(el,ev.pageX,ev.pageY,ev);}}}
function drag(e){var ev,dx,dy;ev=new xEvent(e);if(tryingToDragInput(ev)){return true;}
xPreventDefault(e);dx=ev.pageX-mx;dy=ev.pageY-my;mx=ev.pageX;my=ev.pageY;if(fD){fD(el,dx,dy,ev);}else{xMoveTo(el,xLeft(el)+dx,xTop(el)+dy);}}
function dragEnd(e){var ev=new xEvent(e);if(tryingToDragInput(ev)){return true;}
xPreventDefault(e);jQuery(document).unbind('mouseup',dragEnd);jQuery(document).unbind('mousemove',drag);if(fE){fE(el,ev.pageX,ev.pageY,ev);}
if(xEnableDrag.drop){xEnableDrag.drop(el,ev);}}}
xEnableDrag.drops=[];function disableScrollerOnModal(modal){disableScrollBars();}
function enableScrollerAfterModal(){var e1=(xModalDialog&&xModalDialog.grey)?xModalDialog.grey:null;if(e1)xModalDialog.prototype.hide();enableScrollBars();}
function resizeButtonsGroup(pdiv){var btns=jQuery("#"+pdiv).find("a.btn");if(btns.length>1){biggest_btn_width=0;btns.each(function(){var cur_btn_width=jQuery(this).find("font:first-child").width();if(cur_btn_width>biggest_btn_width)
biggest_btn_width=cur_btn_width;});jQuery(".btn_group:last font:first-child").each(function(){var obj=jQuery(this);obj.find("input").css({"width":(biggest_btn_width-obj.width())/2+"px"});});}}
var disabledButtonsForms=[];function disableNewButtons(formobj){disabledButtonsForms.push(formobj);var jObj=jQuery(formobj);jObj.find('a.btn').disableBtn();if(jObj.attr('isAlreadyClicked')!=null&&jObj.attr('isAlreadyClicked')!='undefined'&&jObj.attr('isAlreadyClicked')!='1'){return false;}
else{jObj.attr('isAlreadyClicked','1');return true;}}
function enableNewButtons(formobj){if("undefined"==typeof formobj){formobj=disabledButtonsForms.pop();}else{for(var i=disabledButtonsForms.length-1;i>=0;i--){if(formobj==disabledButtonsForms[i]){disabledButtonsForms.splice(i,1);break;}}}
var jObj=jQuery(formobj);jObj.find('a.btn').enableBtn();if(jObj.attr('isAlreadyClicked')!=null&&jObj.attr('isAlreadyClicked')!='undefined'&&jObj.attr('isAlreadyClicked')!='1'){jObj.attr('isAlreadyClicked','1');return true;}
else{return false;}}
captcha_finished=false;jQuery.fn.extend({submitBtn:function(element){if(this.length==0){return null;}
if(jQuery(this).is("A")){var parentForm=jQuery(this).parents("form");if(parentForm.length!=0){if(typeof(parentForm.attr("onsubmit"))==="string"){if((new Function(parentForm.attr("onsubmit")))()){parentForm.submit();}}else if(typeof(parentForm.attr("_FS"))==="function"){var regExp=new RegExp("^.*[^{]{(.*[^}])}$","g");if((new Function(parentForm.attr("_FS").toString().replace(/[\n\r]/g,'').replace(regExp,"$1")))()){parentForm.submit();}}else{parentForm.submit();}}}},enableBtn:function(element){if(this.length==0){return null;}
if(jQuery(this).is("A")){this.removeClass('grey');}},disableBtn:function(){if(this.length==0){return null;}
if(jQuery(this).is("A")){this.addClass('grey');}},isDisabledBtn:function(){if(this.length==0){return null;}
if(jQuery(this).is("A")){if(this.hasClass('grey')){return true;}else{return false;}}},getBtnWidth:function(){if(this.length==0){return null;}
if(jQuery(this).is("A")){return this.innerWidth();}}});