(function(f){if(typeof f!="function"||typeof f.fn==typeof __undefined__){throw new Error("jquery library should included first of all. ")}if(typeof f.signal=="function"){return}var e=function(b,a,c){this.sigId=b;this.args=a;this.containers=[];this.opts=c;this.opts.direction|=f.signal.SELF;this.opts.delegated=true};e.prototype.add=function(b){try{b.jQuery.slot.exists();this.containers.push(b.jQuery)}catch(a){return false}};e.prototype.findContainers=function(b){if(b!=window){this.add(b)}for(var a=0;a<b.frames.length;a++){this.findContainers(b.frames[a].contentWindow||b.frames[a])}};e.prototype.delegate=function(b){switch(b.toLowerCase()){case"uplink":if(window==top){return}for(var a=window.parent;a;){this.add(a);if(a==top){a=null}else{a=a.parent}}break;case"followlink":this.findContainers(window);break;case"broadcast":this.findContainers(top);break;default:break}var c;while((c=this.containers.shift())){c.signal(this.sigId,this.args,this.opts)}};e.prototype.clear=function(){for(var a=0;a<this.containers.length;a++){delete this.containers[a]}this.args=null};var h={};var g=/^\s+|\s+$/g;f.signal=function(d,m,a){if(typeof d!=typeof"string"||(d=d.replace(g,"")).length<=0){throw new Error("signal id is not valid - "+d)}m=(typeof m==typeof __undefined__)?"":m;a=f.extend({},{direction:f.signal.BROADCAST,delegated:false,sync:false,scope:window,hops:f.signal.MAXHOPS},a);if(--a.hops<-1){return}if((a.direction&f.signal.SELF)&&f.slot.countOf(d)){for(var b=0;b<h[d].length;b++){var c=h[d][b],l;if(typeof c!="function"){continue}if(m&&typeof(m)=="object"&&typeof(m.pop)=="function"){l=(function(i,j){return function(){i.apply(a.scope,j)}})(c,m)}else{l=(function(i,j){return function(){i.call(a.scope,j)}})(c,m)}if(a.sync){l()}else{setTimeout(l,0)}}}if(a.delegated){return}var n=new e(d,m,a);if(a.direction==f.signal.BROADCAST||a.direction==f.signal.OTHER){n.delegate("broadcast")}else{if(a.direction&f.signal.UPLINK){n.delegate("uplink")}else{if(a.direction&f.signal.FOLLOWLINK){n.delegate("followlink")}}}n.clear();n=null},f.slot={countOf:function(a){try{return h[a].length}catch(b){return 0}},exists:function(a){return(typeof a=="string")&&((a=a.replace(g,"")).length>=1)&&(typeof h[a]=="array")&&(h[a].length>0)},add:function(d,c,a){if(typeof c!="function"){return false}if(!(d in h)||h[d].constructor!=Array){h[d]=[]}if(!a){var b=false;for(var j=0;j<h[d].length;j++){if(h[d][j]===c){if(b){delete h[d][j];j--}else{h[d][j]=c;b=true}}}if(b){return true}}h[d].push(c)},remove:function(d,b){try{if(typeof b==typeof __undefined__){delete h[d];return}var c=h[d];for(var j=0;j<c.length;j++){if(c[j]===b){delete c[j]}}}catch(a){alert(d+": "+a.message)}}};f.signal.SELF=1<<1;f.signal.UPLINK=1<<2;f.signal.FOLLOWLINK=1<<3;f.signal.BROADCAST=f.signal.SELF|f.signal.UPLINK|f.signal.FOLLOWLINK;f.signal.OTHER=f.signal.BROADCAST^f.signal.SELF;f.signal.__debug__=true;f.signal.MAXHOPS=5})(jQuery);