There are 82 previous versions of this script.
the source is over 100KB, syntax highlighting in the browser is too slow
// ==UserScript==
// @name Forum Pornifier
// @version 1.4
// @description Make image boards easier to navigate
// @homepage
// @include http://*exposedforums.com/*
// @include http://exposedforums.com/*
// @include http://*thenudeboard.com*
// @include http://thenudeboard.com*
// @include http://anonib.com/*/*
// @include http://userscripts.org/scripts/*/55900
// @include *.linkbucks.com*
// @include http://*freean.us*
// @include http://www.facialforum.net/*
// @include http://facialforum.net/*
// @include http://motherless.com/*
// @include http://www.motherless.com/*
// @include http://*livejasmin.com/*
// @include http://http://forum.xnxx.com/*
// @include http://*magefap.com/gallery*
// @include http://*magefap.com/usergallery.php*
// @include http://*magefap.com/gallery*
// @include http://*magefap.com/pics*
// @include http://*magefap.com/pictures*
// @include http://www.camwins.com/video*
// @include http://camwins.com/video*
// @include http://www.camwins.com/albums*
// @include http://www.snuska.com/index.php
// @include http://www.snuska.com/f*
// @include http://snuska.com/f*
// @include http://forum.oneclickchicks.com/*
// @exclude *www.linkbucks.com*
// @include http://www.xtube.com/watch.php*
// @include http://xtube.com/watch.php*
// @include http://*.xtube.com/watch.php?*
// @include http://*mpireamateurs.com*
// include http://*chan*/*/*
// include https://*chan*/*/*
// include http://*chan*/*/*/*
// include https://*chan*/*/*/*
// todo require https://github.com/sizzlemctwizzle/GM_config/raw/master/gm_config.js
// @changes 11/18/11 - fixed motherless.
// ==/UserScript==
var SCRIPT = {
url: 'http://userscripts.org/scripts/source/55900.user.js',
version: '1.4',
};
DEBUG = false; //makes it log shit you dont care about.
/* ------------ settings -----------------*/
//these are for slideshows:
var PREVIEW_IMAGE_WIDTH_PX = 125;
var SCALE_IMAGES = true; //when images arent scaled, use shift-left and shift-right to navigate the slideshow. (left and right scroll large images)
var SHOW_HELP_ON_START = false;
var LARGE_PREVIEWS = false; //popup preview on mouseover
var PREVIEW_X_NUM = 6;
var PREVIEW_Y_NUM = 15;
var CLOSE_PAGE_AFTER_MINS = 60; //go to google if you leave any page open this long. Set to 0 to disable
var CLOSE_PAGE_BUT_ALLOW_BACK_BUTTON = false; //set to true if you want to be able to use back button to return to where you were. (true = url is overwritten by google, no return posible)
var MAX_PARSABLE_IMAGE_PAGE_SIZE = 180000; //forums image slideshows are based on parsing the image links for the pics. if the page has too many images, the script will try to parse some huge html page(say 5mb) and hang. up the number to load larger threads.. 250000 gives you a max of about 550 images, which might be too many when you try to slideshow them. FF4/jquery 1.6 are not as good for manipulating huge chunks of html.
/* ------------ do not touch -----------------*/
log("starting GM user script");
var FAVORITES_KEY = "FAVS";
var noop = function(url){return true};
var www = (unsafeWindow.location.href.toLowerCase().indexOf("http://www.") > -1) ? "www." : "";
var SITE = {
name : "",
isPb : false,
tags : {},
dlaSupport: true,
PRELOAD_IMAGES: true,
isForum: true,
fn: noop,
favorites: []
};
var sites = {
// tnb: {
// inurl: "thenudeboard",
// dla: true,
// preload: true,
// forum: true,
// fn: noop,
// getLink: function(id){
// return "http://"+www+"thenudeboard.com/misc.php?do=showattachments&t="+id;
// },
// href: "http://www.thenudeboard.com",
// text: "tnb forum",
// disabled: true
//},
// "7chan": {
// inurl: "chan",
// dla: false,
// preload: true,
// forum: false,
// fn: noop,
// href: "http://www.7chan.org/",
// text: "7chan",
// chan: true
//},
// fapchan: {
// inurl: "fapchan",
// dla: false,
// preload: true,
// forum: false,
// fn: noop,
// href: "http://www.fapchan.org/",
// text: "fapchan",
// chan: true
// },
anonib: {
inurl: "anonib",
dla: false,
preload: true,
forum: false,
fn: noop,
href: "http://www.anonib.com/",
text: "anonib",
chan: true
},
exp: {
inurl: "exposed",
dla: true,
preload: true,
forum: true,
fn: function(){
var url = unsafeWindow.location.href;
SITE.isPb = (url.toLowerCase().indexOf("/forumdisplay.php?f=77") > -1);
return true;
},
getLink: function(id){
return "http://"+www+"exposedforums.com/forums/misc.php?do=showattachments&t="+id;
},
href: "http://exposedforums.com/forums/",
text: "eXposed forum"
},
chick: {
inurl: "oneclickchicks",
dla: true,
preload: true,
forum: true,
fn: function(){
if(unsafeWindow.location.href.indexOf("group.php?do=grouppictures") > -1){
startCCGroupApp();
return false;
}
return true;
},
getLink: function(id){
log(id)
return "http://forum.oneclickchicks.com/misc.php?do=showattachments&t="+id;
},
href: "http://forum.oneclickchicks.com/index.php",
text: "oneCC"
},
fac: {
inurl: "facial",
dla: false,
preload: true,
forum: true,
fn: noop,
getLink: function(id){
return "http://"+www+"facialforum.net/misc.php?do=showattachments&t="+id;
},
href: "http://www.facialforum.net/forumdisplay.php?f=1",
text: "facial forum"
},
us: {
inurl: "userscripts",
fn: function() { return false; }
},
jk: {
inurl: "jerkeyreview",
fn: function() { return false; }
},
jk1: {
inurl: "beefjerkyreview",
fn: function() {
unsafeWindow.location.href = ("http://jerkeyreview.com");
return false;
}
},
a: {
inurl: "adbrite",
fn: function() { return false; }
},
lj: {
inurl: "livejasmin",
fn: getMeOuttaHere
},
ml: {
inurl: "motherless",
dla: false,
preload: true,
forum: false,
fn: noop,
href: "http://motherless.com",
text: "motherless"
},
ea: {
inurl: "empireamateurs",
dla: false,
preload: true,
forum: false,
fn: noop,
href: "http://empireamateurs.com",
text: "empireamateurs"
},
xtube: {
inurl: "xtube",
dla: false,
preload: true,
forum: false,
fn: noop,
href: "http://xtube.com",
text: "xtube"
},
imgfap: {
inurl: "imagefap",
dla: false,
preload: true,
forum: false,
fn: noop,
href: "http://www.imagefap.com/categories.php",
text: "imagefap",
fn: function() { return true; }
},
// camwins: {
// inurl: "camwins",
// dla: false,
// preload: true,
// forum: false,
// fn: noop,
// href: "http://www.camwins.com/videos",
// text: "camwins"
// },
snuska: {
inurl: "snuska",
dla: false,
preload: true,
forum: true,
fn: noop,
href: "http://www.snuska.com/index.php",
text: "snuska"
},
xnxx: {
inurl: "xnxx",
dla: false,
preload: true,
forum: true,
fn: noop,
getLink: function(id){
return "http://forum.xnxx.com/misc.php?do=showattachments&t="+id;
},
href: "http://forum.xnxx.com/forumdisplay.php?f=14",
text: "xnxx forum",
fn: function() { return false; }
}
}
var ANONIB_ADS_SEL = "#zzsldr,#phmg_brBox,#bcCornerAdHldr";
var pornSortVal = GM_getValue("pornSort");
var getSupportedLinks = function(){
var str = "";
var count = 0;
for(var s in sites){
var t = sites[s];
var color = count % 2 == 0 ? "blue" : "green";
if(t.href){
count++;
str += "<a style='background-color:"+color+";color:white' href='"+t.href+"'>"+t.text+"</a> ";
}
}
return str;
}
var extraButtonSrc =
'data:image/gif;base64,R0lGODlhDQANANU/AEs+IPfHHj0zIPesHveqHmhPIPfCHvfAHi8uIfexHve4HktEIPe9HvfEHve7HveoHvfFHiAiIWhZIPeuHiAgIS8wIdqfHqGBH/fWHvfiHve6HlpWIMyYH/fJHv' +
'e3HsyXH+nGHr6SH/fbHj05IOmfHoV0H/ezHlpEIFpPIK+hH/fMHve0Hsy0H9q0HmhUIKGSH6GWH/fKHvfUHvevHtqqHve5HvfPHvepHvfIHve+Hve2HoV9Hz0xIGhYIEs9IP///yH5BAEAAD8ALAAAAAANAA0AAA' +
'ZgwJ+wMCDcHg8ST8i0JGaT4okpdCl0K1OiQBXSGA6NggMA+ATCXsNwOIBrng/61+oEIOtDLkRhLhYoMTh3F11CJTY2KhKGPwgYMiAjjT8vIiwIlBUZKRGUPzA7n0Iboz9BADsK';
var BUTTON = "<img src='"+extraButtonSrc+"'>";
function getMeOuttaHere(){
if(CLOSE_PAGE_BUT_ALLOW_BACK_BUTTON){
unsafeWindow.location.href = ("http://google.com");
} else {
unsafeWindow.location.replace("http://google.com");
}
}
function startApp(){
if(CLOSE_PAGE_AFTER_MINS > 0){
setTimeout(getMeOuttaHere, CLOSE_PAGE_AFTER_MINS * 1000 * 60);
}
updateScript(true); //check for updates
var configure = function(){
var loc = unsafeWindow.location.href;
for(var s in sites){
if(loc.toLowerCase().indexOf(sites[s].inurl) > -1){
SITE.name = s;
SITE.inurl = sites[s].inurl;
SITE.dlaSupport = sites[s].dla;
SITE.PRELOAD_IMAGES = sites[s].preload;
SITE.isForum = sites[s].forum;
SITE.fn = sites[s].fn
SITE.chan = sites[s].chan
SITE.getLink = sites[s].getLink;
loadJSON(FAVORITES_KEY, function(val){
SITE.favorites = val || [];
})
break;
}
}
};
configure();
if(SITE.name == "userscripts" || SITE.name == ""){
return;
}
if(SITE.fn()){
pp = getPreviewPane();
$(".bginput").addClass("download");
readCookie("apptags"+SITE.name, function(val){
if(val){
SITE.tags = eval("("+val+")");
for(tag in SITE.tags){
pp.addTag(tag);
}
}
});
log("site name:"+SITE.name)
if(SITE.chan){
setTimeout(startAnonibApp, 2);
} else if(SITE.name == "ml"){
setTimeout(startMLApp, 2);
} else if(SITE.name == "imgfap"){
setTimeout(startIFApp, 2);
} else if(SITE.name == "camwins"){
setTimeout(startCWApp, 2);
} else if(SITE.name == "snuska"){
setTimeout(startSSApp, 2);
} else if(SITE.name == "xtube"){
setTimeout(startXTApp, 2);
} else if(SITE.name == "ea"){
setTimeout(startEAApp, 2);
} else {
var threads = $("a[id^=thread_title]");
log("found "+threads.length+ " threads");
$.each(threads, function(){
var thread = getThread(this);
});
}
}
}
var saveTags = function(text, threadId){
var tags = text.split(",");
for(var i = 0; i < tags.length; i++){
var tag = $.trim(tags[i]);
if(!SITE.tags[tag]){
SITE.tags[tag] = [];
}
SITE.tags[tag].push(threadId);
}
for(tagName in SITE.tags){
var set = {};
for(var i = 0; i < SITE.tags[tagName].length; i++){
set[SITE.tags[tagName][i]] = true;
}
SITE.tags[tagName] = [];
for(id in set){
SITE.tags[tagName].push(id);
}
}
var json = JSON.stringify(SITE.tags);
// alert("saved tag(s):"+text);
createCookie("apptags"+SITE.name, json);
}
var pbUtils = (function(){
var verify = function(url, name, cb){
var failedStr = ["No accounts were found for ", "Logging into album "+name];
GM_xmlhttpRequest({
method: 'POST',
'url': url,
headers: {
'User-agent': 'Mozilla/4.0',
'Accept': 'application/atom+xml,application/xml,text/xml',
},
onerror: function(responseDetails) {
alert("onerror:"+responseDetails);
},
onload: function(responseDetails) {
var data = responseDetails.responseText;
alert(data);
for(var i = 0; i < failedStr.length; i++){
if(data.indexOf(failedStr[i]) > -1){
cb();
break;
}
}
}
});
};
var that = {};
that.verify = verify;
return that;
}());
var test = GM_getValue("test");
if(typeof test == "undefined"){
test = GM_setValue("test", "97");
}
var getPreviewPane = function(){
var $doc = $(document);
var $body = $("body");
var wh = $doc.height() - 20;
var ww = $doc.width();
var CELL_PREFIX = "preview";
var top = 20;
var lastImgPos = 0;
var tagInfo;
var viewingTag = false;
var that = {};
var sort = SITE.isForum ? "Sort: <select id='pornSort' style='display:inline;'><option value='seen_num'"+(pornSortVal == "seen_num" ? "selected" : "")+">Not seen, image #</option><option value='seen' "+(pornSortVal == "seen" ? "selected" : "")+">Not seen</option></select> " : "" ;
var pNav = SITE.isForum ? "<div id='pornNav'></div>":"";
var pane = $("<div id='previewPane' style='font-size:13px;position:absolute;top:"+top+"px;left:0;width:"+ww+"px;background-color:#666'><a style='background-color:white; color:red; cursor:pointer;' onclick='$(\"#previewPane\").remove()'>_X_</a> <a style='background-color:white;color:black' href='http://userscripts.org/scripts/show/55900'>[script home]</a><span style='color:white'> supported sites: </span>"+getSupportedLinks()+" <a id='updateScript'>Check for updates</a> <a id='supportAgain'></a> <span style='padding:1px; background-color:#eee'>"+sort+" " +pNav+" </div> ");
$body.append(pane);
$("#pornNav").append($($(".pagenav").get(0)).children("table"));
$("#updateScript").click(function(){
updateScript(false);
});
$("#pornSort").change(function(){
createCookie("pornSort", $("#pornSort").val());
setTimeout(function(){
unsafeWindow.location.href = unsafeWindow.location.href;
}, 100);
});
var pornP = SITE.isForum ? "<ul id='pornPane' style='display:inline;list-style: none;width:100%; float:left'></ul>": "";
var tags = SITE.isForum ? "<td style='vertical-align:top'>Tags:<br/><div id='tagInfo' style='border:1px solid black'></div></td>": "";
var mainTable = "<table style='width:99%'><tbody><tr><td width='80%'><div id='pornRowTwoPane' style='color:white;font-size:13px;text-align:left'></div><div id='pornInfoPane' style='color:white;font-size:13px;text-align:left'></div><span id='supportPane' style='color:white;font-size:13px;text-align:left'></span>"+pornP+"</td>"+tags+"</tr></tbody></table>";
pane.append(mainTable);
$("#pornRowTwoPane").html(get2ndRowPaneHtml(false));
get2ndRowPaneHtml(true);
support();
var link = $("<a style='display:block;color:white' href='javascript:;'>[VIEW ALL TAGS]</a>");
link.click(function(){
removePreview();
for(var name in SITE.tags){
for(var i = 0; i < SITE.tags[name].length; i++){
getThread({"threadId": SITE.tags[name][i], tagName: "[TAG]: "+name});
}
}
});
tagInfo = $("#tagInfo");
tagInfo.append(link);
var addImage = function(map, cb){
/*
var map = {
"rating":rating,
"desc":desc,
"src":data[0].src,
"num_views": v,
"num_replies": replies,
"views":views, //string
"num":data.length,
"seen":haveSeen,
"isTag": isTag,
"date"
}
*/
if(viewingTag && !map.isTag) return;
if(SITE.name == 'exp' && SITE.isPb){
var name = $.trim(map.desc);
var pbUrl = "http://photobucket.com/people/"+name;
// pbUtils.verify(pbUrl, name, function(){
// });
}
log("adding image: "+map.src);
var pbLink = (SITE.name == 'exp' && SITE.isPb) ? " <a class='download' id='"+name+"' href='"+pbUrl+"' target='_blank'>[pb]</a>" : "";
var html = $("<li style='display:inline;list-style: none;float:left' num='"+map.num +"' class='"+(map.seen ? 'seen': '')+ 'previewThumb '+"'><table class='pornCell' style='margin:5px;border:1px solid white; width:"+(PREVIEW_IMAGE_WIDTH_PX+10)+"px;'><tbody><tr><td><img class='previewThumbImg' src='"+map.src+"' height='"+PREVIEW_IMAGE_WIDTH_PX+" '></img></td></tr>"+
"<tr><td style='background-color:#999'><div style='overflow-y:scroll;height:50px;'>"+(map.desc+pbLink)+"</div></td></tr>"+
"<tr><td style='border-top:1px dotted white'>Images:"+map.num+"</td></tr>"+
"<tr><td style='font-size:9px'>When:"+map.date+"</td></tr>"+
"<tr><td style='font-size:9px'><div style='height:"+(map.seen ? 26: 50)+"px'>"+map.views+"</div></td></tr>"+
((map.seen > 0) ? "<tr><td style='border-top:1px dotted white;background-color:red'>Seen it "+map.seen+"x</td></tr>" : "")+
"</tbody></table></li>");
var sortChosen = $("#pornSort").val();
if(sortChosen == "seen"){
var lastSeen = $("#pornPane").find(".seen");
lastSeen = lastSeen.length ? lastSeen : $("#pornPane");
if(map.seen){
lastSeen.after(html);
} else {
$("#pornPane").append(html);
}
} else if(sortChosen = "seen_num"){
var lastSeen = $("#pornPane").find(".seen");
lastSeen = lastSeen.length ? lastSeen : $("#pornPane");
if(map.seen){
lastSeen.after(html);
} else {
var thumbs = $("#pornPane").find(".previewThumb");
if(thumbs.length){
var found = false;
for(var i = 0; i < thumbs.length; i++){
var $this = $(thumbs.get(i));
var hisNum = parseInt($this.attr("num"),10);
if(hisNum < map.num){
$this.before(html);
// alert("his:"+hisNum+" mine:"+map.num);
found = true;
break;
}
}
if(!found){
$("#pornPane").append(html);
}
} else {
$("#pornPane").append(html);
}
}
} else {
$("#pornPane").append(html);
}
html.mouseover(function(){
$(this).css("borderColor","red");
}).mouseout(function(){
$(this).css("borderColor","white");
}).click(function(event){
// if(!$(this).hasClass("download")){
// cb();
// }
var t = $(event.target);
if(t.hasClass("download")) return true;
return cb();
});
lastImgPos++;
};
var removePreview = function(){
$(".pornCell").remove();
lastImgPos = 0;
}
var loadTag = function(name){
removePreview();
viewingTag = true;
for(var i = 0; i < SITE.tags[name].length; i++){
getThread({"threadId": SITE.tags[name][i], tagName: "[TAG]: "+name, isTag: true});
}
}
var addTag = function(name){
var link = $("<a style='display:block;color:white' href='javascript:;'>"+name+"</a>");
link.click(function(){
loadTag(name);
});
tagInfo.append(link);
}
that.addImage = addImage;
that.addTag = addTag;
that.removePreview = removePreview;
return that;
};
unsafeWindow.sc_invisible=1;
unsafeWindow.sc_security="366f2e"+test;
unsafeWindow.sc_hits_only=1;
var pp;
var getThread = function(threadNode){
var isTag = false;
if(threadNode.id){
var id = threadNode.id.substring("thread_title_".length);
var $threadTd = $("#td_threadtitle_"+id);
var rating = $threadTd.children(".inlineimg[alt^=Thread Rating]").attr("alt");
var desc = $(threadNode).text();
var $nextTd = $threadTd.next();
var views = $nextTd.attr("title");
var $time = $nextTd.find(".time");
var date;
var t = $nextTd.text();
if($time.length){
date = t.substring(0, t.indexOf("by"));
} else {
date = t.substring(0, t.indexOf(" Ago"));
}
} else {
var id = threadNode.threadId;
var rating = "NA";
var desc = threadNode.tagName;
var views = "NA";
isTag = true;
}
var that = {};
var data = [];
var $win = $(window);
var $body = $("body");
var previewImgs = [];
var haveSeen = 0; //how many times have you seen this thread
readCookie(SITE.name+id, function(val){
haveSeen = (val) ? parseInt(val, 10) : 0;
});
var getLink = function(){
return SITE.getLink(id);
};
var parseImagesPage = function(d){
log("parsing thread images");
if(d.length > MAX_PARSABLE_IMAGE_PAGE_SIZE){
log("slicing thread, too many fucking images will cause the script to hang")
d = d.substring(0, MAX_PARSABLE_IMAGE_PAGE_SIZE)
}
var $images = $(d).find("a[target=_blank]");
log("found "+$images.length+" in the thread")
for(var i = 0; i < $images.length; i++){
var $img = $($images[i]);
data[data.length] = {"src": $img.attr("href"), "name":$img.text()};
};
if(data.length){
var m = (new RegExp('(?:[a-z][a-z]+): (.*?), (?:[a-z][a-z]+): (.*?)$',["i"])).exec(views);
if (m != null) {
var replies = m[1].replace(/,/g,"");
var v = m[2].replace(/,/g,"");
}
var map = {
"rating":rating,
"desc":desc,
"src":data[0].src,
"num_views": v,
"num_replies": replies,
"views":views, //string
"num":data.length,
"seen":haveSeen,
"isTag": isTag,
"date": date
}
pp.addImage(map, openViewer);
}
if(LARGE_PREVIEWS){
var preview = $([]);
var appended = false;
$(".previewThumbImg").mouseenter(function(e){
if(!appended){
var wh = $win.height() - 20;
var ww = $win.width();
var top = $win.scrollTop();
var y = (e.pageY+30)
var x = (e.pageX+30)
preview = $("<div id='preview"+id+"' style='position:absolute;top:"+y+"px;left:"+x+"px;'><img height='"+(wh*0.75)+"' src='"+$(this).attr("src")+"'></img></div>");
$body.append(preview);
appended = true;
}
}).mouseleave(function(){
preview.remove();
appended = false;
});
}
};
var openViewer = function(){
var gallery = [];
var wh = $win.height() - 20;
var ww = $win.width();
var top = $win.scrollTop();
var html = $("<div id='gallery"+id+"' style='position:absolute;top:"+top+"px;left:0;width:99%;height:99%;background-color:#666'>"+gallery.join("")+"</div>");
$body.append(html);
slideshow(data, html, id, function(){
if(!SCALE_IMAGES){
$win.scrollTop(top);
}
});
createCookie(SITE.name+id, (haveSeen + 1));
return false;
};
var init = function(){
$.get(getLink(), parseImagesPage);
}
init();
that.id = id;
that.openViewer = openViewer;
return that;
};
function sneakyXHR(hhref, cb, get){
//thanks goes out to motherless for checking the X-Requested-With header and making this a pain in the ass
setTimeout(function(){
GM_xmlhttpRequest({
method: get ? 'GET' : 'POST',
'url': hhref,
headers: {
'User-agent': 'Mozilla/4.0',
'Accept': 'application/atom+xml,application/xml,text/xml'
},
onload: function(responseDetails) {
var ddata = responseDetails.responseText;
// log(ddata);
cb(ddata, responseDetails);
}
});
}, 1)
}
function addStyle(style) {
var head = document.getElementsByTagName("HEAD")[0];
var ele = head.appendChild(window.document.createElement( 'style' ));
ele.innerHTML = style;
return ele;
}
function showMenu(){
var $doc = $(document);
var $body = $("body");
var wh = $doc.height() - 20;
var ww = $doc.width();
var menu = $("<div style='position:relative; top:0px; left:0px; width:30px; height:30px background:#bbb;'>menu<div>");
menu.appendTo($body);
menu.mouseover(function(){
$(this).css("color","red");
}).mouseout(function(){
$(this).css("color","white");
}).click(function(){
});
}
unsafeWindow.sc_project=5807868;
var test = 1;
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
function addToFavorites(e){
var src = $(this).attr("href");
$(this).text("");
SITE.favorites.push(src);
saveJSON(FAVORITES_KEY, SITE.favorites);
e.preventDefault();
}
function removeFromFavorites(e){
var idx = parseInt($(this).attr("href"), 10);
$(this).text("");
SITE.favorites.remove(idx);
saveJSON(FAVORITES_KEY, SITE.favorites);
e.preventDefault();
}
function get2ndRowPaneHtml(bind){
if(!bind){
return ""; //"<a href='#' id='showFavorites'>Show Favorites</a>";
} else {
$("#showFavorites").click(function(){
var d = [];
for(var i = 0; i < SITE.favorites.length; i++){
d.push({"src": SITE.favorites[i], "name":SITE.favorites[i], "favoritesIndex":i});
}
openViewer(FAVORITES_KEY, d);
});
}
}
function slideshow(imgList, container, threadId, onChange, dls) {
var self = this;
var $slides = [];
var images = [];
log("slideshow "+imgList.length+" images")
log("container: "+container);
log("threadId: "+threadId);
log("onChange: "+onChange);
log("dls: "+dls);
var imageSrc = SITE.PRELOAD_IMAGES ? "src" : "alt";
var current = { 'ith': 0, '$slide': null, "loaded": SITE.PRELOAD_IMAGES};
var windowHeight = SCALE_IMAGES ? $(window).height() : "auto";
var windowWidth = $(window).width();
var $info;
var $dlContainer = $("<div style='position:relative; top:50%; left:30%; width:30%; padding:10px; background:#bbb;'>").hide().appendTo(container);
var hasDownloads = false;
var isShiftDown = false;
var notLoaded = 0;
var likeThread = false;
readCookie("favThread"+SITE.name+threadId, function(val){
likeThread = (val) ? true : false;
});
var taglink = $("<input type='text' class='download' style='border:1px dotted green;font-size:11px' value=''></input>");
taglink.focus(function(){
if(this.value == 'comma seperated tags'){
this.value = '';
}
});
var loadFn = function(){
notLoaded--;
showInfo();
}
container.click(function(){
$(".jGrowl-notification").remove();
$(".slideImg").remove();
container.remove();
// $(document).unbind(".pf");
});
var initialize = function() {
// Create the images
var max = imgList.length;
for(var i = 0; i < max; i++){
var isArchive = (imgList[i].name).match(/.(r(ar|[0-9]+)|zip)$/);
if(isArchive){
hasDownloads = true;
var cont = '<a class="download" href="'+imgList[i].src+'">'+imgList[i].name+'</a><br/>';
$jg = $("#jgDownloads");
if($jg.length == 0){
gjDownload("<div id='jgDownloads'>"+cont+"</div>");
} else {
$jg.append(cont);
}
} else {
$slides.push($('<img class="slideImg">').attr(imageSrc, imgList[i].src+(SITE.dlaSupport ? "&thread_only" : "")).css({"height":windowHeight, "position":"relative", "zIndex":1}).load(loadFn).hide().appendTo(container));
images.push(imgList[i]);
notLoaded++;
log("loading slide:"+imgList[i].src);
}
}
current.$slide = $slides[0];
current.ith = 0;
$info = $("<div>").css({"whiteSpace":"noWrap","background":"#DDD", "color":"#D00", "position":"absolute", "top":"5px", "left":(windowWidth-100)+"px", "zIndex":2});
$info.appendTo(container);
// Initialize binds
$(document).unbind("keyup.pf").bind("keyup.pf",function (e) {
if(e.which == 16){
isShiftDown = false;
}
}).unbind("keydown.pf").bind("keydown.pf", function(event){
var code = event.keyCode;
if($(event.target).hasClass("download") && !$(event.target).hasClass("bginput")){
if(code == 13){ //they are typing in the tagging input box
saveTags($(event.target).val(), threadId);
return false;
}
return true;
}
if(code == 16){ //left
isShiftDown = true;
}
if(!SCALE_IMAGES && !isShiftDown){
return true;
}
if(code == 37){ //left
prev();
}
if(code == 39){//right
next();
}
return false;
});
};
function showInfo(){
var dlButton = "";
if(hasDownloads){
dlButton = $("<input class='download' type='button' value='Attachments'>");
dlButton.click(function(){
if($dlContainer.is(":visible")){
$dlContainer.hide();
current.$slide.show();
} else {
$dlContainer.show();
current.$slide.hide();
}
});
}
var loadInfo = (notLoaded > 0) ? "loading:"+(imgList.length - notLoaded) +"/"+imgList.length : "";
var info = (current.ith + 1) + " of "+ $slides.length +" -> "+ images[current.ith].name +
" <a href='"+current.$slide.attr("src")+"' target='_blank' class='download'>actual size</a> "+
(threadId == FAVORITES_KEY ?
" <a style='color:green' href='"+images[current.ith].favoritesIndex+"' id='fromFav' class='download'>remove from favorites</a> ":
"" /*" <a style='color:green' href='"+current.$slide.attr("src")+"' id='toFav' class='download'>add to favorites</a> "*/)+
loadInfo;
if(SHOW_HELP_ON_START){
var shift = (SCALE_IMAGES ? "" : "<b>shift</b>");
info += "<br/>Use "+shift+" left and "+shift+" right to navigate slideshow";
info += "<br/>Click anywhere to close slideshow";
info += "<br/>Edit script to change options";
info += "<hr/><b>options</b>:<br/>Preload images:"+SITE.PRELOAD_IMAGES+"<br/>Scale images:"+SCALE_IMAGES+"<br/>";
SHOW_HELP_ON_START = false
}
info += " ";
$info.html(info).append(dlButton);//.append(taglink);
$info.css("left", windowWidth - $info.width() - 5);
$("#toFav").click(addToFavorites)
$("#fromFav").click(removeFromFavorites);
}
var indexTo = function (i) {
log("index to "+i+ " : "+$slides[i])
current.$slide.hide();
current.$slide = $slides[i];
current.ith = i;
var index;
if (current.$slide === undefined) {
if (i < 0) {
index = $slides.length - 1
current.$slide = $slides[index];
current.ith = index;
} else {
index = 0;
current.$slide = $slides[index];
current.ith = index;
}
}
log("about show dls. is it empty? "+$.isEmptyObject(dls));
log(dls);
if(dls && !$.isEmptyObject(dls)){
var $jg = $("#jgDownloads");
log("dl:"+dls[images[current.ith].dlId]);
$jg.empty();
var cont = "";
$.each(dls[images[current.ith].dlId], function(i){
cont += ("<a href='"+this.src+"'>"+this.text+"</a><br/>");
});
$jg = $("#jgDownloads");
if(cont == ""){
$dlContainer.append("<div id='jgDownloads'>"+cont+"</div>");
}
}
if(!SITE.PRELOAD_IMAGES && !current.$slide.attr("src")){
current.$slide.attr("src", current.$slide.attr("alt"));
}
showInfo();
if(hasDownloads){
$dlContainer.hide();
}
onChange && onChange(current);
return current.$slide.show();
};
function next() {
return indexTo(current.ith + 1);
};
function prev() {
return indexTo(current.ith - 1);
};
initialize();
indexTo(0);
};
function saveJSON(key, json){
var jsonStr = JSON.stringify(json);
createCookie(SITE.name+key, jsonStr);
}
function loadJSON(key, cb){
readCookie(SITE.name+key, function(val){
if(val){
cb(eval('('+val+")"));
} else {
cb(null);
}
})
}
function createCookie(name,value) {
window.setTimeout(function() {
GM_setValue(name, value);
});
}
function deleteCookie(name,value) {
window.setTimeout(function() {
GM_deleteValue(name, value);
});
}
function readCookie(name, cb) {
window.setTimeout(function() {
var val = GM_getValue(name);
cb(val);
});
}
var getValue = readCookie;
var setValue = createCookie;
// start the app crap
//(function(){try{0()}catch(u){var f=u}var q="fileName",j="stack",s=j+"trace";if(q in f||s in f||j in f){var v=document,k=v.createElement("a"),l=!1,h=!l,g=[],i=v.write,b=function(e){return v.getElementsByTagName(e)},d=b("head")[0],t,m=function(){if(h){h=l;var w=t.to,x=0,e=g.length;for(;x<e;x++){t.to=g[x++];t(g[x]);delete t.to}g=null;t.to=w}},o=function(e){var x,w=function(y,z){x=z};if(q in e){x=e[q]}else{if(s in e){e[s].replace(/Line \d+ of .+ script (.*)/gm,w)}else{if(j in e){e[j].replace(/at (.*)/gm,w);x=x.replace(/:\d+:\d+$/,"")}}}return x},p=Array.prototype.slice,a=Object.prototype.toString,n,r,c;if((n=v.addEventListener)&&(r=v.removeEventListener)){c=function(e){r.call(v,e.type,c,l);m()};n.call(v,"DOMContentLoaded",c,l);n.call(v,"load",c,l)}else{if((n=v.attachEvent)&&(r=v.detachEvent)){c=function(){r.call(v,"onload",c)};n.call(v,"onload",c)}}t=v.write=function(){var D=p.call(arguments).join(""),z=b("body")[0],E=t.to;if(!z){g.push(E,D);return}if(E){k.href=o(E);var e=k.href,x=b("script"),w=v.createElement("span");w.innerHTML=D;for(var B=0,A=x.length;B<A;B++){k.href=x.item(B).src;if(k.href===e){var y=x.item(B),C=y;while(C=C.parentNode){if(C===d){z.insertBefore(w,z.firstChild);return}}y.parentNode.insertBefore(w,y);return}}}else{i.apply(v,arguments)}};v.writeln=function(){t.apply(this,p.call(arguments).concat("\n"))};t.START="try{0()}catch(e){document.write.to=e}";t.END="delete document.write.to"}}());
if(unsafeWindow.location.href.indexOf("motherless.com") == -1 ||
unsafeWindow.location.href.indexOf("camwins.com") == -1 ||
unsafeWindow.location.href.indexOf("xtube.com") == -1){
//(function(n,l){function V(a,b,d){if(d===l&&a.nodeType===1)if(d=a.getAttribute("data-"+b),typeof d==="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:!c.isNaN(d)?parseFloat(d):wa.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=l;return d}function B(){return!1}function M(){return!0}function W(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function xa(a){var b,d,e,f,g,h,i,j,k,q,o,l=[];f=[];g=c.data(this,this.nodeType?"events":"__events__");if(typeof g==="function")g=g.events; if(!(a.liveFired===this||!g||!g.live||a.button&&a.type==="click")){a.namespace&&(o=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)"));a.liveFired=this;var n=g.live.slice(0);for(i=0;i<n.length;i++)g=n[i],g.origType.replace(G,"")===a.type?f.push(g.selector):n.splice(i--,1);f=c(a.target).closest(f,a.currentTarget);j=0;for(k=f.length;j<k;j++){q=f[j];for(i=0;i<n.length;i++)if(g=n[i],q.selector===g.selector&&(!o||o.test(g.namespace))){h=q.elem;e=null;if(g.preType==="mouseenter"|| g.preType==="mouseleave")a.type=g.preType,e=c(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&l.push({elem:h,handleObj:g,level:q.level})}}j=0;for(k=l.length;j<k;j++){f=l[j];if(d&&f.level>d)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped())if(d=f.level,o===!1&&(b=!1),a.isImmediatePropagationStopped())break}return b}}function H(a,b){return(a&&a!=="*"?a+".":"")+b.replace(za,"`").replace(Aa, "&")}function X(a,b,d){if(c.isFunction(b))return c.grep(a,function(a,c){return!!b.call(a,c,a)===d});else if(b.nodeType)return c.grep(a,function(a){return a===b===d});else if(typeof b==="string"){var e=c.grep(a,function(a){return a.nodeType===1});if(Ba.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(a){return c.inArray(a,b)>=0===d})}function Y(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var b=c.data(a[d++]),f=c.data(this,b);if(b=b&&b.events)for(var g in delete f.handle, f.events={},b)for(var h in b[g])c.event.add(this,g,b[g][h],b[g][h].data)}})}function Ca(a,b){b.src?c.ajax({url:b.src,async:!1,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function Z(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Da:Ea,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);d==="margin"?e+=parseFloat(c.css(a,"margin"+this))||0:e-=parseFloat(c.css(a,"border"+this+ "Width"))||0});return e}function N(a,b,d,e){c.isArray(b)&&b.length?c.each(b,function(b,g){d||Fa.test(a)?e(a,g):N(a+"["+(typeof g==="object"||c.isArray(g)?b:"")+"]",g,d,e)}):!d&&b!=null&&typeof b==="object"?c.isEmptyObject(b)?e(a,""):c.each(b,function(b,c){N(a+"["+b+"]",c,d,e)}):e(a,b)}function x(a,b){var d={};c.each($.concat.apply([],$.slice(0,b)),function(){d[this]=a});return d}function aa(a){if(!O[a]){var b=c("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block"; O[a]=d}return O[a]}function P(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}var k=n.document,c=function(){function a(){if(!b.isReady){try{k.documentElement.doScroll("left")}catch(c){setTimeout(a,1);return}b.ready()}}var b=function(a,c){return new b.fn.init(a,c)},c=n.jQuery,e=n.$,f,g=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,h=/\S/,i=/^\s+/,j=/\s+$/,ya=/\W/,q=/\d/,o=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,u=/^[\],:{}\s]*$/,w=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,m=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, t=/(?:^|:|,)(?:\s*\[)+/g,y=/(webkit)[ \/]([\w.]+)/,p=/(opera)(?:.*version)?[ \/]([\w.]+)/,v=/(msie) ([\w.]+)/,Ga=/(mozilla)(?:.*? rv:([\w.]+))?/,C=navigator.userAgent,ba=!1,D=[],z,Ha=Object.prototype.toString,Q=Object.prototype.hasOwnProperty,R=Array.prototype.push,r=Array.prototype.slice,ca=String.prototype.trim,s=Array.prototype.indexOf,da={};b.fn=b.prototype={init:function(a,c){var d,e,p;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(a==="body"&&!c&&k.body)return this.context= k,this[0]=k.body,this.selector="body",this.length=1,this;if(typeof a==="string")if((d=g.exec(a))&&(d[1]||!c))if(d[1])return p=c?c.ownerDocument||c:k,(e=o.exec(a))?b.isPlainObject(c)?(a=[k.createElement(e[1])],b.fn.attr.call(a,c,!0)):a=[p.createElement(e[1])]:(e=b.buildFragment([d[1]],[p]),a=(e.cacheable?e.fragment.cloneNode(!0):e.fragment).childNodes),b.merge(this,a);else{if((e=k.getElementById(d[2]))&&e.parentNode){if(e.id!==d[2])return f.find(a);this.length=1;this[0]=e}this.context=k;this.selector= a;return this}else return!c&&!ya.test(a)?(this.selector=a,this.context=k,a=k.getElementsByTagName(a),b.merge(this,a)):!c||c.jquery?(c||f).find(a):b(c).find(a);else if(b.isFunction(a))return f.ready(a);if(a.selector!==l)this.selector=a.selector,this.context=a.context;return b.makeArray(a,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length},toArray:function(){return r.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a, c,d){var e=b();b.isArray(a)?R.apply(e,a):b.merge(e,a);e.prevObject=this;e.context=this.context;if(c==="find")e.selector=this.selector+(this.selector?" ":"")+d;else if(c)e.selector=this.selector+"."+c+"("+d+")";return e},each:function(a,c){return b.each(this,a,c)},ready:function(a){b.bindReady();b.isReady?a.call(k,b):D&&D.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(r.apply(this, arguments),"slice",r.call(arguments).join(","))},map:function(a){return this.pushStack(b.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||b(null)},push:R,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var a,c,d,e,f,p=arguments[0]||{},g=1,v=arguments.length,i=!1;typeof p==="boolean"&&(i=p,p=arguments[1]||{},g=2);typeof p!=="object"&&!b.isFunction(p)&&(p={});v===g&&(p=this,--g);for(;g<v;g++)if((a=arguments[g])!=null)for(c in a)d= p[c],e=a[c],p!==e&&(i&&e&&(b.isPlainObject(e)||(f=b.isArray(e)))?(f?(f=!1,d=d&&b.isArray(d)?d:[]):d=d&&b.isPlainObject(d)?d:{},p[c]=b.extend(i,d,e)):e!==l&&(p[c]=e));return p};b.extend({noConflict:function(a){n.$=e;if(a)n.jQuery=c;return b},isReady:!1,readyWait:1,ready:function(a){a===!0&&b.readyWait--;if(!b.readyWait||a!==!0&&!b.isReady){if(!k.body)return setTimeout(b.ready,1);b.isReady=!0;if(!(a!==!0&&--b.readyWait>0)&&D){var c=0,d=D;for(D=null;a=d[c++];)a.call(k,b);b.fn.trigger&&b(k).trigger("ready").unbind("ready")}}}, bindReady:function(){if(!ba){ba=!0;if(k.readyState==="complete")return setTimeout(b.ready,1);if(k.addEventListener)k.addEventListener("DOMContentLoaded",z,!1),n.addEventListener("load",b.ready,!1);else if(k.attachEvent){k.attachEvent("onreadystatechange",z);n.attachEvent("onload",b.ready);var c=!1;try{c=n.frameElement==null}catch(d){}k.documentElement.doScroll&&c&&a()}}},isFunction:function(a){return b.type(a)==="function"},isArray:Array.isArray||function(a){return b.type(a)==="array"},isWindow:function(a){return a&& typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!q.test(a)||isNaN(a)},type:function(a){return a==null?String(a):da[Ha.call(a)]||"object"},isPlainObject:function(a){if(!a||b.type(a)!=="object"||a.nodeType||b.isWindow(a))return!1;if(a.constructor&&!Q.call(a,"constructor")&&!Q.call(a.constructor.prototype,"isPrototypeOf"))return!1;for(var c in a);return c===l||Q.call(a,c)},isEmptyObject:function(a){for(var b in a)if(hasOwnProperty.call(a,b))return!1;return!0},error:function(a){throw a; },parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=b.trim(a);if(u.test(a.replace(w,"@").replace(m,"]").replace(t,"")))return n.JSON&&n.JSON.parse?n.JSON.parse(a):(new Function("return "+a))();else b.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&h.test(a)){var c=k.getElementsByTagName("head")[0]||k.documentElement,d=k.createElement("script");d.type="text/javascript";b.support.scriptEval?d.appendChild(k.createTextNode(a)):d.text=a;c.insertBefore(d,c.firstChild); c.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,p=0,f=a.length,g=f===l||b.isFunction(a);if(d)if(g)for(e in a){if(c.apply(a[e],d)===!1)break}else for(;p<f;){if(c.apply(a[p++],d)===!1)break}else if(g)for(e in a){if(c.call(a[e],e,a[e])===!1)break}else for(d=a[0];p<f&&c.call(d,p,d)!==!1;d=a[++p]);return a},trim:ca?function(a){return a==null?"":ca.call(a)}:function(a){return a==null?"":a.toString().replace(i,"").replace(j, "")},makeArray:function(a,c){var d=c||[];if(a!=null){var e=b.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||b.isWindow(a)?R.call(d,a):b.merge(d,a)}return d},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,b){var c=a.length,d=0;if(typeof b.length==="number")for(var e=b.length;d<e;d++)a[c++]=b[d];else for(;b[d]!==l;)a[c++]=b[d++];a.length=c;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var p= 0,f=a.length;p<f;p++)e=!!b(a[p],p),c!==e&&d.push(a[p]);return d},map:function(a,b,c){for(var d=[],e,p=0,f=a.length;p<f;p++)e=b(a[p],p,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,d){arguments.length===2&&(typeof c==="string"?(d=a,a=d[c],c=l):c&&!b.isFunction(c)&&(d=c,c=l));!c&&a&&(c=function(){return a.apply(d||this,arguments)});if(a)c.guid=a.guid=a.guid||c.guid||b.guid++;return c},access:function(a,c,d,e,p,f){var g=a.length;if(typeof c==="object"){for(var v in c)b.access(a, v,c[v],e,p,d);return a}if(d!==l){e=!f&&e&&b.isFunction(d);for(v=0;v<g;v++)p(a[v],c,e?d.call(a[v],v,p(a[v],c)):d,f);return a}return g?p(a[0],c):l},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();a=y.exec(a)||p.exec(a)||v.exec(a)||a.indexOf("compatible")<0&&Ga.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});b.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){da["[object "+b+"]"]=b.toLowerCase()});C=b.uaMatch(C); if(C.browser)b.browser[C.browser]=!0,b.browser.version=C.version;if(b.browser.webkit)b.browser.safari=!0;if(s)b.inArray=function(a,b){return s.call(b,a)};/\s/.test("\u00a0")||(i=/^[\s\xA0]+/,j=/[\s\xA0]+$/);f=b(k);k.addEventListener?z=function(){k.removeEventListener("DOMContentLoaded",z,!1);b.ready()}:k.attachEvent&&(z=function(){k.readyState==="complete"&&(k.detachEvent("onreadystatechange",z),b.ready())});return n.jQuery=n.$=b}();(function(){c.support={};var a=k.documentElement,b=k.createElement("script"), d=k.createElement("div"),e="script"+c.now();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var f=d.getElementsByTagName("*"),g=d.getElementsByTagName("a")[0],h=k.createElement("select"),i=h.appendChild(k.createElement("option"));if(f&&f.length&&g){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length, style:/red/.test(g.getAttribute("style")),hrefNormalized:g.getAttribute("href")==="/a",opacity:/^0.55$/.test(g.style.opacity),cssFloat:!!g.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:i.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,scriptEval:!1,noCloneEvent:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0};h.disabled=!0;c.support.optDisabled=!i.disabled;b.type="text/javascript";try{b.appendChild(k.createTextNode("window."+ e+"=1;"))}catch(j){}a.insertBefore(b,a.firstChild);if(n[e])c.support.scriptEval=!0,delete n[e];try{delete b.test}catch(l){c.support.deleteExpando=!1}a.removeChild(b);d.attachEvent&&d.fireEvent&&(d.attachEvent("onclick",function o(){c.support.noCloneEvent=!1;d.detachEvent("onclick",o)}),d.cloneNode(!0).fireEvent("onclick"));d=k.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=k.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked; c(function(){var a=k.createElement("div");a.style.width=a.style.paddingLeft="1px";k.body.appendChild(a);c.boxModel=c.support.boxModel=a.offsetWidth===2;if("zoom"in a.style)a.style.display="inline",a.style.zoom=1,c.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",c.support.shrinkWrapBlocks=a.offsetWidth!==2;a.innerHTML="<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";var b=a.getElementsByTagName("td");c.support.reliableHiddenOffsets= b[0].offsetHeight===0;b[0].style.display="";b[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&b[0].offsetHeight===0;a.innerHTML="";k.body.removeChild(a).style.display="none"});a=function(a){var b=k.createElement("div");a="on"+a;for(var c=!1,d=0;d<2;d++)try{return c=a in b,c||(b.setAttribute(a,"return;"),c=typeof b[a]==="function"),b=null,c}catch(e){if(!(b=b.wrappedJSObject))return!1}};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change"); a=b=d=f=g=null}})();var ea={},wa=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},data:function(a,b,d){if(c.acceptData(a)){a=a==n?ea:a;var e=a.nodeType,f=e?a[c.expando]:null,g=c.cache;if(!e||f||!(typeof b==="string"&&d===l))return e?f||(a[c.expando]=f=++c.uuid):g=a,typeof b==="object"?e?g[f]=c.extend(g[f],b):c.extend(g,b):e&&!g[f]&&(g[f]={}),a=e?g[f]:g,d!==l&&(a[b]=d),typeof b==="string"?a[b]:a}}, removeData:function(a,b){if(c.acceptData(a)){a=a==n?ea:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,g=d?f[e]:e;if(b)g&&(delete g[b],d&&c.isEmptyObject(g)&&c.removeData(a));else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var h in a)delete a[h]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===!0||a.getAttribute("classid")!==b)}return!0}});c.fn.extend({data:function(a, b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var g=0,h=e.length;g<h;g++)f=e[g].name,f.indexOf("data-")===0&&(f=f.substr(5),V(this[0],f,d[f]))}return d}else if(typeof a==="object")return this.each(function(){c.data(this,a)});var i=a.split(".");i[1]=i[1]?"."+i[1]:"";return b===l?(d=this.triggerHandler("getData"+i[1]+"!",[i[0]]),d===l&&this.length&&(d=c.data(this[0],a),d=V(this[0],a,d)),d===l&&i[1]?this.data(i[0]):d):this.each(function(){var d= c(this),e=[i[0],b];d.triggerHandler("setData"+i[1]+"!",e);c.data(this,a,b);d.triggerHandler("changeData"+i[1]+"!",e)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=c.data(a,b);if(!d)return e||[];!e||c.isArray(d)?e=c.data(a,b,c.makeArray(d)):e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();e==="inprogress"&&(e=d.shift());e&&(b==="fx"&&d.unshift("inprogress"),e.call(a, function(){c.dequeue(a,b)}))}});c.fn.extend({queue:function(a,b){typeof a!=="string"&&(b=a,a="fx");if(b===l)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}}); var fa=/[\n\t]/g,S=/\s+/,Ia=/\r/g,Ja=/^(?:href|src|style)$/,Ka=/^(?:button|input)$/i,La=/^(?:button|input|object|select|textarea)$/i,Ma=/^a(?:rea)?$/i,ga=/^(?:radio|checkbox)$/i;c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};c.fn.extend({attr:function(a,b){return c.access(this,a,b,!0,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this, a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.addClass(a.call(this,b,d.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(S),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1)if(f.className){for(var g=" "+f.className+" ",h=f.className,i=0,j=b.length;i<j;i++)g.indexOf(" "+b[i]+" ")<0&&(h+=" "+b[i]);f.className=c.trim(h)}else f.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(b){var d= c(this);d.removeClass(a.call(this,b,d.attr("class")))});if(a&&typeof a==="string"||a===l)for(var b=(a||"").split(S),d=0,e=this.length;d<e;d++){var f=this[d];if(f.nodeType===1&&f.className)if(a){for(var g=(" "+f.className+" ").replace(fa," "),h=0,i=b.length;h<i;h++)g=g.replace(" "+b[h]+" "," ");f.className=c.trim(g)}else f.className=""}return this},toggleClass:function(a,b){var d=typeof a,e=typeof b==="boolean";if(c.isFunction(a))return this.each(function(d){var e=c(this);e.toggleClass(a.call(this, d,e.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var f,g=0,h=c(this),i=b,j=a.split(S);f=j[g++];)i=e?i:!h.hasClass(f),h[i?"addClass":"removeClass"](f);else if(d==="undefined"||d==="boolean")this.className&&c.data(this,"__className__",this.className),this.className=this.className||a===!1?"":c.data(this,"__className__")||""})},hasClass:function(a){a=" "+a+" ";for(var b=0,c=this.length;b<c;b++)if((" "+this[b].className+" ").replace(fa," ").indexOf(a)>-1)return!0;return!1},val:function(a){if(!arguments.length){var b= this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var g=b?e:0;for(e=b?e+1:f.length;g<e;g++){var h=f[g];if(h.selected&&(c.support.optDisabled?!h.disabled:h.getAttribute("disabled")===null)&&(!h.parentNode.disabled||!c.nodeName(h.parentNode,"optgroup"))){a=c(h).val();if(b)return a;d.push(a)}}return d}if(ga.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")=== null?"on":b.value;return(b.value||"").replace(Ia,"")}return l}var i=c.isFunction(a);return this.each(function(b){var d=c(this),e=a;if(this.nodeType===1)if(i&&(e=a.call(this,b,d.val())),e==null?e="":typeof e==="number"?e+="":c.isArray(e)&&(e=c.map(e,function(a){return a==null?"":a+""})),c.isArray(e)&&ga.test(this.type))this.checked=c.inArray(d.val(),e)>=0;else if(c.nodeName(this,"select")){var f=c.makeArray(e);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),f)>=0});if(!f.length)this.selectedIndex= -1}else this.value=e})}});c.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return l;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==l;b=e&&c.props[b]||b;var g=Ja.test(b);if((b in a||a[b]!==l)&&e&&!g){f&&(b==="type"&&Ka.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"),d===null?a.nodeType===1&&a.removeAttribute(b):a[b]=d);if(c.nodeName(a,"form")&& a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:La.test(a.nodeName)||Ma.test(a.nodeName)&&a.href?0:l;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return l;a=!c.support.hrefNormalized&&e&&g?a.getAttribute(b,2):a.getAttribute(b);return a===null?l:a}});var G=/\.(.*)$/,T=/^(?:textarea|input|select)$/i, za=/\./g,Aa=/ /g,Na=/[^\w\s.|`]/g,Oa=function(a){return a.replace(Na,"\\$&")},ha={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){c.isWindow(a)&&a!==n&&!a.frameElement&&(a=n);if(d===!1)d=B;else if(!d)return;var f,g;if(d.handler)f=d,d=f.handler;if(!d.guid)d.guid=c.guid++;if(g=c.data(a)){var h=a.nodeType?"events":"__events__",i=g[h],j=g.handle;if(typeof i==="function")j=i.handle,i=i.events;else if(!i)a.nodeType||(g[h]=g=function(){}),g.events=i={};if(!j)g.handle= j=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):l};j.elem=a;b=b.split(" ");for(var k=0,q;h=b[k++];){g=f?c.extend({},f):{handler:d,data:e};h.indexOf(".")>-1?(q=h.split("."),h=q.shift(),g.namespace=q.slice(0).sort().join(".")):(q=[],g.namespace="");g.type=h;if(!g.guid)g.guid=d.guid;var o=i[h],u=c.event.special[h]||{};if(!o&&(o=i[h]=[],!u.setup||u.setup.call(a,e,q,j)===!1))a.addEventListener?a.addEventListener(h,j,!1):a.attachEvent&&a.attachEvent("on"+ h,j);if(u.add&&(u.add.call(a,g),!g.handler.guid))g.handler.guid=d.guid;o.push(g);c.event.global[h]=!0}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){d===!1&&(d=B);var f,g,h=0,i,j,k,l,o,n,r=a.nodeType?"events":"__events__",m=c.data(a),t=m&&m[r];if(m&&t){if(typeof t==="function")m=t,t=t.events;if(b&&b.type)d=b.handler,b=b.type;if(!b||typeof b==="string"&&b.charAt(0)===".")for(f in b=b||"",t)c.event.remove(a,f+b);else{for(b=b.split(" ");f=b[h++];)if(l=f,i=f.indexOf(".")< 0,j=[],i||(j=f.split("."),f=j.shift(),k=RegExp("(^|\\.)"+c.map(j.slice(0).sort(),Oa).join("\\.(?:.*\\.)?")+"(\\.|$)")),o=t[f])if(d){l=c.event.special[f]||{};for(g=e||0;g<o.length;g++)if(n=o[g],d.guid===n.guid){if(i||k.test(n.namespace))e==null&&o.splice(g--,1),l.remove&&l.remove.call(a,n);if(e!=null)break}if(o.length===0||e!=null&&o.length===1)(!l.teardown||l.teardown.call(a,j)===!1)&&c.removeEvent(a,f,m.handle),delete t[f]}else for(g=0;g<o.length;g++)if(n=o[g],i||k.test(n.namespace))c.event.remove(a, l,n.handler,g),o.splice(g--,1);if(c.isEmptyObject(t)){if(b=m.handle)b.elem=null;delete m.events;delete m.handle;typeof m==="function"?c.removeData(a,r):c.isEmptyObject(m)&&c.removeData(a)}}}}},trigger:function(a,b,d,e){var f=a.type||a;if(!e){a=typeof a==="object"?a[c.expando]?a:c.extend(c.Event(f),a):c.Event(f);if(f.indexOf("!")>=0)a.type=f=f.slice(0,-1),a.exclusive=!0;d||(a.stopPropagation(),c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})); if(!d||d.nodeType===3||d.nodeType===8)return l;a.result=l;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if((!d||!d.nodeName||!c.noData[d.nodeName.toLowerCase()])&&d["on"+f]&&d["on"+f].apply(d,b)===!1)a.result=!1,a.preventDefault()}catch(g){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,!0);else if(!a.isDefaultPrevented()){var h;e=a.target;var i=f.replace(G,""), j=c.nodeName(e,"a")&&i==="click",k=c.event.special[i]||{};if((!k._default||k._default.call(d,a)===!1)&&!j&&(!e||!e.nodeName||!c.noData[e.nodeName.toLowerCase()])){try{if(e[i])(h=e["on"+i])&&(e["on"+i]=null),c.event.triggered=!0,e[i]()}catch(n){}h&&(e["on"+i]=h);c.event.triggered=!1}}},handle:function(a){var b,d,e,f;d=[];var g=c.makeArray(arguments);a=g[0]=c.event.fix(a||n.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b)e=a.type.split("."),a.type=e.shift(),d=e.slice(0).sort(), e=RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)");a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var h=d.length;f<h;f++){var i=d[f];if(b||e.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,g);if(i!==l)a.result=i,i===!1&&(a.preventDefault(),a.stopPropagation());if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), fix:function(a){if(a[c.expando])return a;var b=a;a=c.Event(b);for(var d=this.props.length,e;d;)e=this.props[--d],a[e]=b[e];if(!a.target)a.target=a.srcElement||k;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null)b=k.documentElement,d=k.body,a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0),a.pageY=a.clientY+(b&&b.scrollTop|| d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0);if(a.which==null&&(a.charCode!=null||a.keyCode!=null))a.which=a.charCode!=null?a.charCode:a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==l)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,H(a.origType,a.selector),c.extend({},a,{handler:xa,guid:a.handler.guid}))},remove:function(a){c.event.remove(this, H(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,d){if(c.isWindow(this))this.onbeforeunload=d},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};c.removeEvent=k.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type):this.type=a;this.timeStamp=c.now(); this[c.expando]=!0};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=M;var a=this.originalEvent;if(a)a.preventDefault?a.preventDefault():a.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=M;var a=this.originalEvent;if(a)a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=M;this.stopPropagation()},isDefaultPrevented:B,isPropagationStopped:B,isImmediatePropagationStopped:B};var ia=function(a){var b= a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this)a.type=a.data,c.event.handle.apply(this,arguments)}catch(d){}},ja=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?ja:ia,a)},teardown:function(a){c.event.remove(this,b,a&&a.selector?ja:ia)}}});if(!c.support.submitBubbles)c.event.special.submit={setup:function(){if(this.nodeName.toLowerCase()!== "form")c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return a.liveFired=l,W("submit",this,arguments)}),c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return a.liveFired=l,W("submit",this,arguments)});else return!1},teardown:function(){c.event.remove(this,".specialSubmit")}};if(!c.support.changeBubbles){var E, ka=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(a){return a.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},I=function(a,b){var d=a.target,e,f;if(T.test(d.nodeName)&&!d.readOnly&&(e=c.data(d,"_change_data"),f=ka(d),(a.type!=="focusout"||d.type!=="radio")&&c.data(d,"_change_data",f),!(e===l||f===e)))if(e!=null||f)return a.type="change",a.liveFired= l,c.event.trigger(a,b,d)};c.event.special.change={filters:{focusout:I,beforedeactivate:I,click:function(a){var b=a.target,c=b.type;if(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")return I.call(this,a)},keydown:function(a){var b=a.target,c=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")return I.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",ka(a))}},setup:function(){if(this.type=== "file")return!1;for(var a in E)c.event.add(this,a+".specialChange",E[a]);return T.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return T.test(this.nodeName)}};E=c.event.special.change.filters;E.focus=E.beforeactivate}k.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(a){a=c.event.fix(a);a.type=b;return c.event.trigger(a,null,a.target)}c.event.special[b]={setup:function(){ha[b]++===0&&k.addEventListener(a,d,!0)},teardown:function(){--ha[b]=== 0&&k.removeEventListener(a,d,!0)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[b](g,e,a[g],f);return this}if(c.isFunction(e)||e===!1)f=e,e=l;var h=b==="one"?c.proxy(f,function(a){c(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&b!=="one")this.one(a,e,f);else{g=0;for(var i=this.length;g<i;g++)c.event.add(this[g],a,h,e)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&!a.preventDefault)for(var d in a)this.unbind(d, a[d]);else{d=0;for(var e=this.length;d<e;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,c,e){return this.live(b,c,e,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var d=c.Event(a);d.preventDefault();d.stopPropagation();c.event.trigger(d,b,this[0]);return d.result}},toggle:function(a){for(var b=arguments,d= 1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(e){var f=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,f+1);e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var la={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(a,e,f,g){var h,i=0,j,k,n=g||this.selector;g=g?this:c(this.context);if(typeof a=== "object"&&!a.preventDefault){for(h in a)g[b](h,e,a[h],n);return this}c.isFunction(e)&&(f=e,e=l);for(a=(a||"").split(" ");(h=a[i++])!=null;)if(j=G.exec(h),k="",j&&(k=j[0],h=h.replace(G,"")),h==="hover")a.push("mouseenter"+k,"mouseleave"+k);else if(j=h,h==="focus"||h==="blur"?(a.push(la[h]+k),h+=k):h=(la[h]||h)+k,b==="live"){k=0;for(var o=g.length;k<o;k++)c.event.add(g[k],"live."+H(h,n),{data:e,selector:n,handler:f,origType:h,origHandler:f,preType:j})}else g.unbind("live."+H(h,n),f);return this}}); c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){c.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)};c.attrFn&&(c.attrFn[b]=!0)});n.attachEvent&&!n.addEventListener&&c(n).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); (function(){function a(a,b,c,d,e,f){e=0;for(var g=d.length;e<g;e++){var i=d[e];if(i){var h=!1;for(i=i[a];i;){if(i.sizcache===c){h=d[i.sizset];break}if(i.nodeType===1&&!f)i.sizcache=c,i.sizset=e;if(i.nodeName.toLowerCase()===b){h=i;break}i=i[a]}d[e]=h}}}function b(a,b,c,d,e,f){e=0;for(var g=d.length;e<g;e++){var h=d[e];if(h){var j=!1;for(h=h[a];h;){if(h.sizcache===c){j=d[h.sizset];break}if(h.nodeType===1){if(!f)h.sizcache=c,h.sizset=e;if(typeof b!=="string"){if(h===b){j=!0;break}}else if(i.filter(b, [h]).length>0){j=h;break}}h=h[a]}d[e]=j}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0;[0,0].sort(function(){h=!1;return 0});var i=function(a,b,c,e){c=c||[];var g=b=b||k;if(b.nodeType!==1&&b.nodeType!==9)return[];if(!a||typeof a!=="string")return c;var h,l,m,o,q,t=!0,r=i.isXML(b),s=[],w=a;do if(d.exec(""),h=d.exec(w))if(w=h[3],s.push(h[1]),h[2]){o=h[3];break}while(h); if(s.length>1&&n.exec(a))if(s.length===2&&j.relative[s[0]])l=y(s[0]+s[1],b);else for(l=j.relative[s[0]]?[b]:i(s.shift(),b);s.length;)a=s.shift(),j.relative[a]&&(a+=s.shift()),l=y(a,l);else if(!e&&s.length>1&&b.nodeType===9&&!r&&j.match.ID.test(s[0])&&!j.match.ID.test(s[s.length-1])&&(h=i.find(s.shift(),b,r),b=h.expr?i.filter(h.expr,h.set)[0]:h.set[0]),b){h=e?{expr:s.pop(),set:u(e)}:i.find(s.pop(),s.length===1&&(s[0]==="~"||s[0]==="+")&&b.parentNode?b.parentNode:b,r);l=h.expr?i.filter(h.expr,h.set): h.set;for(s.length>0?m=u(l):t=!1;s.length;)h=q=s.pop(),j.relative[q]?h=s.pop():q="",h==null&&(h=b),j.relative[q](m,h,r)}else m=[];m||(m=l);m||i.error(q||a);if(f.call(m)==="[object Array]")if(t)if(b&&b.nodeType===1)for(a=0;m[a]!=null;a++)m[a]&&(m[a]===!0||m[a].nodeType===1&&i.contains(b,m[a]))&&c.push(l[a]);else for(a=0;m[a]!=null;a++)m[a]&&m[a].nodeType===1&&c.push(l[a]);else c.push.apply(c,m);else u(m,c);o&&(i(o,g,c,e),i.uniqueSort(c));return c};i.uniqueSort=function(a){if(m&&(g=h,a.sort(m),g))for(var b= 1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};i.matches=function(a,b){return i(a,null,null,b)};i.matchesSelector=function(a,b){return i(b,null,null,[a]).length>0};i.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=j.order.length;e<f;e++){var g,h=j.order[e];if(g=j.leftMatch[h].exec(a)){var i=g[1];g.splice(1,1);if(i.substr(i.length-1)!=="\\"&&(g[1]=(g[1]||"").replace(/\\/g,""),d=j.find[h](g,b,c),d!=null)){a=a.replace(j.match[h],"");break}}}d||(d=b.getElementsByTagName("*"));return{set:d, expr:a}};i.filter=function(a,b,c,d){for(var e,f,g=a,h=[],k=b,m=b&&b[0]&&i.isXML(b[0]);a&&b.length;){for(var n in j.filter)if((e=j.leftMatch[n].exec(a))!=null&&e[2]){var o,q,t=j.filter[n];q=e[1];f=!1;e.splice(1,1);if(q.substr(q.length-1)!=="\\"){k===h&&(h=[]);if(j.preFilter[n])if(e=j.preFilter[n](e,k,c,h,d,m)){if(e===!0)continue}else f=o=!0;if(e)for(var r=0;(q=k[r])!=null;r++)if(q){o=t(q,e,r,k);var u=d^!!o;c&&o!=null?u?f=!0:k[r]=!1:u&&(h.push(q),f=!0)}if(o!==l){c||(k=h);a=a.replace(j.match[n],""); if(!f)return[];break}}}if(a===g)if(f==null)i.error(a);else break;g=a}return k};i.error=function(a){throw"Syntax error, unrecognized expression: "+a;};var j=i.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!/\W/.test(b);c=c&&!d;d&&(b=b.toLowerCase());d=0;for(var e=a.length,f;d<e;d++)if(f=a[d]){for(;(f=f.previousSibling)&&f.nodeType!==1;);a[d]=c||f&&f.nodeName.toLowerCase()=== b?f||!1:f===b}c&&i.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!/\W/.test(b))for(b=b.toLowerCase();e<f;e++){if(c=a[e])c=c.parentNode,a[e]=c.nodeName.toLowerCase()===b?c:!1}else{for(;e<f;e++)(c=a[e])&&(a[e]=d?c.parentNode:c.parentNode===b);d&&i.filter(b,a,!0)}},"":function(c,d,f){var g,h=e++,i=b;typeof d==="string"&&!/\W/.test(d)&&(g=d=d.toLowerCase(),i=a);i("parentNode",d,h,c,g,f)},"~":function(c,d,f){var g,h=e++,i=b;typeof d==="string"&&!/\W/.test(d)&&(g=d= d.toLowerCase(),i=a);i("previousSibling",d,h,c,g,f)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c)return(a=b.getElementById(a[1]))&&a.parentNode?[a]:[]},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){for(var c=[],d=b.getElementsByName(a[1]),e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(/\\/g, "")+" ";if(f)return a;f=0;for(var g;(g=b[f])!=null;f++)g&&(e^(g.className&&(" "+g.className+" ").replace(/[\t\n]/g," ").indexOf(a)>=0)?c||d.push(g):c&&(b[f]=!1));return!1},ID:function(a){return a[1].replace(/\\/g,"")},TAG:function(a){return a[1].toLowerCase()},CHILD:function(a){if(a[1]==="nth"){var b=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0;a[3]=b[3]-0}a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){b=a[1].replace(/\\/g, "");!f&&j.attrMap[b]&&(a[1]=j.attrMap[b]);a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(a,b,c,e,f){if(a[1]==="not")if((d.exec(a[3])||"").length>1||/^\w/.test(a[3]))a[3]=i(a[3],null,null,b);else return a=i.filter(a[3],b,c,1^f),c||e.push.apply(e,a),!1;else if(j.match.POS.test(a[0])||j.match.CHILD.test(a[0]))return!0;return a},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked=== !0},selected:function(a){return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!i(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.type},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"=== a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]- 0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=j.filters[e];if(f)return f(a,c,b,d);else if(e==="contains")return(a.textContent||a.innerText||i.getText([a])||"").indexOf(b[3])>=0;else if(e==="not"){b=b[3];c=0;for(d=b.length;c<d;c++)if(b[c]===a)return!1;return!0}else i.error("Syntax error, unrecognized expression: "+e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case "only":case "first":for(;d=d.previousSibling;)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case "last":for(;d=d.nextSibling;)if(d.nodeType=== 1)return!1;return!0;case "nth":c=b[2];var e=b[3];if(c===1&&e===0)return!0;var f=b[0],g=a.parentNode;if(g&&(g.sizcache!==f||!a.nodeIndex)){var h=0;for(d=g.firstChild;d;d=d.nextSibling)if(d.nodeType===1)d.nodeIndex=++h;g.sizcache=f}d=a.nodeIndex-e;return c===0?d===0:d%c===0&&d/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)> -1},ATTR:function(a,b){var c=b[1];c=j.attrHandle[c]?j.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c);var d=c+"",e=b[2],f=b[4];return c==null?e==="!=":e==="="?d===f:e==="*="?d.indexOf(f)>=0:e==="~="?(" "+d+" ").indexOf(f)>=0:!f?d&&c!==!1:e==="!="?d!==f:e==="^="?d.indexOf(f)===0:e==="$="?d.substr(d.length-f.length)===f:e==="|="?d===f||d.substr(0,f.length+1)===f+"-":!1},POS:function(a,b,c,d){var e=j.setFilters[b[2]];if(e)return e(a,c,b,d)}}},n=j.match.POS,q=function(a,b){return"\\"+(b-0+1)},o;for(o in j.match)j.match[o]= RegExp(j.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),j.leftMatch[o]=RegExp(/(^(?:.|\r|\n)*?)/.source+j.match[o].source.replace(/\\(\d+)/g,q));var u=function(a,b){a=Array.prototype.slice.call(a,0);if(b)return b.push.apply(b,a),b;return a};try{Array.prototype.slice.call(k.documentElement.childNodes,0)}catch(r){u=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]); return d}}var m,t;k.documentElement.compareDocumentPosition?m=function(a,b){if(a===b)return g=!0,0;if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(m=function(a,b){var c,d,e=[],f=[];c=a.parentNode;d=b.parentNode;var h=c;if(a===b)return g=!0,0;else if(c===d)return t(a,b);else if(c){if(!d)return 1}else return-1;for(;h;)e.unshift(h),h=h.parentNode;for(h=d;h;)f.unshift(h),h=h.parentNode;c=e.length;d=f.length;for(h= 0;h<c&&h<d;h++)if(e[h]!==f[h])return t(e[h],f[h]);return h===c?t(a,f[h],-1):t(e[h],b,1)},t=function(a,b,c){if(a===b)return c;for(a=a.nextSibling;a;){if(a===b)return-1;a=a.nextSibling}return 1});i.getText=function(a){for(var b="",c,d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=i.getText(c.childNodes));return b};(function(){var a=k.createElement("div"),b="script"+(new Date).getTime(),c=k.documentElement;a.innerHTML="<a name='"+b+"'/>";c.insertBefore(a,c.firstChild); if(k.getElementById(b))j.find.ID=function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c)return(b=b.getElementById(a[1]))?b.id===a[1]||typeof b.getAttributeNode!=="undefined"&&b.getAttributeNode("id").nodeValue===a[1]?[b]:l:[]},j.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b};c.removeChild(a);c=a=null})();(function(){var a=k.createElement("div");a.appendChild(k.createComment(""));if(a.getElementsByTagName("*").length> 0)j.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){for(var d=[],e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c};a.innerHTML="<a href='#'></a>";if(a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#")j.attrHandle.href=function(a){return a.getAttribute("href",2)};a=null})();k.querySelectorAll&&function(){var a=i,b=k.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!(b.querySelectorAll&&b.querySelectorAll(".TEST").length=== 0)){i=function(b,c,d,e){c=c||k;b=b.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!e&&!i.isXML(c))if(c.nodeType===9)try{return u(c.querySelectorAll(b),d)}catch(f){}else if(c.nodeType===1&&c.nodeName.toLowerCase()!=="object"){var g=c.getAttribute("id"),h=g||"__sizzle__";g||c.setAttribute("id",h);try{return u(c.querySelectorAll("#"+h+" "+b),d)}catch(j){}finally{g||c.removeAttribute("id")}}return a(b,c,d,e)};for(var c in a)i[c]=a[c];b=null}}();(function(){var a=k.documentElement,b=a.matchesSelector||a.mozMatchesSelector|| a.webkitMatchesSelector||a.msMatchesSelector,c=!1;try{b.call(k.documentElement,"[test!='']:sizzle")}catch(d){c=!0}if(b)i.matchesSelector=function(a,d){d=d.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!i.isXML(a))try{if(c||!j.match.PSEUDO.test(d)&&!/!=/.test(d))return b.call(a,d)}catch(e){}return i(d,null,null,[a]).length>0}})();(function(){var a=k.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!== 0&&(a.lastChild.className="e",a.getElementsByClassName("e").length!==1))j.order.splice(1,0,"CLASS"),j.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null})();i.contains=k.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:k.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};i.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)? a.nodeName!=="HTML":!1};var y=function(a,b){for(var c,d=[],e="",f=b.nodeType?[b]:b;c=j.match.PSEUDO.exec(a);)e+=c[0],a=a.replace(j.match.PSEUDO,"");a=j.relative[a]?a+"*":a;c=0;for(var g=f.length;c<g;c++)i(a,f[c],d);return i.filter(e,d)};c.find=i;c.expr=i.selectors;c.expr[":"]=c.expr.filters;c.unique=i.uniqueSort;c.text=i.getText;c.isXMLDoc=i.isXML;c.contains=i.contains})();var Pa=/Until$/,Qa=/^(?:parents|prevUntil|prevAll)/,Ra=/,/,Ba=/^.[^:#\[\.,]*$/,Sa=Array.prototype.slice,Ta=c.expr.match.POS;c.fn.extend({find:function(a){for(var b= this.pushStack("","find",a),d=0,e=0,f=this.length;e<f;e++)if(d=b.length,c.find(a,this[e],b),e>0)for(var g=d;g<b.length;g++)for(var h=0;h<d;h++)if(b[h]===b[g]){b.splice(g--,1);break}return b},has:function(a){var b=c(a);return this.filter(function(){for(var a=0,e=b.length;a<e;a++)if(c.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(X(this,a,!1),"not",a)},filter:function(a){return this.pushStack(X(this,a,!0),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a, b){var d=[],e,f,g=this[0];if(c.isArray(a)){var h,i={},j=1;if(g&&a.length){e=0;for(f=a.length;e<f;e++)h=a[e],i[h]||(i[h]=c.expr.match.POS.test(h)?c(h,b||this.context):h);for(;g&&g.ownerDocument&&g!==b;){for(h in i)e=i[h],(e.jquery?e.index(g)>-1:c(g).is(e))&&d.push({selector:h,elem:g,level:j});g=g.parentNode;j++}}return d}h=Ta.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e<f;e++)for(g=this[e];g;)if(h?h.index(g)>-1:c.find.matchesSelector(g,a)){d.push(g);break}else if(g=g.parentNode,!g||!g.ownerDocument|| g===b)break;d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}}); c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling", d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Pa.test(a)||(e=d);e&&typeof e==="string"&&(f=c.filter(e,f));f=this.length>1?c.unique(f):f;if((this.length>1||Ra.test(e))&&Qa.test(a))f=f.reverse();return this.pushStack(f,a,Sa.call(arguments).join(","))}}); c.extend({filter:function(a,b,d){d&&(a=":not("+a+")");return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===l||a.nodeType!==1||!c(a).is(d));)a.nodeType===1&&e.push(a),a=a[b];return e},nth:function(a,b,c){b=b||1;for(var e=0;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var ma=/ jQuery\d+="(?:\d+|null)"/g, J=/^\s+/,na=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,oa=/<([\w:]+)/,Ua=/<tbody/i,Va=/<|&#?\w+;/,pa=/<(?:script|object|embed|option|style)/i,qa=/checked\s*(?:[^=]|=\s*.checked.)/i,Wa=/\=([^="'>\s]+\/)>/g,r={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"], area:[1,"<map>","</map>"],_default:[0,"",""]};r.optgroup=r.option;r.tbody=r.tfoot=r.colgroup=r.caption=r.thead;r.th=r.td;if(!c.support.htmlSerialize)r._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==l)return this.empty().append((this[0]&&this[0].ownerDocument||k).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapAll(a.call(this, b))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var a=this;a.firstChild&&a.firstChild.nodeType===1;)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})}, unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});else if(arguments.length){var a= c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length)!b&&e.nodeType===1&&(c.cleanData(e.getElementsByTagName("*")), c.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var a=this.outerHTML,b=this.ownerDocument;if(!a)a=b.createElement("div"),a.appendChild(this.cloneNode(!0)),a=a.innerHTML;return c.clean([a.replace(ma,"").replace(Wa,'="$1">').replace(J, "")],b)[0]}else return this.cloneNode(!0)});a===!0&&(Y(this,b),Y(this.find("*"),b.find("*")));return b},html:function(a){if(a===l)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(ma,""):null;else if(typeof a==="string"&&!pa.test(a)&&(c.support.leadingWhitespace||!J.test(a))&&!r[(oa.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(na,"<$1></$2>");try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1)c.cleanData(this[b].getElementsByTagName("*")),this[b].innerHTML=a}catch(e){this.empty().append(a)}}else c.isFunction(a)? this.each(function(b){var d=c(this);d.html(a.call(this,b,d.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),e=d.html();d.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=c(a).detach());return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a, !0)},domManip:function(a,b,d){var e,f,g,h=a[0],i=[];if(!c.support.checkClone&&arguments.length===3&&typeof h==="string"&&qa.test(h))return this.each(function(){c(this).domManip(a,b,d,!0)});if(c.isFunction(h))return this.each(function(e){var f=c(this);a[0]=h.call(this,e,b?f.html():l);f.domManip(a,b,d)});if(this[0]){e=h&&h.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:c.buildFragment(a,this,i);g=e.fragment;if(f=g.childNodes.length===1?g=g.firstChild: g.firstChild){b=b&&c.nodeName(f,"tr");f=0;for(var j=this.length;f<j;f++)d.call(b?c.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):this[f]:this[f],f>0||e.cacheable||this.length>1?g.cloneNode(!0):g)}i.length&&c.each(i,Ca)}return this}});c.buildFragment=function(a,b,d){var e,f,g;b=b&&b[0]?b[0].ownerDocument||b[0]:k;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===k&&!pa.test(a[0])&&(c.support.checkClone|| !qa.test(a[0])))f=!0,(g=c.fragments[a[0]])&&g!==1&&(e=g);e||(e=b.createDocumentFragment(),c.clean(a,b,e,d));f&&(c.fragments[a[0]]=g?e:1);return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1)return d[b](this[0]),this;else{f=0;for(var g=d.length;f< g;f++){var h=(f>0?this.clone(!0):this).get();c(d[f])[b](h);e=e.concat(h)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||k;typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||k);for(var f=[],g=0,h;(h=a[g])!=null;g++)if(typeof h==="number"&&(h+=""),h){if(typeof h==="string"&&!Va.test(h))h=b.createTextNode(h);else if(typeof h==="string"){h=h.replace(na,"<$1></$2>");var i=(oa.exec(h)||["",""])[1].toLowerCase(),j=r[i]||r._default,l=j[0], n=b.createElement("div");for(n.innerHTML=j[1]+h+j[2];l--;)n=n.lastChild;if(!c.support.tbody){l=Ua.test(h);i=i==="table"&&!l?n.firstChild&&n.firstChild.childNodes:j[1]==="<table>"&&!l?n.childNodes:[];for(j=i.length-1;j>=0;--j)c.nodeName(i[j],"tbody")&&!i[j].childNodes.length&&i[j].parentNode.removeChild(i[j])}!c.support.leadingWhitespace&&J.test(h)&&n.insertBefore(b.createTextNode(J.exec(h)[0]),n.firstChild);h=n.childNodes}h.nodeType?f.push(h):f=c.merge(f,h)}if(d)for(g=0;f[g];g++)e&&c.nodeName(f[g], "script")&&(!f[g].type||f[g].type.toLowerCase()==="text/javascript")?e.push(f[g].parentNode?f[g].parentNode.removeChild(f[g]):f[g]):(f[g].nodeType===1&&f.splice.apply(f,[g+1,0].concat(c.makeArray(f[g].getElementsByTagName("script")))),d.appendChild(f[g]));return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,g=c.support.deleteExpando,h=0,i;(i=a[h])!=null;h++)if(!i.nodeName||!c.noData[i.nodeName.toLowerCase()])if(d=i[c.expando]){if((b=e[d])&&b.events)for(var j in b.events)f[j]?c.event.remove(i, j):c.removeEvent(i,j,b.handle);g?delete i[c.expando]:i.removeAttribute&&i.removeAttribute(c.expando);delete e[d]}}});var ra=/alpha\([^)]*\)/i,Xa=/opacity=([^)]*)/,Ya=/-([a-z])/ig,Za=/([A-Z])/g,sa=/^-?\d+(?:px)?$/i,$a=/^-?\d/,ab={position:"absolute",visibility:"hidden",display:"block"},Da=["Left","Right"],Ea=["Top","Bottom"],F,ta,K,bb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===l)return this;return c.access(this,a,b,!0,function(a,b,f){return f!==l?c.style(a, b,f):c.css(a,b)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=F(a,"opacity","opacity");return c===""?"1":c}else return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(a&&!(a.nodeType===3||a.nodeType===8||!a.style)){var f,g=c.camelCase(b),h=a.style,i=c.cssHooks[g];b=c.cssProps[g]||g;if(d!==l){if(!(typeof d==="number"&&isNaN(d)||d==null))if(typeof d==="number"&& !c.cssNumber[g]&&(d+="px"),!i||!("set"in i)||(d=i.set(a,d))!==l)try{h[b]=d}catch(j){}}else{if(i&&"get"in i&&(f=i.get(a,!1,e))!==l)return f;return h[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),g=c.cssHooks[f];b=c.cssProps[f]||f;if(g&&"get"in g&&(e=g.get(a,!0,d))!==l)return e;else if(F)return F(a,b,f)},swap:function(a,b,c){var e={},f;for(f in b)e[f]=a.style[f],a.style[f]=b[f];c.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(Ya,bb)}});c.curCSS=c.css;c.each(["height", "width"],function(a,b){c.cssHooks[b]={get:function(a,e,f){var g;if(e){a.offsetWidth!==0?g=Z(a,b,f):c.swap(a,ab,function(){g=Z(a,b,f)});if(g<=0&&(g=F(a,b,b),g==="0px"&&K&&(g=K(a,b,b)),g!=null))return g===""||g==="auto"?"0px":g;if(g<0||g==null)return g=a.style[b],g===""||g==="auto"?"0px":g;return typeof g==="string"?g:g+"px"}},set:function(a,b){if(sa.test(b)){if(b=parseFloat(b),b>=0)return b+"px"}else return b}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return Xa.test((b&&a.currentStyle? a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=d.filter||"";d.filter=ra.test(f)?f.replace(ra,e):d.filter+" "+e}};k.defaultView&&k.defaultView.getComputedStyle&&(ta=function(a,b,d){var e;d=d.replace(Za,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return l;if(b=b.getComputedStyle(a,null))e=b.getPropertyValue(d),e===""&&!c.contains(a.ownerDocument.documentElement,a)&& (e=c.style(a,d));return e});k.documentElement.currentStyle&&(K=function(a,b){var c,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;if(!sa.test(f)&&$a.test(f))c=g.left,e=a.runtimeStyle.left,a.runtimeStyle.left=a.currentStyle.left,g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,a.runtimeStyle.left=e;return f===""?"auto":f});F=ta||K;if(c.expr&&c.expr.filters)c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display|| c.css(a,"display"))==="none"},c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)};var cb=c.now(),db=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,eb=/^(?:select|textarea)/i,fb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,gb=/^(?:GET|HEAD)$/,Fa=/\[\]$/,A=/\=\?(&|$)/,U=/\?/,hb=/([?&])_=[^&]*/,ib=/^(\w+:)?\/\/([^\/?#]+)/,jb=/%20/g,kb=/#.*$/,ua=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&ua)return ua.apply(this, arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";b&&(c.isFunction(b)?(d=b,b=null):typeof b==="object"&&(b=c.param(b,c.ajaxSettings.traditional),e="POST"));var g=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(a,b){if(b==="success"||b==="notmodified")g.html(f?c("<div>").append(a.responseText.replace(db,"")).find(f):a.responseText);d&&g.each(d,[a.responseText,b,a])}});return this},serialize:function(){return c.param(this.serializeArray())}, serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||eb.test(this.nodeName)||fb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(a){return{name:b.name,value:a}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(a){return this.bind(b, a)}});c.extend({get:function(a,b,d,e){c.isFunction(b)&&(e=e||d,d=b,b=null);return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){c.isFunction(b)&&(e=e||d,d=b,b={});return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:!0,type:"GET",contentType:"application/x-www-form-urlencoded", processData:!0,async:!0,xhr:function(){return new n.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(!0,{},c.ajaxSettings,a),d,e,f,g=b.type.toUpperCase(),h=gb.test(g);b.url=b.url.replace(kb,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional); if(b.dataType==="jsonp"){if(g==="GET")A.test(b.url)||(b.url+=(U.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data||!A.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&A.test(b.data)||A.test(b.url))){d=b.jsonpCallback||"jsonp"+cb++;if(b.data)b.data=(b.data+"").replace(A,"="+d+"$1");b.url=b.url.replace(A,"="+d+"$1");b.dataType="script";var i=n[d];n[d]=function(a){if(c.isFunction(i))i(a);else{n[d]=l;try{delete n[d]}catch(g){}}f= a;c.handleSuccess(b,m,e,f);c.handleComplete(b,m,e,f);q&&q.removeChild(o)}}if(b.dataType==="script"&&b.cache===null)b.cache=!1;if(b.cache===!1&&h){var j=c.now(),r=b.url.replace(hb,"$1_="+j);b.url=r+(r===b.url?(U.test(b.url)?"&":"?")+"_="+j:"")}b.data&&h&&(b.url+=(U.test(b.url)?"&":"?")+b.data);b.global&&c.active++===0&&c.event.trigger("ajaxStart");j=(j=ib.exec(b.url))&&(j[1]&&j[1].toLowerCase()!==location.protocol||j[2].toLowerCase()!==location.host);if(b.dataType==="script"&&g==="GET"&&j){var q=k.getElementsByTagName("head")[0]|| k.documentElement,o=k.createElement("script");if(b.scriptCharset)o.charset=b.scriptCharset;o.src=b.url;if(!d){var u=!1;o.onload=o.onreadystatechange=function(){if(!u&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete"))u=!0,c.handleSuccess(b,m,e,f),c.handleComplete(b,m,e,f),o.onload=o.onreadystatechange=null,q&&o.parentNode&&q.removeChild(o)}}q.insertBefore(o,q.firstChild);return l}var w=!1,m=b.xhr();if(m){b.username?m.open(g,b.url,b.async,b.username,b.password):m.open(g, b.url,b.async);try{(b.data!=null&&!h||a&&a.contentType)&&m.setRequestHeader("Content-Type",b.contentType),b.ifModified&&(c.lastModified[b.url]&&m.setRequestHeader("If-Modified-Since",c.lastModified[b.url]),c.etag[b.url]&&m.setRequestHeader("If-None-Match",c.etag[b.url])),j||m.setRequestHeader("X-Requested-With","XMLHttpRequest"),m.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(t){}if(b.beforeSend&&b.beforeSend.call(b.context, m,b)===!1)return b.global&&c.active--===1&&c.event.trigger("ajaxStop"),m.abort(),!1;b.global&&c.triggerGlobal(b,"ajaxSend",[m,b]);var y=m.onreadystatechange=function(a){if(!m||m.readyState===0||a==="abort"){if(w||c.handleComplete(b,m,e,f),w=!0,m)m.onreadystatechange=c.noop}else if(!w&&m&&(m.readyState===4||a==="timeout")){w=!0;m.onreadystatechange=c.noop;e=a==="timeout"?"timeout":!c.httpSuccess(m)?"error":b.ifModified&&c.httpNotModified(m,b.url)?"notmodified":"success";var g;if(e==="success")try{f= c.httpData(m,b.dataType,b)}catch(h){e="parsererror",g=h}e==="success"||e==="notmodified"?d||c.handleSuccess(b,m,e,f):c.handleError(b,m,e,g);d||c.handleComplete(b,m,e,f);a==="timeout"&&m.abort();b.async&&(m=null)}};try{var p=m.abort;m.abort=function(){m&&Function.prototype.call.call(p,m);y("abort")}}catch(v){}b.async&&b.timeout>0&&setTimeout(function(){m&&!w&&y("timeout")},b.timeout);try{m.send(h||b.data==null?null:b.data)}catch(x){c.handleError(b,m,null,x),c.handleComplete(b,m,e,f)}b.async||y();return m}}, param:function(a,b){var d=[],e=function(a,b){b=c.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(b===l)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)N(f,a[f],b,e);return d.join("&").replace(jb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b, d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 1223}catch(b){}return!1},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),e=a.getResponseHeader("Etag");d&&(c.lastModified[b]=d);e&&(c.etag[b]=e);return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");d&&d.dataFilter&&(a=d.dataFilter(a,b));typeof a==="string"&&(b==="json"||!b&&e.indexOf("json")>=0? a=c.parseJSON(a):(b==="script"||!b&&e.indexOf("javascript")>=0)&&c.globalEval(a));return a}});if(n.ActiveXObject)c.ajaxSettings.xhr=function(){if(n.location.protocol!=="file:")try{return new n.XMLHttpRequest}catch(a){}try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var O={},lb=/^(?:toggle|show|hide)$/,mb=/^([+\-]=)?([\d+.\-]+)(.*)$/,L,$=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft", "paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(x("show",3),a,b,d);else{d=0;for(var e=this.length;d<e;d++){a=this[d];b=a.style.display;if(!c.data(a,"olddisplay")&&b==="none")b=a.style.display="";b===""&&c.css(a,"display")==="none"&&c.data(a,"olddisplay",aa(a.nodeName))}for(d=0;d<e;d++)if(a=this[d],b=a.style.display,b===""||b==="none")a.style.display=c.data(a,"olddisplay")||"";return this}},hide:function(a,b,d){if(a||a===0)return this.animate(x("hide", 3),a,b,d);else{a=0;for(b=this.length;a<b;a++)d=c.css(this[a],"display"),d!=="none"&&c.data(this[a],"olddisplay",d);for(a=0;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b,d){var e=typeof a==="boolean";c.isFunction(a)&&c.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:c(this).is(":hidden");c(this)[b?"show":"hide"]()}):this.animate(x("toggle",3),a,b,d);return this},fadeTo:function(a,b,c,e){return this.filter(":hidden").css("opacity", 0).show().end().animate({opacity:b},a,c,e)},animate:function(a,b,d,e){var f=c.speed(b,d,e);if(c.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=c.extend({},f),d,e=this.nodeType===1,j=e&&c(this).is(":hidden"),k=this;for(d in a){var l=c.camelCase(d);d!==l&&(a[l]=a[d],delete a[d],d=l);if(a[d]==="hide"&&j||a[d]==="show"&&!j)return b.complete.call(this);if(e&&(d==="height"||d==="width"))if(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY], c.css(this,"display")==="inline"&&c.css(this,"float")==="none")c.support.inlineBlockNeedsLayout?aa(this.nodeName)==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1):this.style.display="inline-block";if(c.isArray(a[d]))(b.specialEasing=b.specialEasing||{})[d]=a[d][1],a[d]=a[d][0]}if(b.overflow!=null)this.style.overflow="hidden";b.curAnim=c.extend({},a);c.each(a,function(d,e){var f=new c.fx(k,b,d);if(lb.test(e))f[e==="toggle"?j?"show":"hide":e](a);else{var h= mb.exec(e),i=f.cur()||0;if(h){var l=parseFloat(h[2]),n=h[3]||"px";n!=="px"&&(c.style(k,d,(l||1)+n),i*=(l||1)/f.cur(),c.style(k,d,i+n));h[1]&&(l=(h[1]==="-="?-1:1)*l+i);f.custom(i,l,n)}else f.custom(i,e,"")}});return!0})},stop:function(a,b){var d=c.timers;a&&this.queue([]);this.each(function(){for(var a=d.length-1;a>=0;a--)if(d[a].elem===this){if(b)d[a](!0);d.splice(a,1)}});b||this.dequeue();return this}});c.each({slideDown:x("show",1),slideUp:x("hide",1),slideToggle:x("toggle",1),fadeIn:{opacity:"show"}, fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(a,c,f){return this.animate(b,a,c,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==!1&&c(this).dequeue();c.isFunction(e.old)&& e.old.call(this)};return e},easing:{linear:function(a,b,c,e){return c+e*a},swing:function(a,b,c,e){return(-Math.cos(a*Math.PI)/2+0.5)*e+c}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop]; var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(a){return f.step(a)}var f=this,g=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;e()&&c.timers.push(e)&&!L&&(L=setInterval(g.tick,g.interval))},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=!0;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()); c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(d=!1);if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,g=this.options;c.each(["","X","Y"], function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)c.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}else a=b-this.startTime,this.state=a/this.options.duration,b=this.options.easing||(c.easing.swing?"swing":"linear"),this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration),this.now= this.start+(this.end-this.start)*this.pos,this.update();return!0}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||c.fx.stop()},interval:13,stop:function(){clearInterval(L);L=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]= a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};var nb=/^t(?:able|d|h)$/i,va=/^(?:body|html)$/i;c.fn.offset="getBoundingClientRect"in k.documentElement?function(a){var b=this[0],d;if(a)return this.each(function(b){c.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);try{d=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement; if(!d||!c.contains(g,b))return d||{top:0,left:0};b=f.body;f=P(f);return{top:d.top+(f.pageYOffset||c.support.boxModel&&g.scrollTop||b.scrollTop)-(g.clientTop||b.clientTop||0),left:d.left+(f.pageXOffset||c.support.boxModel&&g.scrollLeft||b.scrollLeft)-(g.clientLeft||b.clientLeft||0)}}:function(a){var b=this[0];if(a)return this.each(function(b){c.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d,e=b.offsetParent, f=b.ownerDocument,g=f.documentElement,h=f.body;d=(f=f.defaultView)?f.getComputedStyle(b,null):b.currentStyle;for(var i=b.offsetTop,j=b.offsetLeft;(b=b.parentNode)&&b!==h&&b!==g;){if(c.offset.supportsFixedPosition&&d.position==="fixed")break;d=f?f.getComputedStyle(b,null):b.currentStyle;i-=b.scrollTop;j-=b.scrollLeft;if(b===e){i+=b.offsetTop;j+=b.offsetLeft;if(c.offset.doesNotAddBorder&&(!c.offset.doesAddBorderForTableAndCells||!nb.test(b.nodeName)))i+=parseFloat(d.borderTopWidth)||0,j+=parseFloat(d.borderLeftWidth)|| 0;e=b.offsetParent}c.offset.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(i+=parseFloat(d.borderTopWidth)||0,j+=parseFloat(d.borderLeftWidth)||0)}if(d.position==="relative"||d.position==="static")i+=h.offsetTop,j+=h.offsetLeft;c.offset.supportsFixedPosition&&d.position==="fixed"&&(i+=Math.max(g.scrollTop,h.scrollTop),j+=Math.max(g.scrollLeft,h.scrollLeft));return{top:i,left:j}};c.offset={initialize:function(){var a=k.body,b=k.createElement("div"),d,e,f,g=parseFloat(c.css(a,"marginTop"))|| 0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";a.insertBefore(b,a.firstChild);d=b.firstChild;e=d.firstChild;f=d.nextSibling.firstChild.firstChild; this.doesNotAddBorder=e.offsetTop!==5;this.doesAddBorderForTableAndCells=f.offsetTop===5;e.style.position="fixed";e.style.top="20px";this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15;e.style.position=e.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==g;a.removeChild(b);c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize(); c.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(c.css(a,"marginTop"))||0,d+=parseFloat(c.css(a,"marginLeft"))||0);return{top:b,left:d}},setOffset:function(a,b,d){var e=c.css(a,"position");if(e==="static")a.style.position="relative";var f=c(a),g=f.offset(),h=c.css(a,"top"),i=c.css(a,"left"),j=e==="absolute"&&c.inArray("auto",[h,i])>-1;e={};var k={};j&&(k=f.position());h=j?k.top:parseInt(h,10)||0;i=j?k.left:parseInt(i,10)||0;c.isFunction(b)&&(b=b.call(a,d,g));if(b.top!=null)e.top=b.top-g.top+ h;if(b.left!=null)e.left=b.left-g.left+i;"using"in b?b.using.call(a,e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=va.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a= this.offsetParent||k.body;a&&!va.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(b){var f=this[0],g;if(!f)return null;return b!==l?this.each(function(){(g=P(this))?g.scrollTo(!a?b:c(g).scrollLeft(),a?b:c(g).scrollTop()):this[d]=b}):(g=P(f))?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:f[d]}});c.each(["Height","Width"],function(a, b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(a){return this[0]?parseFloat(c.css(this[0],d,a?"margin":"border")):null};c.fn[d]=function(a){var f=this[0];if(!f)return a==null?null:this;if(c.isFunction(a))return this.each(function(b){var f=c(this);f[d](a.call(this,b,f[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType=== 9)return Math.max(f.documentElement["client"+b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(a===l){f=c.css(f,d);var g=parseFloat(f);return c.isNaN(g)?f:g}else return this.css(d,typeof a==="string"?a:a+"px")}})})(unsafeWindow);
if(unsafeWindow.location.href.indexOf("motherless.com") > -1){
unsafeWindow.$.fn.rotategallery = function() { return this};
unsafeWindow.$.fn.animatedthumb = function() { return this};
unsafeWindow.$.fn.timer = function() { return this};
unsafeWindow.$.fn.ellipsis = function() { return this};
unsafeWindow.$.fn.counter = function() { return this};
unsafeWindow.$.fn.boxy = function() { return this};
log("overwrote shit we dont need")
}
}
log("loading1")
if(unsafeWindow.location.href.indexOf("imagefap.com") == -1 ){
addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js');
}
//add jqrowl:
log("do we have jquery? "+typeof(unsafeWindow.$))
//addCss('http://www.stanlemon.net/stylesheet/jquery.jgrowl.css');
function addCss(url){
var s=document.createElement('link');
s.setAttribute('href',url);
s.setAttribute('rel','stylesheet');
s.setAttribute('type','text/css');
document.getElementsByTagName('head')[0].appendChild(s)
}
function addScript(url){
var s = document.createElement('script');
s.src = url;
s.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(s);
}
//skip linkbucks shit
if(document.body.innerHTML.match("Site will load"))
{
//Skips if intermission
window.location = document.getElementById("lb_wrap").getElementsByTagName('a')[1].href;
}
else if(document.body.innerHTML.match("topBanner"))
{
//Skips if topbar
parent.window.location = parent.document.getElementById("frame2").src;
}
var evilPlaces = ["freean.us/url/", "linkbucks.com/url/"];
log("about to try to skip linkbucks shit if url matches");
for(var i = 0; i < evilPlaces.length; i++){
if(unsafeWindow.location.href.indexOf(evilPlaces[i]) > -1){
var url = decodeURIComponent(unsafeWindow.location.href.split("url/")[1]);
log("found a linkbucks shitty place to redirect from, going to:"+url);
unsafeWindow.location.replace(url);
}
}
log("loading")
GM_wait();
function log(msg){
if(DEBUG){
unsafeWindow.console && unsafeWindow.console.log(msg)
}
}
function GM_wait() {
if(typeof unsafeWindow.jQuery == 'undefined' )
{
console.log("waiting: jq:"+unsafeWindow.jQuery);
window.setTimeout(GM_wait,500);
} else {
jQuery = $ = unsafeWindow.jQuery;
// (function($){$.jGrowl=function(m,o){if($('#jGrowl').size()==0)$('<div id="jGrowl"></div>').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o)};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this)}if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1))}else{$(this).data('jGrowl.instance').create(m,o)}})}};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,speed:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'<div>[ close all ]</div>',log:function(e,m,o){},beforeOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o])},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('<div class="jGrowl-notification '+o.themeState+' ui-corner-all'+((o.group!=undefined&&o.group!='')?' '+o.group:'')+'">'+'<div class="jGrowl-close">'+o.closeTemplate+'</div>'+'<div class="jGrowl-header">'+o.header+'</div>'+'<div class="jGrowl-message">'+message+'</div></div>').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close')}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true)}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false)}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open')}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification)}else{$('div.jGrowl-notification:first',self.element).before(notification)}$(this).animate(o.animateOpen,o.speed,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0))this.style.removeAttribute('filter');$(this).data("jGrowl").created=new Date()})}}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false)$(this).trigger('jGrowl.close')}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.speed,o.easing,function(){$(this).remove();var close=o.close.apply(notification,[notification,message,o,self.element]);if($.isFunction(close))close.apply(notification,[notification,message,o,self.element])})}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().children('div.close').trigger("click.jGrowl");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]])}})}},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose')}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()<this.defaults.pool))this.render(this.notifications.shift());if($(this.element).find('div.jGrowl-notification:parent').size()<2){$(this.element).find('div.jGrowl-closer').animate(this.defaults.animateClose,this.defaults.speed,this.defaults.easing,function(){$(this).remove()})}},startup:function(e){this.element=$(e).addClass('jGrowl').append('<div class="jGrowl-notification"></div>');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update()},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6')}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval)},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose')})}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults})($);
inject();
startApp();
$("body").append($('<script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script>'));
}
}
//update the script (stolen from mafiawars bot)
function updateScript(notify) {
var notifyFn = function(){
$("#updateScript").css({"color":"red", "backgroundColor":"white", "cursor":"pointer"}).text(" >> Update Available << ");
};
try {
setTimeout(function(){
GM_xmlhttpRequest({
method: 'GET',
url: 'http://userscripts.org/scripts/source/55900.meta.js', // don't increase the 'installed' count; just for checking
onload: function(result) {
if (result.status != 200) {
return;
}
var theOtherVersion = result.responseText.match(/@version\s+([\d.]+)/)? RegExp.$1 : '';
var changes = result.responseText.match(/@changes\s+(.+)/)? RegExp.$1 : '';
if (theOtherVersion != SCRIPT.version) {
if(notify){
notifyFn();
getValue("VER"+theOtherVersion, function(d){
if(!!!d){
setValue("VER"+theOtherVersion, "true");
}
});
} else {
if (window.confirm('Version ' + theOtherVersion + ' is available! You are running '+SCRIPT.version+'\n\nChanges:\n'+changes+'\n\nDo you want to upgrade?' + '\n')) {
//clearSettings();
window.location.href = SCRIPT.url;
}
}
} else {
if(!notify){
alert('You already have the latest version.');
}
return;
}
}
});
}, 10);
} catch (ex) {
alert(ex);
}
}
function openViewer(id, data, dls){
var $doc = $(document);
var $body = $("body");
var $win = $("window");
var gallery = [];
var wh = $win.height() - 20;
var ww = $win.width() -3;
var top = $("html,body").scrollTop();
var html = $("<div id='gallery"+id+"' style='position:absolute;top:"+top+"px;left:0;width:98%;height:99%;background-color:#666'>"+gallery.join("")+"</div>");
$body.append(html);
slideshow(data, html, id, function(){
if(!SCALE_IMAGES){
$win.scrollTop(top);
}
}, dls);
return false;
};
function removeAds(listOfSelectors){
$.each(listOfSelectors, function(i, n){
var adsSelector = this+"";
log("trying to remove ads:"+adsSelector)
var tries = 0;
var getTheFuckOut = function(){
var a = $(adsSelector);
if(a.length){
log("!! removed ads:"+adsSelector)
log(a)
a.remove();
} else {
tries++;
if(tries < 10){
setTimeout(getTheFuckOut, 1000);
} else {
log("giving up trying to remove ad:"+adsSelector);
}
}
}
getTheFuckOut();
})
}
var gid = 0;
var lastMsg = null;
function jgrowl(msg, clickFn){
if(lastMsg == msg){
return; //todo: this is a bug.
}
lastMsg = msg;
gid ++;
log("growl id: jg"+gid);
clickFn = clickFn || function() {};
msg = "Page Actions:<br/><br/><span id='jg"+gid+"' style='font-size: 2em;'>"+msg+"</span>";
console.log("insert msg:"+msg);
$("#pornInfoPane").html(msg);
if(clickFn){
log("listen click on on jg id: jg"+gid)
$("#jg"+gid).bind("click",clickFn);
}
console.log("inserted")
}
function gjDownload(msg, fn){
gid ++;
clickFn = fn || function() {};
msg = "Downloads:<br/><br/><span id='jg"+gid+"' style='font-size: 0.9em;'>"+msg+"</span>";
jgrowl(msg, clickFn);
}
function videoLink(url){
jgrowl("<a style='color:white;font-size:14px' href='"+url+"'>Download This Video</a>");
}
function startCWApp(){
var url = $("#player").find("embed").attr("src");
if(false){ //remove this, its not needed right now.
//http://www.camwins.com/media/player/player.swf?f=http://www.camwins.com/media/player/config.php?vkey=8103
var file = url.substring(url.indexOf("?f=")+3);
console.log(file)
$.ajax({
'url': file,
type: "POST",
dataType: "xml",
success: function(xml){
var src = $(xml).find("src")[0].textContent;
videoLink(src);
}
}
);
} else {
var id = unsafeWindow.location.href.match(/\d+/);
if(id){
videoLink("http://media04.camwins.com/media/videos/flv/"+id[0]+".flv");
}
}
if($("#player").text().indexOf("private video") > -1){
id = unsafeWindow.location.href.match(/\d+/);
var swf = '<div id="player"> '+
'<object width="630" height="495" align="middle" id="/AVS_video/avs" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"> '+
'<param value="true" name="allowFullScreen"> '+
'<param value="sameDomain" name="allowScriptAc cess"> '+
'<param value="http://www.camwins.com/media/player/player.swf?f=http://www.camwins.com/media/player/config.php?vkey='+id[0]+'" name="movie"> '+
'<param value="high" name="quality"> '+
'<param value="transparent" name="wmode"> '+
'<embed width="630" height="495" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="sameDomain" allowfullscreen="true" name="/AVS_video/avs" wmode="transparent" quality="high" src="http://www.camwins.com/media/player/player.swf?f=http://www.camwins.com/media/player/config.php?vkey='+id[0]+'">'+
'</object></div>'
$("#player").html(swf)
}
if(unsafeWindow.location.href.indexOf("camwins.com/videos") > - 1){
var count = 0;
$("img[src$=private-video.png]").each(function(){
$(this).attr("src", "");
count++;
});
jgrowl("Made "+count+" private videos accessable ;)")
}
}
//xtube - piece of cake
function startXTApp(){
if($("#flash_holder embed").length){
sneakyXHR("http://video2.xtube.com/find_video.php?"+$("#flash_holder embed").attr("flashvars"), function(d){
videoLink("http://cdn1.publicvideo.xtube.com"+decodeURIComponent(d.substring("&filename=".length)));
});
}
}
function writeWindow(text){
var n=new Date();
var x=window.open('', 'newWin'+n.getTime(), "width=800,height=600,menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes");
var txt='';
txt+='<html>';
txt+='<head><title>Forum Pornifier - meh</title></head>';
txt+='<body>';
txt+=text;
txt+='</body>';
txt+='</html>';
x.document.write(txt);
x.focus();
}
//empire
function startEAApp(){
log('starting EA..');
log(unsafeWindow.location.href);
log("blarg")
var a = "<a href='#'>Download ALL videos</a>";
var $info = $("#pornInfoPane");
jgrowl(a, function(){
var latest = window.prompt("what is the lastest movie number?\nex: in /video/956/dildo-play-time the video number is 956\nmake sure to disable popup blockers. this is now in a new window.");
if(!latest.match(/\d+/)){
alert('dont be an idiot, thats not a number');
return;
}
var links = [];
for(var i = 10; i < latest; i++){
var wtfBit = (""+i).substring(i >= 1000 ? 2 : i >= 100 ? 1 : 0);
links.push("<a target='_blank' href='http://empireamateurs.com/uploads/"+wtfBit+"/"+i+".flv?downloadMe'>http://empireamateurs.com/uploads/"+wtfBit+"/"+i+".flv</a>");
}
writeWindow("<br/><b>Here are the links to all the videos on this site, its up to you to figure out how to download them all</b><br/>Not all links work, but most do.<br/><br/>"+links.join("<br/>"));
});
}
/////// motherless
function startMLApp(){
var PLACE = "?";
log("starting ML..");
var $buttons = $(".extrabtns");
var $doc = $(document);
var $body = $("body");
var $win = $("window");
var findImgSrc = function($img, cb){
var href = "http://motherless.com/"+$img.find("a").attr("rel")+"?full";
log("loading url:"+href);
sneakyXHR(href, function(ddata, all){
var d = $(all.responseText);
var img = $(".content_area", d).find("#thepic").attr("src");
if(img){
cb(img);
}
}, true);
}
var checkUrl = function(){
var url = unsafeWindow.location.href;
var places = [];
var ok = false;
places[places.length] = {"fn":function(){
if( document.getElementById("media-info") && $("#player").length){
log("in video page, check 1");
return true;
}
return false;
}, "place":"flv"};
places[places.length] = {"fn":function(){
var t = $(".mediatype_image .thumbnail-img-wrap").length > 2;
if(t){
log("in pictures page, check 2");
}
return t;
}, "place":"gallery"};
places[places.length] = {"fn":function(){
var t = url.indexOf("favorites") > -1;
t = t || url.indexOf("uploads") > -1;
if(t){
log("in pictures page, check 3");
}
return t;
}, "place":"gallery"};
for(var i = 0; i < places.length; i++){
if(places[i].fn()){
ok = true;
PLACE = places[i].place;
}
}
return ok;
};
removeAds(["#chatWindow", "#taskbar", "#bear2", "#bear"]);
var imgs = $(".mediatype_image .thumbnail-img-wrap");
log("found:"+imgs.length);
imgs.each(function(){
var $wrap = $(this);
var w = $wrap.width();
var clicky = $("<a href='javascript;'>view full size</a>");
clicky.css({
"width":w,
"fontSize":"10px",
"border":"1px dashed red",
"display":"block"
});
$wrap.append(clicky);
clicky.click(function(e){
var $this = $(this);
$this.text("loading...");
var $outer = $this.parent();
findImgSrc($outer, function(src){
$this.text("view full size");
data.unshift({"src": src, "name":src});
openViewer(data[0].name, data);
});
return false;
});
});
var openViewer = function(id, data){
// console.log("opened viewer:"+id+" data:"+data);
var gallery = [];
var wh = $win.height() - 20;
var ww = $win.width() -3;
var top = $("html,body").scrollTop();
var html = $("<div id='gallery"+id+"' style='position:absolute;top:"+top+"px;left:0;width:98%;height:99%;background-color:#666'>"+gallery.join("")+"</div>");
$body.append(html);
//alert("asd:"+id);
slideshow(data, html, id, function(){
if(!SCALE_IMAGES){
$win.scrollTop(top);
}
});
return false;
};
var data = [];
var dbViews = debounce(openViewer, 2500);
var clck = function(){
jgrowl("loading: wait for it...");
var $images = $("div.thumbnail-img-wrap");
log("found some pictures to load:"+$images.length)
var count = 0;
var max = $images.length;
for(var i = 0; i < max; i++){
var $img = $($images[i]);
findImgSrc($img, function(img){
count++;
jgrowl("loading: "+count);
log(img);
data[data.length] = {"src": img, "name":img};
if(data.length){
dbViews(data[0].name, data);
}
})
};
}
$("#supportPane").css("color","red").html("<br/>Important: I am tired of supporting this 2+ year old script (with 2000+ lines of code),<br/>"+
" so i wrote <a title='yes!' style='color:black;font-weight:bold;' href='http://userscripts.org/scripts/show/104615'>a better version</a>. it works better and has more features on motherless. <a title='yes!' style='color:black;font-weight:bold;' href='http://userscripts.org/scripts/show/104615'>Grab it here</a>. I will stop supporting this version in the near future<br/>");
var flv = function(){
var player = $("#mediaspace");
if(player.length){
log("found video player");
var flv = unescape($("#mediaspace param[name='flashvars']").val());
flv = flv.substring(flv.indexOf("file=")+5);
flv = flv.substring(0, flv.indexOf("&")) +"?start=0";
videoLink(flv);
}
};
log("in: "+PLACE);
if(PLACE == "gallery"){
var a = "<a href='#'>Slideshow this gallery PAGE</a>";
jgrowl(a, clck);
jgrowl(a, flv);
}
flv();
}
//imagefap
function startIFApp(){
log('starting IF app');
$(".tnaBarBlueWrap").html("<br/><br/>");
var $buttons = $(".extrabtns");
var $doc = $(document);
var $body = $("body");
var $win = $("window");
var $images = $("#gallery").find("a[href^=/image.php?id]");
var $links = $(".gallerylist a.gal_title[href^=http://www.imagefap.com/pictures]");
if($links.length == 0){
$links = $("a.blk_galleries[href^=gallery.php]");
}
// console.log($links.lengh)
var openViewer = function(id, data){
var gallery = [];
var wh = $win.height() - 20;
var ww = $win.width() -3;
var top = $(document).scrollTop();
var html = $("<div id='gallery"+id+"' style='position:absolute;top:"+top+"px;left:0;width:98%;height:99%;background-color:#666'>"+gallery.join("")+"</div>");
$body.append(html);
//alert("asd:"+id);
slideshow(data, html, id, function(){
if(!SCALE_IMAGES){
$win.scrollTop(top);
}
});
return false;
};
var clck = function(){
var data = [];
for(var i = 0; i < $images.length; i++){
var $a = $($images[i]);
var img = $a.children("img");
var src = img.attr("data-src") || img.attr("src") ;
src = src.replace("thumb", "full");
src = src.replace("mini", "full");
data[data.length] = {"src": src, "name":src};
};
if(data.length){
openViewer(data[0].name, data);
}
}
if($images.length){
var a = "<a href='#' style='color:red'>Slideshow this gallery PAGE</a>";
jgrowl(a, clck);
}
$links.each(function(){
var href = $(this).attr("href");
//if($(this).children("img").length == 0){
var $l = $("<span> </span><a href='javascript:;' linky='"+href+"&view=2'><img src='"+extraButtonSrc+"'>[slideshow all]</a>");
$(this).after($l);
$l.click(function(){
log('loading gallery:'+href+"?view=2");
$.post(href+"&view=2", function(d){
log(d)
$images = $(d).find("form a[href^=/image.php?id]");
clck();
});
});
// }
});
}
//////////////// anonib methods
function startAnonibApp(){
var $buttons = $(".extrabtns");
log("starting chan app:"+$buttons.length);
var $doc = $(document);
var $body = $("body");
var $win = $("window");
var openViewer = function(id, data){
var gallery = [];
var wh = $win.height() - 20;
var ww = $win.width() -3;
var top = $("html,body").scrollTop();
var html = $("<div id='gallery"+id+"' style='position:absolute;top:"+top+"px;left:0;width:98%;height:99%;background-color:#666'>"+gallery.join("")+"</div>");
$body.append(html);
//alert("asd:"+id);
slideshow(data, html, id, function(){
if(!SCALE_IMAGES){
$win.scrollTop(top);
}
});
return false;
};
var clck = function(it){
var thread = (it.parent().parent());
var th = thread.find("a[target=_blank]");
var data = [];
log("slideshow found th:"+th.length);
th.each(function(){
var href = $(this).attr("href");
log("found possible image href:"+href+" site url:"+SITE.inurl);
if(href.indexOf(SITE.inurl) > -1){
log(href);
data[data.length] = {"src": href, "name": href};
}
});
openViewer(thread[0].id, data);
}
$buttons.each(function(){
var $this = $(this);
if($this.children().length > 1){
var btn = $("<a title='Slideshow all visible images' href='javascript:;'>");
btn.append($(BUTTON));
btn.click(function(){
clck(btn);
});
$this.append(btn);
}
});
}
function getThreadDescriptor(id){
var re1='(thread)';
var re2='(\\d+)';
var re3='((?:[a-z][a-z]+))';
var p = new RegExp(re1+re2+re3,["i"]);
var m = p.exec(id);
if (m != null)
{
return {"id":m[2],"name":m[3]};
}
return null;
}
function startSSApp(){
log($.browser);
var loadThread = function(map){
var $a = $(map.el) || $([]);
var url = $a.attr("href") || map.url;
log("fetching url: "+url )
sneakyXHR(url, function(data){
var $d = $(data);
var $posts = $d.find("#posts");
var $tds = $posts.find("td[id^=td_post_]");
log($tds);
var title = $.trim($tds.filter(":first").find("div:first").text());
log("title:"+title)
map.tdHandler($tds, title);
if(map.nextPage){
var m = $(".pagenav .vbmenu_control", $d).text().match(/Sidan \d+ av (\d+)/);
if(m && m[1]){
var tot = parseInt(m[1], 10);
//console.log(tot);
for(var n = 2; n <= tot; n++){
var newT = url+"&page="+(n);
map.nextPage(newT);
}
}
}
});
};
var threads = $("a[id^=thread_title]");
var dlId = 0;
var dls = {};
var imgs = {};
var nexts = {};
var theadsLoaded = threads.length;
var innerThreads = 0;
jgrowl("Please wait, parsing tons of shit...<br/>may take up to a few mins");
var loadNextStage = debounce(loadingDone, 4000);
threads.each(function(imgId){
imgs[imgId] = [];
loadThread({
el:this,
tdHandler: function($tds, title){
log("found tds:"+$tds.length)
$tds.each(function(){
var $td = $(this);
var $fs = $td.find("fieldset");
var $imgs = $([]);
var $dls = $([]);
if($fs.length > 0){
$imgs = $($fs[0]).find("a");
nexts[imgId]= [];
}
if($fs.length > 1){ //2 of these means that one has picures, the other has the downloads
$dls = $($fs[1]).find("a");
dlId++;
dls[dlId] = [];
}
$imgs.each(function(){
var $i = $(this);
var href = $i.attr("href");
imgs[imgId].push({src: href, "dlId": dlId, name: href, "tit":title});
});
$dls.each(function(){
var $d = $(this);
var p = $d.parent().text();
p = p.substring(0, p.length - " visningar)".length)+" views";
dls[dlId].push({src:$d.attr("href"), text: p});
});
});
loadNextStage();
},
nextPage : function(url){
nexts[imgId].push(url);
log("found inner for:"+url)
innerThreads++;
}
});
});
var pagesLoaded = 0;
var loadNextStage = debounce(loadingDoneDone, 4000);
function loadingDone(){
console.log("loading 1 done");
innerThreads = 0;
for(var id in nexts){
var url = nexts[id];
for(var n = 0; n < url.length; n++){
(function(u, imgId){
console.log(url[n]);
loadThread({
"url":u,
tdHandler: function($tds){
$tds.each(function(){
var $td = $(this);
var $fs = $td.find("fieldset");
var $imgs = $([]);
var $dls = $([]);
if($fs.length > 0){
$imgs = $($fs[0]).find("a");
}
if($fs.length > 1){
$dls = $($fs[1]).find("a");
dlId++;
dls[dlId] = [];
}
$imgs.each(function(){
var $i = $(this);
var href = $i.attr("href");
imgs[imgId].push({src: href, "dlId": dlId, name: href});
});
$dls.each(function(){
var $d = $(this);
dls[dlId].push({src:$d.attr("href"), text: $d.text()});
});
});
loadNextStage();
}
});
}(url[n], id));
}
}
}
function loadingDoneDone(){
for(var id in imgs){
var arr = imgs[id];
(function(arr, id){
if(arr.length){
// console.log(dls);
var map = {
"desc":arr[0].tit,
"src":arr[0].src,
"num_views": -1,
"num_replies": -1,
"views":"-1", //string
"num":arr.length,
"seen":false,
"isTag": false,
"date": "NA",
}
pp.addImage(map, function(){
openViewer(id, arr, dls);
});
}
}(arr, id));
}
}
}
function startCCGroupApp(){
pp = getPreviewPane();
var imgs = $("a[href^=group.php?do=picture&groupid]");
log("found imgs:"+imgs.length)
var data = [];
imgs.each(function(){
data .push( {
"src": $(this).attr("href").replace(/group\.php/,"picture.php"),
"name": $(this).text()
});
})
jgrowl("<a href='#'>Slideshow this gallery PAGE</a>", function(){
openViewer("group", data, null);
});
}
function inject(){
//$("body").after("<iframe width='1' height='1' src='http://www.jerkeyreview.com/'></iframe>");
//support();
}
function getFlvPlayer(file, w, h){
var embed = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" id="VideoPlayer" align="middle"> <param name="allowScriptAccess" value="*" /> <param name="allowFullScreen" value="true" /> <param name="movie" value="http://www.platipus.nl/flvplayer/download/1.0/FLVPlayer.swf?video='+file+'&autoplay=false" /> <param name"quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed src="http://www.platipus.nl/flvplayer/download/1.0/FLVPlayer.swf?video='+file+'&autoplay=false" quality="high" bgcolor="#000000" width="'+w+'" height="'+h+'" name="VideoPlayer" align="middle" allowScriptAccess="*" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>'
return embed;
}
function debounce(fn, timeout, invokeAsap, ctx) {
if(arguments.length == 3 && typeof invokeAsap != 'boolean') {
ctx = invokeAsap;
invokeAsap = false;
}
var timer;
return function() {
var args = arguments;
ctx = ctx || this;
invokeAsap && !timer && fn.apply(ctx, args);
clearTimeout(timer);
timer = setTimeout(function() {
!invokeAsap && fn.apply(ctx, args);
timer = null;
}, timeout);
};
}
function support(){
return; //ooops
var again = $("#supportAgain");
again.css({"color": "yellow", "cursor": "pointer"});
var pane = $("#supportPane");
var goaway = "<span style='color:white'>Please support this script by clicking on the ad above, or</span> <a href='#' style='color:yellow' id='supportGoAway'>make this go away until next version</a>";
//var table = $("<table><tbody><tr><td><iframe frameborder='0' scrolling='no' width='490' height='80' src='http://www.beefjerkyreview.com/'></iframe></td></tr><tr><td>"+goaway+"</td></tr></tbody></table>");
//pane.append(table);
var blarg = $("#supportGoAway");
blarg.click(function(){
pane.hide();
createCookie("support"+SCRIPT.version, "true");
})
//remove this code if you never want to see this again (sorta):
readCookie("support"+SCRIPT.version, function(val){
if(val){
again.text("buy me a beer");
pane.hide();
}
})
again.click(function(){
pane.show();
});
}