var ga_url=location.href.replace(/^http:\/\/.*?\//i,"/");if(ga_pl){ga_url+=ga_url.indexOf("?")>-1?"&":"?";ga_url+="hl="+ga_pl}var _gaq=_gaq||[];function track_click_out(){try{_gaq.push(["my_tracker._trackEvent","ad","click","0"])}catch(a){}return true}_gaq.push(function(){_gat.createTracker(ga_acct,"my_tracker");_gat.createTracker("UA-2551200-33","fp_tracker")});
_gaq.push(["my_tracker._setAccount",ga_acct],["fp_tracker._setAccount","UA-2551200-33"],["_setDomainName",".madthumbs.com"],["my_tracker._setAllowLinker",true],["my_tracker._setAllowHash",false],["my_tracker._setCustomVar",4,"Role",ga_user_role,2]);
_gaq.push(function(){var a=_gat._getTrackerByName("my_tracker"),c=a._getVisitorCustomVar(1),b=a._getVisitorCustomVar(5);if(!c||b&&ga_source&&b!=ga_source)_gaq.push(["my_tracker._setCustomVar",1,"FirstTime",ga_time,1],["my_tracker._setCustomVar",2,"FirstCampaign",ga_campaign,1],["my_tracker._setCustomVar",3,"LastMilestone","0",1],["my_tracker._setCustomVar",5,"FirstSource",ga_source,1]);else{b=parseInt(a._getVisitorCustomVar(3));if(b<10){a=b;b=0}else{a=Math.floor(b/10);b=b%10}var e=ga_time-c,h=[[86400,
1],[259200,2],[604800,3],[1209600,4],[2592E3,5]],d=ga_is_mobile?b:a;c=d;for(var f=0,i=0;i<h.length;++i){var g=h[i];if(e>g[0]&&d<g[1]){c=g[1];f=Math.floor(g[0]/86400)}else if(e<=g[0])break}e="/goal/repeat/";if(!document.referrer){e="/goal/loyalty/";_gaq.push(["my_tracker._trackPageview","/goal/hook/bookmark"])}if(f)_gaq.push(["my_tracker._setCustomVar",3,"LastMilestone",ga_is_mobile?a*10+c:c*10+b,1],["my_tracker._trackPageview",e+"day_"+f])}});_gaq.push(["my_tracker._trackPageview",ga_url]);
(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://www.google-analytics.com/ga.js";var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(a,c)})();
var mt_main={warning:{init:function(){is_network()?createCookie("warned","1",360):$("#warning").overlay({top:300,fixed:false,mask:{color:"#000",loadSpeed:0,opacity:1},closeOnClick:false,closeOnEsc:false,load:true,zIndex:1E4});$("#enterlink").click(function(){createCookie("warned","1",360);$("#warning").overlay().close();return false})}},mobile_redirect:{init:function(a){a=a.match(/videos/i)?"http://mobile.madthumbs.com/"+a:a.match(/categories/i)?"http://mobile.madthumbs.com"+a.replace(/categories/,
""):"";if(navigator.userAgent.match(/iphone/i))location.replace(a);else if(navigator.userAgent.match(/ipod/i))location.replace(a);else if(navigator.userAgent.match(/android/i))location.replace(a);else if(navigator.userAgent.match(/sgh/i))location.replace(a);else if(navigator.userAgent.match(/sonyericsson/i))location.replace(a);else if(navigator.userAgent.match(/psp/i))location.replace(a);else if(navigator.userAgent.match(/mot/i))location.replace(a);else if(navigator.userAgent.match(/htc/i))location.replace(a);
else if(navigator.userAgent.match(/lg/i))location.replace(a);else if(navigator.userAgent.match(/opera mini/i))location.replace(a);else if(navigator.userAgent.match(/blackberry/i))location.replace(a);else if(navigator.userAgent.match(/nokia/i))location.replace(a);else if(navigator.userAgent.match(/palm/i))location.replace(a);else if(navigator.userAgent.match(/ipaq/i))location.replace(a);else navigator.userAgent.match(/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|pda|treo)/i)&&
!navigator.userAgent.match(/ipad/i)&&location.replace(a)}},admin:{init:function(){var a;$(".edit_user","#admin_form").live("click",function(){$(this).parent(".admin_override").find(":hidden").show().find("input.override").focus().change(function(){var c=$(this);if(c.val()=="yes"){c.parents("form").find(":input:disabled").removeAttr("disabled").end().find(".admin_override").empty();$("#save_close").removeAttr("disabled");$(".listOfTags span").each(function(){var b=$(this).find("u");b.replaceWith('<a class="removableTag" href="#">'+
b.text()+"</a>")})}})});$("#banned, #banned_reason","#admin_form").live("change",function(){$(this).parents("form").find("input[type=submit], #save_close").removeAttr("disabled")});$("a.admin_icon, a.admin_link").live("mouseenter",function(){var c=false;$(this).overlay({target:"#overlay",fixed:false,mask:{color:"#333333",loadSpeed:600,opacity:0.75,zIndex:"9997"},zIndex:"9998",onBeforeLoad:function(){var b=this.getOverlay().find(".formWrap");a=this.getTrigger().attr("href");b.load(a,function(){var e=
$("#admin_form");$("#close").show();$("#category").change(function(){var h=$(this).find("option:selected").val();$(':input[value="'+h+'"]').attr("checked","checked")});e.hasClass("user_upload")&&e.find(":input").not(".override").attr("disabled","disabled");e.submit(function(){var h=$(this).find(":input:not(#generate_form :input)").serialize();$.ajax({type:"POST",url:a,async:false,cache:false,data:h,error:function(){$("#message").html('<span class="error fr">Save error!</span>')},success:function(d){d=
$(d).find("#message").html();var f=d.length?'<span class="green fr">'+d+"</span>":'<span class="error fr">Save error. Please try again.</span>';$("#message").html(f);if(d!=null&&d.length==0)c=true}});return false})});$("#html5Player").removeAttr("controls");typeof $f()!="undefined"&&$f().stop().close()},onLoad:function(){var b=this;$("#save_close").live("click",function(){c||setTimeout(function(){b.close()},600)});$("#generate").click(function(e){var h=$("#generate_form").find(':input:not(:text[value=""])').serialize();
$this=$(this);$this.css("cursor","wait").attr("disabled","disabled");$.ajax({type:"GET",url:"/admin/refresh/autogenerate",dataType:"json",data:h,error:function(d,f,i){alert("Sorry, the form could not be submitted. "+f+": "+i);$this.css("cursor","default").removeAttr("disabled")},success:function(d){$this.css("cursor","default").removeAttr("disabled");d.title&&$("#title").val(d.title);d.description&&$("#description").val(d.description)}});e.preventDefault();return false})},onBeforeClose:function(){$("#html5Player").attr("controls",
"controls")}})});$("#status").live("change",function(){var c=$(this),b=c.children("option").filter(":selected");c.siblings("input[type=text]").hide();b.val()=="PAYABLE"&&$("#cash_amount").show().focus();b.val()=="UNPAYABLE"&&$("#c4p_reason").show().focus()});$('input[name="watermark_position"]',"#admin_form").live("change",function(){$(this).is(":checked")&&$("#reencode").attr("checked","checked")});$("#reencode").live("change",function(){$(this).is(":checked")||$('input[name="watermark_position"]:checked',
"#admin_form").removeAttr("checked")})}},star_rating:{init:function(a){$("input[type=radio].star").rating({callback:function(c){$.ajax({type:"POST",url:a+"/"+c/2,async:false,data:null})}})}},player_page:{init:function(){$("#locker_add_link, #locker_remove_link").live("click",function(){var a=$(this);$(this).parents("span:first").load(a.attr("href"));return false});$("button","#flag").click(function(){var a=$("#flag_reason").find("option:selected").val()+"&c="+escape($("#flag_comment").val());a=$(this).val()+
a;$.ajax({type:"POST",async:false,url:a,data:null,success:function(){$(".flaglink","#playerInfo").empty().html('Flagged!<span class="flagged"></span>').removeAttr("href");$("#flag").slideUp()}});return false});$('input[name="seekonstart"]',"#embed").change(function(){var a="&t="+$(this).val();$("#embed_code").text(function(c,b){return b.replace(/(id%3D\d*)(%26t%3D\d*)?/gi,"$1"+escape(a))})});$("#embed_code, #link_code").mouseup(function(){$(this).select()});$("#video_description").hide();$(".first a, .flaglink",
"#playerInfo").click(function(){var a=$(this).attr("href");$(a).slideToggle(function(){a=="#embed"&&$(a).is(":visible")&&$(a).children("textarea").select()});return false});$(".toggle","#ad_popup").click(function(){$("#ad_popup").stop(true).slideUp()});$("a","#share").click(function(a){switch($(this).attr("id")){case "twitter":window.open("http://twitter.com/share?url="+encodeURIComponent(window.location)+"&via=MadThumbsTube&related=realitykings:THE%20TOP%2028%20HD%20PORN%20SITES%20ON%20THE%20WEB!!!%206000%2B%20VIDEOS&text="+
escape(vid_title),"Twitter","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1,height=450,width=550");break;case "facebook":window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(window.location)+"&t="+escape(vid_title),"Facebook","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1,height=440,width=620");break;case "reddit":window.open("http://reddit.com/submit?url="+encodeURIComponent(window.location)+"&title="+escape(vid_title),
"Reddit","status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=1,height=740,width=860");break;default:break}return a.preventDefault()})}},flowplayer:{init:function(a,c,b,e,h,d){var f=location.hash.split("t=")[1],i=function(l){var m=g.getPlugin("thumb_scroll"),n=g.getControls(),o=g.getScreen();if(l){m.animate({opacity:1,top:"50pct"},500);n.enable({fullscreen:false});o.animate({opacity:0.3},500)}else{m.animate({opacity:0,top:"150pct"},500);n.enable({fullscreen:true});o.animate({opacity:1},
500)}},g=$f("thePlayer",{src:a,version:[9,115],expressInstall:null,wmode:"opaque",cachebusting:false},{onError:function(l,m){try{_gaq.push(["fp_tracker._trackEvent","Errors",l+m,g.getClip().url,g.getTime()])}catch(n){}},onBeforeLoad:function(){if(d){$("#thePlayer, #playerCont").css({height:"516px"});$("#pop_wrap").css({bottom:"40px"})}},onLoad:function(){if(d){g.getControls().animate({bottom:16},500,function(){b||$("#ad_popup").show().delay(4E3).slideUp(function(){$("#pop_wrap").remove()})});g.loadPlugin("deep_tags",
"http://cache.tgpsitecentral.com/madthumbs/js/flowplayer/plugins/flowplayer.deeptags-3.2.6-dev.swf",{duration:vid_duration,urlBase:"http://www.madthumbs.com",id:vid_id},function(){$("#thePlayer").append('<img src="http://cache.tgpsitecentral.com/madthumbs/images/deep_tags.png" class="deep_tag_logo" alt="DeepTags&trade;" title="DeepTags&trade; - Patent Pending"/>')})}},onBeforeFullscreen:function(){if(b)return false},onFullscreenExit:function(){i();g.isPaused()&&g.play();d&&g.getControls().animate({bottom:16},
500)},onBeforeResume:function(){if(b)return false},screen:{bottom:23},plugins:{thumb_scroll:{xmlPath:e,showRating:!b,url:"http://cache.tgpsitecentral.com/madthumbs/js/flowplayer/plugins/flowplayer.thumbscroller-3.2.5-dev.swf",opacity:0,top:"150%",left:0,zIndex:2},controls:{tooltips:{scrubberImage:h},autoHide:{enabled:false}}},clip:{url:c,duration:vid_duration,onBegin:function(){i()},onMetaData:function(l){l=l.metaData.keyframes.times||[];var m=Math.floor(vid_duration/l.length);if(m>2||l.length==0)try{_gaq.push(["fp_tracker._trackEvent",
"Keyframes",vid_id,m+" seconds apart"])}catch(n){}},onStart:function(){f&&g.seek(f);if(b){g.stop();this.getControls().hide()}},onPause:function(){i(1)},onBeforeSeek:function(){g.isPaused()&&g.resume()},onBeforeFinish:function(){g.isFullscreen()&&g.toggleFullscreen();i(1)},onResume:function(){i()},onStop:function(){i(1)}}});b&&$("#playerInfo").html('<p class="s bot"><br/>This video has been removed.</p><br/>')}},profile_page:{init:function(){var a=$.browser.msie&&$.browser.version==6,c=location.hash?
location.hash:"#recently_viewed_tab",b=$("#tabs").tabs({selected:null,cache:true,spinner:"Loading&hellip;",ajaxOptions:{cache:false,error:function(e,h,d,f){$(f.hash).html('<div class="cont"><p class="bodytext"><br/><span class="error">Error retrieving data. Please try refreshing the page.</span></p></div>')}},load:function(e,h){$(".pagination a",h.panel).live("click",function(){$(h.panel).load(this.href,function(){a||$(".scrub_box").one("mouseenter",function(){initScrubber($(this),{speed:400,numImages:50})})});
return false});$("#programs_form").submit(function(){return formSubmit($(this),$(this).attr("action"),function(){$("#programs_form .err").text("Changes saved").show()})})}}).bind({tabsload:function(e,h){$(h.panel).attr("id")=="programs"&&$("#clear_ads").change(function(){$(this).is(":checked")?$(this).parent("label").siblings("fieldset.sponsor").find("input[type=text]:not([name*=linkurl])").val(""):b.tabs("load",h.index)});a||$(".scrub_box").one("mouseenter",function(){initScrubber($(this),{speed:400,
numImages:50})})},tabsselect:function(e,h){if(String(location).match(/profile/i))location.hash=$(h.panel).attr("id")+"_tab"}});cashUser?b.tabs("select","cash4porn_tab"):b.tabs("select",c.split("_tab")[0]);String(location).match(/profile/i)&&$(".biglink a").not(":last").click(function(){var e=$(this).attr("href");$(this).addClass("active");c=e.substr(e.lastIndexOf("#"));b.tabs("select",c);b.tabs("load",b.tabs("option","selected"));return false});$("#resend").click(function(){$.post("/users/email_request/",
function(){$("#confirm_email").html("<p>Instructions for verifying your email address have been sent to "+email+".</p>")});return false});$("#profile_form").validate({errorPlacement:function(e){e.insertBefore($("input[type=submit]","#profile_form"))},rules:{email:{required:true,email:true},number:{required:true,phoneUS:true}},messages:{email:"Please enter a valid email address",number:"Please enter your mobile #"},submitHandler:function(e){formSubmit($(e),"/users/update",function(){})}});$(".formToggle",
"#member_box").click(function(){var e=$(this).attr("href");$("ul, input[type=submit]",e).slideToggle();return false});$('input[name="payment_method"]:first',"#payment_method").change(function(){$(this).is(":checked")&&$("#address_field").slideDown()}).triggerHandler("change");$("#tax_form").validate({errorPlacement:function(e,h){h.attr("name")=="certify"?e.insertBefore($("input[type=submit]","#tax_form")):e.insertAfter(h)},rules:{first_name:{required:true},last_name:{required:true},address:{required:true},
city:{required:true},tax_name:{required:true},payment_type:{required:true},certify:{required:true}},messages:{first_name:"Please enter your first name",last_name:"Please enter your last name",address:"Please enter your street address",city:"Please enter your city",state:"Select your state",tax_name:"Please enter the name of your business",certify:"You must certify that this information is correct"},submitHandler:function(e){var h=$(e);e=h.attr("action");formSubmit(h,e,function(){$('<span class="green block">Tax Info Updated</span>').appendTo(h).delay(2E3).slideUp()})}})}}};
jQuery.fn.swap=function(a){a=jQuery(a)[0];var c=this[0],b=c.parentNode.insertBefore(document.createTextNode(""),c);a.parentNode.insertBefore(c,a);b.parentNode.insertBefore(a,b);b.parentNode.removeChild(b);return this};jQuery.validator.addMethod("phoneUS",function(a,c){a=a.replace(/\s+/g,"");return this.optional(c)||a.length>9&&a.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/)},"Please specify a valid phone number.");
var validateAjaxForms=function(a){$("#forgot","#overlay_form").validate({rules:{email:{required:true,email:true}},messages:{email:"Please enter a valid email address"},submitHandler:function(c){formSubmit($(c),"/users/login",function(){location.reload()})}});$("#login_overlay","#overlay_form").validate({rules:{username:{required:true,minlength:1},password:{required:true,minlength:1}},messages:{username:{required:"Please enter a username",minlength:"Please enter a username"},password:{required:"Please provide a password",
minlength:"Please enter a username"}},submitHandler:function(c){formSubmit($(c),"/users/login",function(){var b=a.attr("href").split("?page=")[1];location.href=typeof b!="undefined"?"/"+b:String(location).split("?")[0].replace(location.hash,"")})}});$("#signup_overlay","#overlay_form").validate({ignore:".premium",rules:{username:{required:true},password:{required:true},email:{required:true,email:true}},messages:{username:{required:"Please enter a username"},password:{required:"Please provide a password"},
email:"Please enter a valid email address"},submitHandler:function(c){formSubmit($(c),"/users/register",function(){var b=a.attr("href").split("?page=")[1];location.href=typeof b!="undefined"?"/"+b:String(location).split("?")[0].replace(location.hash,"")})}})};
$(function(){function a(){$("iframe:not(#hd_iframe, #hd_videos)").each(function(){$(this).attr("src",function(d,f){return f})});++c>4&&window.clearInterval(b)}$.browser.msie&&$.browser.version==6||$(".scrub_box").one("mouseenter",function(){initScrubber($(this),{speed:400,numImages:50})});if(!readCookie("nonSocial")){$("#social_bookmark").show();$("a.close","#social_bookmark").click(function(){createCookie("nonSocial","nonSocial",0);$("#social_bookmark").animate({width:0},400,function(){$(this).remove()});
return false})}$("a","#category_list").click(function(){var d=$(this).parents(".category_click").attr("id");if(d!="")document.cookie="tag_click="+d+"; path=/; domain=madthumbs.com"});var c=0,b=window.setInterval(a,12E4);$("#anext, #aprev").click(function(){var d=$("#login_overlay"),f=$("#forgot");d.swap(f).toggle("slow",function(){$(this).find("input:first").focus()});f.toggle("slow",function(){$(this).find("input:first").focus()})});$("#searchButton").click(function(){var d=$("#sitesearch");$("#searchInput").val()!=
"Search MadThumbs"&&d.submit();return false});$("a.fakelink","#wrapTab, #user, #menu, #footer").click(function(){var d=$(this),f=d.attr("target"),i=d.attr("rev");d=d.attr("title").replace(/ /g,"_");if(f=="_top")location=i;else window.open(i,d);return false});$("a.login","#user, #comments, #locker_link, #recent, #member_box").overlay({close:".close",top:300,fixed:false,target:"#overlay_form",mask:{color:"#333333",loadSpeed:200,opacity:0.75,zIndex:"9997"},zIndex:"9998",onBeforeLoad:function(){$("#html5Player").removeAttr("controls");
typeof $f()!="undefined"&&$f().stop().close()},onLoad:function(){var d=this.getTrigger();$("#signup_overlay","#overlay_form").hide();$("#loginscroll","#overlay_form").show().find("input[type=text]:first").focus();validateAjaxForms(d)},onBeforeClose:function(){$("#html5Player").attr("controls","controls")}});$("a.signup","#user, #get_access, #comments").overlay({close:"#close",top:300,fixed:false,target:"#overlay_form",mask:{color:"#333333",loadSpeed:200,opacity:0.75,zIndex:"9997"},zIndex:"9998",onBeforeLoad:function(){$("#html5Player").removeAttr("controls");
typeof $f()!="undefined"&&$f().stop().close()},onLoad:function(){var d=this.getTrigger();$("#loginscroll","#overlay_form").hide();$("#signup_overlay","#overlay_form").show().find("input[type=text]:first").focus();validateAjaxForms(d)},onBeforeClose:function(){$("#html5Player").attr("controls","controls")}});$(".login_toggle","#overlay_form").click(function(){$("#signup_overlay, #loginscroll").toggle("slow",function(){$(this).find("input:first").focus()});return false});$("#register_link, #login_link").click(function(){$("#register, #login_form").slideToggle(function(){$(this).find("input:first").focus()});
return false});$("a.forgot","#login_form, #password_form").click(function(){$("#password_form, #login_form").slideToggle(function(){$(this).find("input:first").focus()});return false});$.formSubmit=formSubmit;$("#register").validate({rules:{username:{required:true,minlength:1},password:{required:true,minlength:1},email:{required:true,email:true}},messages:{username:{required:"Please enter a username",minlength:"Please enter a username"},password:{required:"Please provide a password",minlength:"Please provide a password"},
email:"Please enter a valid email address"},submitHandler:function(d){var f=$(d),i=f.attr("action");String(location).match(/cash/i)?d.submit(d.serialize()):formSubmit(f,i,function(){var g=String(location).split("?page=")[1];location.href=typeof g!="undefined"?"/"+g:String(location).split("?")[0].replace(location.hash,"")})}});$("#login_form").validate({rules:{username:{required:function(d){$(d).is(":visible")},minlength:1},password:{required:function(d){$(d).is(":visible")},minlength:1}},messages:{username:{required:"Please enter a username",
minlength:"Please enter a username"},password:{required:"Please provide a password",minlength:"Please enter a username"}},submitHandler:function(d){var f=$(d),i=f.attr("action");String(location).match(/cash/i)?d.submit(d.serialize()):formSubmit(f,i,function(){var g=String(location).split("?page=")[1];location.href=typeof g!="undefined"?"/"+g:String(location).split("?")[0].replace(location.hash,"")})}});$("#password_form").validate({rules:{email:{required:true,email:true}},messages:{email:"Please enter a valid email address"},
submitHandler:function(d){var f=$(d),i=f.attr("action");String(location).match(/cash/i)?d.submit():formSubmit(f,i,function(){var g=String(location).split("?page=")[1];location.href=typeof g!="undefined"?"/"+g:String(location).split("?")[0].replace(location.hash,"")})}});$("#terms_form").validate({errorPlacement:function(d,f){f.attr("name")=="agree"?d.insertBefore(f):d.insertAfter(f)},rules:{agree:{required:true},paypal:{required:true,email:true},paypal_confirm:{required:true,equalTo:"#paypal"},email:{required:true,
email:true}},messages:{agree:{required:"You must agree to the terms"},paypal:"Please enter a valid email address",paypal_confirm:{required:"Please re-enter your PayPal email",equalTo:"Email addresses must match"},email:"Please enter a valid email address"}});var e;$("#searchInput").blur(function(){setTimeout(function(){$("#suggestions").fadeOut(100)},250)}).keyup(function(d){var f=$("#autoSuggestionsList").children("li.chosen").find("a");clearTimeout(e);if(f.length)if(d.keyCode==13)location=f.attr("href");
[27,33,34,37,38,39,40,46].indexOf(d.keyCode)==-1&&lookup($(this).val())}).keydown(function(d){var f=$("#autoSuggestionsList");switch(d.keyCode){case 38:$("#autoSuggestionsList").children().length&&$("#suggestions").fadeIn(100);var i=function(){if(indx>0){f.children("li").eq(indx-=1).addClass("chosen").siblings().removeClass("chosen");$("#searchInput").val(f.children("li.chosen").find("a").text());e=setTimeout(i,150)}else{indx=-1;f.children("li:first").removeClass("chosen");$("#searchInput").val(lastSearch);
clearTimeout(e)}};i();break;case 40:$("#autoSuggestionsList").children().length&&$("#suggestions").fadeIn(100);var g=function(){if(indx<f.children().length-1){f.children("li").eq(indx+=1).addClass("chosen").siblings().removeClass("chosen");$("#searchInput").val(f.children("li.chosen").find("a").text());e=setTimeout(g,150)}};clearTimeout(e);g();break;case 27:$(this).blur();$("#suggestions").fadeOut(100);$("#autoSuggestionsList").empty();break;case 37:f.children("li").removeClass("chosen");$("#suggestions").fadeOut(100);
break;case 39:f.children("li").removeClass("chosen");$("#suggestions").fadeOut(100);break;case 8:f.children("li").removeClass("chosen");break;case 32:f.children("li").removeClass("chosen");break}});var h=$.fn.position;$.fn.position=function(){var d=h.call(this),f=d.top+this.outerHeight(),i=d.left+this.outerWidth(),g=arguments;return g.length?this.animate({top:g[0].top||g[0],left:g[0].left||g[1]},(g[0].top?g[1]:g[2])||1):$.extend(d,{bottom:f,right:i})}});var indx=-1,lastSearch="",failedSearch="";
function lookup(a){if(a.length<3)$("#suggestions").fadeOut(100);else{if(failedSearch.length>2)if(failedSearch==a.substr(0,failedSearch.length)){$("#suggestions").fadeOut(100);return}window.clearTimeout($.timeoutID);lastSearch=a;$.timeoutID=window.setTimeout(doSearch,250,a)}}
function doSearch(){inputString=lastSearch;$.post("index.php/suggest/",{ss:inputString},function(a){indx=-1;if(a.toString()=="false"){$("#suggestions").fadeOut(100);failedSearch=lastSearch}else if(a.length>0){$("#autoSuggestionsList").empty();var c;$.each(a,function(b){c=b%2?"odd":"even";if(typeof a[b]==="string")$("#autoSuggestionsList").append('<li class="'+c+'"><a title="'+a[b]+'" href="/categories/'+a[b]+'">'+a[b]+"</a></li>");else a[b].length>3?$("#autoSuggestionsList").append('<li class="'+
c+' model_result"><a title="'+a[b][2]+'" href="/pornstar/'+a[b][0]+"/"+a[b][3]+'">'+a[b][1]+'</a><span class="smaller fr">Pornstar</span></li>'):$("#autoSuggestionsList").append('<li class="'+c+'"><a title="'+a[b][2]+'" href="/search?q='+a[b][0]+'">'+a[b][1]+"</a></li>")});$("#suggestions").fadeIn(100)}else{$("#suggestions").fadeOut(100);failedSearch=inputString}},"json")}function fill(a){$("#searchInput").val(a)}
if(!Array.indexOf)Array.prototype.indexOf=function(a){for(var c=0;c<this.length;c++)if(this[c]==a)return c;return-1};
function formSubmit(a,c,b,e){var h=a.find(".err");if(!h.length){h=$("<p></p>").addClass("err");a.append(h)}h.hide();var d=a.serialize();$.ajax({type:"POST",url:c,async:false,data:d,cache:false,error:function(f,i,g){e&&typeof e=="function"?e.call():alert("Sorry, the form could not be submitted. "+i+": "+g)},success:function(f){if(f){h.html(f).show();setTimeout(function(){h.slideUp()},4E3);a.find("input.txt:first").focus()}else typeof b=="string"?h.html(b).show():b.call()}});return false}
function sec_to_min(a){var c=parseInt(a,10);a="";var b=Math.floor(c/3600);c%=3600;var e=Math.floor(c/60);c=Math.floor(c%60);if(b>0)a+=b+":";if(e<10)a+="0";a+=e+":";if(c<10)a+="0";a+=c;return a}
function initScrubber(a,c){c=c||{};var b=$(".scrub_thumb",a),e=b.parent("a"),h=b.attr("longdesc"),d=b.attr("src"),f=e.attr("rev")/c.numImages,i=$(".sprite_loader",a),g=$(".timewrap",a),l=$(".timebox",a),m=$(".arrow",a),n=$(".timeline",a),o=$(".timedot",n),y=true,s=false,t=0,p,v,w,u,k=0,A=function(){!s&&!i.is(":visible")&&i.fadeIn("fast").delay(1E3).fadeOut("fast")},C=function(j){t=Math.floor(f*k);v=(j.pageX-g.offset().left)/(g.width()/c.numImages);k=Math.round(v);if(k<1)k=1;p=(k-1)*117;e.attr("rel",
t);b.css("top","-"+p+"px");$("a",l).text(sec_to_min(f*v));j=Math.floor(j.pageX-g.offset().left);if(j<1)j=1;if(j>156)j=156;B(j)},B=function(j){$(".arrow, .timedot, .timebox",g).each(function(){var q=$(this),r=j-Math.floor(q.outerWidth()/2),z=g.outerWidth()-q.outerWidth();if(r<0)r=0;if(r>z)r=z;q.css("left",r+"px")})},D=function(){l.show();m.show();o.show();n.css("background","#f90");$(".thumb_container",a).css("border-color","#f90")},E=function(){l.hide();m.hide();o.hide();n.css("background","#333");
$(".thumb_container",a).css("border-color","#333")},F=function(){if(s){t=Math.floor(f*k);window.clearInterval(u);y=true;u=window.setInterval(function(){k+=5;if(k<1)k=0;if(k>49)k=0;p=k*117;e.attr("rel",t);b.css("top","-"+p+"px")},400)}},x=function(){w=window.setTimeout(A,400);b.attr("src",h).load(function(){i.clearQueue().fadeOut("fast");window.clearTimeout(w);s=true;a.unbind("mouseenter",x);b.mouseover(F).trigger("mouseover");g.bind({mouseover:function(){y=false;D();window.clearInterval(u)},mouseleave:E,
mousemove:C})}).each(function(){if($.browser.msie)if(this.complete||this.readyState===4){s=true;$(this).load()}})};a.hover(x,function(){b.unbind("load").css("top","0").attr("src",d);e.removeAttr("rel");i.clearQueue().fadeOut("fast");window.clearTimeout(w);window.clearInterval(u);a.mouseenter(x);k=p=0;g.unbind("mouseover, mouseleave, mousemove")}).mouseenter();$("a.fastlink",a).click(function(){$(this).attr("href",function(j,q){return q+"?#t="+e.attr("rel")})});$(".thumb_click",a).click(function(){var j=
$(this).parents(".thumbbox").attr("id");if(j!="")document.cookie="thumb_click="+j.split("thumb_")[1]+"; path=/; domain=madthumbs.com"})}function createCookie(a,c,b){if(b){var e=new Date;e.setTime(e.getTime()+b*24*60*60*1E3);b="; expires="+e.toGMTString()}else b="";document.cookie=a+"="+c+b+"; path=/"}
function readCookie(a){a=a+"=";for(var c=document.cookie.split(";"),b=0;b<c.length;b++){for(var e=c[b];e.charAt(0)===" ";)e=e.substring(1,e.length);if(e.indexOf(a)===0)return e.substring(a.length,e.length)}return null}function clicker(a){createCookie("warned","1",360);return true}
function is_network(){if(location.href.match(/#nowarn/))return true;if(document.referrer&&document.referrer.length>0){var a=document.referrer,c=[];c[0]=/sublime/;c[1]=/madt/;c[2]=/cowlist/;c[3]=/teeniefiles/;c[4]=/purextc/;c[5]=/88by88/;c[6]=/bigtits/;c[7]=/madteenies/;c[8]=/treasurethumbs/;c[9]=/youporn/;c[10]=/fling/;c[11]=/tube/;if(a.match(/google|yahoo|msn|ask\.com|aol|live|altvista|yandex|baidu|netscape|alltheweb|lycos|mamma/i))return false;var b;for(b=0;b<c.length;b++)if(a.match(c[b]))return true;
return true}return false};

