$(document).ready(function(){addAnimsAccount();addAnimsEditContent();addAnimsContent();addChecksContent();addChecksAuths();addFeaturesUpload();addStylesGeneral();addAnimsTickers();addChangeLinks();addPromotional();addEditHelpers();addToolTips();jQuery().tinymce&&wysiwygReAttachToTextAreas();var a=jQuery.ajaxSettings.cache;jQuery.ajaxSettings.cache=true;$("#fb-root").length&&$.getScript("http://connect.facebook.net/en_US/all.js",function(){FB.init({appId:"145094122239152",status:true,cookie:true,xfbml:true})});
$.getScript("https://apis.google.com/js/plusone.js");jQuery.ajaxSettings.cache=a});var intCurrentPage,intTopPage;intTopPage=intCurrentPage=1;
function addAnimsContent(){for(var a=1;a<11;a++){if($("#pageTurner"+a).length==0)break;intTopPage=a;$("#pageTurner"+a).click(function(){var e;e=String(this.id).match(/pageTurner([0-9]+)/)[1];for(var f=1;f<11;f++){$("#pageTurner"+f).length>0&&$("#pageTurner"+f).removeClass().addClass("tabup");$("#page"+f).length>0&&$("#page"+f).slideUp("slow")}$("#pageTurner"+e).removeClass().addClass("tabdown");$("#page"+e).slideDown("slow");intCurrentPage=e})}$("#pageTurnerPrev").length>0&&$("#pageTurnerPrev").click(function(){$("#pageTurner"+
intCurrentPage).removeClass().addClass("tabup");$("#page"+intCurrentPage).slideUp("slow");intCurrentPage--;if(intCurrentPage<1)intCurrentPage=intTopPage;$("#pageTurner"+intCurrentPage).removeClass().addClass("tabdown");$("#page"+intCurrentPage).slideDown("slow")});$("#pageTurnerNext").length>0&&$("#pageTurnerNext").click(function(){$("#pageTurner"+intCurrentPage).removeClass().addClass("tabup");$("#page"+intCurrentPage).slideUp("slow");intCurrentPage++;if(intCurrentPage>intTopPage)intCurrentPage=
1;$("#pageTurner"+intCurrentPage).removeClass().addClass("tabdown");$("#page"+intCurrentPage).slideDown("slow")});$("#btnMoreItems").length>0&&$("#btnMoreItems").click(function(){$("#btnMoreItems").slideUp(400);$("#divMoreItems").slideDown(400,function(){$("html,body").animate({scrollTop:$("#divMoreItems").offset().top-50},1E3)});$("#divMoreArticles").slideUp(400);$("#btnMoreArticles").slideDown(400);$("#divMoreDiscussions").slideUp(400);$("#btnMoreDiscussions").slideDown(400);return false});$("#btnMoreArticles").length>
0&&$("#btnMoreArticles").click(function(){$("#btnMoreArticles").slideUp(400);$("#divMoreArticles").slideDown(400,function(){$("html,body").animate({scrollTop:$("#divMoreArticles").offset().top-50},1E3)});$("#divMoreItems").slideUp(400);$("#btnMoreItems").slideDown(400);$("#divMoreDiscussions").slideUp(400);$("#btnMoreDiscussions").slideDown(400);return false});$("#btnMoreDiscussions").length>0&&$("#btnMoreDiscussions").click(function(){$("#btnMoreDiscussions").slideUp(400);$("#divMoreDiscussions").slideDown(400,
function(){$("html,body").animate({scrollTop:$("#divMoreDiscussions").offset().top-50},1E3)});$("#divMoreItems").slideUp(400);$("#btnMoreItems").slideDown(400);$("#divMoreArticles").slideUp(400);$("#btnMoreArticles").slideDown(400);return false});$("#btnRelatedItems").length>0&&$("#btnRelatedItems").click(function(){$("#btnRelatedItems").parent().slideUp(400);$("#divRelatedItems").slideDown(400);return false});$("#btnRelatedArticles").length>0&&$("#btnRelatedArticles").click(function(){$("#btnRelatedArticles").parent().slideUp(400);
$("#divRelatedArticles").slideDown(400);return false});$("#btnRecentReviews").length>0&&$("#btnRecentReviews").click(function(){$("#btnRecentReviews").parent().slideUp(400);$("#divRecentReviews").slideDown(400);return false});$("#btnMoreBuyOptions").length>0&&$("#btnMoreBuyOptions").click(function(){$("#btnMoreBuyOptions").slideUp(400);$("#divMoreBuyOptions").slideDown(400);return false});if($("#Image").length>0){var b,c,d;a=$("#Image").width();b=$("#Image").height();c=$("#Image").parent().width()-
10;if(a>c){d=parseInt(c/a*b);$("#Image").width(c);$("#Image").height(d);$("#Image").parent().gzoom({sW:c,sH:d,lW:a,lH:b,lightbox:false})}}if($("#ToolbarContainer").length>0){a=$(".hboxcontainer").offset();a.left=$("#Container").offset().left-$("#ToolbarContainer").outerWidth();$("#ToolbarContainer").offset(a);$("#ToolbarContainer").data("MaxTop",a.top);$("#ToolbarContainer").fadeIn();setTimeout(moveShareBox,500)}}
function moveShareBox(){var a,b;a=$("html").scrollTop();b=$("#ToolbarContainer").offset();a=a>$("#ToolbarContainer").data("MaxTop")?a+50:$("#ToolbarContainer").data("MaxTop");b.top!=a&&$("#ToolbarContainer").animate({top:a+"px"},250);setTimeout(moveShareBox,500)}
function addAnimsTickers(){if((document.all?document.body.clientWidth:window.innerWidth)<1155){$("ul.homewidetabs li:last").remove();$("div.homewidebox > div:last").remove()}$("div.homewidebox > div").each(function(){var a,b,c;a=$(this).find("p");b=a.html();for(c=$(this).parent().height();$(this).outerHeight()>c;){b=b.replace(/\s*([^\s]+)\s*$/,"");a.html(b+"...");if(b.length<10)break}});$("ul.homewidetabs").tabs("div.homewidebox > div",{effect:"fade",fadeOutSpeed:"fast",rotate:true}).slideshow({autoplay:true,
clickable:false});$("#HomeSpotlight > div").each(function(){var a,b,c;b=$(this).find("div");c=(a=b.find("div img"))?a.outerHeight()+25:285;if(c<285)c=285;a=b.find("span.forumitalic");b=b.find("span.descriptionlist");if(a&&b){var d,e;d=a.html();for(e=b.html();$(this).outerHeight()>c;){var f;for(f=$(this).outerHeight();f==$(this).outerHeight();){d=d.replace(/\s*([^\s]+)\s*$/,"");a.html(d+"...");if(d.length<100){c=0;break}}if($(this).outerHeight()<=c)break;for(f=$(this).outerHeight();f==$(this).outerHeight();){e=
e.replace(/\s*([^\s]+)\s*$/,"");b.html(e+"...");if(e.length<100){c=0;break}}}}});$("ul#HomeSpotlightTabs").each(function(){$(this).css("padding-left",parseInt($(this).width()/2)-parseInt($(this).find("li").length*$(this).find("li").outerWidth()/2)+"px")});$("ul#HomeSpotlightTabs").tabs("div#HomeSpotlight > div",{effect:"fade",fadeOutSpeed:"fast",rotate:true}).slideshow({autoplay:true,interval:4E3,clickable:false});$("#PromosNavigation").width($("#NavigationPromos").width()-20);$("#PromosNavigation div.items > div").length>
1&&$("#PromosNavigation").scrollable({circular:true,speed:1E3}).autoscroll({autoplay:true,interval:9E3})}function addAnimsAccount(){$("#btnHaveAccount").length>0&&$("#btnHaveAccount").click(function(){$("#Account2").slideDown("slow");$("html,body").animate({scrollTop:$("#Account1").offset().top+$("#Account1").height()-50},1E3);return false});$(".important").length>0&&$("#Account2").slideDown("slow")}
function addAnimsEditContent(){$("#btnEditTags").length>0&&$("#btnEditTags").click(function(){$("#EditTags").slideDown("slow");$("#DisplayTags").slideUp("slow");return false});$("#btnStep2a").length>0&&$("#btnStep2a").click(function(){$("#stepTwoA").slideDown("slow");$("#stepTwoB").slideUp("slow");$("#stepTwoC").slideUp("slow");$("#stepTwoD").slideUp("slow");$("#stepThree").slideUp("slow");$("#stepFour").slideUp("slow");$("html,body").animate({scrollTop:$("#Step1").offset().top+$("#Step1").height()-
50},1E3);return false});$("#btnStep2b").length>0&&$("#btnStep2b").click(function(){$("#stepTwoB").slideDown("slow");$("#stepTwoA").slideUp("slow");$("#stepTwoC").slideUp("slow");$("#stepTwoD").slideUp("slow");$("#stepThree").slideUp("slow");$("#stepFour").slideUp("slow");$("html,body").animate({scrollTop:$("#Step1").offset().top+$("#Step1").height()-50},1E3);return false});$("#btnStep2c").length>0&&$("#btnStep2c").click(function(){$("#stepTwoC").slideDown("slow");$("#stepTwoA").slideUp("slow");$("#stepTwoB").slideUp("slow");
$("#stepTwoD").slideUp("slow");$("#stepThree").slideUp("slow");$("#stepFour").slideUp("slow");$("html,body").animate({scrollTop:$("#Step1").offset().top+$("#Step1").height()-50},1E3);return false});$("#btnStep2d").length>0&&$("#btnStep2d").click(function(){$("#stepTwoD").slideDown("slow");$("#stepTwoA").slideUp("slow");$("#stepTwoB").slideUp("slow");$("#stepTwoC").slideUp("slow");$("#stepThree").slideUp("slow");$("#stepFour").slideUp("slow");$("#btnWizStep3").show();$("html,body").animate({scrollTop:$("#Step1").offset().top+
$("#Step1").height()-50},1E3);return false});$("#btnStep3").length>0&&$("#btnStep3").click(eventCreateNewItem);$("#btnStep4").length>0&&$("#btnStep4").click(function(){$("#Step5").slideDown("slow");$(this).slideUp("slow");$("html,body").animate({scrollTop:$("#Step4").offset().top+$("#Step4").height()-50},1E3);return false});$("#btnWizStep3").length>0&&$("#btnWizStep3").click(function(){$("#stepThree").slideDown("slow");$(this).slideUp("slow");$("html,body").animate({scrollTop:$("#stepTwoD").offset().top+
$("#stepTwoD").height()-50},1E3);return false})}
function addChecksContent(){$("#btnSaveDiscussion").length>0&&$("#btnSaveDiscussion").click(function(){if($("#fieldComment").val().length<5){alert("The body of any item must be at least 5 characters long!\nPlease edit the body of this item and try again!");return false}if($("#fieldTitle").val().length<5){alert("The title of any item must be at least 5 characters long!\nPlease edit the title and try again!");return false}if($("#fieldTags").length>0){var a;a=new objStringReference($("#fieldTags").val(),
0);stringFixTags(a);$("#fieldTags").val(a.strValue);if(a.intResult==-1){alert("You must enter at least one tag!\nPlease double check the list of tags you wish to submit and try again!");return false}else if(a.intResult==-2){alert("Some of the tags you have entered contain illegal characters, these have been removed or converted to acceptable equivalents.\nPlease double check the list of tags you wish to submit and try again!");return false}}$("#formDiscussion").submit();$(this).unbind("click");$(this).removeClass("blue");
$(this).addClass("grey");return false});$("#btnSaveFixedDiscussion").length>0&&$("#btnSaveFixedDiscussion").click(function(){if($("#fieldFixedComment").val().length<5){alert("The body of any item must be at least 5 characters long!\nPlease edit the body of this item and try again!");return false}if($("#fieldTitle").length>0)if($("#fieldTitle").val().length<5){alert("The title of any item must be at least 5 characters long!\nPlease edit the title and try again!");return false}if($("#fieldTags").length>
0){var a;a=new objStringReference($("#fieldTags").val(),0);stringFixTags(a);$("#fieldTags").val(a.strValue);if(a.intResult==-1){alert("You must enter at least one tag!\nPlease double check the list of tags you wish to submit and try again!");return false}else if(a.intResult==-2){alert("Some of the tags you have entered contain illegal characters, these have been removed or converted to acceptable equivalents.\nPlease double check the list of tags you wish to submit and try again!");return false}}$("#formDiscussion").submit();
$(this).unbind("click");$(this).removeClass("blue");$(this).addClass("grey");return false});$("#btnSaveArticle").length>0&&$("#btnSaveArticle").click(function(){var a;if($("#formArticle").find("#fieldBody").val().length<5){alert("The body of any item must be at least 5 characters long!\nPlease edit the body of this item and try again!");return false}if($("#formArticle").find("#fieldTitle").val().length<5){alert("The title of any item must be at least 5 characters long!\nPlease edit the title and try again!");
return false}a=new objStringReference($("#formArticle").find("#fieldTags").val(),0);stringFixTags(a);$("#formArticle").find("#fieldTags").val(a.strValue);if(a.intResult==-1){alert("You must enter at least one tag!\nPlease double check the list of tags you wish to submit and try again!");return false}else if(a.intResult==-2){alert("Some of the tags you have entered contain illegal characters, these have been removed or converted to acceptable equivalents.\nPlease double check the list of tags you wish to submit and try again!");
return false}$(this).unbind("click");$(this).removeClass("blue");$(this).addClass("grey");$("#formArticle").submit();return false});$("#btnWizSubmit").length>0&&$("#btnWizSubmit").click(function(){if($("#Description").val().length<5){alert("Your review must be at least 5 characters long!\nVery short reviews are best submitted as comments, so if this is about a paragraph or less long, add it as a comment instead!");return false}if($("#idTitle").val().length<5){alert("The title of any item must be at least 5 characters long!\nPlease edit the title and try again!");
return false}$(this).unbind("click");$(this).removeClass("blue");$(this).addClass("grey");$("#formTemplate").submit();return false});$("#btnAddComment").length>0&&$("#btnAddComment").click(function(){if(jQuery().tinymce){tinyMceEditorObject.theme_advanced_buttons1="bold,italic,underline,separator,link,unlink,image";tinyMceEditorObject.theme_advanced_toolbar_align="center";$("#FormComment1").slideDown(400,function(){$("#fieldComment").tinymce(tinyMceEditorObject)})}else $("#FormComment1").slideDown(400);
$(this).slideUp(400);$("#fieldComment").width($("h5").width()-$("label").width());$("#fieldComment").height(150);return false});if($(".Advisor").length>0)if(jQuery().tinymce){$(".AdvisorSave").hide();$(".Advisor").html('<div style="margin-left: 175px;">Click to check your submission for suggestions, common mistakes, etc...</div><a href="#" style="width: 150px; margin-left: 175px; margin-top: 10px;" class="cbtn blue"><i></i><span><span></span><i></i>Check Article</span></a>');$(".Advisor a").click(function(){var a,
b,c;$(".AdvisorSave").show();c=$(this).parent().attr("data-checkname");b=$("#"+$(this).parent().attr("data-checkfield")).html();a="<ul>";if($(this).parent().attr("data-checklength")){var d;d=b.replace(/\[\/?[a-z0-9_=".]+?\]/ig,"");d=d.replace(/\[\/?url.*?\]/ig,"");d=d.replace(/\s/ig,"");if(d.length<1500)a+="<li><b>Short "+c+"</b><br/>Your "+c.toLowerCase()+" is very short, perhaps you should consider adding this as a comment instead? "+c+"s take up a whole page and visitors might not want to read them if they contain very little about the subject you are covering and what you thought about it.</li>"}if($(this).parent().attr("data-checkforimages"))if(b.search(/\[img.+?]/ig)==
-1)a+="<li><b>No Images</b><br/>Your "+c.toLowerCase()+" seems not to be illustrated with any images or screenshots, these can help break up the text and make it visually more appealing and fun to read.</li>";if($(this).parent().attr("data-checkparagraphs")){var e;e=false;b.replace(/.{750,}/g,function(){e=true});if(e)a+="<li><b>Long Paragraphs</b><br/>Your "+c.toLowerCase()+" contains one or more long paragraphs, these can make text harder for people to read. Consider adding more line breaks to make your work easier for people to scan.</li>"}if($(this).parent().attr("data-checkbuytag"))if(b.search(/\[buy\].+?\[\/buy\]/ig)==
-1)a+="<li><b>No Buy Tag</b><br/>If your article contains a product, consider surrounding the title of the product with our buy hint tags. These let people find cheap places to buy them from appear more accurately next to articles. Eg. [buy]Star Wars[/buy]</li>";if(a=="<ul>")a="<ul><li>No problems found!</li></ul>";else a+="</ul>";$(this).parent().children("div").hide();$(this).parent().children("div").html(a);$(this).parent().children("div").slideDown(1E3);$(this).parent().children("a").html("<i></i><span><span></span><i></i>Re-check "+
c.toLowerCase()+"</span>");return false})}$("#errorNotify").length>0&&alert($("#errorNotify").text());$(".decrypt").each(function(){var a;a=typeof $(this).attr("href")=="undefined"?$(this).text():$(this).attr("href");a=a.replace(/([a-z0-9_.-]+)\[at\]([a-z0-9_.-]+)/ig,function(b,c,d){b="";for(var e=0;e<c.length;e++)b=c.charAt(e)+b;c="";for(e=0;e<d.length;e++)c=d.charAt(e)+c;return b+"@"+c});typeof $(this).attr("href")=="undefined"?$(this).text(a):$(this).attr("href",a)})}
function addChecksAuths(){$("#btnAppRefuse").length>0&&$("#btnAppRefuse").click(function(){return confirm("You are REFUSING this entry, this will delete the entry from the site.\nThere is no easy way to undo this action.\nAre you sure you wish to REFUSE this entry?")});$("#btnAppAccept").length>0&&$("#btnAppAccept").click(function(){return confirm("You are marking this entry for APPROVAL, this will make the entry public so it appears in searches and on index pages.\nAre you sure you wish to APPROVE this entry?")})}
function addStylesGeneral(){$(".shaded").length>0&&$(".shaded").each(function(){var a;$(this).css("display","block");a=$(this).getHiddenDimensions();$(this).wrap("<div class='ibox' style='width:"+(a.w+19)+"px;'><div class='iboxtitle'></div></div>");$(this).parent().parent().prepend("<b class='iboxtop'><b class='iboxb1'></b><b class='iboxb2'></b><b class='iboxb3'></b><b class='iboxb4'></b></b>");$(this).parent().parent().append("<b class='iboxbottom'><b class='iboxb4'></b><b class='iboxb3'></b><b class='iboxb2'></b><b class='iboxb1'></b></b>")});
$(".shadednw").length>0&&$(".shadednw").each(function(){$(this).css("display","block");$(this).getHiddenDimensions();$(this).wrap("<div class='ibox'><div class='iboxtitle'></div></div>");$(this).parent().parent().prepend("<b class='iboxtop'><b class='iboxb1'></b><b class='iboxb2'></b><b class='iboxb3'></b><b class='iboxb4'></b></b>");$(this).parent().parent().append("<b class='iboxbottom'><b class='iboxb4'></b><b class='iboxb3'></b><b class='iboxb2'></b><b class='iboxb1'></b></b>")});$("#formSearch").length>
0&&$("#formSearch").height()>25&&$("#helpSearchBox").width(140);if($("#LogoCrop").length>0){$("#LogoCrop").width()<317&&$("#LogoCrop").width(232);$("#LogoCrop").click(function(){window.location="/"})}$("#SearchAndBuy").length>0&&$.get("/searchBuy.asp",{a:$("#SearchAndBuy").attr("alt")},eventSearchAndBuy,"text")}function addChangeLinks(){$('a[href^="http://"]').each(function(){$(this).attr("href").search(/^http:\/\/[a-z]+\.myreviewer\.com/i)==-1&&$(this).attr("target","_blank")})}
function addPromotional(){if($.cookie("twitterprompted")!=1&&(!$.cookie("twitterpromptcount")||parseInt($.cookie("twitterpromptcount"))<3)){$.cookie("twitterpromptcount")?$.cookie("twitterpromptcount",parseInt($.cookie("twitterpromptcount"))+1,{expires:186,path:"/"}):$.cookie("twitterpromptcount","1",{expires:186,path:"/"});$.cookie("twitterprompted","1",{expires:7,path:"/"});var a;$("#Container").append('<div id="PromoDiv" style="display: none; position: absolute; width: 500px; padding: 15px; background-color: #BDE2F9; border: 1px solid blue;"><span id="PromoClose" style="float: right; cursor: pointer; color: blue;">close X</span><h2 style="margin-top: 0px;">Follow us on Twitter!</h2><p><a href="https://twitter.com/myreviewer" target="_blank"><img src="http://images.myreviewer.com/icons/myreviewerontwitter.gif" width="500" height="153" border="0"></a><br/>For highlights of the latest news and reviews!</p><div>');
a=$("#Container").offset();a.left+=50;a.top+=380;$("#PromoDiv").offset(a);$("#PromoDiv").slideDown(2E3);$("#PromoDiv a").click(function(){$("#PromoDiv").slideUp()});$("#PromoClose").click(function(){$.cookie("twitterpromptcount","1",{expires:186,path:"/"});var b,c,d,e,f,k;k=$("#PromoDiv");d=$("#NavigationBrowseList div");if(d.length){c=d.offset();b=k.offset();e=d.width();f=d.height();d="-="+(b.left-c.left)+"px";b="-="+(b.top-c.top)+"px";k.animate({left:d,top:b,width:e,height:f},1500,"swing",function(){$(this).fadeOut(1E3,
function(){$(this).remove()})})}else k.fadeOut()})}}function addEditHelpers(){$("textarea.expvertical").length>0&&$("textarea.expvertical").autoResize()}
function addToolTips(){var a=navigator.userAgent;a.match(/iPad/i)||a.match(/iPhone/i)||parseInt($.cookie("hidetooltips"))!=1&&$("[title]").tooltip({effect:"slide",layout:'<div><span class="hidealltooltips">hide all tooltips</span></div>',delay:1E3,onShow:function(){$("body").data("lasttooltip",this);$(".hidealltooltips").click(function(){$(".tooltip").fadeOut(500);$.cookie("hidetooltips","1",{expires:186,path:"/"})})},onBeforeShow:function(){if($("body").data("lasttooltip")){$("body").data("lasttooltip").hide();
$("body").data("lasttooltip",null)}}}).dynamic({bottom:{direction:"down",bounce:true}})}function bookmarkPrompt(a,b){if(window.sidebar)window.sidebar.addPanel(a,b,"");else window.external&&window.external.AddFavorite(b,a)}function bookmarkGetText(){return window.sidebar?"Bookmark Page":window.external?"Add to Favorites":""}var strSearchAndBuyText="";
function eventSearchAndBuy(a){strSearchAndBuyText=a;$("#SearchAndBuy").slideUp(400,function(){$("#SearchAndBuy").html(strSearchAndBuyText);$("#SearchAndBuy").slideDown(400,function(){$("#btnMoreBuyOptions").length>0&&$("#btnMoreBuyOptions").click(function(){$("#btnMoreBuyOptions").slideUp(400);$("#divMoreBuyOptions").slideDown(400);return false})})})}var intUploadSessionID=0;
function addFeaturesUpload(){if($("#ImageCover").length>0){intUploadSessionID=(new Date).getTime();$("body").append('<div id="progressbar"></div>');$("body").append('<iframe id="UploadFrame" src="/blank.htm" frameBorder="0" style="display: none; border: 0; padding: 0; margin: 0;"></iframe>');$("#progressbar").progressbar({value:0});$("#progressbar").hide();$("#ImageCover").after('<a href="#" id="Upload" style="width: 100px; float: left; margin-right: 5px; margin-top: 2px;" class="cbtn blue"><i></i><span><span></span><i></i>Upload</span></a><div id="PreviewImage" style="margin-left: 170px; margin-top: 5px; margin-bottom: 5px;"></div>');
$("#Upload").click(function(){var a;$("#UploadFrame").show();$("#Upload").attr("disabled","disabled");$("#ImageCover").height($("#ImageCover").height()+3);a=$("#ImageCover").offset();a.left+=10;$("#UploadFrame").offset(a);$("#UploadFrame").width($("#ImageCover").width()-5);$("#UploadFrame").height($("#ImageCover").height());$("#UploadFrame").contents().find("body").append('<form method="post" enctype="multipart/form-data" name="form1" id="formUpload" action="http://upload.myreviewer.com/cgi-bin/uploadv3.cgi?sID='+
intUploadSessionID+'"><input type="file" name="file1" id="fieldUpload" onchange="parent.eventStartUpload();" /></form>');$("#UploadFrame").contents().find("#fieldUpload").trigger("click");return false})}$("#SubmitFile0").length>0&&$("#SubmitFile0").click(eventAddNewImageUploadForm)}
function eventAddNewImageUploadForm(){var a,b,c,d;a=parseInt(this.id.match(/SubmitFile([0-9]+)/i)[1]);c=$("#formUploadFile"+a);b=c.outerHTML();b=b.replace(RegExp("File"+a,"ig"),"File"+(a+1));b=b.replace(/\?s=([0-9]+)/i,"?s="+(new Date).getTime());$("#formUploadFile"+a).after(b);$("#UseAsCoverFile"+(a+1)).remove();$("#SubmitFile"+(a+1)).click(eventAddNewImageUploadForm);$(this).hide();b=$("#idFile"+a);c.before('<div class="UploadInfo">Upload for '+b.val()+"</div>");$("body").append('<div id="progressbarFile'+
a+'"></div>');a=$("#progressbarFile"+a);a.progressbar({value:0});a.offset(b.offset());a.width(b.width());a.height(b.height());a.addClass("prog_alive");d=c.attr("action").match(/\?s=([0-9]+)/i)[1];a.data("sid",d);(d=c.attr("action").match(/\&a=([0-9]+)/i))&&a.data("article",d[1]);a.data("form",c);a.data("coverarea",b);if($("body").data("uploadtimeout")!=true){setTimeout("eventUploadNewImageTrigger()",3E3);$("body").data("uploadtimeout",true)}return true}
function eventStartUpload(){$("#UploadFrame").contents().find("#formUpload").submit();$("#UploadFrame").hide();$("#progressbar").show();$("#progressbar").progressbar("option","value",0);$("#progressbar").offset($("#ImageCover").offset());$("#progressbar").width($("#ImageCover").width());$("#progressbar").height($("#ImageCover").height());setTimeout("eventUploadTrigger()",3E3)}
function eventUploadTrigger(){$.ajaxSetup({cache:false});$.get("/uploadstatus.asp",{sessionid:intUploadSessionID},eventUploadProgress,"text")}function eventUploadNewImageTrigger(){$("body").data("uploadtimeout",false);$.ajaxSetup({cache:false});$(".prog_alive").each(function(){$(this).data("sid")&&$.get("/uploadstatus_v3_newimg.asp",{sessionid:$(this).data("sid"),article:$(this).data("article")},eventUploadNewImageProgress,"text")})}
function eventUploadNewImageProgress(a){var b,c,d,e;a=a.split("-");b=parseInt(a[0]);c=parseInt(a[1]);d=parseInt(a[2]);e=a[3];$(".prog_alive").each(function(){if($(this).data("sid")==c){$(this).offset($(this).data("coverarea").offset());$(this).width($(this).data("coverarea").width());$(this).height($(this).data("coverarea").height());$(this).progressbar("option","value",d);switch(b){case 1:var f;if(f=decodeImageString(e).match(/([0-9]*).jpg\|([0-9]*)/i)){for(;f[1].length<10;)f[1]="0"+f[1];e=f[1]}$(this).data("form").replaceWith('<a href="/NewImage/a'+
f[2]+'"><img src="http://images.myreviewer.co.uk/small/'+e+'.jpg" style="max-width: 100; max-height: 50;" /></a>');$(this).progressbar().remove();break;case 2:alert(e);$(this).progressbar().remove()}}});if($("body").data("uploadtimeout")!=true){setTimeout("eventUploadNewImageTrigger()",3E3);$("body").data("uploadtimeout",true)}}
function eventUploadProgress(a){var b,c;c=a.split("-");a=parseInt(c[0]);b=parseInt(c[1]);c=c[2];$("#progressbar").progressbar("option","value",b);if(a==0)setTimeout("eventUploadTrigger()",3E3);else{if(a==1){$("#ImageCover").val(c);$("#PreviewImage").empty();if(a=decodeImageString(c).match(/([0-9]*).jpg\|([0-9]*)/i)){for(;a[1].length<10;)a[1]="0"+a[1];for(;a[2].length<10;)a[2]="0"+a[2];c=a[1];$("#PreviewImage").html('<img src="http://images.myreviewer.co.uk/small/'+c+'.jpg" style="max-width: 100; max-height: 50;" />')}}else alert(c);
$("#progressbar").hide();$("#UploadFrame").remove();$("body").append('<iframe id="UploadFrame" src="/blank.htm" frameBorder="0" style="display: none; border: 0; padding: 0; margin: 0;"></iframe>');$("#Upload").removeAttr("disabled")}}
function decodeImageString(a){var b;if(a.substr(0,2)=="DE")a=a.substr(2);else return a;b="";for(var c=0;c<a.length;c++)if(a.charAt(c)=="Z")b+=".";else if(a.charAt(c)=="Y")b+="|";else if(a.charAt(c)=="X")b+="=";else{var d;d=a.charCodeAt(c);b+=d>64&&d<75?String.fromCharCode(48+(d-65)):a.charAt(c)}return b}function eventCreateNewItem(){$("#Step4").slideDown("slow");$("#Step3").slideUp("slow");$("html,body").animate({scrollTop:$("#Step3").offset().top},1E3);return false}
function clickInsertTag(a){if($("#formDiscussion").find("#fieldTags").is(":visible")){var b;b=$("#formDiscussion").find("#fieldTags").val();b=b.replace(/^\s*|\s*$/g,"");b+="\n"+a;$("#formDiscussion").find("#fieldTags").val(b)}if($("#formArticle").find("#fieldTags").is(":visible")){b=$("#formArticle").find("#fieldTags").val();b=b.replace(/^\s*|\s*$/g,"");b+="\n"+a;$("#formArticle").find("#fieldTags").val(b)}}var intLastTemplateType;
function clickWizSelect(a,b){intLastTemplateType=a;$("#idAttachmentType").val(intLastTemplateType);$("#stepFour").slideDown("slow");$(".idItemName").text(b);$("#idItemTag").val(b);$("html,body").animate({scrollTop:$("#stepThree").offset().top+$("#stepThree").height()-50},1E3)}
function clickWizNewItem(){$("#idTitle").val("Review for "+$("#formNewItem").find("#fieldTitle").val());$("#idProductTitle").val($("#formNewItem").find("#fieldTitle").val());$("#btnWizNewItem").slideUp("slow");$("#stepFive").slideDown("slow");$("html,body").animate({scrollTop:$("#stepFour").offset().top+$("#stepFour").height()-50},1E3);return false}function objStringReference(a,b){this.strValue=a;this.intResult=b}
function stringFixTags(a){var b;b=a.strValue;b=b.replace(/`/g,"'");b=b.replace(/\ufffd/g,"'");b=b.replace(/\ufffd/g,"'");b=b.replace(/\ufffd/g,"'");b=b.replace(/^\s+|\s+$/g,"");if(b.length==0){a.strValue=b;a.intResult=-1;return false}if(b.search(/[^-a-zA-Z0-9.&' \r\n]+/)!=-1){b=b.replace(/,/g,"\r\n");b=b.replace(/;/g,"\r\n");b=b.replace(/[\ufffd]/g,"ae");b=b.replace(/&#230;/g,"ae");b=b.replace(/[\ufffd]/g,"AE");b=b.replace(/&#198;/g,"AE");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd]/g,"a");
b=b.replace(/&#22[4-9];/g,"a");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd]/g,"A");b=b.replace(/&#19[23567];/g,"A");b=b.replace(/[\ufffd]/g,"c");b=b.replace(/&#231;/g,"c");b=b.replace(/[\ufffd]/g,"C");b=b.replace(/&#199;/g,"C");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd]/g,"e");b=b.replace(/&#23[2-5];/g,"e");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd]/g,"E");b=b.replace(/&#20[0-3];/g,"E");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd]/g,"i");b=b.replace(/&#23[6-9];/g,"i");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd]/g,
"I");b=b.replace(/&#20[4-7];/g,"I");b=b.replace(/[\ufffd]/g,"n");b=b.replace(/&#241;/g,"n");b=b.replace(/[\ufffd]/g,"N");b=b.replace(/&#209;/g,"N");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd\ufffd]/g,"o");b=b.replace(/&#24[2-6];/g,"o");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd\ufffd]/g,"O");b=b.replace(/&#21[0-4];/g,"O");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd]/g,"u");b=b.replace(/&#249;/g,"u");b=b.replace(/&#25[0-2];/g,"u");b=b.replace(/[\ufffd\ufffd\ufffd\ufffd]/g,"U");b=b.replace(/&#21[7-9];/g,"U");b=
b.replace(/&#220;/g,"U");b=b.replace(/[\ufffd\ufffd]/g,"y");b=b.replace(/&#25[35];/g,"y");b=b.replace(/[\ufffd]/g,"Y");b=b.replace(/&#221;/g,"Y");b=b.replace(/[^-a-zA-Z0-9.&' \r\n]+/g,"");a.strValue=b;a.intResult=-2;return false}a.strValue=b;a.intResult=0;return true}function insertAdBlockCheckIntoDiv(a,b){if($(a).length>0)if(bolAdBlocked&&b){b=b.replace("$1",strLine1);b=b.replace("$2",strLine2);objScript.parentNode.innerHTML=b;$(a).outer(b)}}
var tinyMceEditorObject={script_url:"/scripts/tiny_mce/tiny_mce.js",theme:"advanced",mode:"none",plugins:"paste,searchreplace,fullscreen,pagebreak,inlinepopups,lists,autolink,myrevcode,myrevimage,myrevlink",theme_advanced_buttons1:"styleselect,bold,italic,underline,separator,bullist,numlist,pagebreak,separator,link,unlink,image,separator,myquote,mycode,myspoiler,myblock,separator,selectall,removeformat,separator,fullscreen,code",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",
theme_advanced_toolbar_align:"left",style_formats:[{title:"Heading",inline:"span",classes:"forumheading"},{title:"Subheading",inline:"span",classes:"forumsubheading"},{title:"Big",inline:"span",classes:"forumbig"},{title:"Small",inline:"span",classes:"forumsmall"},{title:"Colours"},{title:"Red",inline:"span",classes:"forumred"},{title:"Green",inline:"span",classes:"forumgreen"},{title:"Blue",inline:"span",classes:"forumblue"},{title:"Purple",inline:"span",classes:"forumpurple"},{title:"Teal",inline:"span",
classes:"forumteal"}],theme_advanced_text_colors:"FF0000,0000FF,00FF00,800080,008080",theme_advanced_more_colors:false,entity_encoding:"raw",add_unload_trigger:false,remove_linebreaks:false,forced_root_block:"div",force_br_newlines:true,force_p_newlines:false,convert_newlines_to_brs:false,inline_styles:false,convert_fonts_to_spans:true,font_size_classes:"forumheading,forumsubheading,forumbig,forumnormal,forumnormal,forumnormal,forumsmall",skin:"o2k7",gecko_spellcheck:true,cleanup:true,cleanup_on_startup:true,
apply_source_formatting:false,fix_list_elements:true,fix_table_elements:true,fix_nesting:true,valid_elements:"-h1,-h2,-h3,-h4,-h5,-h6,br,-b/strong,-u,-i/em,-span[!class],img[src|class],-a[!href],-ol,-ul,-li,hr",trim_span_elements:false,remove_trailing_nbsp:true,content_css:"/styles/wysiwyg.css",verify_css_classes:false,object_resizing:false,urlconverter_callback:"myCustomURLConverter",paste_auto_cleanup_on_paste:true,paste_preprocess:pastePreprocess,paste_postprocess:pastePostprocess,paste_convert_middot_lists:true,
paste_retain_style_properties:"text-align",paste_strip_class_attributes:"none",paste_remove_spans:true,paste_remove_styles:true,paste_block_drop:true,pagebreak_separator:"<hr />",setup:function(a){a.addButton("myquote",{title:"Quote Block",image:"/Scripts/tiny_mce/themes/advanced/img/quote.gif",onclick:function(){a.focus();a.selection.setContent('<span class="forumquote">'+a.selection.getContent({skip:true})+"</span>")}});a.addButton("mycode",{title:"Code Block",image:"/Scripts/tiny_mce/themes/advanced/img/code.gif",
onclick:function(){a.focus();a.selection.setContent('<span class="forumcode">'+a.selection.getContent({skip:true})+"</span>")}});a.addButton("myspoiler",{title:"Spoiler Block",image:"/Scripts/tiny_mce/themes/advanced/img/spoiler.gif",onclick:function(){a.focus();a.selection.setContent('<span class="forumspoiler">'+a.selection.getContent({skip:true})+"</span>")}});a.addButton("myblock",{title:"Area Block",image:"/Scripts/tiny_mce/themes/advanced/img/block.gif",onclick:function(){a.focus();a.selection.setContent('<span class="forumblock">'+
a.selection.getContent({skip:true})+"</span>")}})}};function myCustomURLConverter(a,b){if(b=="img")if(a.indexOf("http://images.myreviewer.co.uk")!=0&&a.match(/^http:\/\/[a-z]*.myreviewer.co.uk\/scripts\/tiny_mce/ig)==null)return"http://images.myreviewer.co.uk/brokenimage.gif";return a}
function pastePreprocess(a,b){var c=b.content;c=c.replace(/[\r\n]/g," ");if(c.search(/<p [^>]*>/i)!=-1){c=c.replace(/<p>([\s\S]*?)<\/p>/ig,"$1<br />");c=c.replace(/<p style="[^"]+" align="[^"]+">([\s\S]*?)<\/p>/ig,"$1<br />");c=c.replace(/<p class="?[a-z0-9_]+"?[^>]*>([\s\S]*?)<\/p>/ig,"$1<br />");c=c.replace(/<p ?[^>]*>([\s\S]*?)<\/p>/ig,"$1<br /><br />")}else c=c.replace(/<p>([\s\S]*?)<\/p>/ig,"$1<br /><br />");b.content=c}
function pastePostprocess(a,b){var c=b.node.innerHTML;c=c.replace(/&nbsp;/ig," ");c=c.replace(/<div[^>]*>([\s\S]*?)<\/div>/ig,"$1<br /><br />");c=c.replace(/<br\s*\/?>\s*<br\s*\/?>\s*<br\s*\/?>\s*<br\s*\/?>/ig,"<br /><br />");c=c.replace(/<br\s*\/?>\s*<br\s*\/?>\s*<br\s*\/?>/ig,"<br /><br />");c=c.replace(/<b>\s*<\/b>/ig,"");c=c.replace(/<i>\s*<\/i>/ig,"");c=c.replace(/\s*<br \/>\s*/ig,"<br />");b.node.innerHTML=c}
function wysiwygReAttachToTextAreas(){$("#fieldBody").tinymce(tinyMceEditorObject);$("#fieldDescription").tinymce(tinyMceEditorObject);$("#fieldFixedComment").tinymce(tinyMceEditorObject);$("#Description").tinymce(tinyMceEditorObject)}
jQuery.cookie=function(a,b,c){if(typeof b!="undefined"){c=c||{};if(b===null){b="";c.expires=-1}var d="";if(c.expires&&(typeof c.expires=="number"||c.expires.toUTCString)){if(typeof c.expires=="number"){d=new Date;d.setTime(d.getTime()+c.expires*864E5)}else d=c.expires;d="; expires="+d.toUTCString()}var e=c.path?"; path="+c.path:"",f=c.domain?"; domain="+c.domain:"";c=c.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),d,e,f,c].join("")}else{b=null;if(document.cookie&&document.cookie!=
""){c=document.cookie.split(";");for(d=0;d<c.length;d++){e=jQuery.trim(c[d]);if(e.substring(0,a.length+1)==a+"="){b=decodeURIComponent(e.substring(a.length+1));break}}}return b}};
jQuery.fn.gzoom=function(a){a=jQuery.extend({sW:10,sH:10,lW:20,lH:20,step:5,frameColor:"#cecece",frameWidth:1,re:/thumbs\//,replace:"",debug:false,overlayBgColor:"#000",overlayOpacity:0.8,containerBorderSize:10,containerResizeSpeed:400,loaderContent:"loading...",lightbox:false,zoomIcon:""},a);return this.each(function(){function b(h,g){h.load(function(){j.children("span.loader").fadeOut(250)}).error(function(){alert("Image does not exist or its SRC is not correct.")}).attr("src",g)}function c(h,g){a.debug&&
typeof console!="undefined"&&console.log("resize_fx("+h+","+g+")");if(h>$(window).width()*80/100){imgWidth=$(window).width()*80/100;g*=imgWidth/h;$("#zoomedimage").css({width:imgWidth+"px",height:g});a.debug&&typeof console!="undefined"&&console.log("Img dimensions 80% horizontal:"+imgWidth+"x"+g)}else imgWidth=h;if(g>$(window).height()*80/100){imgHeight=$(window).height()*80/100;imgWidth*=imgHeight/g;$("#zoomedimage").css({width:imgWidth+"px",height:imgHeight});a.debug&&typeof console!="undefined"&&
console.log("Img dimensions 80% vertical:"+imgWidth+"x"+imgHeight)}else imgHeight=g;a.debug&&typeof console!="undefined"&&console.log("Img dimensions:"+imgWidth+"x"+imgHeight);var n=$("#imagebox").width(),q=$("#imagebox").height(),r=imgWidth+a.containerBorderSize*2,p=imgHeight+a.containerBorderSize*2;n-=r;q-=p;$("#imagebox").animate({width:r,height:p},a.containerResizeSpeed,function(){f()});if(n==0&&q==0)$.browser.msie?l(250):l(100);$("#lboximgdatacontainer").css({width:imgWidth})}function d(){$("body").append('<div id="gzoomoverlay"></div><div id="gzoomlbox"><div id="imagebox"><div id="gzoom-cont-img"><img id="zoomedimage"><div id="gzoomloading"><a href="#" id="gzoomloadinglink"><img src="images/loading.gif"></a></div></div></div><div id="gzoomlbox-con-imgdata"><div id="lboximgdatacontainer"><div id="gzoomlbox-image-details"><span id="gzoom-image-caption"></span></div></div></div></div>');
$("#gzoomoverlay").css({backgroundColor:a.overlayBgColor,opacity:a.overlayOpacity,width:$(window).width(),height:$(document).height()}).fadeIn();$("#gzoomlbox").css({top:$(window).scrollTop()+$(window).height()/10,left:$(window).scrollLeft()}).show();$("#gzoomoverlay,#gzoomlbox").click(function(){k()});$(window).resize(function(){$("#gzoomoverlay").css({width:$(window).width(),height:$(window).height()});$("#gzoomlbox").css({top:$(window).scrollTop()+$(window).height()/10,left:$(window).scrollLeft()})});
e()}function e(){$("#gzoomlbox-con-imgdata").hide();$("#zoomedimage").hide();$("#gzoomloading").show();var h=new Image,g=m?i.attr("src").replace(a.re,a.replace):i.attr("src").replace(a.re,a.replace);h.onload=function(){$("#zoomedimage").attr("src",g);c(h.width,h.height)};h.src=g}function f(){$("#gzoomloading").hide();$("#zoomedimage").fadeIn(function(){$("#lightbox-loading").hide();$("#gzoom-image-caption").html(i.attr("title"));$("#gzoomlbox-con-imgdata").slideDown("fast")})}function k(){$("#gzoomlbox").remove();
$("#gzoomoverlay").fadeOut(function(){$("#gzoomoverlay").remove()});$("embed, object, select").css({visibility:"visible"})}function l(h){var g=new Date;do var n=new Date;while(n-g<h)}var m=false,j=jQuery(this).css({width:a.sW,height:a.sH,border:a.frameWidth+"px solid "+a.frameColor,overflow:"hidden"}).addClass("minizoompan");j.wrap('<div class="gzoomwrap"></div>').css({width:a.sW});var i=j.children().css({position:"relative"});jQuery(window).bind("load",function(){i.width(a.sW);i.height(a.sH)});jQuery("<span class='loader'>"+
a.loaderContent+"</span>").insertBefore(i);if(a.zoomIcon!=""&&a.lightbox){var s=jQuery('<img class="zoomIcon" src="'+a.zoomIcon+'" alt="view larger" />').insertBefore(i);s.load(function(){s.css({left:a.sW-s.width()+"px"}).show()});s.click(function(){d()})}else if(a.lightbox){j.click(function(){d()});j.css({cursor:"pointer"})}var t=jQuery('<div class="ui-icon ui-icon-circle-plus gzoombutton">&nbsp;</div>').insertAfter(j),o=jQuery('<div class="gzoomSlider"></div>').insertAfter(j).css({width:a.sW-42+
"px"}),u=jQuery('<div class="ui-icon ui-icon-circle-minus gzoombutton">&nbsp;</div>').insertAfter(j);t.click(function(){valore=parseInt(o.slider("value"))+a.step;o.slider("value",valore)});u.click(function(){valore=parseInt(o.slider("value"))-a.step;o.slider("value",valore)});o.slider({value:0,min:0,max:100,step:a.step,change:function(h,g){if(!m){var n=i.attr("src").replace(a.re,a.replace);b(i,n);j.children("span.loader").fadeIn(250);m=true}val=g.value;newWidth=a.sW+(a.lW-a.sW)*val/100;newHeight=
a.sH+(a.lH-a.sH)*val/100;ig_pos=i.position();a.debug&&typeof console!="undefined"&&console.log("new dimensions:"+newWidth+"x"+newHeight);deltaWidth=i.width()-a.sW;leftPos=Math.abs(ig_pos.left);leftFactor=leftPos/deltaWidth;newDeltaWidth=newWidth-a.sW;newLeft=leftFactor*newDeltaWidth*-1;deltaHeight=i.height()-a.sH;topPos=Math.abs(ig_pos.top);topFactor=topPos/deltaHeight;newDeltaHeight=newHeight-a.sH;newTop=topFactor*newDeltaHeight*-1;i.css({width:newWidth,height:newHeight,left:newLeft,top:newTop})}});
$('<br style="clear:both" />').insertAfter(t);j.mousemove(function(h){var g=j.width(),n=j.height(),q=i.width(),r=i.height(),p=j.offset();g=(h.pageX-p.left)*(g-q)/(g+a.frameWidth*2);h=(h.pageY-p.top)*(n-r)/(n+a.frameWidth*2);a.debug&&typeof console!="undefined"&&console.log("left:"+g+"|Top:"+h);i.css({left:g,top:h})});typeof $.event.special.mousewheel!="undefined"&&i.mousewheel(function(h,g){if(g>0){valore=parseInt(o.slider("value"))+a.step;o.slider("value",valore)}else if(g<0){valore=parseInt(o.slider("value"))-
a.step;o.slider("value",valore)}return false})})};
(function(a){function b(d){var e=[].slice.call(arguments,1),f=0;d=a.event.fix(d||window.event);d.type="mousewheel";if(d.wheelDelta)f=d.wheelDelta/120;if(d.detail)f=-d.detail/3;e.unshift(d,f);return a.event.handle.apply(this,e)}var c=["DOMMouseScroll","mousewheel"];a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var d=c.length;d;)this.addEventListener(c[--d],b,false);else this.onmousewheel=b},teardown:function(){if(this.removeEventListener)for(var d=c.length;d;)this.removeEventListener(c[--d],
b,false);else this.onmousewheel=null}};a.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}})})(jQuery);
(function(a){a.fn.getHiddenDimensions=function(b){var c={position:"absolute",visibility:"hidden",display:"block"},d={w:0,h:0},e=this.parents().andSelf().not(":visible"),f=[];e.each(function(){var k={},l;for(l in c){k[l]=this.style[l];this.style[l]=c[l]}f.push(k)});d.w=b===true?this.outerWidth():this.width();d.h=b===true?this.outerHeight():this.height();e.each(function(k){k=f[k];for(var l in c)this.style[l]=k[l]});return d}})(jQuery);$.fn.outer=function(a){if(a){$(a).insertBefore(this);$(this).remove()}else return $("<div>").append($(this).clone()).html()};
jQuery.fn.outerHTML=function(){return $("<div>").append(this.eq(0).clone()).html()};(function(a){a.fn.hasScrollBar=function(){return this.get(0).scrollHeight>this.height()}})(jQuery);(function(a){a.fn.scrollHeight=function(){return this.get(0).scrollHeight}})(jQuery);
(function(a){a.fn.autoResize=function(b){var c=a.extend({onResize:function(){},animate:true,animateDuration:150,animateCallback:function(){},extraSpace:20,limit:1E3},b);this.filter("textarea").each(function(){var d=a(this).css({resize:"none","overflow-y":"hidden"}),e=d.height(),f=function(){var m={};a.each(["height","width","lineHeight","textDecoration","letterSpacing"],function(j,i){m[i]=d.css(i)});return d.clone().removeAttr("id").removeAttr("name").css({position:"absolute",top:0,left:-9999}).css(m).attr("tabIndex",
"-1").insertBefore(d)}(),k=null,l=function(){f.height(0).val(a(this).val()).scrollTop(1E4);var m=Math.max(f.scrollTop(),e)+c.extraSpace,j=a(this).add(f);if(k!==m){k=m;if(m>=c.limit)a(this).css("overflow-y","");else{c.onResize.call(this);c.animate&&d.css("display")==="block"?j.stop().animate({height:m},c.animateDuration,c.animateCallback):j.height(m)}}};d.unbind(".dynSiz").bind("keyup.dynSiz",l).bind("keydown.dynSiz",l).bind("change.dynSiz",l)});return this}})(jQuery);

