jCommon={};jCommon.browser=function(){var c=window.navigator.userAgent.toLowerCase();return{version:(c.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],webkit:/webkit/.test(c),opera:/opera/.test(c),msie:/msie/.test(c)&&!/opera/.test(c),mozilla:/mozilla/.test(c)&&!/(compatible|webkit)/.test(c),safari:/safari/.test(c)&&!/chrome/.test(c),chrome:/chrome/.test(c)}}(); jCommon.cookie=function(c,b,a){if("undefined"!=typeof b){a=a||{};if(null===b){b="";a.expires=-1}var h="";if(a.expires&&("number"==typeof a.expires||a.expires.toUTCString)){if("number"==typeof a.expires){h=new Date;h.setTime(h.getTime()+a.expires*24*60*60*1E3)}else h=a.expires;h="; expires="+h.toUTCString()}var i=a.path?"; path="+a.path:"",j=a.domain?"; domain="+a.domain:"";a=a.secure?"; secure":"";document.cookie=[c,"=",encodeURIComponent(b),h,i,j,a].join("");return this}b=null;if(document.cookie&& ""!=document.cookie){a=document.cookie.split(";");for(h=0;h<a.length;h++){i=jQuery.trim(a[h]);if(i.substring(0,c.length+1)==c+"="){b=decodeURIComponent(i.substring(c.length+1));break}}}return b}; jCommon.popupWindow=function(){function c(b,a){function h(i,j,k){var d={height:600,menubar:"no",resizeable:"yes",scrollbars:"yes",status:"yes",toolbar:"no",width:540},g=[],f={};k=$.extend(f,d,k);k.left=Math.round((screen.availWidth-k.width)/2);k.top=Math.round((screen.availHeight-k.height)/2);for(var l in k)g.push(l+"="+k[l]);k=window.open(i,"",g.join(","));if(i.match(/\.(gif|jpe?g|png)$/i)){k.document.open();k.document.write("<html><head>"+(""!=j?"<title>"+j+"</title>":"")+'</head><body style="background: #fff; margin: 0; padding: 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"><tr><td align="center"><img src="'+ i+'" /></td></tr></table></body></html>');k.document.close()}k.focus()}$(b).click(function(){h($(this).attr("href"),"",undefined===a?{}:a);return false})}$(function(){$(".popup").each(function(){new c(this)})});return function(b,a){$(b).each(function(){new c(this,a)})}}(); jCommon.shortcuts=function(){var c={start:{keyCode:36,ctrlKey:true,altKey:false},prev:{keyCode:37,ctrlKey:true,altKey:false},up:{keyCode:38,ctrlKey:true,altKey:false},next:{keyCode:39,ctrlKey:true,altKey:false},down:{keyCode:40,ctrlKey:true,altKey:false}};$(function(){$("link").each(function(){var b=$(this).attr("rel");if(c[b])c[b].href=$(this).attr("href")});$(document).keydown(function(b){var a=c;for(var h in a)if(a[h].keyCode==b.keyCode&&a[h].ctrlKey==b.ctrlKey&&a[h].altKey==b.altKey)if("string"== typeof a[h].href&&""!=a[h].href)document.location=a[h].href;else if($.isFunction(a[h].href))return a[h].href(b)})});return{bind:function(b,a,h,i,j){i=new Boolean(i);j=new Boolean(j);c[b]={href:a,keyCode:h,ctrlKey:i,altKey:j}},unbind:function(b){delete c[b]},unbindAll:function(){c={}}}}(); jCommon.fixIePng=function(){var c="file:///",b=c==location.href.substr(0,c.length)?"./i/e.gif":"/f/1/global/i/e.gif";return jCommon.browser.msie&&6>=parseInt(jCommon.browser.version)?function(a){var h;if("IMG"==a.tagName||"INPUT"==a.tagName&&"image"==a.type){if(/\.png$/.test(a.src)){h=a.src;a.src=b}}else if(h=a.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i)){h=h[1];a.runtimeStyle.backgroundImage="none"}var i=/iesizing\-(\w+)/;i=i.exec(a.className);if(h){i=i?i[1]:"crop";a.runtimeStyle.filter= "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+h+"',sizingMethod='"+i+"')"}}:function(){}}();if(jCommon.browser.msie&&6>=parseInt(jCommon.browser.version))try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}jCommon.browser.msie&&6>=parseInt(jCommon.browser.version)&&$(window).resize(function(){$("#layout")[0].style.width=(document.documentElement.clientWidth||document.body.clientWidth)<990?"990px":"100%"}); String.prototype.stripTags||$.extend(String.prototype,{stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")}});String.prototype.formatNumber||$.extend(String.prototype,{formatNumber:function(c,b){c=c||" ";b=b||",";var a=this.indexOf("."),h=a>-1?this.substring(a+1):"",i=a>-1?this.substring(0,a):this;if(5>i.length)return i+(a>-1?b+h:"");for(var j="";3<i.length;){j=i.substring(i.length-3)+(j.length>0?c:"")+j;i=i.substring(0,i.length-3)}return j=i+c+j+(-1<a?b+h:"")}}); Number.prototype.formatNumber||$.extend(Number.prototype,{formatNumber:function(c,b){return this.toString().formatNumber(c,b)}});$(document.documentElement).addClass("js"); jCommon.support=function(){var c={canvas:false,svg:document.createElementNS?true:false,vml:false};if("undefined"==typeof HTMLCanvasElement){if(!document.namespaces.v){document.namespaces.add("v","urn:schemas-microsoft-com:vml");document.namespaces.add("o","urn:schemas-microsoft-com:office:office");var b=document.createStyleSheet();b.cssText="v\\:arc, v\\:curve, v\\:extrusion, v\\:fill, v\\:formulas, v\\:group, v\\:handles, v\\:image, v\\:imagedata, v\\:line, v\\:oval, v\\:path, v\\:polyline, v\\:rect, v\\:roundrect, v\\:shadow, v\\:shape, v\\:shapetype, v\\:stroke, v\\:textbox, v\\:textpath, v\\:vmlframe {behavior:url(#default#VML);display:block;} o\\:callout, o\\:locks, o\\:skew {behavior:url(#default#VML);}"}c.vml= true}else c.canvas=true;return c}();jCommon.ns={svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",ev:"http://www.w3.org/2001/xml-events"}; jCommon.measurer=function(){function c(){j=$('<div id="measurer"></div>').css({height:"1em",left:0,lineHeight:"1em",margin:0,position:"absolute",padding:0,top:"-1em",visibility:"hidden",width:"100%"}).appendTo("body");if(jCommon.browser.msie)j.resize(b);else{i=j.height();setInterval(function(){var g=j.height();if(g!=i){i=g;b()}},h);$(window).resize(b)}}function b(){for(var g=0;g<a.length;g++)a[g]()}var a=[],h=500,i,j,k=false,d=false;$(function(){d=true;k&&c()});return{resize:b,bind:function(g){if(!j){k= true;d&&c()}a.push(g)},unbind:function(g){for(var f=0;f<a.length;f++)a[f]==g&&a.splice(f,1)}}}(); jCommon.webkitPlaceholder=function(){function c(b,a){b=$(b);a="string"===typeof a?a:"empty";b.focus(function(){if(this.value===$(this).attr("placeholder"))this.value="";$(this).removeClass(a)});b.blur(function(){if(!this.value.length){this.value=$(this).attr("placeholder");$(this).addClass(a)}});b.val().length||$(b).blur()}if(jCommon.browser.webkit)return{bind:function(){}};$(function(){$("input[placeholder]").each(function(){c(this)})});return{bind:c}}(); jCommon.labelPlaceholder=function(){function c(d,g){d=$(d);g=$(g);var f=d.data(k);if(!f){f=[];d.data(k,f).click(b)}f.push(g[0]);g.data(j,d).bind("focus blur",a).blur()}function b(d){var g=$(this).data(k);if(g){$(g).filter(":visible:first").focus();d.preventDefault()}}function a(d){var g=$(this),f=g.data(j);!$.trim(g.val())&&"blur"==d.type?f.show():f.hide()}function h(d){c(d,"#"+$(d).attr("for"))}function i(d){d=$(d);var g=$("#"+d.attr("for"));d.data(k,"").unbind("click",b);g.data(j,"").unbind("focus blur", a)}var j="labelPlaceholder",k="bindedFields";$(function(){$("label.placeholder").each(function(){c(this,"#"+$(this).attr("for"))})});return{bind:h,unbind:i}}(); jCommon.popupBlock=function(){function c(b,a){function h(f){var l=f.keyCode?f.keyCode:f.which?f.which:null;l===27&&i(f)}function i(f){if(!b.hasClass("hidden")){a.beforeHide&&a.beforeHide();a.fader&&a.fader.addClass("hidden");b.addClass("hidden");$(document).unbind("click",d).unbind("keydown",g);a.afterHide&&a.afterHide();if(f){f.preventDefault();f.stopPropagation()}}}function j(f){if(b.hasClass("hidden")){a.beforeShow&&a.beforeShow();a.fader&&a.fader.removeClass("hidden");jCommon.browser.msie?b.removeClass("hidden"): b.css("opacity",0).removeClass("hidden").animate({opacity:1},300,function(){b.css("opacity","");a.afterShow&&a.afterShow()});d=i;g=h;$(document).click(d).keydown(g);jCommon.browser.msie&&a.afterShow&&a.afterShow();if(f){f.preventDefault();f.stopPropagation()}}}function k(f){b.hasClass("hidden")?j(f):i(f)}var d,g;b.click(function(f){f.stopPropagation()});if(a.fader)a.fader=$(a.fader);if(a.link){a.link=$(a.link);a.link.click(k)}if(a.close){a.close=$(a.close);a.close.click(k)}return{hide:i,show:j,toggle:k}} return function(b,a){return new c($(b),a)}}(); jCommon.eventDispatcher=function(){function c(d,g,f){if(!g instanceof Function)throw new Error("Listener isn't a function");f=f?k:j;d="string"==typeof d?d.split(" "):d;for(var l=0;l<d.length;l++)if(f[d[l]])f[d[l]].push(g);else f[d[l]]=[g]}function b(d){return"undefined"!=typeof j[d]||"undefined"!=typeof k[d]}function a(d,g){if(!b(d))return false;for(var f=[j,k],l=0;l<f.length;l++)for(var n=f[l][d],m=0;m<n.length;m++)n[m]==g&&n.splice(m,1);return true}function h(d,g){if(!b(d))return false;var f=[j, k];g=new i(d,g);for(var l=0;l<f.length;l++){var n=f[l][d];if(n)for(var m=0,o=n.length;m<o;m++)n[m](g)}k[d]&&delete k[d];return true}function i(d,g){this.type=d;if(g)this.data=g}var j={},k={};return{bind:c,hasBinds:b,unbind:a,dispatch:h}}(); jCommon.getXml=function(c){var b=null;try{if(window.ActiveXObject){b=new ActiveXObject("Microsoft.XMLDOM");b.async=false;b.loadXML(c)}else if(window.DOMParser)b=(new DOMParser).parseFromString(c,"text/xml");if(!b||!b.documentElement||"parsererror"==b.documentElement.nodeName||b.getElementsByTagName("parsererror").length)return false}catch(a){return false}return b};
