/*======================================================================*\
|| #################################################################### ||
|| # vBulletin 4.1.7
|| # ---------------------------------------------------------------- # ||
|| # Copyright �2000-2011 vBulletin Solutions Inc. All Rights Reserved. ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/
(function(A,B){A("[data-role=page]").live("pagecreate",function(C){var M=this;A("div#header",M).after(A(".cms_primarycontent",M));A("div#.pagetitle",M).after(A(".cms_toolbar",M));A("a.scrolltop").click(function(){A.mobile.silentScroll();return false});A("a.fullsitelink",M).click(function(){var O=window.location.href;if(O.search(/\?/)==-1){window.top.location=O+"?styleid=-1"}else{window.top.location=O+"&styleid=-1"}return false});A("input[name='newforumpwd']",M).parent().siblings().eq(0).hide();A("[data-role='vbpagenav']",M).vbpagenav();A("[data-role='imagereg']",M).imagereg();A('[name="preview"]',M).unbind().live("vclick",function(O){A("<input>").attr({type:"hidden",id:"previewinput",name:"preview",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});A("a.newreplylink",M).unbind().click(function(P){var O=A("#qr_threadid",M).val();A.ajax({type:"POST",url:"ajax.php?do=getquotes&t="+O,data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=getquotes&t="+O,success:function(R){var Q=A(R).find("quotes").text();G(Q)},dataType:"xml"});return false});A('.quickreplycontainer [name="cancel"]').unbind().live("click",function(P){var O=A(this).closest(".quickreplycontainer");O.remove();return false});A("a.quickreply").unbind().click(function(O){var P=A(this).attr("id").substr(3);if(!A("#qrcontainer_"+P,M).length){J(this,"");A("#qrcontainer_q_"+P,M).remove()}return false});A("a.quickreplyquote").unbind().click(function(O){var P=A(this).attr("id").substr(5);if(!A("#qrcontainer_q_"+P,M).length){A.ajax({type:"POST",url:"ajax.php?do=getquotes&p="+P,data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=getquotes&p="+P,success:N,dataType:"xml",context:A(this)})}return false});function N(P){var O=A(P).find("quotes").text();var Q=A(this).attr("id").substr(5);if(O){J(this,O);A("#qrcontainer_"+Q,M).remove()}}function J(R,Q){var S=A(R).attr("id").substr(3);if(!A("#qrcontainer_"+S,M).length){var P=A(".qr_defaultcontainer",M).clone().attr("id","qrcontainer_"+S).removeClass("qr_defaultcontainer");P.find('input[name="p"]').val(S);var O=P.find('textarea[name="message"]');if(Q.length){O.val(Q)}O.textinput();P.insertAfter(A(R).closest("div.postfoot")).show();P.parent().siblings().find(".quickreplycontainer").remove()}}function G(Q){var P;if(!A("#qrcontainer_default",M).length){P=A(".qr_defaultcontainer",M).clone().attr("id","qrcontainer_default").removeClass("qr_defaultcontainer")}else{P=A("#qrcontainer_default",M)}var O=P.find('textarea[name="message"]').textinput();if(Q.length){O.val(Q)}P.insertAfter(A(".qr_defaultcontainer",M)).show();A.mobile.silentScroll(P.position().top)}A("a.tablink",M).each(function(){A(this).click(A(this),E);A(this).closest("li").unbind("click").click(A(this),E)});function E(Q){var O=Q.data;var R=O.attr("id").substr(4);var P=O.parents("[data-role=content]").find(".page-"+R);if(!P.length){A("[data-role=page]").animationComplete(function(){A("a.tablink").removeClass("ui-btn-active");A("a.tab-"+R).not(".tablinklist").addClass("ui-btn-active");var S=A(".page-"+R);S.removeClass("hidden").show().siblings(".tabbody").addClass("hidden");S.find(".ui-listview").listview("refreshthumbs")});return true}if(O.hasClass("tablinklist")){A("a.tablink").not(".tablinklist").removeClass("ui-btn-active")}else{O.addClass("ui-btn-active").parent().siblings("li").find("a").removeClass("ui-btn-active")}P.removeClass("hidden").show().siblings(".tabbody").addClass("hidden");P.find(".ui-listview").listview("refreshthumbs");return false}A(".navbar").each(function(){var O=A(this).parent().find("div.pagetitle");if(O.length){O.after(A(this))}});A("a.dismiss").click(function(){var O=A(this).attr("id").substr(14);A.ajax({type:"POST",url:"ajax.php?do=dismissnotice",data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=dismissnotice&noticeid="+O,success:K,dataType:"xml",context:A(this)})});function K(O){var P=A(O).find("dismissed").text();A("li.navbar_notice_"+P).remove()}if(typeof FB!=="undefined"){FB.init({appId:FB_appid,status:true,cookie:true,xfbml:true});A("#fb_regloginbtn").click(function(){if(FB.getSession(true)){F()}else{FB.login(function(O){if(O.session){F()}},this.loginperms)}return false});A("#fb_reglogoutbtn").click(function(){FB.logout(F);return false});A("#facebookassociate").click(function(){A("#vb_login_username").val(A("#facebookusername").val());A("#vb_login_password").val(A("#facebookpassword").val());A("#facebookassociateform").submit();return false});A('[name="link"]',M).unbind().live("vclick",function(O){A("<input>").attr({type:"hidden",id:"linkinput",name:"link",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});A('[name="nolink"]',M).unbind().live("vclick",function(O){A("<input>").attr({type:"hidden",id:"nolinkinput",name:"nolink",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});function F(){var O=window.top.location.href.replace(/#.*/,"");var P=(window.top.location.search.substring(1)?"&":"?");window.top.location=O+P+"dofbredirect=1"+window.top.location.hash}}if(A(".sidebar_container .categories ul li",M).length){A("a.blogcategorylink",M).show().click(function(){if(!A(this).siblings(".categories").length){A(this).after(A(".sidebar_container .categories",M).first().clone(true));A(this).siblings(".content_container",M).hide()}else{A(this).siblings(".categories",M).remove();A(this).siblings(".content_container",M).show()}return false});A("button.categoriesback",M).click(function(){var O=A(this).parents("div.categories");O.siblings(".content_container",M).show();O.remove()})}if(A(".sidebar_container .blogusername",M).length){A(".memberinfoheader .userinfo",M).html(A(".sidebar_container .blogusername",M).html());A(".memberinfoheader .avatar",M).html(A(".sidebar_container .bloguseravatar",M).html())}A("a.blogpostcommentlink",M).click(function(){A.mobile.silentScroll(A("form#qc_form",M).last().position().top);return false});A("a.blogcommentslink",M).click(function(){A.mobile.silentScroll(A("div.comments",M).last().position().top);return false});A("a.articlecommentlink",M).click(function(){A.mobile.silentScroll(A("#form_widget_comments",M).last().position().top);return false});A('[name="draft"]',M).unbind().click(function(O){A("<input>").attr({type:"hidden",id:"draftinput",name:"draft",value:"1"}).appendTo("form");A(this).closest("form").submit();return false});if(A("ul.breadcrumb li",M).length>1){A(M).data("breadcrumbshow",false);A("div.pagetitle h1",M).before(A("<a>").attr("href","#").html(A("<img>").attr("src",IMGDIR_MOBILE+"/arrow-left.png").addClass("backbutton")).click(function(O){O.preventDefault()}));A("div.pagetitle",M).click(function(){if(!A(M).data("breadcrumbshow")){A(".breadcrumb",M).show();var O=A(".breadcrumb",M).offset();A(".breadcrumboverlay",M).offset(O).show();A("div.pagetitle img.backbutton",M).attr("src",IMGDIR_MOBILE+"/arrow-down.png");A(M).data("breadcrumbshow",true)}else{A(".breadcrumb",M).hide();A(".breadcrumboverlay",M).offset({top:0,left:0}).hide();A("div.pagetitle img.backbutton",M).attr("src",IMGDIR_MOBILE+"/arrow-left.png");A(M).data("breadcrumbshow",false)}}).after(A("<div>").addClass("breadcrumboverlay"))}if(A(".cmssections ul li",M).length){A("a.cmssectionlink",M).show().click(function(){if(!A(this).parent().siblings(".cmssections").length){A(this).parent().siblings(".content_container",M).before(A(".cmssections",M).first().clone(true));A(this).parent().siblings(".categories",M).remove();A(this).parent().siblings(".content_container",M).hide()}else{A(this).parent().siblings(".cmssections",M).remove();A(this).parent().siblings(".content_container",M).show()}return false});A("button.cmssectionsback",M).click(function(){var O=A(this).parents("div.cmssections");O.siblings(".content_container",M).show();O.remove()})}if(A(".categories ul li",M).length){A("a.cmscategorylink",M).show().click(function(){if(!A(this).parent().siblings(".categories").length){A(this).parent().siblings(".content_container",M).before(A(".categories",M).first().clone(true));A(this).parent().siblings(".cmssections",M).remove();A(this).parent().siblings(".content_container",M).hide()}else{A(this).parent().siblings(".categories",M).remove();A(this).parent().siblings(".content_container",M).show()}return false});A("button.cmscategoriesback",M).click(function(){var O=A(this).parents("div.categories");O.siblings(".content_container",M).show();O.remove()})}A("button[data-submitname]",M).each(function(){A(this).unbind().click(function(Q){var O=A(this).attr("data-submitvalue");var P=A(this).attr("data-submitname");A("<input>").attr({type:"hidden",id:P+"input",name:P,value:O}).appendTo("form");A(this).closest("form").submit();return false})});A('#pmform [name="move"]',M).click(function(O){A('#pmform [name="dowhat"]',M).val("move");A("#pmform",M).submit();O.preventDefault()});A('#pmform [name="delete"]',M).click(function(O){if(confirm("Are you sure?")){A('#pmform [name="dowhat"]',M).val("delete");A("#pmform",M).submit()}O.preventDefault()});A('button[name="moderate"]',M).click(function(O){A(".inlinemodcheckboxradio",M).toggle();A(".inlinemodbuttons",M).toggle()});A("button.inlinemod",M).unbind().click(function(P){var O=A(this).attr("name");A("<input>").attr({type:"hidden",id:O+"input",name:"do",value:O}).appendTo("form");A(this).closest("form").submit();return false});A(".postbit",M).each(function(){var O=A(this).find("label.ui-btn");if(O.length){O.parent().addClass("inlinemodcheckboxradio");O.removeClass("ui-btn-corner-all");O.children("span").removeClass("ui-btn-corner-all")}});var I=D();A("a.multiquote",M).unbind().click(function(){H(A(this).attr("id").substr(3));return false}).each(function(){var O=A(this).attr("id").substr(3);L(O,(A.inArray(O,I)>-1))});function D(){var O=A.cookie("vbulletin_multiquote");if(O!=null&&O!=""){O=O.split(",")}else{O=new Array()}return O}function L(P,O){if(O){A("#mq_"+P,M).addClass("highlight");A("#mq_image_"+P,M).attr("src",BBURL+"/"+IMGDIR_BUTTON+"/multiquote-selected_40b.png")}else{A("#mq_"+P,M).removeClass("highlight");A("#mq_image_"+P,M).attr("src",BBURL+"/"+IMGDIR_BUTTON+"/multiquote_40b.png")}}function H(T){var R=D();var P=new Array();var S=false;for(Q in R){if(!R.hasOwnProperty(Q)){continue}if(R[Q]==T){S=true}else{if(R[Q]){P.push(R[Q])}}}L(T,!S);if(!S){P.push(T);if(typeof mqlimit!="undefined"&&mqlimit>0){for(var Q=0;Q<(P.length-mqlimit);Q++){var O=P.shift();L(O,false)}}}A.cookie("vbulletin_multiquote",P.join(","),{path:"/"});return false}A(".bbcode_container a.view",M).click(function(Q){var O=A(this).parents(".bbcode_container").eq(0).find(".bbcode_code");var P=window.open("","bbcode_code");P.document.write("<html><head><title>Popup</title></head><body>");P.document.write('<p>[<a href="#" onclick="window.opener.focus();window.close();return false;">Back</a>]</p><div class="bbcode_container">');P.document.write(O.outerHTML());P.document.write("</div></body>");P.document.close();return false})});A("[data-role=page]").live("pageshow",function(F){var D=this,C=window.location.href;var E=/do=(postreply|postthread)/gi;if(E.test(C)&&A(".postbit",D).length){setTimeout(function(){A.mobile.silentScroll(A(".postbit",D).last().position().top)},400)}E=/#post(\d+)/gi;var G=E.exec(C);if(G){var H=G[1]||"";if(H){setTimeout(function(){A.mobile.silentScroll(A("#post_"+H,D).last().position().top)},400)}}E=/&(new_comment|comments)/gi;if(E.test(C)&&A("div.comments",D).length){setTimeout(function(){A.mobile.silentScroll(A("div.comments",D).last().position().top)},400)}})})(jQuery,this);(function(A,B){A.widget("mobile.imagereg",A.mobile.widget,{options:{theme:null},_create:function(){var D=this.element,E=this.options,C=this;D.find("#refresh_imagereg").removeClass("hidden").click(this,this.fetch_image);D.find("#imagereg").click(this,this.fetch_image);D.ajaxError(function(H,I,G,F){alert("error in: "+G.url+" \nerror:\n"+I.responseText)})},fetch_image:function(D){var C=D.data.element;D.preventDefault();C.find("#progress_imagereg").removeClass("hidden");A.ajax({type:"POST",url:"ajax.php?do=imagereg",data:SESSIONURL+"securitytoken="+SECURITYTOKEN+"&do=imagereg&hash="+C.find("#hash").val(),success:D.data.handle_ajax_response,dataType:"xml",context:D.data})},handle_ajax_response:function(D){var E=this.element;E.find("#progress_imagereg").addClass("hidden");if(D){var C=A(D).find("error").text();if(C){alert(C)}else{var F=A(D).find("hash").text();if(F){E.find("#hash").val(F);E.find("#imagereg").attr("src","image.php?"+SESSIONURL+"type=hv&hash="+F)}}}}})})(jQuery);(function(A,B){A.widget("mobile.vbpagenav",A.mobile.widget,{lowpage:1,highpage:1,numberoflinks:1,height:20,navbuttonwidth:20,pagenumberwidth:20,useqmark:false,options:{theme:null,pagenumber:1,totalpages:1,address:"",address2:"",anchor:""},_create:function(){var E=this.element,I=this.options,C=this;if(I.address.search(/\?/)==-1){this.useqmark=true}else{this.useqmark=false}var F=/\\?&?(page|pagenumber)=?\d+/gi;I.address=I.address.replace(F,"");A("<div>").addClass("ui-vbpagenav-pagenumbers").appendTo(E);var G=A("<a>",{href:I.address+I.address2+(this.useqmark?"?":"&")+"page=1"+(I.anchor?"#"+I.anchor:""),role:"button"}).text("First").addClass("ui-vbpagenav-first").appendTo(E).buttonMarkup({theme:I.theme,icon:"arrow-l",iconpos:"notext",corners:false,shadow:false,iconshadow:true}).click(function(){if(I.pagenumber==1){return false}return true});this.height=parseInt(G.css("height"))+parseInt(G.css("padding-top"))+parseInt(G.css("padding-bottom"))+parseInt(G.css("border-top-width"))+parseInt(G.css("border-bottom-width"));this.navbuttonwidth=parseInt(G.css("width"))+parseInt(G.css("padding-left"))+parseInt(G.css("padding-right"))+parseInt(G.css("border-left-width"))+parseInt(G.css("border-right-width"));A("<a>",{href:I.address+I.address2+(this.useqmark?"?":"&")+"page="+I.totalpages+(I.anchor?"#"+I.anchor:""),role:"button"}).text("Last").addClass("ui-vbpagenav-last").appendTo(E).buttonMarkup({theme:I.theme,icon:"arrow-r",iconpos:"notext",corners:false,shadow:false,iconshadow:true}).click(function(){if(I.pagenumber==I.totalpages){return false}return true});var H=E.find("div.ui-vbpagenav-pagenumbers");var D=A("<a>",{href:"#",role:"button"}).text("#").addClass("ui-vbpagenav-pagenumber").buttonMarkup({theme:I.theme,corners:false,inline:true,shadow:false,iconshadow:true}).addClass("ui-btn-icon-notext").appendTo(H);this.pagenumberwidth=parseInt(D.css("width"))+parseInt(D.css("padding-left"))+parseInt(D.css("padding-right"))+parseInt(D.css("border-left-width"))+parseInt(D.css("border-right-width"));D.remove();A("[data-role=page]").live("pageshow pagecreate orientationchange resize",function(){C.refresh()})},refresh:function(){var J=this.options,G=this.element,D=this;var I=G.find("div.ui-vbpagenav-pagenumbers");var C=A(document).width();this.numberoflinks=parseInt((C-this.navbuttonwidth*2)/this.pagenumberwidth)+1;this.lowpage=J.pagenumber-parseInt(this.numberoflinks*1.5)+1;if(this.lowpage<1){this.lowpage=1}this.highpage=J.pagenumber+parseInt(this.numberoflinks*1.5)+1;if(this.highpage>J.totalpages){this.highpage=J.totalpages}var F=C/2;var H=F-(J.pagenumber-this.lowpage+0.5)*this.pagenumberwidth;if(H>this.navbuttonwidth||((this.highpage-this.lowpage+1)*this.pagenumberwidth)<C-this.navbuttonwidth*2){H=this.navbuttonwidth}else{if((this.highpage-J.pagenumber+0.5)*this.pagenumberwidth+this.navbuttonwidth<F){H+=F-((this.highpage-J.pagenumber+0.5)*this.pagenumberwidth+this.navbuttonwidth)}}I.css("left",H.toString()+"px");I.empty();for(var E=this.lowpage;E<=this.highpage;E++){D._buildPagenumber(E,false)}I.live("swipeleft",function(){D.swipeleft()}).live("swiperight",function(){D.swiperight()});G.live("swipeleft",function(){D.swipeleft()}).live("swiperight",function(){D.swiperight()})},swipeleft:function(){var I=this.options,G=this.element,E=this;var H=G.find("div.ui-vbpagenav-pagenumbers");var D=A(document).width();var F,C;if((this.highpage-this.lowpage+1)*this.pagenumberwidth+H.offset().left>D-this.navbuttonwidth){C=this.highpage;this.highpage=this.highpage+this.numberoflinks-1;if(this.highpage>I.totalpages){this.highpage=I.totalpages}for(i=C+1;i<=this.highpage;i++){E._buildPagenumber(i,false)}F=(this.numberoflinks-2)*this.pagenumberwidth;if((this.highpage-this.lowpage+1)*this.pagenumberwidth+H.offset().left-F<D-this.navbuttonwidth){F=(this.highpage-this.lowpage+1)*this.pagenumberwidth+H.offset().left-D+this.navbuttonwidth}H.css("left",function(J,K){return(parseInt(K)-F).toString()+"px"})}},swiperight:function(){var H=this.options,E=this.element,C=this;var G=E.find("div.ui-vbpagenav-pagenumbers");var D,F;if(G.offset().left==this.navbuttonwidth){F=this.lowpage;this.lowpage=this.lowpage-this.numberoflinks+1;if(this.lowpage<1){this.lowpage=1}for(i=F-1;i>=this.lowpage;i--){C._buildPagenumber(i,true)}}D=(this.numberoflinks-2)*this.pagenumberwidth;if(G.offset().left+D>this.navbuttonwidth){D=this.navbuttonwidth-G.offset().left}G.css("left",function(I,J){if(D){return(parseInt(J)+D).toString()+"px"}return this.navbuttonwidth+"px"})},_buildPagenumber:function(F,D){var I=this.options,E=this.element,C=this;var H=E.find("div.ui-vbpagenav-pagenumbers");var G=A("<a>",{href:I.address+I.address2+(this.useqmark?"?":"&")+"page="+F+(I.anchor?"#"+I.anchor:""),role:"button"}).text(F.toString()).addClass("ui-vbpagenav-pagenumber").buttonMarkup({theme:I.theme,corners:false,inline:true,shadow:false,iconshadow:true}).addClass("ui-btn-icon-notext").live("swipeleft",function(){C.swipeleft()}).live("swiperight",function(){C.swiperight()});if(D){G.prependTo(H)}else{G.appendTo(H)}if(F==I.pagenumber){G.removeClass("ui-btn-up-d").addClass("ui-btn-up-e").click(function(){return false})}}})})(jQuery);(function(A,C){var B={};A.widget("mobile.listview",A.mobile.listview,{_itemApply:function(F,G){var D=this;G.find(".ui-li-count").addClass("ui-btn-up-"+(F.jqmData("counttheme")||this.options.countTheme)+" ui-btn-corner-all");G.find("h1, h2, h3, h4, h5, h6").addClass("ui-li-heading");G.find("p, dl").addClass("ui-li-desc");F.find("li").find(">img").eq(0).addClass("ui-li-thumb").each(function(){A(this).closest("li").addClass(A(this).is(".ui-li-icon")?"ui-li-has-icon":"ui-li-has-thumb");if(!A(this).hasClass("ui-li-icon")){A(this).one("load",function(){D._refreshthumb(this)}).each(function(){if(this.complete){A(this).trigger("load")}})}});var E=G.find(".ui-li-aside");if(E.length){E.each(function(H,I){A(I).prependTo(A(I).parent())})}if(A.support.cssPseudoElement||!A.nodeName(G[0],"ol")){return }},refresh:function(N){this._createSubPages();var R=this.options,D=this.element,Q=this,V=D.jqmData("dividertheme")||R.dividerTheme,O=D.jqmData("splittheme"),H=D.jqmData("spliticon"),P=D.children("li"),L=A.support.cssPseudoElement||!A.nodeName(D[0],"ol")?0:1;if(L){D.find(".ui-li-dec").remove()}for(var J=0,G=P.length;J<G;J++){var T=P.eq(J),E="ui-li";if(N||!T.hasClass("ui-li")){var M=T.jqmData("theme")||R.theme,U=T.find("a");if(U.length){var S=T.jqmData("icon");T.buttonMarkup({wrapperEls:"div",shadow:false,corners:false,iconpos:"right",icon:"arrow-r",theme:M});U.first().addClass("ui-link-inherit");U.each(function(X){if(A(this).hasClass("splitlink")){E+=" ui-li-has-alt";var Y=A(this),W=O||Y.jqmData("theme")||R.splitTheme;Y.appendTo(T).attr("title",Y.text()).addClass("ui-li-link-alt").empty().buttonMarkup({shadow:false,corners:false,theme:M,icon:false,iconpos:false}).find(".ui-btn-inner").append(A("<span />").buttonMarkup({shadow:true,corners:true,theme:W,iconpos:"notext",icon:H||Y.jqmData("icon")||R.splitIcon}))}})}else{if(T.jqmData("role")==="list-divider"){E+=" ui-li-divider ui-btn ui-bar-"+V;T.attr("role","heading");if(L){L=1}}else{E+=" ui-li-static ui-body-"+M}}D.find("li > .ui-btn-inner").bind("click",function(X){var W=A(this).find("a").first().attr("href");if(W){var Y=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;if(!Y.test(W)){W=BBURL+"/"+W}window.top.location=W}return false});var I=T.find("[type='radio'], [type='checkbox']");if(I.length){var K=A("<label>").attr("for",I.attr("id"));I.add(K).insertBefore(A(".ui-btn-inner",T));I.checkboxradio();I.parent().addClass("inlinemodcheckboxradio");K.removeClass("ui-btn-corner-all");K.children("span").removeClass("ui-btn-corner-all");E+=" ui-li-checkboxradio"}}if(R.inset){if(J===0){E+=" ui-corner-top";T.add(T.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-tr").end().find(".ui-li-thumb").addClass("ui-corner-tl");if(T.next().next().length){Q._removeCorners(T.next())}}if(J===P.length-1){E+=" ui-corner-bottom";T.add(T.find(".ui-btn-inner")).find(".ui-li-link-alt").addClass("ui-corner-br").end().find(".ui-li-thumb").addClass("ui-corner-bl");if(T.prev().prev().length){Q._removeCorners(T.prev())}}}if(L&&E.indexOf("ui-li-divider")<0){var F=T.is(".ui-li-static:first")?T:T.find(".ui-link-inherit");F.addClass("ui-li-jsnumbering").prepend("<span class='ui-li-dec'>"+(L++)+". </span>")}T.add(T.find(".ui-btn-inner")).addClass(E);if(!N){Q._itemApply(D,T)}}},_createSubPages:function(){var J=this.element,K=J.closest(".ui-page"),D=K.jqmData("url"),G=D||K[0][A.expando],E=J.attr("id"),F=this.options,H="data-"+A.mobile.ns,L=this,I=K.find(":jqmData(role='footer')").jqmData("id");if(typeof (B[G])==="undefined"){B[G]=-1}E=E||++B[G];A(J.find("li>ul, li>ol").toArray().reverse()).each(function(N){var Q=A(this),P=Q.attr("id")||E+"-"+N,S=Q.parent(),U=A(Q.prevAll().toArray().reverse()),U=U.length?U:A("<span>"+A.trim(S.contents()[0].nodeValue)+"</span>"),R=U.first().text(),M=(D||"")+"&"+A.mobile.subPageUrlKey+"="+P;theme=Q.jqmData("theme")||F.theme,countTheme=Q.jqmData("counttheme")||J.jqmData("counttheme")||F.countTheme,newPage=Q.detach().wrap("<div "+H+"role='page' "+H+"url='"+M+"' "+H+"theme='"+theme+"' "+H+"count-theme='"+countTheme+"'><div "+H+"role='content'></div></div>").parent().before("<div "+H+"role='header' "+H+"theme='"+F.headerTheme+"'><div class='ui-title'>"+R+"</div></div>").after(I?A("<div "+H+"role='footer' "+H+"id='"+I+"'>"):"").parent().appendTo(A.mobile.pageContainer);newPage.page();var O=S.find("a:first");if(!O.length){O=A("<a />").html(U||R).prependTo(S.empty());O.attr("href",window.top.location+"#"+M)}else{var T=A("<a>").attr("href",window.top.location+"#"+M).addClass("splitlink").click(function(){window.top.location=window.top.location+"#"+M;return false}).appendTo(S)}}).listview()},refreshthumbs:function(){var G=this.options,F=this.element,E=this,D=F.children("li");D.each(function(I){var H=A(this);H.find("img.ui-li-thumb").each(function(){E._refreshthumb(this)})})},_refreshthumb:function(D){A(D).removeAttr("width").removeAttr("height").css({width:"",height:""});if(D.width>D.height&&D.width>=80){D.height=D.height*80/D.width;D.width=80}else{if(D.width<=D.height&&D.height>=80){D.width=D.width*80/D.height;D.height=80}}if(D.width<=80){A(D).css("left",((100-D.width)/2)+"px")}if(D.height<=80){var E=D;setTimeout(function(){var F=A(E).parents(".ui-btn-inner").first().innerHeight();A(E).css("top",((F-E.height)/2)+"px")},80)}}})})(jQuery);jQuery.fn.outerHTML=function(A){return(A)?this.before(A).remove():jQuery("<p>").append(this.eq(0).clone()).html()};jQuery.cookie=function(B,I,L){if(typeof I!="undefined"){L=L||{};if(I===null){I="";L.expires=-1}var E="";if(L.expires&&(typeof L.expires=="number"||L.expires.toUTCString)){var F;if(typeof L.expires=="number"){F=new Date();F.setTime(F.getTime()+(L.expires*24*60*60*1000))}else{F=L.expires}E="; expires="+F.toUTCString()}var K=L.path?"; path="+(L.path):"";var G=L.domain?"; domain="+(L.domain):"";var A=L.secure?"; secure":"";document.cookie=[B,"=",encodeURIComponent(I),E,K,G,A].join("")}else{var D=null;if(document.cookie&&document.cookie!=""){var J=document.cookie.split(";");for(var H=0;H<J.length;H++){var C=jQuery.trim(J[H]);if(C.substring(0,B.length+1)==(B+"=")){D=decodeURIComponent(C.substring(B.length+1));break}}}return D}};