(function(a){a.extend({xmlToJSON:function(g){try{if(!g){return null;}var f={};f.typeOf="JSXBObject";var d=(g.nodeType==9)?g.documentElement:g;f.RootName=d.nodeName||"";if(g.nodeType==3||g.nodeType==4){return g.nodeValue;}var b=function(l){var e="";if(l&&typeof l=="string"){e=l;}var m=/^((-)?([0-9]*)((\.{0,1})([0-9]+))?$)/;return m.test(e);};function k(l){var m=/-/g;var e=String(l).replace(m,"_");return e;}function c(m,l){if(l.attributes.length>0){var e=l.attributes.length-1;var n;m._attributes=[];do{n=String(k(l.attributes[e].name));m._attributes.push(n);m[n]=a.trim(l.attributes[e].value);}while(e--);}}function j(e){e.getNodeByAttribute=function(l,p){if(this.length>0){var n;var m=this.length-1;try{do{n=this[m];if(n[l]==p){return n;}}while(m--);}catch(o){return false;}return false;}};e.contains=function(l,o){if(this.length>0){var m=this.length-1;try{do{if(this[m][l]==o){return true;}}while(m--);}catch(n){return false;}return false;}};e.indexOf=function(l,o){var p=-1;if(this.length>0){var m=this.length-1;try{do{if(this[m][l]==o){p=m;}}while(m--);}catch(n){return -1;}return p;}};e.SortByAttribute=function(n,m){if(this.length){function l(r,p){var q=r[p];q=(b(q))?parseFloat(q):q;return q;}function o(s,q){var t=0;var r,p;r=l(s,n);p=l(q,n);if(r<p){t=-1;}else{if(p<r){t=1;}}if(m){t=(m.toUpperCase()=="DESC")?(0-t):t;}return t;}this.sort(o);}};e.SortByValue=function(m){if(this.length){function l(p){var o=p.Text;o=(b(o))?parseFloat(o):o;return o;}function n(r,p){var s=0;var q,o;q=l(r);o=l(p);if(q<o){s=-1;}else{if(o<q){s=1;}}if(m){s=(m.toUpperCase()=="DESC")?(0-s):s;}return s;}this.sort(n);}};e.SortByNode=function(n,m){if(this.length){function l(r,q){var p=r[q][0].Text;p=(b(p))?parseFloat(p):p;return p;}function o(s,q){var t=0;var r,p;r=l(s,n);p=l(q,n);if(r<p){t=-1;}else{if(p<r){t=1;}}if(m){t=(m.toUpperCase()=="DESC")?(0-t):t;}return t;}this.sort(o);}};}function i(r,o){var p;var m;var q;var e="";if(!o){return null;}if(o.attributes.length>0){c(r,o);}r.Text="";if(o.hasChildNodes()){var l=o.childNodes.length-1;var s=0;do{m=o.childNodes[s];switch(m.nodeType){case 1:r._children=[];p=(m.localName)?m.localName:m.baseName;p=k(p);if(e!=p){r._children.push(p);}if(!r[p]){r[p]=[];}q={};r[p].push(q);if(m.attributes.length>0){c(q,m);}if(!r[p].contains){j(r[p]);}e=p;if(m.hasChildNodes()){i(q,m);}break;case 3:r.Text+=a.trim(m.nodeValue);break;case 4:r.Text+=(m.text)?a.trim(m.text):a.trim(m.nodeValue);break;}}while(s++<l);}}i(f,d);g=null;d=null;return f;}catch(h){return null;}}});a.extend({textToXML:function(f){var c=null;try{c=(a.browser.msie)?new ActiveXObject("Microsoft.XMLDOM"):new DOMParser();c.async=false;}catch(d){throw new Error("XML Parser could not be instantiated");}var b;try{if(a.browser.msie){b=(c.loadXML(f))?c:false;}else{b=c.parseFromString(f,"text/xml");}}catch(d){throw new Error("Error parsing XML string");}return b;}});})(jQuery);var SOAPClient={Proxy:"",SOAPServer:"",ContentType:"text/xml",CharSet:"utf-8",ResponseXML:null,ResponseText:"",Status:0,ContentLength:0,Namespace:function(a,b){return{"name":a,"uri":b};},SendRequest:function(a,d){if(!!SOAPClient.Proxy){SOAPClient.ResponseText="";SOAPClient.ResponseXML=null;SOAPClient.Status=0;var b=a.toString();SOAPClient.ContentLength=b.length;function c(f){if(!!d){SOAPClient.Status=f.status;SOAPClient.ResponseText=f.responseText;SOAPClient.ResponseXML=f.responseXML;var e=$.xmlToJSON(f.responseXML);d(e);}}$.ajax({type:"POST",url:SOAPClient.Proxy,dataType:"xml",processData:false,data:b,complete:c,contentType:SOAPClient.ContentType+'; charset="'+SOAPClient.CharSet+'"',beforeSend:function(e){e.setRequestHeader("Method","POST");e.setRequestHeader("Content-Length",SOAPClient.ContentLength);e.setRequestHeader("SOAPServer",SOAPClient.SOAPServer);e.setRequestHeader("SOAPAction",a.Action);}});}},ToXML:function(d){var b=[];var i=false;try{if(!!d&&typeof(d)==="object"&&d.typeOf==="SOAPObject"){if(!!d.ns){if(typeof(d.ns)==="object"){i=true;b.push("<"+d.ns.name+":"+d.name);b.push(" xmlns:"+d.ns.name+'="'+d.ns.uri+'"');}else{b.push("<"+d.name);b.push(' xmlns="'+d.ns+'"');}}else{b.push("<"+d.name);}if(d.attributes.length>0){var h;var a=d.attributes.length-1;do{h=d.attributes[a];if(i){b.push(" "+d.ns.name+":"+h.name+'="'+h.value+'"');}else{b.push(" "+h.name+'="'+h.value+'"');}}while(a--);}b.push(">");if(d.hasChildren()){var f,c;for(f in d.children){c=d.children[f];if(typeof(c)==="object"){b.push(SOAPClient.ToXML(c));}}}if(!!d.value){b.push(d.value);}if(i){b.push("</"+d.ns.name+":"+d.name+">");}else{b.push("</"+d.name+">");}return b.join("");}}catch(g){alert("Unable to process SOAPObject! Object must be an instance of SOAPObject");}}};var SOAPRequest=function(d,c){this.Action=d;var b=[];var e=[];var a=(!!c)?[c]:[];this.addNamespace=function(f,g){b.push(new SOAPClient.Namespace(f,g));};this.addHeader=function(f){e.push(f);};this.addBody=function(f){a.push(f);};this.toString=function(){var f=new SOAPObject("soapenv:Envelope");f.attr("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/");if(b.length>0){var h,j;
for(h in b){if(!b.hasOwnProperty||b.hasOwnProperty(h)){j=b[h];if(typeof(j)==="object"){f.attr("xmlns:"+j.name,j.uri);}}}}if(e.length>0){var l=f.appendChild(new SOAPObject("soapenv:Header"));var k;for(k in e){if(!e.hasOwnProperty||e.hasOwnProperty(k)){l.appendChild(e[k]);}}}if(a.length>0){var i=f.appendChild(new SOAPObject("soapenv:Body"));var g;for(g in a){if(!a.hasOwnProperty||a.hasOwnProperty(g)){i.appendChild(a[g]);}}}return f.toString();};};var SOAPObject=function(a){this.typeOf="SOAPObject";this.ns=null;this.name=a;this.attributes=[];this.children=[];this.value=null;this.attr=function(b,c){this.attributes.push({"name":b,"value":c});return this;};this.appendChild=function(b){this.children.push(b);return b;};this.hasChildren=function(){return(this.children.length>0)?true:false;};this.val=function(b){if(!b){return this.value;}else{this.value=b;return this;}};this.toString=function(){return SOAPClient.ToXML(this);};};
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version 2.1.2
 */
(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";"+"left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";"+"width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";"+"height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+";"+'"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild);}});}:function(){return this;});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c;}})(jQuery);(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false);}}else{this.onmousewheel=b;}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false);}}else{this.onmousewheel=null;}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel");},unmousewheel:function(d){return this.unbind("mousewheel",d);}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120;}if(f.detail){g=-f.detail/3;}d.unshift(f,g);return c.event.handle.apply(this,d);}})(jQuery);(function(g){if(/1\.(0|1|2)\.(0|1|2)/.test(g.fn.jquery)||/^1.1/.test(g.fn.jquery)){alert("blockUI requires jQuery v1.2.3 or later!  You are using v"+g.fn.jquery);return;}g.fn._fadeIn=g.fn.fadeIn;var i=document.documentMode||0;var d=g.browser.msie&&((g.browser.version<8&&!i)||i<8);var e=g.browser.msie&&/MSIE 6.0/.test(navigator.userAgent)&&!i;g.blockUI=function(o){c(window,o);};g.unblockUI=function(o){h(window,o);};g.growlUI=function(s,q,r,o){var p=g('<div class="growlUI"></div>');if(s){p.append("<h1>"+s+"</h1>");}if(q){p.append("<h2>"+q+"</h2>");}if(r==undefined){r=3000;}g.blockUI({message:p,fadeIn:700,fadeOut:1000,centerY:false,timeout:r,showOverlay:false,onUnblock:o,css:g.blockUI.defaults.growlCSS});};g.fn.block=function(o){return this.unblock({fadeOut:0}).each(function(){if(g.css(this,"position")=="static"){this.style.position="relative";}if(g.browser.msie){this.style.zoom=1;}c(this,o);});};g.fn.unblock=function(o){return this.each(function(){h(this,o);});};g.blockUI.version=2.23;g.blockUI.defaults={message:"<h1>Please wait...</h1>",css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},overlayCSS:{backgroundColor:"#000",opacity:0.6,cursor:"wait"},growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:0.6,cursor:null,color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:false,baseZ:1000,centerX:true,centerY:true,allowBodyStretch:true,bindEvents:true,constrainTabKey:true,fadeIn:200,fadeOut:400,timeout:0,showOverlay:true,focusInput:true,applyPlatformOpacityRules:true,onUnblock:null,quirksmodeOffsetHack:4};var b=null;var f=[];function c(q,o){var B=(q==window);var r=o&&o.message!==undefined?o.message:undefined;o=g.extend({},g.blockUI.defaults,o||{});o.overlayCSS=g.extend({},g.blockUI.defaults.overlayCSS,o.overlayCSS||{});var A=g.extend({},g.blockUI.defaults.css,o.css||{});r=r===undefined?o.message:r;
if(B&&b){h(window,{fadeOut:0});}if(r&&typeof r!="string"&&(r.parentNode||r.jquery)){var u=r.jquery?r[0]:r;var y={};g(q).data("blockUI.history",y);y.el=u;y.parent=u.parentNode;y.display=u.style.display;y.position=u.style.position;if(y.parent){y.parent.removeChild(u);}}var C=o.baseZ;var x=(g.browser.msie||o.forceIframe)?g('<iframe class="blockUI" style="z-index:'+(C++)+';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+o.iframeSrc+'"></iframe>'):g('<div class="blockUI" style="display:none"></div>');var w=g('<div class="blockUI blockOverlay" style="z-index:'+(C++)+';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');var s=B?g('<div class="blockUI blockMsg blockPage" style="z-index:'+C+';display:none;position:fixed"></div>'):g('<div class="blockUI blockMsg blockElement" style="z-index:'+C+';display:none;position:absolute"></div>');if(r){s.css(A);}if(!o.applyPlatformOpacityRules||!(g.browser.mozilla&&/Linux/.test(navigator.platform))){w.css(o.overlayCSS);}w.css("position",B?"fixed":"absolute");if(g.browser.msie||o.forceIframe){x.css("opacity",0);}g([x[0],w[0],s[0]]).appendTo(B?"body":q);var F=d&&(!g.boxModel||g("object,embed",B?null:q).length>0);if(e||F){if(B&&o.allowBodyStretch&&g.boxModel){g("html,body").css("height","100%");}if((e||!g.boxModel)&&!B){var G=l(q,"borderTopWidth"),v=l(q,"borderLeftWidth");var E=G?"(0 - "+G+")":0;var p=v?"(0 - "+v+")":0;}g.each([x,w,s],function(t,J){var z=J[0].style;z.position="absolute";if(t<2){B?z.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:"+o.quirksmodeOffsetHack+') + "px"'):z.setExpression("height",'this.parentNode.offsetHeight + "px"');B?z.setExpression("width",'jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):z.setExpression("width",'this.parentNode.offsetWidth + "px"');if(p){z.setExpression("left",p);}if(E){z.setExpression("top",E);}}else{if(o.centerY){if(B){z.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');}z.marginTop=0;}else{if(!o.centerY&&B){var H=(o.css&&o.css.top)?parseInt(o.css.top):0;var I="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+H+') + "px"';z.setExpression("top",I);}}}});}if(r){s.append(r);if(r.jquery||r.nodeType){g(r).show();}}if((g.browser.msie||o.forceIframe)&&o.showOverlay){x.show();}if(o.fadeIn){if(o.showOverlay){w._fadeIn(o.fadeIn);}if(r){s.fadeIn(o.fadeIn);}}else{if(o.showOverlay){w.show();}if(r){s.show();}}k(1,q,o);if(B){b=s[0];f=g(":input:enabled:visible",b);if(o.focusInput){setTimeout(n,20);}}else{a(s[0],o.centerX,o.centerY);}if(o.timeout){var D=setTimeout(function(){B?g.unblockUI(o):g(q).unblock(o);},o.timeout);g(q).data("blockUI.timeout",D);}}function h(r,s){var q=r==window;var p=g(r);var t=p.data("blockUI.history");var u=p.data("blockUI.timeout");if(u){clearTimeout(u);p.removeData("blockUI.timeout");}s=g.extend({},g.blockUI.defaults,s||{});k(0,r,s);var o=q?g("body").children().filter(".blockUI"):g(".blockUI",r);if(q){b=f=null;}if(s.fadeOut){o.fadeOut(s.fadeOut);setTimeout(function(){j(o,t,s,r);},s.fadeOut);}else{j(o,t,s,r);}}function j(o,r,q,p){o.each(function(s,t){if(this.parentNode){this.parentNode.removeChild(this);}});if(r&&r.el){r.el.style.display=r.display;r.el.style.position=r.position;if(r.parent){r.parent.appendChild(r.el);}g(r.el).removeData("blockUI.history");}if(typeof q.onUnblock=="function"){q.onUnblock(p,q);}}function k(o,s,t){var r=s==window,q=g(s);if(!o&&(r&&!b||!r&&!q.data("blockUI.isBlocked"))){return;}if(!r){q.data("blockUI.isBlocked",o);}if(!t.bindEvents||(o&&!t.showOverlay)){return;}var p="mousedown mouseup keydown keypress";o?g(document).bind(p,t,m):g(document).unbind(p,m);}function m(r){if(r.keyCode&&r.keyCode==9){if(b&&r.data.constrainTabKey){var q=f;var p=!r.shiftKey&&r.target==q[q.length-1];var o=r.shiftKey&&r.target==q[0];if(p||o){setTimeout(function(){n(o);},10);return false;}}}if(g(r.target).parents("div.blockMsg").length>0){return true;}return g(r.target).parents().children().filter("div.blockUI").length==0;}function n(o){if(!f){return;}var p=f[o===true?f.length-1:0];if(p){p.focus();}}function a(v,o,z){var w=v.parentNode,u=v.style;var q=((w.offsetWidth-v.offsetWidth)/2)-l(w,"borderLeftWidth");var r=((w.offsetHeight-v.offsetHeight)/2)-l(w,"borderTopWidth");if(o){u.left=q>0?(q+"px"):"0";}if(z){u.top=r>0?(r+"px"):"0";}}function l(o,q){return parseInt(g.css(o,q))||0;}})(jQuery);var LazyLoader={};LazyLoader.timer={};LazyLoader.scripts=[];LazyLoader.load=function(b,d,h){var g=null;var c=null;try{LazyLoader.scripts.push(b);var a=document.createElement("script");a.src=b;a.type="text/javascript";d.get(0).appendChild(a);if(h){a.onreadystatechange=function(){if(a.readyState=="loaded"||a.readyState=="complete"){h();
$(a).remove();}};a.onload=function(){h();$(a).remove();return;};try{if(($.browser.webkit&&!navigator.userAgent.match(/Version\/3/))||$.browser.opera){LazyLoader.timer[b]=setInterval(function(){if(/loaded|complete/.test(document.readyState)){clearInterval(LazyLoader.timer[b]);h();}},10);}}catch(f){}}}catch(f){alert(f);}};var xrayAd={div:null,viewport:null,thresold:200,elements:[],adBlockCount:0,w:160,h:200,init:function(){this.div=$("#xrayAd");if(!this.div){this.div=$("<div>",{id:"xrayAd",css:{position:"fixed",top:10,left:10,width:this.w,height:this.h,zIndex:10000,background:"rgba(0,0,0, 0.5)"}});this.div.appendTo($("body"));}},viewportUpdate:function(){if(!this.viewport){this.viewport=$("<div>",{id:"xrayAdViewport",css:{position:"absolute",width:this.w,height:10,zIndex:10001,background:"rgba(255,255,255, 0.3)"}});this.viewport.appendTo(this.div);}if(!this.viewThresoldTop){this.viewThresoldTop=$("<div>",{id:"xrayAdThresold",css:{position:"absolute",width:this.w,height:1,zIndex:10002,background:"rgba(255,0,0, 0.5)"}});this.viewThresoldTop.appendTo(this.div);this.viewThresoldBottom=this.viewThresoldTop.clone().appendTo(this.div);}this.bodyHeight=$(document).height();this.bodyWidth=$(window).width();var c=($(window).height()/this.bodyHeight)*xrayAd.h,a=($(window).scrollTop()/this.bodyHeight)*xrayAd.h;this.viewport.css({height:c,top:a});this.viewThresoldTop.css({top:(($(window).scrollTop()-xrayAd.thresold)/this.bodyHeight)*xrayAd.h});this.viewThresoldBottom.css({top:(($(window).scrollTop()+xrayAd.thresold)/this.bodyHeight)*xrayAd.h+c-1});if(this.div&&this.div.length){var b=this.div.find(".xrayAdBlock");$.each(b,function(g,i){var d=$(this);var f=$(xrayAd.elements[g]);if(d.length&&f.length){var e={};e.off=f.offset();if(e.off){e.top=(e.off.top/xrayAd.bodyHeight)*xrayAd.h;e.left=(e.off.left/xrayAd.bodyWidth)*xrayAd.w;e.w=(Math.max(f.width(),10)/xrayAd.bodyWidth)*xrayAd.w;e.h=(Math.max(f.height(),10)/xrayAd.bodyHeight)*xrayAd.h;var h="#FF0071";h=(f.data("loading")=="true"?"orange":h);h=(f.data("loaded")=="true"?"#00FF00":h);d.css({top:e.top,left:e.left,width:e.w,height:e.h,borderColor:h});}}});}},load:function(c,b){this.thresold=b||0;this.init();var a=$("<div>",{"class":"xrayAdBlock","css":{position:"absolute",background:"#ffffff",border:"1px solid #FF0071",top:0,left:0,width:0,height:0,zIndex:10003}});$.each(c,function(){a.clone().attr("xrayblock","xrayAdBlock_"+(xrayAd.adBlockCount++)).appendTo(xrayAd.div);$(this).bind("onCompleteXray",function(){xrayAd.viewportUpdate();});$(this).bind("onLoadXray",function(){xrayAd.viewportUpdate();});xrayAd.elements.push(this);});xrayAd.viewportUpdate();$(window).bind("scroll",function(d){xrayAd.viewportUpdate();});}};(function($){$.lazyLoadAdRunning=false;$.lazyLoadAdTimers=[];$.fn.lazyLoadAd=function(options){var settings={threshold:0,failurelimit:1,forceLoad:false,event:"scroll",viewport:window,placeholder:false,onLoad:false,onComplete:false,timeout:1500,debug:false,xray:false};if(options){$.extend(settings,options);}function _debug(){if(typeof console!="undefined"&&settings.debug){var args=[];for(var i=0;i<arguments.length;i++){args.push(arguments[i]);}try{console.log("LazyLoadAD |",args);}catch(e){}}}if(settings.xray&&(typeof xrayAd=="object")){xrayAd.load(this,settings.threshold);}var elements=this;$(settings.viewport).bind("checkLazyLoadAd",function(){var counter=0;elements.each(function(){if($.lazyLoadAdRunning){if($.lazyLoadAdTimers["runTimeOut"]){clearTimeout($.lazyLoadAdTimers["runTimeOut"]);}$.lazyLoadAdTimers["runTimeOut"]=setTimeout(function(){$(settings.viewport).trigger("checkLazyLoadAd");},300);return false;}else{if(settings.forceLoad==true){$(this).trigger("load");}else{if(!$.belowthefold(this,settings)&&!$.abovethetop(this,settings)){$(this).trigger("load");}else{if(counter++>settings.failurelimit){return false;}}}}});var temp=$.grep(elements,function(element){return !(($(element).data("loaded")=="true")?true:false);});elements=$(temp);});if("scroll"==settings.event){$(settings.viewport).bind("scroll",function(event){if(elements.length==0){return false;}$(settings.viewport).trigger("checkLazyLoadAd");});}this.each(function(_index,_value){var self=$(this);if(undefined==self.attr("original")){self.attr("original",self.attr("src"));}self.isLoaded=function(){return((self.data("loaded")=="true")?true:false);};self.bind("debug",function(e,status){status=status||"start";if(settings.xray){if(status=="start"){self.trigger("onLoadXray");}else{if(status=="error"){self.trigger("onErrorXray");}else{if(status=="complete"){self.trigger("onCompleteXray");}}}}if(settings.debug){if(status=="start"){self.css({border:"3px solid orange"});}else{if(status=="error"){self.css({border:"3px solid red"});}else{if(status=="complete"){self.css({border:"3px solid green"});}}}}});self.one("onComplete",function(){_debug("---> lazyLoadComplete");$(self).removeAttr("original");$.lazyLoadAdRunning=false;self.data("loaded","true");self.trigger("debug","complete");if(typeof settings.onComplete=="function"){try{settings.onComplete();
}catch(e){}}});self.stack=[];self.makinaBlock=false;self.bind("makina_go",function(){if(self.makinaBlock){return false;}if(self.stack.length>0){var el=self.stack.shift();var wrapAd=self.find(".wrapAd");if(!wrapAd.length){wrapAd=$('<div class="wrapAd"></div>').clone();wrapAd.appendTo(self);}var wrap=$("<div>").clone().appendTo(wrapAd);if(typeof el=="string"){wrap.replaceWith(el);}else{if(typeof el=="object"){if(el.is("script")){if(el.attr("src")){_debug("JS to load !! --> "+el.attr("src"));LazyLoader.load(el.attr("src"),self,function(){self.makinaBlock=false;_debug("JS to load !! ++> "+el.attr("src"));self.trigger("makina_go");});}else{wrap.replaceWith(el);}}else{wrap.replaceWith(el);}}}self.trigger("makina_go");}else{if($.lazyLoadAdTimers.loadJS){clearTimeout($.lazyLoadAdTimers.loadJS);}$.lazyLoadAdTimers.loadJS=setTimeout(function(){self.trigger("onComplete");},settings.timeout);}});self.bind("docWrite_direct",function(e,html){var el=$(html);_debug("Fragment Direct Write : ",el,el.length);$.each(el,function(){self.stack.push($(this));});self.trigger("makina_go");});self.bind("docWrite_delayed",function(e,html){_debug("Fragment Delayed Write : ",html);self.numWrappers--;_debug("Fragment append : ",self.numWrappers,html);self.docHtmlCurrent+=html;if(self.numWrappers==0){html=self.docHtmlCurrent;self.docHtmlCurrent="";setTimeout(function(){self.stack.push(html);self.docHtmlCurrent="";self.trigger("makina_go");},0);}});self.numWrappers=0;self.docHtmlCurrent="";self.bind("docWrite_overload",function(){document._writeOriginal=document.write;document.write=document.writeln=function(){var args=arguments,id=null;var html="";for(var i=0;i<args.length;i++){html+=args[i];}var testHTML="",directWrite=false;try{testHTML=$(html);directWrite=((testHTML.is("div")||testHTML.is("script"))?true:false);}catch(e){}self.history[self.fragmentId]=self.history[self.fragmentId]||{};if(self.history[self.fragmentId][html]==undefined){self.history[self.fragmentId][html]=true;if(directWrite){self.trigger("docWrite_direct",html);}else{self.numWrappers++;setTimeout(function(){self.trigger("docWrite_delayed",html);},0);}}};});self.bind("evalCode",function(){var scripts=[],script,regexp=/<code[^>]*>([\s\S]*?)<\/code>/gi;while((script=regexp.exec(self.html()))){var _s=script[1];_s=_s.replace("<!--//<![CDATA[","").replace("//]]>-->","").replace("<!--","").replace("//-->","");_s=_s.replace(/\&gt\;/g,">").replace(/\&lt\;/g,"<");scripts.push($.trim(_s));}try{scripts=(scripts.length?scripts.join("\n"):"");_debug("Script to eval : ",scripts);if(scripts!=""){eval(scripts);}}catch(e){}});self.bind("loadJS",function(e,js2load){var callback=null,script=null;if(js2load.src){callback=js2load.callback||null;js2load=js2load.src;}if(js2load.indexOf("?")==-1){js2load+="?_="+(new Date().getTime());}else{js2load+="&_="+(new Date().getTime());}_debug("loadJS :: ",js2load);LazyLoader.load(js2load,self,function(){_debug("loadJS COMPLETE :: "+js2load);if(callback){callback();}else{$.lazyLoadAdTimers.loadJS=setTimeout(function(){self.trigger("onComplete");},settings.timeout);}});});self.one("load",function(){if(!self.isLoaded()){$.lazyLoadAdRunning=true;self.data("loading","true");self.trigger("debug","start");var srcOriginal=$(self).attr("original");self.history={};_debug("------------------------------  Lazy Load Ad CALL ----");_debug("Context : ",self);self.trigger("docWrite_overload");self.trigger("evalCode");if(srcOriginal){self.trigger("loadJS",srcOriginal);}}});if("scroll"!=settings.event){self.bind(settings.event,function(event){if(!self.isLoaded()){self.trigger("load");}});}});$(settings.viewport).trigger("checkLazyLoadAd");return this;};$.belowthefold=function(element,settings){if(settings.viewport===undefined||settings.viewport===window){var fold=$(window).height()+$(window).scrollTop();}else{var fold=$(settings.viewport).offset().top+$(settings.viewport).height();}return fold<=$(element).offset().top-settings.threshold;};$.abovethetop=function(element,settings){if(settings.viewport===undefined||settings.viewport===window){var fold=$(window).scrollTop();}else{var fold=$(settings.viewport).offset().top;}return fold>=$(element).offset().top+settings.threshold+$(element).height();};})(jQuery);(function(a){a.DF={version:"1.0",copyright:"Dating Factory"};a.extend(a.DF,{scripts:[],styles:[],require:function(b){if(this.scripts.indexOf(b)==-1){document.write('<script language="JavaScript" type="text/javascript" src="'+b+'"></scr'+"ipt>");this.scripts.push(b);}},css:function(b){if(this.styles.indexOf(b)==-1){a('<link href="'+b+'" type="text/css" rel="stylesheet" />').appendTo("head");this.styles.push(b);}},registerJsFile:function(b){if(this.scripts.indexOf(b)==-1){this.scripts.push(b);}},_blockElementOverlayMessage:{message:null,overlayCSS:{opacity:"0.6"}},trackEvent:function(c,d,e,b){if(typeof(systemPageTracker)!="undefined"&&a.isFunction(systemPageTracker._trackEvent)){systemPageTracker._trackEvent(c,d,e,b);}},getUserContext:function(){var c={};var e=document.body.className.split(" ");
c.niche=e[1];c.nicheMarket=e[2];c.locale=e[3];c.country=e[e.length-1];var b=document.body.className.match(/mySex-([\w]*)/g);if(b){c.sex=b[0].replace("mySex-","");}var b=document.body.className.match(/seekingSex-([\w]*)/g);if(b){c.seekingSex=[];for(var d=0;d<b.length;d++){c.seekingSex.push(b[d].replace("seekingSex-",""));}}return c;}});})(jQuery);$.DF.Popup={_popup:null,_query:[],_opened:false,options:null,open:function(b,c,a){b=b||'<div class="loading"></div>';a=$.extend({alignX:"center",alignY:"center",modal:true},a||{});if(!$.DF.Popup._opened){$.DF.Popup.options=a;$.DF.Popup._popup.find("div.content").html(b);$.blockUI({message:$.DF.Popup._popup,showOverlay:$.DF.Popup.options.modal});if(!$.DF.Popup.options.modal){$.DF.Popup._popup.addClass("not-modal");}$.DF.Popup.align();$.DF.Popup._opened=true;if($.isFunction(c)){c();}}else{$.DF.Popup._query.push({html:b,callback:c,options:a});}},update:function(a,b){if($.DF.Popup._opened&&a){$.DF.Popup._popup.find("div.content").html(a);$.DF.Popup.align("slow",b);}},close:function(a){$.DF.Popup._popup.find("div.content").html("");$.unblockUI();$.DF.Popup._popup.removeClass("not-modal");$.DF.Popup._opened=false;$.DF.Popup.options=null;if($.DF.Popup._query.length>0){setTimeout(function(){var b=$.DF.Popup._query.shift();$.DF.Popup.open(b.html,b.callback,b.options);},150);}},align:function(e,h){var d=this._popup.find("div.content").children(":first");var c=d.width()+10;var a=d.height()+10;var g,f;switch(this.options.alignX){case"left":g=10;break;case"center":g=Math.max(0,parseInt($(window).width()-c)/2);break;case"right":g=Math.max(0,parseInt($(window).width()-c)-10);break;}switch(this.options.alignY){case"top":f=10;break;case"center":f=Math.max(0,parseInt($(window).height()-a)/2);break;case"bottom":f=Math.max(0,parseInt($(window).height()-a)-10);break;}var b=this._popup.parents("div.blockMsg");if(e!="slow"){b.resizeTo(c,a);b.moveTo(g,f);}else{b.animate({left:g,top:f,width:c,height:a},300,function(){if($.isFunction(h)){h();}});}}};$(document).ready(function(){$.extend($.blockUI.defaults,{css:{padding:0,margin:0,width:"auto",top:"40%",left:"35%",textAlign:"center",border:"none"},overlayCSS:{opacity:"0.6"},fadeIn:0,fadeOut:0});$.DF.Popup._popup=$('<div class="popup"><div class="head"></div><div class="content"></div></div>');$(document.body).append($.DF.Popup._popup);});window.alert=function(a){$.DF.Popup.open(String.format('<div class="alert"><p>{0}</p><button type="button" class="submit common" onclick="$.DF.Popup.close()">Ok</button></div>',a));};$.DF.Sticker={_queue:[],_sticker:null,options:{timeout:15*1000,close:true},open:function(i,f,l){var d=this.buildHTML(i);var g=this._queue.push(d)-1;var h=d.find("div.content");h.html(f);d.css("left",-1000);d.css("top",-1000);var c=d.find("div.content");if($.browser.msie){c.css("float","left").children(":first").css("float","left");}var a=c.realWidth()+12;var k=c.realHeight()+12+5;if($.browser.msie){c.css("float","").children(":first").css("float","");}if($.browser.msie&&$.browser.version<7){d.find("div.popup").width(a-12);}if(this._queue.length==1){var b=parseInt($(window).width()-a)/2;var j=parseInt($(window).height()-k)/2;}else{var e=this._queue[0].offset();var b=e.left+(this._queue.length-1)*20;var j=e.top+(this._queue.length-1)*20;}b+=$(window).scrollLeft();j+=$(window).scrollTop();d.css("opacity",0);d.css("left",b);d.css("top",j);d.css("width",a);d.css("height",k);d.animate({opacity:1},200,function(){d.css("filter","");if($.browser.msie){d.bgiframe();}});l=$.extend({},this.options,l||{});if(l.timeout>0){d.timer=setTimeout(function(){$.DF.Sticker.close(d);},l.timeout);}if(l.close){$('<img alt="close" title="close" width="16" height="16" src="/theme/images/ico_close.gif" class="close" />').appendTo(d.find("div.popup")).click(function(){$.DF.Sticker.close(d);});}return d;},close:function(d){if(d){d.animate({opacity:0},200,function(){d.trigger("remove");d.remove();});clearTimeout(d.timer);var b=this._queue.indexOf(d);if(b>=0&&b<this._queue.length){for(var c=b+1;c<this._queue.length;c++){this._queue[c].animate({left:"-=20px",top:"-=20px"},200);}var a=this._queue.slice(0,b);var e=this._queue.slice(b+1,this._queue.length);this._queue=a.concat(e);}}},buildHTML:function(a){var b=$(String.format('<div class="sticker {0}"><div class="shadow"></div><div class="popup"><div class="head"></div><div class="content"></div></div></div>',a));$(document.body).append(b);b.find("div.shadow").css("opacity",0.5);return b;}};$.DF.AjaxComponent={"guestbook.ReadGuestbook":{"url":"/guestbook/viewGuestbook.do","component":"guestbook.ReadGuestbook","template":"preview.html"},"guestbook.EditGuestbook":{"component":"guestbook.GuestbookComment","template":"edit.html"},"profile.ViewProfile":{"url":"/viewMemberProfile.do","component":"profile.ViewProfile"},"profile.ViewProfilePopup":{"url":"/viewMemberProfile.do","component":"profile.ViewProfilePopup"},"profile.EditProfile":{"url":"/editMyProfile.do","component":"profile.MyProfileEdit","template":"parted.html"},"informer.Message":{"url":"/informer/viewMessage.do","component":"informer.InformerMessage","template":"default.html"},"chat.ChatHistory":{"url":"/chat/history/","component":"chat.ChatHistory"},"gallery.EditMediaItem":{"component":"profile.gallery.MediaItem","template":"editTiny.html","attributes[editMode]":true,"attributes[edit]":false},"search.Search":{"url":"/widget/search/quick/","component":"search.Search","template":"widget.html","attributes[searchType]":"Quick"},"search.SearchResult":{"url":"/widget/search/quick.do","component":"search.SearchResult","template":"widget.html","action":"searchAction"},"page.LandingPage":{"component":"page.LandingPage","template":"default.html"}};
$.DF.AjaxRender={_loading:null,_request:function(b,a,c){if(a){$(a).block($.DF._blockElementOverlayMessage);}$.ajax({type:"GET",data:b,dataType:"html",url:"/ajaxRender.do",error:function(d,f,e){},success:function(d,e){if(a){$(a).unblock();$(a).html(d);}if($.isFunction(c)){c(d);}}});},ReadGuestbook:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["guestbook.ReadGuestbook"]);this._request(b,a,c);},EditGuestbook:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["guestbook.EditGuestbook"],{"random":parseInt((new Date())*Math.random())});this._request(b,a,c);},ViewProfileComposeMessage:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["profile.ViewProfilePopup"],{template:"composeMessage.html"});this._request(b,a,c);},ViewProfileContextMenu:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["profile.ViewProfilePopup"],{template:"contextMenu.html"});this._request(b,a,c);},ViewProfile:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["profile.ViewProfile"],{template:"parted.html"});this._request(b,a,c);},EditProfile:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["profile.EditProfile"],{"random":parseInt((new Date())*Math.random())});this._request(b,a,c);},InformerMessage:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["informer.Message"]);this._request(b,a,c);},ChatHistory:function(a,c){var b=$.DF.AjaxComponent["chat.ChatHistory"];this._request(b,a,c);},EditMediaItem:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["gallery.EditMediaItem"],{"random":parseInt((new Date())*Math.random())});this._request(b,a,c);},QuickSearch:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["search.Search"]);this._request(b,a,c);},QuickSearchResult:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["search.SearchResult"]);this._request(b,a,c);},LandingPage:function(b,a,c){var b=$.extend(b||{},$.DF.AjaxComponent["page.LandingPage"]);this._request(b,a,c);}};$.DF.AjaxSubmit={initialize:function(b,a,c){$(b).unbind("submit",$.DF.AjaxSubmit.onSubmit).bind("submit",{additional:a,callback:c},$.DF.AjaxSubmit.onSubmit);},serialize:function(b){var c={};var a=["input:hidden","input:text:enabled","input:password:enabled","input:checkbox:checked:enabled","input:radio:checked:enabled","textarea:enabled","select:enabled"].join(",");$(b).find(a).each(function(){var d=this.name;var e=$(this).val()||"";if(!c[d]){c[d]=e;}else{if($.isArray(c[d])){c[d].push(e);}else{c[d]=[c[d],e];}}});return c;},onSubmit:function(b){var a=this;$(a).block($.DF._blockElementOverlayMessage);var c=$.extend({url:$(a).attr("action")},b.data.additional||{});c=$.extend(c,$.DF.AjaxSubmit.serialize(a));$.ajax({type:$(a).attr("method"),url:"/ajaxRender.do",data:c,dataType:"html",success:function(d){$(a).unblock();if($.isFunction(b.data.callback)){$.hitch(a,b.data.callback)($.trim(d));}},error:function(d,f,e){$(a).unblock();}});b.preventDefault();}};$.DF.REST={_getUrl:function(a,b){return"/ws/rs/"+a+"/"+b.join("/")+".json";},_request:function(d,a,f,e,g){var c=this._getUrl(a,f);var b={type:d,url:c,data:e,dataType:"json",success:function(h){if($.isFunction(g)){g(h);}h.ServicePath=f;$().trigger(a,h);},error:function(h,j,i){if($.isFunction(g)){g({"ServiceOperationResult":{"success":false,"messageText":h.responseText}});}}};if($.browser.opera){$.extend(b,{contentType:"application/json",data:b.data||{"operadata":Math.random()}});}$.ajax(b);},ping:function(a){this._request("POST","InformerService",["ping"],null,a);},chatRequest:function(b,a){this._request("POST","InformerService",["messages","CHAT_REQUEST",b],null,a);},chatResponse:function(a,d,b,c){this._request("POST","InformerService",["messages",a,"reply",d,b],null,c);},closeMessage:function(a,b){this._request("POST","InformerService",["messages",a,"close"],null,b);},getRegionsListByCountryId:function(a,b){this._request("GET","GeoService",["regions","byCountry",a],null,function(f){var j=[];for(var e=0,g=f.Region.length;e<g;e++){var d="&nbsp;&nbsp;".repeat(parseInt(f.Region[e]["@nestingLevel"])||0)+f.Region[e]["name"];var h=f.Region[e]["@id"];var c=!!(f.Region[e]["selectable"]);j.push([h,d,c]);}if($.isFunction(b)){b(j);}});},getCitiesListByCountryId:function(a,b){this._request("GET","GeoService",["cities","byCountry",a],null,function(d){var e=[];for(var c=0,f=d.City.length;c<f;c++){e.push([d.City[c]["@id"],d.City[c]["name"]]);}if($.isFunction(b)){b(e);}});},getCitiesListByRegionId:function(b,a){this._request("GET","GeoService",["cities","byRegion",b],null,function(d){var e=[];for(var c=0,f=d.City.length;c<f;c++){e.push([d.City[c]["@id"],d.City[c]["name"]]);}if($.isFunction(a)){a(e);}});},getPostalCodesByCityId:function(b,a){this._request("GET","GeoService",["postalCodes","byCity",b],null,function(e){var c=[];for(var d=0,f=e.PostalCode.length;d<f;d++){c.push([e.PostalCode[d]["@id"],e.PostalCode[d]["code"]]);}if($.isFunction(a)){a(c);}});},setAdultRating:function(a,b){this._request("POST","MemberService",["myprofile","filter","edit",a],null,b);},validate:function(a,b,c){this._request("POST","UtilityService",[a,b],null,c);
},markAsRead:function(a,b){this._request("POST","MailboxService",["mailbox","markRead",a],null,b);},newMembers:function(a,b){this._request("GET","WidgetService",["search","newMembers",a],null,b);},quickSearch:function(b,c,d){var a=$.DF.getUserContext();b=$.extend({countryIsoCode:a.country||"uk",mySexId:1,seekingSexId:2,ageFrom:18,ageTo:90},b||{});this._request("GET","WidgetService",["search","quick"].concat([b.countryIsoCode,b.mySexId,b.seekingSexId,b.ageFrom,b.ageTo,c]),null,d);}};$.DF.Validation={initialize:function(c,b){for(var a=0;a<c.length;a++){$(String.format("[name={0}]",c[a].name),b).bind("change",c[a],$.hitch($.DF.Validation,"onChange"));}},onChange:function(a){var c=$(a.target);var b=a.data;c.closest("dd").prevAll("p.error").remove();if(c.val()!=""){$.DF.REST.validate(b.serviceType,c.val(),function(d){if(d.ServiceOperationResult.success==false){$(String.format('<p class="error" style="display:none;">{0}</p>',d.ServiceOperationResult.messageText)).insertBefore(c.closest("dd").prev("dt")).slideDown("fast");}});}}};(function(a){a.fn.extend({"attach":function(c,b){c=c||[];this.each(function(d,g){for(var e=0,f=c.length;e<f;e++){a(g).addOption(c[e][0],c[e][1],c[e][2]);}if(b!=null){a(g).val(b);}});return this;},"clear":function(c,b){this.each(function(d,e){a(e).empty();if(c!==true){a(e).addOption(b||"0",c||"");}});return this;},"addOption":function(e,f,b,d){var c=a(String.format('<option value="{0}">{1}</option>',e,f));if(b==false){c.attr("disabled","disabled");}if(d==true){c.attr("selected","selected");}this.each(function(g,h){if(h.options){a(h).append(c);}});return this;}});})(jQuery);
