var ResAjax={title:"Response message",RequestFail:"Request failed.",IncorrectResponse:"Incorrect response."};var isEmpty=function(b,a){return b===null||b===undefined||(!a?b==="":false)};(function(){jQuery.cookie=function(h,d,a){if(typeof d!="undefined"){a=a||{};if(d===null){d="";a.expires=-1}var g="";if(a.expires&&(typeof a.expires=="number"||a.expires.toUTCString)){var b;if(typeof a.expires=="number"){b=new Date();b.setTime(b.getTime()+(a.expires*24*60*60*1000))}else{b=a.expires}g="; expires="+b.toUTCString()}var l=a.path?"; path="+(a.path):"";var c=a.domain?"; domain="+(a.domain):"";var j=a.secure?"; secure":"";document.cookie=[h,"=",encodeURIComponent(d),g,l,c,j].join("")}else{var f=null;if(document.cookie&&document.cookie!=""){var m=document.cookie.split(";");for(var k=0;k<m.length;k++){var e=jQuery.trim(m[k]);if(e.substring(0,h.length+1)==(h+"=")){f=decodeURIComponent(e.substring(h.length+1));break}}}return f}}})();var blockUI=function(){$.blockUI({message:'<img src="../images/body/ajax-loader.gif" alt=""/><h1>Loading...</h1>',overlayCSS:{opacity:0.5,backgroundColor:"#000"},css:{border:"none",backgroundColor:"#fff",padding:15,"-webkit-border-radius":"10px","-moz-border-radius":"10px",opacity:0.5,color:"#000"}})};var unblockUI=function(){$.unblockUI()};var onClickQuestion=function(){var a=document.getElementById("hidQuestionMessage").value;if(confirm(a)){blockUI();return true}return false};function slide(d,f,e,h,g){var a=d+" li.sliding-element";var c=a+" a";var b=0;$(a).each(function(j){$(this).css("margin-left","-180px");b=(b*g+h);$(this).animate({marginLeft:"0"},b);$(this).animate({marginLeft:"15px"},b);$(this).animate({marginLeft:"0"},b)});$(c).each(function(j){$(this).hover(function(){$(this).animate({paddingLeft:f},150)},function(){$(this).animate({paddingLeft:e},150)})})}galsport={};galsport.redirect=function(a){window.location=a};galsport.vote=function(){var a=$("#poll1Wraper input[type='radio']:checked").val();var b=$("#poll2Wraper input[type='radio']:checked").val();window.location="Vote.aspx?answer1id="+a+"&answer2id="+b};var Enums={ResponseCodes:{INCORRECT_RESPONSE:0,REQUEST_FAILED:3,SESSION_EXPIRED:5,ERROR:6,SUCCESS:7,NOT_LOGGED:10,USER_LOCKED:11,USER_ALREADY_LOGGED:12,USER_PASSWORD_SHOULDBE_CHANGED:13,USER_LOGGED:14,USER_INVALID_LOGIN:12}};var Ajax={checkResponse:function(b){var a="";switch(b.ResponseCode){case Enums.ResponseCodes.SESSION_EXPIRED:break;case Enums.ResponseCodes.ERROR:a=b.ResponseData;break;case Enums.ResponseCodes.REQUEST_FAILED:a=ResAjax.RequestFail;break;case Enums.ResponseCodes.CLIENT_NO_EXISTS:a=ResAjax.CLIENT_NO_EXISTS;break;case Enums.ResponseCodes.CLIENT_CODE_EXISTS:a=ResAjax.CLIENT_CODE_EXISTS;break;case Enums.ResponseCodes.PORTFOLIO_NO_EXISTS:a=ResAjax.PORTFOLIO_NO_EXISTS;break;case Enums.ResponseCodes.PORTFOLIO_CODE_EXISTS:a=ResAjax.PORTFOLIO_CODE_EXISTS;break;default:return true}unblockUI();Msg.show(ResAjax.title,a);return false},postToServer:function(b,c,a){$.ajax({type:"POST",url:b,data:c,contentType:"application/json; charset=utf-8",dataType:"json",success:function(d,g,f){var e;if(!isEmpty(d)){e=d.d}else{Msg.show(ResAjax.title,"Incorrect response");return}if(Ajax.checkResponse(e)){a(e)}},error:function(d,e,f){unblockUI();Msg.show(ResAjax.title,d.responseText)}})}};var Msg={show:function(a,b){$.blockUI({title:a,message:b});$(".blockOverlay").attr("title","Click to unblock").click($.unblockUI)}};var initAdminMenu=function(){var a=0;var b;for(b=0;b<20;b++){if($(".a"+b+"").attr("id")){a=$(".a"+b+"").attr("id").slice(1,2)}}var d=a*($("#b0").outerWidth());var c;$("#sprite").css({backgroundPosition:""+d+"px 4px"});$("#b0,#b1,#b2,#b3,#b4,#b5,#b6,#b7").css({backgroundPosition:"0px 0px"}).mouseover(function(){c=$(this).attr("id").slice(1,2)*($("#b0").outerWidth());$("#sprite").stop().animate({backgroundPosition:""+c+"px 4px"},{duration:300})});$("#b0,#b1,#b2,#b3,#b4,#b5,#b6,#b7").css({backgroundPosition:"0px 0px"}).mouseout(function(){$("#sprite").stop().animate({backgroundPosition:""+d+"px 4px"},{duration:300})})};function changeDisplay(a){var b=document.getElementById(a);if(b.style.display=="none"){b.style.display="block"}else{b.style.display="none"}}function onCity(){document.getElementById("all-city").style.height="auto"}function offCity(){document.getElementById("all-city").style.height="0px"}var timer=null;function refresh(b,a){if(a==0||a==null){a=2}if(isEmpty(b)){b="cam"}if($("#frequency"+a)!=null){$("#frequency"+a).attr("checked",true)}$.cookie(b+"_frequency",a,{expires:7,path:"/"});a=a*1000;timer&&clearInterval(timer);timer=setInterval(function(){$("#"+b).attr("src","http://cam.uar.net/"+b+"/jpg/cam.cgi?"+Math.random())},a)}(function(a){a.fn.superfish=function(g){var h=a.fn.superfish,e=h.c,i=a(['<span class="',e.arrowClass,'"> &#187;</span>'].join("")),j=function(){var l=a(this),c=d(l);clearTimeout(c.sfTimer);l.showSuperfishUl().siblings().hideSuperfishUl()},f=function(){var m=a(this),l=d(m),c=h.op;clearTimeout(l.sfTimer);l.sfTimer=setTimeout(function(){c.retainPath=(a.inArray(m[0],c.$path)>-1);m.hideSuperfishUl();if(c.$path.length&&m.parents(["li.",c.hoverClass].join("")).length<1){j.call(c.$path)}},c.delay)},d=function(l){var c=l.parents(["ul.",e.menuClass,":first"].join(""))[0];h.op=h.o[c.serial];return c},k=function(c){c.addClass(e.anchorClass).append(i.clone())};return this.each(function(){var c=this.serial=h.o.length;var l=a.extend({},h.defaults,g);l.$path=a("li."+l.pathClass,this).slice(0,l.pathLevels).each(function(){a(this).addClass([l.hoverClass,e.bcClass].join(" ")).filter("li:has(ul)").removeClass(l.pathClass)});h.o[c]=h.op=l;a("li:has(ul)",this)[(a.fn.hoverIntent&&!l.disableHI)?"hoverIntent":"hover"](j,f).each(function(){if(l.autoArrows){k(a(">a:first-child",this))}}).not("."+e.bcClass).hideSuperfishUl();var m=a("a",this);m.each(function(o){var n=m.eq(o).parents("li");m.eq(o).focus(function(){j.call(n)}).blur(function(){f.call(n)})});l.onInit.call(this)}).each(function(){var c=[e.menuClass];if(h.op.dropShadows&&!(a.browser.msie&&a.browser.version<7)){c.push(e.shadowClass)}a(this).addClass(c.join(" "))})};var b=a.fn.superfish;b.o=[];b.op={};b.IE7fix=function(){var c=b.op;if(a.browser.msie&&a.browser.version>6&&c.dropShadows&&c.animation.opacity!=undefined){this.toggleClass(b.c.shadowClass+"-off")}};b.c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",arrowClass:"sf-sub-indicator",shadowClass:"sf-shadow"};b.defaults={hoverClass:"sfHover",pathClass:"overideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},speed:"normal",autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};a.fn.extend({hideSuperfishUl:function(){var d=b.op,c=(d.retainPath===true)?d.$path:"";d.retainPath=false;var e=a(["li.",d.hoverClass].join(""),this).add(this).not(c).removeClass(d.hoverClass).find(">ul").hide().css("visibility","hidden");d.onHide.call(e);return this},showSuperfishUl:function(){var d=b.op,e=b.c.shadowClass+"-off",c=this.addClass(d.hoverClass).find(">ul:hidden").css("visibility","visible");b.IE7fix.call(c);d.onBeforeShow.call(c);c.animate(d.animation,d.speed,function(){b.IE7fix.call(c);d.onShow.call(c)});return this}})})(jQuery);
