
$(document).ready(function()
{$('.load-login').cluetip({local:true,cursor:'pointer',sticky:true,closePosition:'title',arrows:true,activation:'click',width:620,showTitle:false});$('.load-submit').cluetip({local:true,cursor:'pointer',sticky:true,closePosition:'title',arrows:true,activation:'click',width:480,showTitle:false});$('.load-help').tooltip({delay:500,showURL:false,track:true});$('textarea').autogrow();$('#logo').click(function(){location.href='/';});$('.confirm').click(function(){return confirm('Are you sure? Click OK to confirm.');})
var intUpdate;if(!($.browser.msie&&$.browser.version<7)){$('.showquickmenu').click(function(){clearTimeout(intUpdate);intUpdate=setTimeout("ajax_read('/ajax/ajax_getchat.php?cat="+$(this).attr("rel")+"')",0);$("#chatwindow").html("");$(".showquickmenu").removeClass("activechat");$(this).addClass("activechat");$("#chatwindow").attr("title",$(this).attr("rel"));$("#chattitle").html($(this).attr("title"));$("#fixedquickmenu").show();$("#chatmsg").focus();return false;})
$('.closequickmenu').click(function(){$('.showquickmenu').removeClass("activechat");$("#fixedquickmenu").hide();return false;})
$('.togglemessagepopup').click(function(){$("#fixedmessagepopup").toggle();return false;})}else{$('.togglequickmenu').remove();$('.togglemessagepopup').remove();}
$('.thickbox').click(function(){var dimensions=$(this).attr("rel").split(",");$.showAkModal($(this).attr("href"),$(this).attr("title"),dimensions[0],dimensions[1]);return false;});$("#replyform .button_text").click(function(){var message=$("#replymessage").val();var pmid=$("#replypmid").val();var recipient=$("#replyrecipient").val();var dataString='message='+message+'&pmid[]='+pmid+'&recipient='+recipient;$.ajax({type:"POST",url:"/ajax/ajax_sendmessage.php",data:dataString,success:function(){$("#fixedmessagepopup").fadeOut();$(".togglemessagepopup").remove();}});return false;});$(".tracklink").click(function(){pageTracker._trackEvent('links','external',window.location.pathname);});imagePreview();});new function(){$.fn.validate={init:function(o){if(o.name=='name'){this.alphanumeric(o)};if(o.name=='email'){this.email(o)};if(o.name=='password1'){this.password(o)};if(o.name=='password2'){this.password(o)};if(o.name=='productname'){this.empty(o)};if(o.name=='guideprice'){this.guideprice(o);};if(o.name=='description'){this.empty(o)};if(o.name=='subject'){this.empty(o)};if(o.name=='comment'){this.empty(o)};if(o.name=='category'){this.empty(o)};if(o.name=='tags'){this.tags(o)};if(o.name=='captcha'){this.empty(o)};if(o.name=='image'){this.image(o)};},password:function(o){if(o.value.length>5){doSuccess(o);return true;}else{doError(o,'Password must be at least 6 characters');return false;};},passwordmatch:function(o1,o2){if(o1.value==o2.value){doSuccess(o2);return true;}else{doError(o2,'Passwords do not match');return false;};},email:function(o){var email=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(o.value.match(email)){doSuccess(o);return true;}else{doError(o,'Not a valid email');return false;};},guideprice:function(o){var text=/^([0-9]{1,4}(\.[0-9][0-9])?)$/;if(o.value.match(text)){doSuccess(o);return true;}else{doError(o,'Price is not an acceptable value');return false;};},tags:function(o){var text=/^([A-Za-z0-9\s\,]*)$/;if(o.value.match(text)){doSuccess(o);return true;}else{doError(o,'Letters, numbers, commas and spaces only');return false;};},alphanumeric:function(o){var text1=/^([A-Za-z0-9\s]*)$/;var text2=/[(\w.)*]/;if(o.value.match(text1)&&o.value.match(text2)){doSuccess(o);return true;}else{doError(o,'Letters, numbers and spaces only');return false;};},empty:function(o){var text=/[(\w.)*]/;if(o.value.match(text)){doSuccess(o);return true;}else{doError(o,'You must enter something');return false;};},image:function(o){if(o.value!='blank'){doSuccess(o);return true;}else{doError(o,'Image is missing');return false;};}};function doSuccess(o){$('#'+o.id+'_wrap').removeClass("error");$('#'+o.id+'_guide').html("OK");}
function doError(o,m){$('#'+o.id+'_wrap').addClass("error");$('#'+o.id+'_guide').html(m);}};$(document).ready(function()
{$(".validate .element").keyup(function(){$(this).validate.init(this);});$(".validate .element").blur(function(){$(this).validate.init(this);});$("form li").mouseover(function(){$(this).addClass("highlighted");});$("form li").mouseout(function(){$(this).removeClass("highlighted");});});$(document).ready(function()
{$("#comment_form").submit(function(){var ok=1;if($(this).validate.empty(document.getElementById("comment_form").comment)==false){ok=0}
if(ok==1){return true;}else{return false;}});$("#comment").charCounter(250,{container:"#comment_guide",format:"Comment can have up to %1 more characters"});$('a.load-list').cluetip({local:true,cursor:'pointer',sticky:true,closePosition:'title',arrows:true,activation:'click',width:300});$("#addtofavs").click(function(){if($("#addtofavs span").hasClass("removefromfavs")){$("#addtofavs span").load("/ajax/ajax_addtofavs.php?remove=1&id="+$("#addtofavs").attr("rel"));$("#addtofavs span").removeClass("removefromfavs");}else{$("#addtofavs span").load("/ajax/ajax_addtofavs.php?id="+$("#addtofavs").attr("rel"));$("#addtofavs span").addClass("removefromfavs");}
return false;});$("#addtowanted").click(function(){if($("#addtowanted span").hasClass("removefromwanted")){$("#addtowanted span").load("/ajax/ajax_addtowanted.php?remove=1&id="+$("#addtowanted").attr("rel"));$("#addtowanted span").removeClass("removefromwanted");}else{$("#addtowanted span").load("/ajax/ajax_addtowanted.php?id="+$("#addtowanted").attr("rel"));$("#addtowanted span").addClass("removefromwanted");}
return false;});$('#rater').rater('/ajax/ajax_rater.php?id='+$("#rater").attr("title"),{curvalue:$("#rater").attr("rel")});$("#mylistadd").click(function(){var listid=$("input[name='mylistbox']:checked").val();if(listid!=undefined){$.get("/ajax/ajax_addtolist.php",{id:$("#listbox").attr("title"),listid:listid});$("#cluetip").fadeOut();}});$("#mytribeadd").click(function(){var tribeid=$("input[name='mytribebox']:checked").val();if(tribeid!=undefined){$.get("/ajax/ajax_addtotribe.php",{id:$("#listbox").attr("title"),tribeid:tribeid});$("#cluetip").fadeOut();}});$(".buylink, #buyfromshop").mouseover(function(){window.status=this.title;return true;})
$(".buylink, #buyfromshop").mouseout(function(){window.status='Done';return true;});if($("#commentpanel").length>0){$("#commentpanel").load("/ajax/ajax_commentpanel.php?id="+$("#commentpanel").attr("rel"),'',function(){ajaxDocumentReady();});}
ajaxDocumentReady();});function ajaxDocumentReady(){$(".moretwitter").click(function(){$(this).parent().addClass("loading");$(this).fadeTo("fast",0);$(this).parent().load("/ajax/ajax_commentpanel_twitter.php?id="+$(this).attr("rel")+"&page="+$(this).attr("title"),'',function(){ajaxDocumentReady();$(".loading").removeClass("loading");});return false;});$(".moreamazon").click(function(){$(this).parent().addClass("loading");$(this).fadeTo("fast",0);$(this).parent().load("/ajax/ajax_commentpanel_amazon.php?id="+$(this).attr("rel")+"&page="+$(this).attr("title"),'',function(){ajaxDocumentReady();$(".loading").removeClass("loading");});return false;});}
jQuery.fn.rater=function(url,options)
{if(url==null)return;var settings={url:url,maxvalue:5,curvalue:0};if(options){jQuery.extend(settings,options);};jQuery.extend(settings,{cancel:(settings.maxvalue>1)?true:false});var container=jQuery(this);jQuery.extend(container,{averageRating:settings.curvalue,url:settings.url});if(!settings.style||settings.style==null||settings.style=='basic'){var raterwidth=settings.maxvalue*35;var ratingparent='<ul class="star-rating" style="width:'+raterwidth+'px">';}
if(settings.style=='small'){var raterwidth=settings.maxvalue*14;var ratingparent='<ul class="star-rating small-star" style="width:'+raterwidth+'px">';}
if(settings.style=='inline'){var raterwidth=settings.maxvalue*14;var ratingparent='<span class="inline-rating"><ul class="star-rating small-star" style="width:'+raterwidth+'px">';}
container.append(ratingparent);var starWidth,starIndex,listitems='';var curvalueWidth=Math.floor(100/settings.maxvalue*settings.curvalue);for(var i=0;i<=settings.maxvalue;i++){if(i==0){listitems+='<li class="current-rating" style="width:'+curvalueWidth+'%;">'+settings.curvalue+'/'+settings.maxvalue+'</li>';}else{starWidth=Math.floor(100/settings.maxvalue*i);starIndex=(settings.maxvalue-i)+2;listitems+='<li class="star"><a href="#'+i+'" title="'+i+'/'+settings.maxvalue+'" style="width:'+starWidth+'%;z-index:'+starIndex+'">'+i+'</a></li>';}}
container.find('.star-rating').append(listitems);if(settings.maxvalue>1)
{container.append('<span class="star-rating-result"></span>');}
else
{container.append('<span class="single-star-rating-result"></span>');}
var stars=jQuery(container).find('.star-rating').children('.star');stars.click(function()
{if(settings.maxvalue==1)
{settings.curvalue=(settings.curvalue==0)?1:0;jQuery(container).find('.star-rating').children('.current-rating').css({width:(settings.curvalue*100)+'%'});jQuery.post(container.url,{"rating":settings.curvalue},function(response){container.children('.single-star-rating-result').html(response);$('.single-star-rating-result').blur();});return false;}
else
{settings.curvalue=stars.index(this)+1;raterValue=jQuery(this).children('a')[0].href.split('#')[1];jQuery.post(container.url,{"rating":raterValue},function(response){container.children('.star-rating-result').html(response)});return false;}
return true;});return this;}
jQuery.fn.charCounter=function(max,settings){max=max||100;settings=$.extend({container:"<span></span>",classname:"charcounter",format:"(%1 characters remaining)",pulse:true,delay:0},settings);var p,timeout;function count(el,container){el=$(el);if(el.val().length>max){el.val(el.val().substring(0,max));if(settings.pulse&&!p){pulse(container,true);};};if(settings.delay>0){if(timeout){window.clearTimeout(timeout);}
timeout=window.setTimeout(function(){container.html(settings.format.replace(/%1/,(max-el.val().length)));},settings.delay);}else{container.html(settings.format.replace(/%1/,(max-el.val().length)));}};function pulse(el,again){if(p){window.clearTimeout(p);p=null;};el.animate({opacity:0.1},100,function(){$(this).animate({opacity:1.0},100);});if(again){p=window.setTimeout(function(){pulse(el)},200);};};return this.each(function(){var container=(!settings.container.match(/^<.+>$/))?$(settings.container):$(settings.container).insertAfter(this).addClass(settings.classname);$(this).bind("keydown",function(){count(this,container);}).bind("keypress",function(){count(this,container);}).bind("keyup",function(){count(this,container);}).bind("focus",function(){count(this,container);}).bind("mouseover",function(){count(this,container);}).bind("mouseout",function(){count(this,container);}).bind("paste",function(){var me=this;setTimeout(function(){count(me,container);},10);});if(this.addEventListener){this.addEventListener('input',function(){count(this,container);},false);};count(this,container);});}
$(document).ready(function()
{$(".thumbsup").click(function(){if($(this).hasClass("thumbsup_on")){}else{$.get("/ajax/ajax_rateuser.php?x=good&id="+$(this).attr("rel"));$(".thumbsup[@rel='"+$(this).attr("rel")+"']").addClass("thumbsup_on");$(".thumbsdown[@rel='"+$(this).attr("rel")+"']").removeClass("thumbsdown_on");}
return false;});$(".thumbsdown").click(function(){if($(this).hasClass("thumbsdown_on")){}else{$.get("/ajax/ajax_rateuser.php?x=bad&id="+$(this).attr("rel"));$(".thumbsdown[@rel='"+$(this).attr("rel")+"']").addClass("thumbsdown_on");$(".thumbsup[@rel='"+$(this).attr("rel")+"']").removeClass("thumbsup_on");}
return false;});});if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return"";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;