var sdignorethread_getting=0;function sdignorethread(threadid,postid,unignore)
{var unignore=(unignore==null||unignore==0)?0:1;if(!AJAX_Compatible)
{return true;}
else
{if(sdignorethread_getting==1)
{return false;}
else
{sdignorethread_getting=1;setTimeout("sdignorethread_getting = 0",500);}
var sdpostrow=$("#sdpostrow_"+postid);var sdignorethread_param=new Object();sdignorethread_param['ajax']=1;sdignorethread_param['do']=unignore?"unignorethread":"ignorethread"
sdignorethread_param['threadid']=threadid;sdignorethread_param['securitytoken']=SECURITYTOKEN;sdpostrow.find("img").filter(".ignorethreadsmall").removeClass("concat-general ignorethreadsmall").attr("src",function(){return this.src.replace("blank","ajaxsmall");})
$.post('profile.php',sdignorethread_param,function(data)
{if(data=="<!-- sdignorethread ok -->")
{var sdpostrowget=$("#sdpostrowget_"+postid);if(sdpostrowget.size()==1)
{sdpostrowget.find("#postmenu_"+postid+"_menu").addClass("nosdanim").end().sdhideRow();}
sdpostrow.sdhideRow();var sdignorecount=$("#ignorecount").not(".icounted"+postid);if(sdignorecount.size()==1)
{sdignorecount.text(String(sdignorecount.text()-1)).addClass("icounted"+postid);}}
else
{alert("There was an error. Please try again.");}});return false;}};var sdpsticky_getting=0;function sdpsticky(threadid,stick)
{var sticky=(sticky==null||sticky==0)?0:1;if(!AJAX_Compatible)
{return true;}
else
{if(sdpsticky_getting==1)
{return false;}
else
{sdpsticky_getting=1;setTimeout("sdpsticky_getting = 0",500);}
var sdmystickypin=$("#mystickypin_"+threadid);var sdpsticky_param=new Object();sdpsticky_param['ajax']=1;sdpsticky_param['do']=sticky?"personalsticky":"unpersonalsticky"
sdpsticky_param['threadid']=threadid;sdpsticky_param['securitytoken']=SECURITYTOKEN;sdmystickypin.removeClass().attr("src",function(){return this.src.replace("blank","ajaxsmall")})
$.post('showthread.php',sdpsticky_param,function(data)
{if(data=="<!-- sdpsticky ok -->")
{sdmystickypin.remove();var threadtitle=$("#thread_title_"+threadid).parent();var stickystr=threadtitle.html();stickystr=stickystr.replace("My Sticky:","");threadtitle.html(stickystr);}
else
{alert("There was an error. Please try again.");}});return false;}};var sdtag_posting=0;var sdtag_errors_shown=false;var tagFormShown=false;function setAddTagForm(threadid)
{sdfetch_object("sdtag_form").threadid.value=threadid;}
function showAddTagForm(e,threadid,slickdealid)
{if(tagFormShown==false)
{tagFormShown=true;showDiv(e,'addsdtag_div');formobj=sdfetch_object("sdtag_form");formobj.threadid.value=threadid;formobj.addsdtag_txt.focus();}
else
{tagFormShown=false;closeDiv(e,'addsdtag_div');}}
function sdtag_prepare_submit(formobj)
{if(!AJAX_Compatible)
{return sdtag_check_data(formobj);}
else if(sdtag_check_data(formobj))
{var test_ajax=new vB_AJAX_Handler(true);if(!test_ajax.init()||(typeof vb_disable_ajax!='undefined'&&vb_disable_ajax>0))
{return true;}
if(is_ie&&userAgent.indexOf('msie 5.')!=-1)
{if(PHP.urlencode(formobj.tag.value).indexOf('%u')!=-1)
{return true;}}
if(sdtag_posting==1)
{return false;}
else
{sdtag_posting=1;setTimeout("sdtag_posting = 0",1000);}
if(typeof formobj=="string")
{var submitstring=formobj;}
else if(typeof formobj=="object")
{var submitstring='do=tagthread&ajax=1';for(i=0;i<formobj.elements.length;i++)
{var obj=formobj.elements[i];if(obj.name&&!obj.disabled)
{switch(obj.type)
{case'text':case'textarea':case'hidden':submitstring+='&'+obj.name+'='+PHP.urlencode(obj.value);break;case'checkbox':case'radio':submitstring+=obj.checked?'&'+obj.name+'='+PHP.urlencode(obj.value):'';break;case'select':submitstring+='&'+obj.name+'='+PHP.urlencode(obj.options[obj.selectedIndex].value);break;}}}}
document.body.style.cursor='wait';sdtag_ajax_post(submitstring);return false;}
else
{return false;}}
function sdtag_check_data(formobj)
{if(typeof formobj=="object")
{re=new RegExp("^[a-z,A-Z,0-9,.,&,,,\\-,\\s]{0,50}$",'i');if(formobj.addsdtag_txt!=null)
tagval=formobj.addsdtag_txt.value
else
{var tagin=formobj.filtersdtag_txt;if(tagin.value=="Tag"||tagin.value=="Search Tag")
tagin.value='';tagval=tagin.value;}
var tagvalid=(tagval.match(re)!=null&&tagval!='')?true:false;if(!tagvalid)
sdtag_show_errors("Invalid tag.");else
sdtag_hide_errors();return tagvalid;}
return true;}
function sdtag_ajax_post(submitstring)
{xml=new vB_AJAX_Handler(true);xml.onreadystatechange(sdtag_do_ajax_post);xml.send('sdtag_ajax.php',submitstring);}
function sdtag_do_ajax_post()
{if(xml.handler.readyState==4&&xml.handler.status==200&&xml.handler.responseText)
{document.body.style.cursor='auto';if(xml.handler.responseText.match(/^<!-- sdtag ok -->/))
{lp=fetch_object('sdtagbits_'+sdfetch_object("sdtag_form").threadid.value);lp.innerHTML=xml.handler.responseText;fetch_object('addsdtag_txt').value="";fetch_object('addsdtag_menu').style.display="none";sdtag_hide_errors();if(is_ie)
{xml.handler.abort();}
if(fetch_object('sdtag_submit'))
{fetch_object('sdtag_submit').blur();}}
else
{if(!is_saf)
{if(xml.handler.responseText.match(/^<!-- sdtag error -->/))
{sdtag_show_errors(xml.handler.responseText);if(is_ie)
{xml.handler.abort();}
return;}}
if(is_ie)
{xml.handler.abort();}
fetch_object('sdtag_form').submit();}}}
function sdtag_show_errors(errortext)
{sdtag_errors_shown=true;fetch_object("sdtag_err").innerHTML=errortext;return false;}
function sdtag_hide_errors()
{if(sdtag_errors_shown)
{sdtag_errors_shown=true;fetch_object("sdtag_err").innerHTML="";return false;}}
function sdtag_confirmdel(tag)
{return confirm('Are you sure you want to delete '+tag+'?\nClick OK to delete, or cancel to hide this prompt.');};var sdpost_getting=0;function sdpost_get(postid)
{if($("#sdpostrowget_"+postid).size()==1)
{var sdpostrowget=$("#sdpostrowget_"+postid);if(sdpostrowget.css("display")=="none")
{sdpostrowget.show();}
else
{sdpostrowget.hide();}
var imgtoggle=$("#sdpostimg_"+postid);if(imgtoggle.length==1)
{toggleimg(imgtoggle.get(0));}
return false;}
if(!AJAX_Compatible)
{return true;}
else
{if(sdpost_getting==1)
{return false;}
else
{sdpost_getting=1;setTimeout("sdpost_getting = 0",1000);}
var sdpost_param=new Object();sdpost_param['ajax']=1;sdpost_param['do']="sdpostget"
sdpost_param['postid']=postid;$("#sdpostimg_"+postid).attr("src",function(){return this.src.replace("expand","ajaxsmall")});$.post('sdpost_ajax.php',sdpost_param,function(data)
{if(data.match(/^<!-- sdpost ok -->/))
{var lp=$('#sdpostrow_'+postid);if(lp.length<=0)
{lp=$(".sdwiki").parent("a[href$='"+postid+"']").parents("tr");}
var newrow=$(document.createElement("tr"));var newcol=$(document.createElement("td"));newrow.attr("id","sdpostrowget_"+postid).append(newcol).css("display","none");newcol.css("padding","0px").attr("colSpan",9).addClass("alt1").html(data);lp.after(newrow);$("#sdpostimg_"+postid).attr("src",function(){return this.src.replace("ajaxsmall","expand_collapsed")});newrow.find(":hidden").addClass("nosdanim").end().show();}
else
{alert("There was an error. Please try again.");}});return false;}};var sdthreadrate_getting=0;var sdthreadrate_postid=0;function sdthreadrate_vote(postid,vote,controltype)
{controltype=typeof(controltype)!='undefined'?controltype:"thread";votefeedback=$("#vote_feedback_"+postid+"_"+vote);if(votefeedback.length>0)
{if(votefeedback.find("input").length==1)
{sdthreadrate_submit(postid,vote,votefeedback.find("input").val(),controltype);}
else
{votefeedback.find(".voteselected").attr("postid",postid);votefeedback.find(".voteselected").attr("vote",vote);votefeedback.slideDown("fast");}}
else
{sdthreadrate_submit(postid,vote,0,controltype);}}
function sdthreadrate_extendedvote(input,controltype)
{input=$(input);vote=input.attr("vote");postid=input.attr("postid")
$("#vote_feedback_"+postid+"_"+vote).slideUp("fast");sdthreadrate_submit(postid,vote,input.val(),controltype);}
function sdthreadrate_submit(postid,vote,votetypeid,controltype)
{controltype=typeof(controltype)!='undefined'?controltype:"thread";if(sdthreadrate_getting==1)
{return false;}
else
{sdthreadrate_getting=1;setTimeout("sdthreadrate_getting = 0",1000);}
var sdthreadrate_param=new Object();sdthreadrate_param['ajax']=1;sdthreadrate_param['do']="sdthreadratevote"
sdthreadrate_param['postid']=postid;sdthreadrate_param['vote']=vote;sdthreadrate_param['votetypeid']=votetypeid;sdthreadrate_param['controltype']=controltype;sdthreadrate_param['securitytoken']=SECURITYTOKEN;var voteimgindex=vote+1;$("#ratecontrol_"+postid+" img:eq("+voteimgindex+")").attr("src","http://i.slickdeals.net/images/buttons/ajaxsmall.gif");$.post('/forums/sdthreadrate_ajax.php',sdthreadrate_param,function(data)
{if($(data).find("error").length==0)
{$("#sharethistab:visible").hide();$("#showfeedback:hidden").show();$("#fistthread_publicopinion:hidden").css("visibility","").hide().fadeIn()
var postid=geturlvar($(this).attr("data"),"postid");var score=$(".vote_score")
score.hide();updateHtmlBits(data);score.slideDown("normal");var error=$(data).find("errormsg")
if(error.length>0)
{errordialog(error.text());}}
else
{errordialog($(data).find("error").text());}});return false;};function vB_AJAX_sdTagSuggest(varname,textobjid,menukey)
{var webkit_version=userAgent.match(/applewebkit\/([0-9]+)/);if(AJAX_Compatible&&!(is_saf&&!(webkit_version[1]>=412)))
{this.menuobj=fetch_object(menukey+'_menu');this.textobj=fetch_object(textobjid);this.textobj.obj=this;this.varname=varname;this.menukey=menukey;this.fragment='';this.donenames='';this.selected=0;this.menuopen=false;this.timeout=null;this.names=new Array();this.xml_sender=null;this.allow_multiple=false;this.min_chars=3;this.get_text=function()
{if(this.allow_multiple)
{var semicolon=this.textobj.value.lastIndexOf(',');if(semicolon==-1)
{this.donenames=new String('');this.fragment=new String(this.textobj.value);}
else
{this.donenames=new String(this.textobj.value.substring(0,semicolon+1));this.fragment=new String(this.textobj.value.substring(semicolon+1));}}
else
{this.fragment=new String(this.textobj.value);}
this.fragment=PHP.trim(this.fragment);}
this.set_text=function(i)
{if(i==-1)
{if(this.textobj.form.onsubmit!=null)
{if(this.textobj.form.onsubmit());this.textobj.form.onsubmit();}
else
this.textobj.form.submit();return false;}
if(this.allow_multiple)
{this.textobj.value=PHP.ltrim(this.donenames+" "+this.names[i]+",");}
else
{this.textobj.value=this.names[i];}
this.textobj.focus();this.menu_hide();return false;}
this.move_row_selection=function(increment)
{var newval=parseInt(this.selected,10)+parseInt(increment,10);if(newval<-1)
{newval=this.names.length-1;}
else if(newval>=this.names.length)
{newval=-1;}
this.set_row_selection(newval);return false;}
this.set_row_selection=function(i)
{var tds=fetch_tags(this.menuobj,'td');if(i==-1)
{if(this.selected>=0&&this.selected<=this.names.length)
tds[this.selected].className='vbmenu_option';this.selected=-1;}
else if(this.selected==-1)
{tds[i].className='vbmenu_hilite';this.selected=i;}
else
{tds[this.selected].className='vbmenu_option';this.selected=i;tds[this.selected].className='vbmenu_hilite';}}
this.key_event_handler=function(evt)
{evt=evt?evt:window.event;if(this.menuopen)
{switch(evt.keyCode)
{case 38:{this.move_row_selection(-1);return false;}
case 40:{this.move_row_selection(1);return false;}
case 27:{this.menu_hide();this.textobj.focus();return false;}
case 13:{this.set_text(this.selected);return false;}}}
this.get_text();if(this.fragment.length>=this.min_chars)
{clearTimeout(this.timeout);this.timeout=setTimeout(this.varname+'.name_search();',500);}
else
{this.menu_hide();}}
this.name_search=function()
{this.names=new Array();if(!this.xml_sender)
{this.xml_sender=new vB_AJAX_Handler(true);}
this.xml_sender.onreadystatechange(this.onreadystatechange);this.xml_sender.send('sdtag_ajax.php','do=tagautocomplete&tag='+PHP.urlencode(this.fragment)+'&forumid='+PHP.urlencode(this.textobj.form.f.value));}
var me=this;this.onreadystatechange=function()
{if(me.xml_sender.handler.readyState==4&&me.xml_sender.handler.status==200&&me.xml_sender.handler.responseXML)
{var users=fetch_tags(me.xml_sender.handler.responseXML,'tag');for(i=0;i<users.length;i++)
{me.names[i]=users[i].firstChild.nodeValue;}
if(me.names.length>0)
{me.menu_build();me.menu_show();}
else
{me.menu_hide();}
me.xml_sender.handler.abort();}}
this.menu_build=function()
{this.menu_empty();var re=new RegExp('^('+PHP.preg_quote(this.fragment)+')',"i");var table=document.createElement('table');table.cellPadding=4;table.cellSpacing=1;table.border=0;for(i in this.names)
{var td=table.insertRow(-1).insertCell(-1);td.className=(i==this.selected?'vbmenu_hilite':'vbmenu_option');td.innerHTML='<a onclick="return '+this.varname+'.set_text('+i+')">'+this.names[i].replace(re,'<strong>$1</strong>')+'</a>';}
this.menuobj.appendChild(table);this.vbmenu=vBmenu.register(this.menukey,true);}
this.menu_empty=function()
{this.selected=0;while(this.menuobj.firstChild)
{this.menuobj.removeChild(this.menuobj.firstChild);}}
this.menu_show=function()
{this.vbmenu.show(fetch_object(this.menukey),this.menuopen);this.menuopen=true;this.selected=-1;var tds=fetch_tags(this.menuobj,'td');tds[0].className='vbmenu_option';this.set_row_selection(-1);}
this.menu_hide=function()
{try
{this.vbmenu.hide();}
catch(e){}
this.menuopen=false;}
this.textobj.onkeyup=function(e){return this.obj.key_event_handler(e);};this.textobj.onkeypress=function(e)
{e=e?e:window.event;if(e.keyCode==13)
{return(this.obj.menuopen?false:true);}};}}