function submitThis(a){document.getElementById(a).submit();}jQuery.fn.extend({makeGoogleMap:function(a,b){var c=jQuery(this);var d=null;if(GBrowserIsCompatible()){d=new GMap2(document.getElementById(c.attr("id")));
d.addControl(new GSmallMapControl());d.addControl(new GMapTypeControl());d.setCenter(new GLatLng(55.677031,12.570617),8);c.data("googleMap",d);if(a){c.findGoogleMapAddress(a,b);
}}return this;},findGoogleMapAddress:function(a,b){var d=jQuery(this);var c={animSpeed:1,showOnlyOnFind:false,showMarkerPopup:false};jQuery.extend(c,b);var f=d.data("googleMap");
if(!f){d.makeGoogleMap(a);}else{var g={placeMarker:function(j){f.checkResize();var h=new GLatLng(j.Point.coordinates[1],j.Point.coordinates[0]);f.setCenter(h);var i=new GMarker(h);
f.addOverlay(i);if(c.showMarkerPopup){i.openInfoWindowHtml(j.address);}GEvent.addListener(i,"click",function(){i.openInfoWindowHtml(j.address);});}};var e=new GClientGeocoder();
if(e){e.getLocations(a,function(h){if(!h||h.Status.code!=200){f.setZoom(4);}else{if(c.showOnlyOnFind){d.show(c.animSpeed,function(){g.placeMarker(h.Placemark[0]);
});}else{g.placeMarker(h.Placemark[0]);}}});}}return this;},charLengthLimit:function(a){jQuery(this).keyup(function(){$.MinglerTools.limitChars(this,a);});return this;
},charSetLimit:function(a,b){jQuery(this).keyup(function(){$.MinglerTools.limitCharSet(this,a,b);});return this;},numSizeLimit:function(a,b){jQuery(this).keyup(function(){jQuery(this).val($.validate.limitCharSet(jQuery(this).val(),$.validate.getCharSet("numeric")));
var c=jQuery(this).val();if(b&&c>b){jQuery(this).val(b);}else{if(a&&c<a){jQuery(this).val(a);}}});return this;},opusFocus:function(b){var a=jQuery(this).find("input:visible").filter(function(c){if(c==0){return jQuery(this);
}});a=jQuery(a).size()==0?jQuery(this).find("textarea:visible").filter(function(c){if(c==0){return jQuery(this);}}):a;jQuery(a).focus();if(b&&jQuery(a).val().length>0){jQuery(a).select();
}return this;},blink:function(b){var e=this;var d={type:"block",speed:500,limit:-1};jQuery.extend(d,b);if(d.limit>0||d.limit==-1){d.limit=d.limit>0?d.limit-1:d.limit;
if(d.type=="block"){jQuery(e).toggle(d.speed,function(){$(e).blink(d);});}if(d.type=="inline"){var a;if(jQuery("#blinkDummyTimer").size()<1){jQuery("body").append(jQuery("<div></div>").css({position:"absolute",width:1,height:1}).attr({id:"blinkDummyTimer"}));
}a=jQuery("#blinkDummyTimer");var c=jQuery(e).css("visibility")=="hidden";jQuery(a).animate({width:2},d.speed,function(){jQuery(e).css({visibility:(c?"visible":"hidden")});
$(e).blink(d);});}}return this;},confirmLink:function(b,a){jQuery(this).each(function(){var e=a;if(a.indexOf("%NAME%")!=-1){var c=jQuery(this).attr("name");e=e.replace(/%NAME%/g,c);
}if(a.indexOf("%TITLE%")!=-1){var d=jQuery(this).attr("title");e=e.replace(/%TITLE%/g,d);}jQuery(this).click(function(){var f=jQuery(this).attr("href");$.MinglerTools.confirmThis(null,f,"url",b,e);
return false;});});return this;},boxLoading:function(c,a){var b=c?c+"<br />":"";if(!a){jQuery(this).empty();}return jQuery("<div></div>").attr("class","tCenter vMiddle").css({padding:10,fontWeight:"bold"}).html(b).append(jQuery("<img />").attr({src:"/img/loadanim.gif",alt:"Loading..."})).prependTo(this);
}});jQuery.MinglerTools=function(){var l={confirmBox:{buttonYes:"Yes",buttonNo:"No"},alertBox:{buttonOk:"OK"},tabLoader:{notLoaded:"Content not loaded, please try again."},contentFilter:{confirmHeader:"Please confirm",confirmText:"Switch to subnet?",redirect:"/"}};
var e=false;var a=true;var u=0.97;var v=0.03;var f=function(y){var A=Math.round(y[0]*255);var z=Math.round(y[1]*255);var x=Math.round(y[2]*255);return"#"+(A<16?"0":"")+A.toString(16)+(z<16?"0":"")+z.toString(16)+(x<16?"0":"")+x.toString(16);
};var b=function(x){if(x.length==7){return[parseInt("0x"+x.substring(1,3))/255,parseInt("0x"+x.substring(3,5))/255,parseInt("0x"+x.substring(5,7))/255];}else{if(x.length==4){return[parseInt("0x"+x.substring(1,2))/15,parseInt("0x"+x.substring(2,3))/15,parseInt("0x"+x.substring(3,4))/15];
}}};var s=function(y,x,z){z=(z<0)?z+1:((z>1)?z-1:z);if(z*6<1){return y+(x-y)*z*6;}if(z*2<1){return x;}if(z*3<2){return y+(x-y)*(0.66666-z)*6;}return y;};var o=function(x){if(x>u){return u;
}if(x<v){return v;}return x;};var r=function(C){var z,E,F,A,G,y;var x=o(C[0]),B=o(C[1]),D=o(C[2]);z=Math.min(x,Math.min(B,D));E=Math.max(x,Math.max(B,D));F=E-z;y=(z+E)/2;
G=0;if(y>0&&y<1){G=F/(y<0.5?(2*y):(2-2*y));}A=0;if(F>0){if(E==x&&E!=B){A+=(B-D)/F;}if(E==B&&E!=D){A+=(2+(D-x)/F);}if(E==D&&E!=x){A+=(4+(x-B)/F);}A/=6;}return[A,G,y];
};var j=function(C){var E,D,x,A,B;var z=C[0],F=C[1],y=C[2];D=(y<=0.5)?y*(F+1):y+F-y*F;E=y*2-D;return[s(E,D,z+0.33333),s(E,D,z),s(E,D,z-0.33333)];};var q=function(x,y){if(x+y>255){return 255;
}else{if(x+y<0){return 0;}else{return x+y;}}};var t=function(x){if(x){$("select").css("visibility","hidden");}if(!x){$("select").css("visibility","visible");}};var n=function(x,y){if(x){var A=jQuery("<div></div>").attr("id","autoLoadingBox").append(jQuery("<img />").attr({src:"/img/loadanim.gif",alt:"Please Wait"}));
var z=200;var B=$.MinglerTools.getPopupPosition(z);jQuery(A).css({width:z,left:B.left,top:(B.top+50)});if(y){return jQuery(A).prepend(jQuery("<div></div>").html(y));
}else{return A;}}else{$.MinglerTools.destroyElement(jQuery("#autoLoadingBox"),{gracefully:true});}};var i={confirm:"iconWarning",alert:"iconAlert"};var c=function(x,A,y){if(a){var z='<img src="/img/s.gif" class="iconS '+x+'" alt="'+(A?A:"icon")+'" />';
if(A&&!y){z+='<span class="iconText">'+A+"</span>";}return z;}else{return A?A:"";}};var m=function(y){if(typeof y=="string"){return true;}if(typeof y=="object"){var x=y.constructor.toString().match(/string/i);
return(x!=null);}return false;};var d=function(A,z){var x=400;var y=$.MinglerTools.getPopupPosition(x);return jQuery("<div></div>").css({opacity:0,width:x,left:y.left,top:y.top}).attr("id","globalConfirmBox").append(jQuery("<h2></h2>").attr("class","confirmBoxHeader").html(c(i.confirm,A)),jQuery("<div></div>").attr("class","confirmBoxContent").append(jQuery("<div></div>").attr("class","globalConfirmText").css({paddingBottom:20}).html(z),jQuery("<table></table>").attr("class","grid").append(jQuery("<tr></tr>").append(jQuery("<td></td>").append(jQuery("<a></a>").attr({href:"javascript:;","class":"buttonYes"}).click(function(){$.MinglerTools.confirmThis(true);
return false;}).html(l.confirmBox.buttonYes)),jQuery("<td></td>").append(jQuery("<a></a>").attr({href:"javascript:;","class":"buttonNo"}).click(function(){$.MinglerTools.confirmThis(false);
return false;}).html(l.confirmBox.buttonNo)))))).animate({opacity:1},300);};var p={redirectMethod:"",redirectString:""};var g=function(A,z){var x=400;var y=$.MinglerTools.getPopupPosition(x);
return jQuery("<div></div>").css({opacity:0,width:x,left:y.left,top:y.top}).attr("id","globalAlertBox").append(jQuery("<h2></h2>").attr("class","alertBoxHeader").html(c(i.alert,A)),jQuery("<div></div>").attr("class","alertBoxContent").append(jQuery("<div></div>").attr("class","globalAlertText").css({paddingBottom:20}).html(z),jQuery("<div></div>").append(jQuery("<a></a>").attr({href:"javascript:;","class":"button"}).css({width:80}).click(function(){$.MinglerTools.alertThis(true);
return false;}).html(l.alertBox.buttonOk)))).animate({opacity:1},300);};var k=function(z){var x=parseInt(jQuery("#pageCon").width());var A=860;var y=((x/2)-(A/2));
return jQuery("<div></div>").attr({id:"imageBox","class":"tCenter vMiddle"}).css({zIndex:1000,position:"absolute",left:y,top:50,width:A,minHeight:700,backgroundColor:"#FFFFFF",cursor:"pointer",opacity:0}).append(jQuery("<div></div>").attr({id:"imageFrame","class":"tCenter cMiddle fullscreenImage"}).css({backgroundColor:"#000000",margin:30}));
};var h={width:800,height:600};var w=false;return{contentFilter:function(z,B,x,y){w=x;if(y){var A=z+","+B+","+x;$.MinglerTools.confirmThis(null,"lurk|"+A,"callback",l.contentFilter.confirmHeader,l.contentFilter.confirmText);
}else{$.ajax({url:"/changelocale.jsp?"+z+"="+B,processData:false,complete:function(D,C){if(C=="success"){if(w){location.href="/";}else{location.href=l.contentFilter.redirect;
}}}});}},goPublic:function(z,x){var y="/ajax/gopublic.jsp?answer="+z;$.ajax({type:"GET",url:y,dataType:"html",success:function(A){if(!z){location.href="/member/warroom.jsp";
}},error:function(C,A,B){alert("error: "+B);}});},customSelectBox:function(x,y,z){if(z){if(jQuery(x).css("display")!="none"){jQuery(x).slideUp(200);jQuery(y).attr("src","/img/icon/down.gif");
}}else{if(jQuery(x).css("display")=="none"){jQuery(x).slideDown(200);jQuery(y).attr("src","/img/icon/up.gif");}else{jQuery(x).slideUp(200);jQuery(y).attr("src","/img/icon/down.gif");
}}},quickSearch:function(y,x){var z=jQuery(y).val();if($.trim(z).length<1){$.feedback.markInput(y);}else{location.href=x+z;}return false;},doSearch:function(z){var x=z?$("#advancedSearch"):$("#simpleSearch");
if(!z){var y=$("#textQuery");if($.trim(jQuery(y).val()).length<1){$.feedback.markInput(y);return;}}jQuery(x).submit();},blinds:function(z,x){var B=jQuery(z).parent();
var y=jQuery(B).next();var A=jQuery(y).css("display")=="none";if(A&&!x){jQuery(B).css({marginBottom:0});jQuery(y).slideDown(500,function(){if(jQuery.browser.msie){jQuery(this).css({zoom:1});
}if(a){jQuery(z).attr("class","blindsIcon iconBlinds_up");}else{jQuery(z).attr("class","blindsIcon").html("-");}});}else{if(!A){jQuery(y).slideUp(500,function(){jQuery(B).css({marginBottom:10});
if(a){jQuery(z).attr("class","blindsIcon iconBlinds_down");}else{jQuery(z).attr("class","blindsIcon").html("+");}});}}},viewHelp:function(y){var x=y?"/help.jsp?helpId="+y:"/help.jsp";
window.open(x,"help","scrollbars=yes,width=650,height=600,left=20,top=20");},viewPage:function(y,A,x){var z=A&&x?"scrollbars=yes, width="+A+", height="+x:"scrollbars=yes";
window.open(y,"view",z);},limitChars:function(y,x){var B=jQuery(y).val();var z=jQuery(y).attr("id");var C=(x-B.length)>0?x-B.length:"0";var A=jQuery("span#"+z+"_limit");
if(jQuery(A).size()==1){jQuery(A).html(C);}if(B.length>x){jQuery(y).val(B.substring(0,x));}},loadTab:function(H,z,G,A){var F=A==null?1:A;var B="subTabsContent-"+H;
var D="subTabs-"+H;var C=G.indexOf("?")!=-1?"&":"?";var x=G+C+"page="+F+"&tabSetId="+H+"&tabId="+z;var y=jQuery("div#"+B);if(jQuery(y).size()!=1){return;}var E=$(y).height();
jQuery(y).css({minHeight:E});jQuery(y).empty().append(jQuery("<h2></h2>").attr("class","boxHeader").html("&nbsp;"),jQuery("<div></div>").attr("class","boxContent tCenter vMiddle").css({padding:20}).html('<img src="/img/loadanim.gif" alt="" />'));
$.ajax({type:"GET",url:x,dataType:"html",success:function(I){jQuery(y).css({minHeight:0}).empty().append(I);jQuery(y).find("a").filter(".button").addClass("ajaxButton");
jQuery(y).find("div").filter(".nBox").addClass("ajaxNBox");Nifty("a.ajaxButton","transparent");Nifty("div.ajaxNBox","transparent");jQuery("ul#"+D+" a").each(function(J){if(J+1==z){$(this).addClass("selected");
}else{$(this).removeClass("selected");}});},error:function(I){jQuery(y).css({minHeight:0}).empty().append(jQuery("<h2></h2>").attr("class","boxHeader").html("&nbsp;"),jQuery("<div></div>").attr("class","boxContent tCenter vMiddle").css({padding:20}).html(l.tabLoader.notLoaded));
jQuery("ul#"+D+" a").each(function(J){if(J+1==z){$(tabs[J]).addClass("selected");}else{$(tabs[J]).removeClass("selected");}});}});},calculateColorShade:function(x,C){var y,A,z,B;
B=C/100;A=b(x);z=r(A);if(z[2]<0.5){y=j([z[0],z[1],z[2]+B]);}else{y=j([z[0],z[1],z[2]-B]);}return f(y);},calculateHexColor:function(y,B){y=y.substring(0,1)==("#")?y.substring(1):y;
var A=parseInt(y.substring(0,2),16);var z=parseInt(y.substring(2,4),16);var x=parseInt(y.substring(4,6),16);A=q(A,B);z=q(z,B);x=q(x,B);A=A.toString(16).length<2?"0"+A.toString(16):A.toString(16);
z=z.toString(16).length<2?"0"+z.toString(16):z.toString(16);x=x.toString(16).length<2?"0"+x.toString(16):x.toString(16);return"#"+(A+z+x).toUpperCase();},getPopupPosition:function(B){var y=parseInt(jQuery("#pageCon").width());
var x=jQuery("#content").offset().top;var A=(y/2)-(B/2);var z=x+100;return{left:A,top:z};},blockContent:function(B,x,z){var C=$("#pageCon");var D=$("iframe");var y=jQuery("#content");
var A=y.offset();var E=jQuery("body");var I=jQuery("#contentBlocker");if(jQuery(I).size()<1){I=jQuery("<div></div>").attr({id:"contentBlocker"}).css({opacity:0.1}).append(jQuery("<img />").attr({src:"/img/s.gif",alt:""}));
jQuery(I).prependTo(C);}var H=0;var J=A.top;var F=y.width()+parseInt(y.css("padding-left"))+parseInt(y.css("padding-right"));var G=y.height()+parseInt(y.css("padding-top"))+parseInt(y.css("padding-bottom"));
if(x){H=0;J=0;F=E.width()+parseInt(E.css("padding-left"))+parseInt(E.css("padding-right"));G=E.height()+parseInt(E.css("padding-top"))+parseInt(E.css("padding-bottom"));
}if(B){t(true);jQuery(D).css({visibility:"hidden"});jQuery(I).show(1,function(){jQuery(this).css({width:F,height:G,left:H,top:J,zIndex:999}).fadeTo(500,0.6);});if(z){jQuery(C).append(jQuery(n(true,z)).fadeIn(500));
}}if(!B){jQuery(I).fadeOut(500,function(){t(false);jQuery(D).css({visibility:"visible"});jQuery(this).empty().remove();});n(false);}},confirmThis:function(D,C,z,x,B){if(D==null){p.redirectMethod=z.toLowerCase();
p.redirectString=C;$.MinglerTools.blockContent(true);jQuery("#pageCon").append(d(x,B));Nifty("div#globalConfirmBox a","transparent");document.location.href="#";}if(D!=null&&D){if(p.redirectMethod=="function"){p.redirectString(D);
}else{if(p.redirectMethod=="url"){location.href=p.redirectString;}else{if(p.redirectMethod=="submit"){$("#"+p.redirectString).submit();}else{if(p.redirectMethod=="callback"){if(m(p.redirectString)&&p.redirectString.indexOf("|")!=-1){var A=p.redirectString.split("|");
if(A[0]=="lurk"){var y=A[1].split(",");$.MinglerTools.contentFilter(y[0],y[1],y[2],false);}else{$.MinglerTools.goPublic(true,A[1]);}}else{confirmBoxCallback(true,p.redirectString);
}}else{alert("Error, wrong redirectMethod used, "+p.redirectMethod+' is not supported, please use: "url", "submit", "function" or "callback"');}}}}$.MinglerTools.blockContent(false);
$.MinglerTools.destroyElement("#globalConfirmBox",{gracefully:true});}if(D!=null&&!D){if(p.redirectMethod=="function"){p.redirectString(D);}else{if(p.redirectMethod=="callback"){if(m(p.redirectString)&&p.redirectString.indexOf("|")!=-1){var A=p.redirectString.split("|");
if(A[0]!="lurk"){$.MinglerTools.goPublic(false,A[1]);}}else{confirmBoxCallback(false,p.redirectString);}}}$.MinglerTools.blockContent(false);$.MinglerTools.destroyElement("#globalConfirmBox",{gracefully:true});
}},alertThis:function(A,z,x,y,B){if(A==null){$.MinglerTools.blockContent(true);p.redirectMethod=x.toLowerCase();p.redirectString=z;jQuery("#pageCon").append(g(y,B));
Nifty("div#globalAlertBox a","transparent");document.location.href="#";}if(A!=null&&A){if(p.redirectMethod=="reload"){location.reload(true);}else{if(p.redirectMethod=="url"){location.href=p.redirectString;
}else{if(p.redirectMethod=="none"){$.MinglerTools.blockContent(false);$.MinglerTools.destroyElement("#globalAlertBox",{gracefully:true});}}}}},viewImageFullscreen:function(z,D,A,x){var y=k(D);
var C=A?"&maxWidth="+A:"&maxWidth="+h.width;var B=A?"&maxHeight="+x:"&maxHeight="+h.height;$.MinglerTools.blockContent(true,true);location.href="#";jQuery("#pageCon").append(jQuery(y).animate({opacity:1},300,function(){jQuery(y).find("div").filter(".fullscreenImage").load("/ajax/viewpic.jsp?binaryId="+z+C+B,function(){n(false);
jQuery(y).click(function(){$.MinglerTools.blockContent(false);$.MinglerTools.destroyElement(y,{gracefully:true});});if(D&&D.length>=1){jQuery(y).append(jQuery("<div></div>").css({marginBottom:0,paddingTop:0,paddingRight:30,paddingBottom:20,paddingLeft:30,color:"#000000",textAlign:"left"}).html(D));
}});}),jQuery(n(true)).fadeIn(300));},setupZebra:function(){var x=false;jQuery("table.zebra").each(function(){jQuery(this).find("tr").filter(".zebra").each(function(){if(x){jQuery(this).find("td").addClass("zebraEven");
x=!x;}else{jQuery(this).find("td").addClass("zebraOdd");x=!x;}});});},limitCharSet:function(z,x,y){$(z).val($.validate.limitCharSet($(z).val(),$.validate.getCharSet(x),y));
},truncateString:function(x,z){var y="";if(x!=null){x=x.replace("&nbsp;"," ");x=jQuery.trim(x);if(x.length<z){return x;}else{y=x.substring(0,z);if(y.lastIndexOf(" ")==-1){y+="..";
return y;}else{y=y.substring(0,y.lastIndexOf(" "));y+="..";}}}return y;},divideWords:function(G,F){G=G.replace("&nbsp;"," ");G=G.replace("\n"," ");G=G.replace("\r"," ");
G=G.replace("\t"," ");G=G.replace("\b"," ");if(F>0&&G.length>F){var E=G.split(" ");var C="";var y,B,z,H;for(var D=0;D<E.length;D++){var x=jQuery.trim(E[D]);H=x.length;
if(H>F){z=H/F;for(var A=0;A<=z;A++){B=A*F;y=x.substring(B).length;if(y>F){C+=x.substring(B,F);}else{C+=x.substring(B);}C+=" ";}}else{C+=x;C+=" ";}}G=C;}return G;
},prepareStringForListing:function(z,x,y){if(z==null||z==""){return"";}z=z.replace("<br>"," ");z=z.replace("<br />"," ");if(x>0&&z.length>x){z=$.MinglerTools.truncateString(z,x);
}if(y>0&&z.length>y){z=$.MinglerTools.divideWords(z,y);}return z;},getIcon:function(x,y){return c(x,y);},getIconOrText:function(x,y){return c(x,y,true);},getImageUrl:function(y,x){return"/image/"+y+"/"+(x?x:"")+"?.cached";
},isEven:function(x){return !(x%2);},destroyElement:function(B,x,A){var y={gracefully:false,speed:500};jQuery.extend(y,x);var z=jQuery.isFunction(A)?A:false;if(y.gracefully){jQuery(B).animate({opacity:0},y.speed,function(){jQuery(B).empty().remove();
if(z){z();}});}else{jQuery(B).empty().remove();if(z){z();}}},setup:function(z,x,y){l=z;e=x;a=y;}};}();jQuery.fn.MinglerTools=function(){return this;};