function reportAbuseConfirm(b,a){Chat.Confirm.show("confirmAbuseRequest",{onSuccess:function(){reportCommentAbuse(b,a);return},height:105,width:350,zIndex:5})}function reportCommentAbuse(d,a){var b=$("overlayerReportComments");var c={user:d,info:$("comment_"+a).innerHTML,comment_id:a};new Ajax.Request("/newalbums/index/report-abuse.ajax",{method:"get",parameters:Object.toQueryString(c),onSuccess:function(e){if(e.responseText.indexOf("ok")>=0){if(Object.isUndefined(Chat)){alert($("response").innerHTML)
}else{Chat.Confirm.show($("overlayerReportComments").innerHTML,{title:b.readAttribute("title"),width:450,height:100,showEffect:Element.show,hideEffect:Element.hide})}}}})}String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;
b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))
}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5
},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";
if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var e;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){e=b}else{e=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var d=a.delay;$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c){b=$(b);c=(c||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[c][1]:Effect.PAIRS[c][0]](b,a)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn
});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);
this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(a){function b(d,c){return((d[c+"Internal"]?"this.options."+c+"Internal(this);":"")+(d[c]?"this.options."+c+"(this);":""))
}if(a&&a.transition===false){a.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;
this.render=(function(){function c(e,d){if(e.options[d+"Internal"]){e.options[d+"Internal"](e)}if(e.options[d]){e.options[d](e)}}return function(d){if(this.state==="idle"){this.state="running";c(this,"beforeSetup");if(this.setup){this.setup()}c(this,"afterSetup")}if(this.state==="running"){d=(this.options.transition(d)*this.fromToDelta)+this.options.from;this.position=d;c(this,"beforeUpdate");if(this.update){this.update(d)
}c(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();
if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])
}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,f,e){c=Object.isString(c)?$(c):c;
var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(g){c[d]=g};this.start(Object.extend({from:f,to:e},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})
}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)
},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]
}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=e.round()+"px"
}if(this.options.scaleY){f.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}this.element.setStyle(f)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())
}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();if(b.offset){d[1]+=b.offset}return new Effect.Tween(null,a.top,d[1],b,function(e){scrollTo(a.left,e.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();
var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()
}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()
},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(d){d=$(d);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});var e=parseFloat(b.distance);var c=parseFloat(b.duration)/10;var a={top:d.getStyle("top"),left:d.getStyle("left")};return new Effect.Move(d,{x:e,y:0,duration:c,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:-e,y:0,duration:c,afterFinishInternal:function(l){l.element.undoPositioned().setStyle(a)
}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();
if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()
},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var g=c.getDimensions();var h,f;var e,d;switch(b.direction){case"top-left":h=f=e=d=0;break;case"top-right":h=g.width;f=d=0;e=-g.width;break;case"bottom-left":h=e=0;f=g.height;d=-g.height;break;case"bottom-right":h=g.width;f=g.height;e=-g.width;d=-g.height;break;case"center":h=g.width/2;f=g.height/2;e=-g.width/2;d=-g.height/2;break}return new Effect.Move(c,{x:h,y:f,duration:0.01,beforeSetup:function(j){j.element.hide().makeClipping().makePositioned()
},afterFinishInternal:function(j){new Effect.Parallel([new Effect.Opacity(j.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(j.element,{x:e,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(j.element,100,{scaleMode:{originalHeight:g.height,originalWidth:g.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(k){k.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(k){k.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};
var f=c.getDimensions();var e,d;switch(b.direction){case"top-left":e=d=0;break;case"top-right":e=f.width;d=0;break;case"bottom-left":e=0;d=f.height;break;case"bottom-right":e=f.width;d=f.height;break;case"center":e=f.width/2;d=f.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:e,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),e=b.transition||Effect.Transitions.linear,d=function(f){return 1-e((-Math.cos((f*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:a})
}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))
};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);
var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]});a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(e){d.element.style[e.style]=""})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)
})}this.transforms=this.style.map(function(g){var f=g[0],e=g[1],d=null;if(e.parseColor("#zzzzzz")!="#zzzzzz"){e=e.parseColor();d="color"}else{if(f=="opacity"){e=parseFloat(e);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(e)){var c=e.match(/^([\+\-]?[0-9\.]+)(.*)$/);e=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(f);
return{style:f.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(e):e,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)
}this.element.setStyle(d,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");
var e=[$(d)||$$(d)].flatten();return e.map(function(f){return new c(f,Object.extend({sync:true},b))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])
}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;
c=Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=a[e];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(c,e,b){c=$(c);var d=e.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);return c},highlight:function(b,a){b=$(b);
new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]
});Element.addMethods(Effect.Methods);if(typeof Prototype=="undefined"||!Prototype.Version.match("1.6")){throw ("Prototype-UI library require Prototype library >= 1.6.0")}if(Prototype.Browser.WebKit){Prototype.Browser.WebKitVersion=parseFloat(navigator.userAgent.match(/AppleWebKit\/([\d\.\+]*)/)[1]);Prototype.Browser.Safari2=(Prototype.Browser.WebKitVersion<420)}if(Prototype.Browser.IE){Prototype.Browser.IEVersion=parseFloat(navigator.appVersion.split(";")[1].strip().split(" ")[1]);
Prototype.Browser.IE6=Prototype.Browser.IEVersion==6;Prototype.Browser.IE7=Prototype.Browser.IEVersion==7}Prototype.falseFunction=function(){return false};Prototype.trueFunction=function(){return true};var UI={Abstract:{},Ajax:{}};Object.extend(Class.Methods,{extend:Object.extend.methodize(),addMethods:Class.Methods.addMethods.wrap(function(a,b){if(!b){return this}if(!b.hasOwnProperty("methodsAdded")){return a(b)
}var c=b.methodsAdded;delete b.methodsAdded;a(b);c.call(b,this);b.methodsAdded=c;return this}),addMethod:function(c,b){var a={};a[c]=b;return this.addMethods(a)},method:function(a){return this.prototype[a].valueOf()},classMethod:function(){$A(arguments).flatten().each(function(a){this[a]=(function(){return this[a].apply(this,arguments)}).bind(this.prototype)},this);return this},undefMethod:function(a){this.prototype[a]=undefined;
return this},removeMethod:function(a){delete this.prototype[a];return this},aliasMethod:function(a,b){this.prototype[a]=this.prototype[b];return this},aliasMethodChain:function(b,a){a=a.camelcase();this.aliasMethod(b+"Without"+a,b);this.aliasMethod(b,b+"With"+a);return this}});Object.extend(Number.prototype,{snap:function(a){return parseInt(a==1?this:(this/a).floor()*a)}});Object.extend(String.prototype,{camelcase:function(){var a=this.dasherize().camelize();
return a.charAt(0).toUpperCase()+a.slice(1)},makeElement:function(){var a=new Element("div");a.innerHTML=this;return a.down()}});Object.extend(Array.prototype,{empty:function(){return !this.length},extractOptions:function(){return this.last().constructor===Object?this.pop():{}},removeAt:function(b){var a=this[b];this.splice(b,1);return a},remove:function(b){var a;while((a=this.indexOf(b))!=-1){this.removeAt(a)
}return b},insert:function(b){var a=$A(arguments);a.shift();this.splice.apply(this,[b,0].concat(a));return this}});Element.addMethods({getScrollDimensions:function(a){return{width:a.scrollWidth,height:a.scrollHeight}},getScrollOffset:function(a){return Element._returnOffset(a.scrollLeft,a.scrollTop)},setScrollOffset:function(a,b){a=$(a);if(arguments.length==3){b={left:b,top:arguments[2]}}a.scrollLeft=b.left;
a.scrollTop=b.top;return a},getNumStyle:function(a,b){var c=parseFloat($(a).getStyle(b));return isNaN(c)?null:c},appendText:function(a,b){a=$(a);b=String.interpret(b);a.appendChild(document.createTextNode(b));return a}});document.whenReady=function(a){if(document.loaded){a.call(document)}else{document.observe("dom:loaded",a)}};Object.extend(document.viewport,{getScrollOffset:document.viewport.getScrollOffsets,setScrollOffset:function(a){Element.setScrollOffset(Prototype.Browser.WebKit?document.body:document.documentElement,a)
},getScrollDimensions:function(){return Element.getScrollDimensions(Prototype.Browser.WebKit?document.body:document.documentElement)}});(function(){UI.Options={methodsAdded:function(b){b.classMethod($w(" setOptions allOptions optionsGetter optionsSetter optionsAccessor "))},setOptions:function(b){if(!this.hasOwnProperty("options")){this.options=this.allOptions()}this.options=Object.extend(this.options,b||{})
},allOptions:function(){var c=this.constructor.superclass,b=c&&c.prototype;return(b&&b.allOptions)?Object.extend(b.allOptions(),this.options):Object.clone(this.options)},optionsGetter:function(){a(this,arguments,false)},optionsSetter:function(){a(this,arguments,true)},optionsAccessor:function(){this.optionsGetter.apply(this,arguments);this.optionsSetter.apply(this,arguments)}};function a(c,d,b){d=$A(d).flatten();
if(d.empty()){d=Object.keys(c.allOptions())}d.each(function(f){var e=(b?"set":"get")+f.camelcase();c[e]=c[e]||(b?function(g){return this.options[f]=g}:function(){return this.options[f]})})}})();UI.Carousel=Class.create(UI.Options,{options:{direction:"horizontal",previousButton:".previous_button",nextButton:".next_button",container:".container",scrollInc:"auto",disabledButtonSuffix:"_disabled",overButtonSuffix:"_over"},initialize:function(b,a){this.setOptions(a);
this.element=$(b);this.id=this.element.id;this.container=this.element.down(this.options.container).firstDescendant();this.elements=this.container.childElements();this.previousButton=this.options.previousButton==false?null:this.element.down(this.options.previousButton);this.nextButton=this.options.nextButton==false?null:this.element.down(this.options.nextButton);this.posAttribute=(this.options.direction=="horizontal"?"left":"top");
this.dimAttribute=(this.options.direction=="horizontal"?"width":"height");this.elementSize=this.computeElementSize();this.nbVisible=this.currentSize()/this.elementSize;var c=this.options.scrollInc;if(c=="auto"){c=Math.floor(this.nbVisible)}[this.previousButton,this.nextButton].each(function(d){if(!d){return}var e=(d==this.nextButton?"next_button":"previous_button")+this.options.overButtonSuffix;d.clickHandler=this.scroll.bind(this,(d==this.nextButton?-1:1)*c*this.elementSize);
d.observe("click",d.clickHandler).observe("mouseover",function(){d.addClassName(e)}.bind(this)).observe("mouseout",function(){d.removeClassName(e)}.bind(this))},this);this.updateButtons()},destroy:function($super){[this.previousButton,this.nextButton].each(function(a){if(!a){return}a.stopObserving("click",a.clickHandler)},this);this.element.remove();this.fire("destroyed")},fire:function(b,a){a=a||{};
a.carousel=this;return this.element.fire("carousel:"+b,a)},observe:function(a,b){this.element.observe("carousel:"+a,b.bind(this));return this},stopObserving:function(a,b){this.element.stopObserving("carousel:"+a,b);return this},checkScroll:function(a,d){if(a>0){a=0}else{var b=this.elements.last().positionedOffset()[this.posAttribute]+this.elementSize;var c=this.currentSize();if(a+b<c){a+=c-(a+b)}a=Math.min(a,0)
}if(d){this.container.style[this.posAttribute]=a+"px"}return a},scroll:function(b){if(this.animating){return this}var a=this.currentPosition()+b;a=this.checkScroll(a,false);b=a-this.currentPosition();if(b!=0){this.animating=true;this.fire("scroll:started");var c=this;this.container.morph("opacity:0.5",{duration:0.2,afterFinish:function(){c.container.morph(c.posAttribute+": "+a+"px",{duration:0.4,delay:0.2,afterFinish:function(){c.container.morph("opacity:1",{duration:0.2,afterFinish:function(){c.animating=false;
c.updateButtons().fire("scroll:ended",{shift:b/c.currentSize()})}})}})}})}return this},scrollTo:function(a){if(this.animating||a<0||a>this.elements.length||a==this.currentIndex()||isNaN(parseInt(a))){return this}return this.scroll((this.currentIndex()-a)*this.elementSize)},updateButtons:function(){this.updatePreviousButton();this.updateNextButton();return this},updatePreviousButton:function(){var a=this.currentPosition();
var b="previous_button"+this.options.disabledButtonSuffix;if(this.previousButton.hasClassName(b)&&a!=0){this.previousButton.removeClassName(b);this.fire("previousButton:enabled")}if(!this.previousButton.hasClassName(b)&&a==0){this.previousButton.addClassName(b);this.fire("previousButton:disabled")}},updateNextButton:function(){var a=this.currentLastPosition();var b=this.currentSize();var c="next_button"+this.options.disabledButtonSuffix;
if(this.nextButton.hasClassName(c)&&a!=b){this.nextButton.removeClassName(c);this.fire("nextButton:enabled")}if(!this.nextButton.hasClassName(c)&&a<=b){this.nextButton.addClassName(c);this.fire("nextButton:disabled")}},computeElementSize:function(){return this.elements.first().getDimensions()[this.dimAttribute]},currentIndex:function(){return -this.currentPosition()/this.elementSize},currentLastPosition:function(){if(this.container.childElements().empty()){return 0
}return this.currentPosition()+this.elements.last().positionedOffset()[this.posAttribute]+this.elementSize},currentPosition:function(){return this.container.getNumStyle(this.posAttribute)},currentSize:function(){return this.container.parentNode.getDimensions()[this.dimAttribute]},updateSize:function(){this.nbVisible=this.currentSize()/this.elementSize;var a=this.options.scrollInc;if(a=="auto"){a=Math.floor(this.nbVisible)
}[this.previousButton,this.nextButton].each(function(b){if(!b){return}b.stopObserving("click",b.clickHandler);b.clickHandler=this.scroll.bind(this,(b==this.nextButton?-1:1)*a*this.elementSize);b.observe("click",b.clickHandler)},this);this.checkScroll(this.currentPosition(),true);this.updateButtons().fire("sizeUpdated");return this}});UI.Ajax.Carousel=Class.create(UI.Carousel,{options:{elementSize:-1,url:null},initialize:function($super,b,a){if(!a.url){throw ("url option is required for UI.Ajax.Carousel")
}if(!a.elementSize){throw ("elementSize option is required for UI.Ajax.Carousel")}$super(b,a);this.endIndex=0;this.hasMore=true;this.updateHandler=this.update.bind(this);this.updateAndScrollHandler=function(e,d,c){this.update(d,c);this.scroll(e)}.bind(this);this.runRequest.bind(this).defer({parameters:{from:0,to:Math.ceil(this.nbVisible)-1},onSuccess:this.updateHandler})},runRequest:function(a){this.requestRunning=true;
new Ajax.Request(this.options.url,Object.extend({method:"GET"},a));this.fire("request:started");return this},scroll:function($super,a){if(this.animating||this.requestRunning){return this}var d=(-a)/this.elementSize;if(this.hasMore&&d>0&&this.currentIndex()+this.nbVisible+d-1>this.endIndex){var c=this.endIndex+1;var b=Math.ceil(c+this.nbVisible-1);this.runRequest({parameters:{from:c,to:b},onSuccess:this.updateAndScrollHandler.curry(a).bind(this)});
return this}else{$super(a)}},update:function(b,a){this.requestRunning=false;this.fire("request:ended");if(!a){a=b.responseJSON}this.hasMore=a.more;this.endIndex=Math.max(this.endIndex,a.to);this.elements=this.container.insert({bottom:a.html}).childElements();return this.updateButtons()},computeElementSize:function(){return this.options.elementSize},updateSize:function($super){var a=this.nbVisible;$super();
if(Math.floor(this.nbVisible)-Math.floor(a)>=1&&this.hasMore){if(this.currentIndex()+Math.floor(this.nbVisible)>=this.endIndex){var b=Math.floor(this.currentIndex()+Math.floor(this.nbVisible)-this.endIndex);this.runRequest({parameters:{from:this.endIndex+1,to:this.endIndex+b},onSuccess:this.updateHandler})}}return this},updateNextButton:function($super){var a=this.currentLastPosition();var b=this.currentSize();
var c="next_button"+this.options.disabledButtonSuffix;if(this.nextButton.hasClassName(c)&&a!=b){this.nextButton.removeClassName(c);this.fire("nextButton:enabled")}if(!this.nextButton.hasClassName(c)&&a==b&&!this.hasMore){this.nextButton.addClassName(c);this.fire("nextButton:disabled")}}});var loadingImage="http://static2.machteamsoft.ro/modules/promoted/img/loading.v0.gif";var closeButton="http://static2.machteamsoft.ro/modules/promoted/img/close.v0.gif";
function getPageScroll(){var a;if(self.pageYOffset){a=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}else{if(document.body){a=document.body.scrollTop}}}arrayPageScroll=new Array("",a);return arrayPageScroll}function getPageSize(){var c,a;if(window.innerHeight&&window.scrollMaxY){c=document.body.scrollWidth;a=window.innerHeight+window.scrollMaxY
}else{if(document.body.scrollHeight>document.body.offsetHeight){c=document.body.scrollWidth;a=document.body.scrollHeight}else{c=document.body.offsetWidth;a=document.body.offsetHeight}}var b,d;if(self.innerHeight){b=self.innerWidth;d=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){b=document.documentElement.clientWidth;d=document.documentElement.clientHeight
}else{if(document.body){b=document.body.clientWidth;d=document.body.clientHeight}}}if(a<d){pageHeight=d}else{pageHeight=a}if(c<b){pageWidth=b}else{pageWidth=c}arrayPageSize=new Array(pageWidth,pageHeight,b,d);return arrayPageSize}function pause(b){var a=new Date();var c=a.getTime()+b;while(true){a=new Date();if(a.getTime()>c){return}}}function getKey(a){if(a==null){keycode=event.keyCode}else{keycode=a.which
}key=String.fromCharCode(keycode).toLowerCase();if(key=="x"){hideLightbox()}}function listenKey(){document.onkeypress=getKey}function showLightbox(c){var h=document.getElementById("overlay");var b=document.getElementById("lightbox");var e=document.getElementById("lightboxCaption");var j=document.getElementById("lightboxImage");var a=document.getElementById("loadingImage");var g=document.getElementById("lightboxDetails");
var f=getPageSize();var d=getPageScroll();if(a){a.style.top=(d[1]+((f[3]-35-a.height)/2)+"px");a.style.left=(((f[0]-20-a.width)/2)+"px");a.style.display="block"}h.style.height=(f[1]+"px");h.style.display="block";imgPreload=new Image();imgPreload.onload=function(){j.src=c.href;var l=d[1]+((f[3]-35-imgPreload.height)/2);var k=((f[0]-20-imgPreload.width)/2);b.style.top=(l<0)?"0px":l+"px";b.style.left=(k<0)?"0px":k+"px";
g.style.width=imgPreload.width+"px";if(c.getAttribute("title")){e.style.display="block";e.innerHTML=c.getAttribute("title")}else{e.style.display="none"}if(navigator.appVersion.indexOf("MSIE")!=-1){pause(250)}if(a){a.style.display="none"}selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="hidden"}b.style.display="block";f=getPageSize();h.style.height=(f[1]+"px");
listenKey();return false};imgPreload.src=c.href}function hideLightbox(){objOverlay=document.getElementById("overlay");objLightbox=document.getElementById("lightbox");objOverlay.style.display="none";objLightbox.style.display="none";selects=document.getElementsByTagName("select");for(i=0;i!=selects.length;i++){selects[i].style.visibility="visible"}document.onkeypress=""}function initLightbox(){if(!document.getElementsByTagName){return
}var b=document.getElementsByTagName("a");for(var e=0;e<b.length;e++){var f=b[e];if(f.getAttribute("href")&&(f.getAttribute("rel")=="lightbox")){f.onclick=function(){showLightbox(this);return false}}}var p=document.getElementsByTagName("body").item(0);var o=document.createElement("div");o.setAttribute("id","overlay");o.onclick=function(){hideLightbox();return false};o.style.display="none";o.style.position="absolute";
o.style.top="0";o.style.left="0";o.style.zIndex="90";o.style.width="100%";p.insertBefore(o,p.firstChild);var h=getPageSize();var j=getPageScroll();var k=new Image();k.onload=function(){var r=document.createElement("a");r.setAttribute("href","#");r.onclick=function(){hideLightbox();return false};o.appendChild(r);var q=document.createElement("img");q.src=loadingImage;q.setAttribute("id","loadingImage");
q.style.position="absolute";q.style.zIndex="150";r.appendChild(q);k.onload=function(){};return false};k.src=loadingImage;var c=document.createElement("div");c.setAttribute("id","lightbox");c.style.display="none";c.style.position="absolute";c.style.zIndex="100";p.insertBefore(c,o.nextSibling);var d=document.createElement("a");d.setAttribute("href","#");d.setAttribute("title","Click to close");d.onclick=function(){hideLightbox();
return false};c.appendChild(d);var l=new Image();l.onload=function(){var q=document.createElement("img");q.src=closeButton;q.setAttribute("id","closeButton");q.style.position="absolute";q.style.zIndex="200";d.appendChild(q);return false};l.src=closeButton;var n=document.createElement("img");n.setAttribute("id","lightboxImage");d.appendChild(n);var m=document.createElement("div");m.setAttribute("id","lightboxDetails");
c.appendChild(m);var g=document.createElement("div");g.setAttribute("id","lightboxCaption");g.style.display="none";m.appendChild(g);var a=document.createElement("div");a.setAttribute("id","keyboardMsg");a.innerHTML=' <a href="#" onclick="hideLightbox(); return false;"><kbd> </kbd></a> ';m.appendChild(a)}function addLoadEvent(a){var b=window.onload;if(typeof window.onload!="function"){window.onload=a
}else{window.onload=function(){b();a()}}}addLoadEvent(initLightbox);
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var E="undefined",s="object",T="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",r="application/x-shockwave-flash",S="SWFObjectExprInst",y="onreadystatechange",P=window,k=document,u=navigator,U=false,V=[h],p=[],O=[],J=[],m,R,F,C,K=false,a=false,o,H,n=true,N=function(){var ab=typeof k.getElementById!=E&&typeof k.getElementsByTagName!=E&&typeof k.createElement!=E,ai=u.userAgent.toLowerCase(),Z=u.platform.toLowerCase(),af=Z?/win/.test(Z):/win/.test(ai),ad=Z?/mac/.test(Z):/mac/.test(ai),ag=/webkit/.test(ai)?parseFloat(ai.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,Y=!+"\v1",ah=[0,0,0],ac=null;
if(typeof u.plugins!=E&&typeof u.plugins[T]==s){ac=u.plugins[T].description;if(ac&&!(typeof u.mimeTypes!=E&&u.mimeTypes[r]&&!u.mimeTypes[r].enabledPlugin)){U=true;Y=false;ac=ac.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ah[0]=parseInt(ac.replace(/^(.*)\..*$/,"$1"),10);ah[1]=parseInt(ac.replace(/^.*\.(.*)\s.*$/,"$1"),10);ah[2]=/[a-zA-Z]/.test(ac)?parseInt(ac.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof P.ActiveXObject!=E){try{var ae=new ActiveXObject(X);
if(ae){ac=ae.GetVariable("$version");if(ac){Y=true;ac=ac.split(" ")[1].split(",");ah=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]}}}catch(aa){}}}return{w3:ab,pv:ah,wk:ag,ie:Y,win:af,mac:ad}}(),l=function(){if(!N.w3){return}if((typeof k.readyState!=E&&k.readyState=="complete")||(typeof k.readyState==E&&(k.getElementsByTagName("body")[0]||k.body))){f()}if(!K){if(typeof k.addEventListener!=E){k.addEventListener("DOMContentLoaded",f,false)
}if(N.ie&&N.win){k.attachEvent(y,function(){if(k.readyState=="complete"){k.detachEvent(y,arguments.callee);f()}});if(P==top){(function(){if(K){return}try{k.documentElement.doScroll("left")}catch(Y){setTimeout(arguments.callee,0);return}f()})()}}if(N.wk){(function(){if(K){return}if(!/loaded|complete/.test(k.readyState)){setTimeout(arguments.callee,0);return}f()})()}t(f)}}();function f(){if(K){return
}try{var aa=k.getElementsByTagName("body")[0].appendChild(D("span"));aa.parentNode.removeChild(aa)}catch(ab){return}K=true;var Y=V.length;for(var Z=0;Z<Y;Z++){V[Z]()}}function L(Y){if(K){Y()}else{V[V.length]=Y}}function t(Z){if(typeof P.addEventListener!=E){P.addEventListener("load",Z,false)}else{if(typeof k.addEventListener!=E){k.addEventListener("load",Z,false)}else{if(typeof P.attachEvent!=E){j(P,"onload",Z)
}else{if(typeof P.onload=="function"){var Y=P.onload;P.onload=function(){Y();Z()}}else{P.onload=Z}}}}}function h(){if(U){W()}else{I()}}function W(){var Y=k.getElementsByTagName("body")[0];var ab=D(s);ab.setAttribute("type",r);var aa=Y.appendChild(ab);if(aa){var Z=0;(function(){if(typeof aa.GetVariable!=E){var ac=aa.GetVariable("$version");if(ac){ac=ac.split(" ")[1].split(",");N.pv=[parseInt(ac[0],10),parseInt(ac[1],10),parseInt(ac[2],10)]
}}else{if(Z<10){Z++;setTimeout(arguments.callee,10);return}}Y.removeChild(ab);aa=null;I()})()}else{I()}}function I(){var ah=p.length;if(ah>0){for(var ag=0;ag<ah;ag++){var Z=p[ag].id;var ac=p[ag].callbackFn;var ab={success:false,id:Z};if(N.pv[0]>0){var af=c(Z);if(af){if(G(p[ag].swfVersion)&&!(N.wk&&N.wk<312)){x(Z,true);if(ac){ab.success=true;ab.ref=A(Z);ac(ab)}}else{if(p[ag].expressInstall&&B()){var aj={};
aj.data=p[ag].expressInstall;aj.width=af.getAttribute("width")||"0";aj.height=af.getAttribute("height")||"0";if(af.getAttribute("class")){aj.styleclass=af.getAttribute("class")}if(af.getAttribute("align")){aj.align=af.getAttribute("align")}var ai={};var Y=af.getElementsByTagName("param");var ad=Y.length;for(var ae=0;ae<ad;ae++){if(Y[ae].getAttribute("name").toLowerCase()!="movie"){ai[Y[ae].getAttribute("name")]=Y[ae].getAttribute("value")
}}Q(aj,ai,Z,ac)}else{q(af);if(ac){ac(ab)}}}}}else{x(Z,true);if(ac){var aa=A(Z);if(aa&&typeof aa.SetVariable!=E){ab.success=true;ab.ref=aa}ac(ab)}}}}}function A(ab){var Y=null;var Z=c(ab);if(Z&&Z.nodeName=="OBJECT"){if(typeof Z.SetVariable!=E){Y=Z}else{var aa=Z.getElementsByTagName(s)[0];if(aa){Y=aa}}}return Y}function B(){return !a&&G("6.0.65")&&(N.win||N.mac)&&!(N.wk&&N.wk<312)}function Q(ab,ac,Y,aa){a=true;
F=aa||null;C={success:false,id:Y};var af=c(Y);if(af){if(af.nodeName=="OBJECT"){m=g(af);R=null}else{m=af;R=Y}ab.id=S;if(typeof ab.width==E||(!/%$/.test(ab.width)&&parseInt(ab.width,10)<310)){ab.width="310"}if(typeof ab.height==E||(!/%$/.test(ab.height)&&parseInt(ab.height,10)<137)){ab.height="137"}k.title=k.title.slice(0,47)+" - Flash Player Installation";var ae=N.ie&&N.win?"ActiveX":"PlugIn",ad="MMredirectURL="+P.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ae+"&MMdoctitle="+k.title;
if(typeof ac.flashvars!=E){ac.flashvars+="&"+ad}else{ac.flashvars=ad}if(N.ie&&N.win&&af.readyState!=4){var Z=D("div");Y+="SWFObjectNew";Z.setAttribute("id",Y);af.parentNode.insertBefore(Z,af);af.style.display="none";(function(){if(af.readyState==4){af.parentNode.removeChild(af)}else{setTimeout(arguments.callee,10)}})()}v(ab,ac,Y)}}function q(Z){if(N.ie&&N.win&&Z.readyState!=4){var Y=D("div");Z.parentNode.insertBefore(Y,Z);
Y.parentNode.replaceChild(g(Z),Y);Z.style.display="none";(function(){if(Z.readyState==4){Z.parentNode.removeChild(Z)}else{setTimeout(arguments.callee,10)}})()}else{Z.parentNode.replaceChild(g(Z),Z)}}function g(ad){var ab=D("div");if(N.win&&N.ie){ab.innerHTML=ad.innerHTML}else{var Z=ad.getElementsByTagName(s)[0];if(Z){var ae=Z.childNodes;if(ae){var Y=ae.length;for(var aa=0;aa<Y;aa++){if(!(ae[aa].nodeType==1&&ae[aa].nodeName=="PARAM")&&!(ae[aa].nodeType==8)){ab.appendChild(ae[aa].cloneNode(true))
}}}}}return ab}function v(aj,ah,Z){var Y,ab=c(Z);if(N.wk&&N.wk<312){return Y}if(ab){if(typeof aj.id==E){aj.id=Z}if(N.ie&&N.win){var ai="";for(var af in aj){if(aj[af]!=Object.prototype[af]){if(af.toLowerCase()=="data"){ah.movie=aj[af]}else{if(af.toLowerCase()=="styleclass"){ai+=' class="'+aj[af]+'"'}else{if(af.toLowerCase()!="classid"){ai+=" "+af+'="'+aj[af]+'"'}}}}}var ag="";for(var ae in ah){if(ah[ae]!=Object.prototype[ae]){ag+='<param name="'+ae+'" value="'+ah[ae]+'" />'
}}ab.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+ai+">"+ag+"</object>";O[O.length]=aj.id;Y=c(aj.id)}else{var aa=D(s);aa.setAttribute("type",r);for(var ad in aj){if(aj[ad]!=Object.prototype[ad]){if(ad.toLowerCase()=="styleclass"){aa.setAttribute("class",aj[ad])}else{if(ad.toLowerCase()!="classid"){aa.setAttribute(ad,aj[ad])}}}}for(var ac in ah){if(ah[ac]!=Object.prototype[ac]&&ac.toLowerCase()!="movie"){e(aa,ac,ah[ac])
}}ab.parentNode.replaceChild(aa,ab);Y=aa}}return Y}function e(aa,Y,Z){var ab=D("param");ab.setAttribute("name",Y);ab.setAttribute("value",Z);aa.appendChild(ab)}function z(Z){var Y=c(Z);if(Y&&Y.nodeName=="OBJECT"){if(N.ie&&N.win){Y.style.display="none";(function(){if(Y.readyState==4){b(Z)}else{setTimeout(arguments.callee,10)}})()}else{Y.parentNode.removeChild(Y)}}}function b(aa){var Z=c(aa);if(Z){for(var Y in Z){if(typeof Z[Y]=="function"){Z[Y]=null
}}Z.parentNode.removeChild(Z)}}function c(aa){var Y=null;try{Y=k.getElementById(aa)}catch(Z){}return Y}function D(Y){return k.createElement(Y)}function j(aa,Y,Z){aa.attachEvent(Y,Z);J[J.length]=[aa,Y,Z]}function G(aa){var Z=N.pv,Y=aa.split(".");Y[0]=parseInt(Y[0],10);Y[1]=parseInt(Y[1],10)||0;Y[2]=parseInt(Y[2],10)||0;return(Z[0]>Y[0]||(Z[0]==Y[0]&&Z[1]>Y[1])||(Z[0]==Y[0]&&Z[1]==Y[1]&&Z[2]>=Y[2]))?true:false
}function w(ad,Z,ae,ac){if(N.ie&&N.mac){return}var ab=k.getElementsByTagName("head")[0];if(!ab){return}var Y=(ae&&typeof ae=="string")?ae:"screen";if(ac){o=null;H=null}if(!o||H!=Y){var aa=D("style");aa.setAttribute("type","text/css");aa.setAttribute("media",Y);o=ab.appendChild(aa);if(N.ie&&N.win&&typeof k.styleSheets!=E&&k.styleSheets.length>0){o=k.styleSheets[k.styleSheets.length-1]}H=Y}if(N.ie&&N.win){if(o&&typeof o.addRule==s){o.addRule(ad,Z)
}}else{if(o&&typeof k.createTextNode!=E){o.appendChild(k.createTextNode(ad+" {"+Z+"}"))}}}function x(aa,Y){if(!n){return}var Z=Y?"visible":"hidden";if(K&&c(aa)){c(aa).style.visibility=Z}else{w("#"+aa,"visibility:"+Z)}}function M(Z){var aa=/[\\\"<>\.;]/;var Y=aa.exec(Z)!=null;return Y&&typeof encodeURIComponent!=E?encodeURIComponent(Z):Z}var d=function(){if(N.ie&&N.win){window.attachEvent("onunload",function(){var ad=J.length;
for(var ac=0;ac<ad;ac++){J[ac][0].detachEvent(J[ac][1],J[ac][2])}var aa=O.length;for(var ab=0;ab<aa;ab++){z(O[ab])}for(var Z in N){N[Z]=null}N=null;for(var Y in swfobject){swfobject[Y]=null}swfobject=null})}}();return{registerObject:function(ac,Y,ab,aa){if(N.w3&&ac&&Y){var Z={};Z.id=ac;Z.swfVersion=Y;Z.expressInstall=ab;Z.callbackFn=aa;p[p.length]=Z;x(ac,false)}else{if(aa){aa({success:false,id:ac})
}}},getObjectById:function(Y){if(N.w3){return A(Y)}},embedSWF:function(ac,ai,af,ah,Z,ab,aa,ae,ag,ad){var Y={success:false,id:ai};if(N.w3&&!(N.wk&&N.wk<312)&&ac&&ai&&af&&ah&&Z){x(ai,false);L(function(){af+="";ah+="";var ak={};if(ag&&typeof ag===s){for(var am in ag){ak[am]=ag[am]}}ak.data=ac;ak.width=af;ak.height=ah;var an={};if(ae&&typeof ae===s){for(var al in ae){an[al]=ae[al]}}if(aa&&typeof aa===s){for(var aj in aa){if(typeof an.flashvars!=E){an.flashvars+="&"+aj+"="+aa[aj]
}else{an.flashvars=aj+"="+aa[aj]}}}if(G(Z)){var ao=v(ak,an,ai);if(ak.id==ai){x(ai,true)}Y.success=true;Y.ref=ao}else{if(ab&&B()){ak.data=ab;Q(ak,an,ai,ad);return}else{x(ai,true)}}if(ad){ad(Y)}})}else{if(ad){ad(Y)}}},switchOffAutoHideShow:function(){n=false},ua:N,getFlashPlayerVersion:function(){return{major:N.pv[0],minor:N.pv[1],release:N.pv[2]}},hasFlashPlayerVersion:G,createSWF:function(aa,Z,Y){if(N.w3){return v(aa,Z,Y)
}else{return undefined}},showExpressInstall:function(aa,ab,Y,Z){if(N.w3&&B()){Q(aa,ab,Y,Z)}},removeSWF:function(Y){if(N.w3){z(Y)}},createCSS:function(ab,aa,Z,Y){if(N.w3){w(ab,aa,Z,Y)}},addDomLoadEvent:L,addLoadEvent:t,getQueryParamValue:function(ab){var aa=k.location.search||k.location.hash;if(aa){if(/\?/.test(aa)){aa=aa.split("?")[1]}if(ab==null){return M(aa)}var Z=aa.split("&");for(var Y=0;Y<Z.length;
Y++){if(Z[Y].substring(0,Z[Y].indexOf("="))==ab){return M(Z[Y].substring((Z[Y].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(a){var Y=c(S);if(Y&&m){Y.parentNode.replaceChild(m,Y);if(R){x(R,true);if(N.ie&&N.win){m.style.display="block"}}if(F){F(C)}}a=false}}}}();if(Object.isUndefined(Markers)){var Markers={}}Markers.Canvas=Class.create({canvasObject:null,canvasObjectDimensions:null,options:null,labelOptions:[],markers:new Hash(),activeMarker:null,editor:null,PATH_TO_IMAGES:null,initialize:function(b,a){if(!Object.isElement(b)){b=$(b);
if(!b){throw ("Cannot find provided object in DOM! (canvasObject: "+b+")")}}if(Object.isUndefined(a)){a={}}if(b.getStyle("position").toLowerCase()!="relative"){b.relativize()}if(a.labelOptions){this.setLabelOptions(a.labelOptions);delete a.labelOptions}this.options=a;this.canvasObject=b;this.PATH_TO_IMAGES=a.pathToImages||"http://static2.sentimente.ro/modules/default/img/markers/";this.mouseOverHandlerBinded=this.mouseOverHandler.bindAsEventListener(this);
Event.observe(document.body,"mouseover",this.mouseOverHandlerBinded)},getObjectDimensions:function(){if(this.canvasObjectDimensions){return this.canvasObjectDimensions}if(!this.canvasObject.visible()){return false}this.canvasObjectDimensions=this.canvasObject.getDimensions();return this.canvasObjectDimensions},create:function(){if(!this.editor){new Markers.Editor(this)}if(this.editor.isActive()){return false
}this.editor.show();return this},setLabelOptions:function(a){this.labelOptions=a;if(this.editor){this.editor.updateLabelOptions(a)}},getLabelOptions:function(){return this.labelOptions},setSaveCallback:function(a){this.saveCallback=a},cancelCreation:function(){if(!this.editor||!this.editor.isActive()){return false}this.editor.hide()},add:function(a){if(this.markers.get(a.getId())){throw ("Marker already defined!")
}a.element.setStyle({background:"url("+this.PATH_TO_IMAGES+"ie_empty_div_bug.gif) left top repeat"});a.canvasInstance=this;this.canvasObject.insert(a.element);this.markers.set(a.getId(),a)},addNew:function(g,e,a,f,c,d){var b=new Markers.Marker(g);b.setLabel(e);b.setPosition(a,f);b.setDimension(c,d);this.add(b)},get:function(a){return this.markers.get(a)},changeId:function(c,b){var a=this.markers.unset(c);
a.setId(b);this.markers.set(b,a)},remove:function(b){var a=this.markers.unset(b);a.remove();delete a},removeAll:function(){this.markers.each(function(b){var a=this.markers.unset(b.key);a.remove();delete a}.bind(this))},mouseOverHandler:function(c){try{if(this.editor&&this.editor.isActive()){return}var b=c.element();if(!b.hasClassName("markerContainer")){if(this.activeMarker&&!b.descendantOf(this.activeMarker.element)){this.hideActiveMarker()
}return}var a=this.markers.get(b.identify());if(this.activeMarker){if(this.activeMarker.getId()==a.getId()){return}else{this.hideActiveMarker()}}this.activeMarker=a;a.show()}catch(c){alert(c)}},hideActiveMarker:function(){if(!this.activeMarker){return}this.activeMarker.hide();this.activeMarker=null},editorActive:function(){if(!this.editor){return false}return this.editor.isActive()}});Markers.Editor=Class.create({canvasInstance:null,element:null,editForm:null,formType:null,active:false,currentScale:1,currentDimensions:{},currentPos:{},EDIT_FORM_WIDTH:200,PATH_TO_IMAGES:null,SCALES:[1,1.35,1.75],initialize:function(a){if(Object.isUndefined(a)){throw ("Every editor instance must be created using markers instance as parameter!")
}this.canvasInstance=a;var b=Object.extend({background:"url("+this.canvasInstance.PATH_TO_IMAGES+"ie_empty_div_bug.gif) left top repeat",position:"absolute",cursor:"move",top:"20px",left:"40px"},Markers.Styles.MARKER_PROPERTIES);var d=Object.extend({background:"url("+this.canvasInstance.PATH_TO_IMAGES+"marker_label_plus.gif) left top repeat",borderWidth:"2px 0 0 2px",bottom:0,right:0},Markers.Styles.MARKER_EDITOR_RESIZER);
var c=Object.extend({display:"none",background:"url("+this.canvasInstance.PATH_TO_IMAGES+"marker_label_minus.gif) left top repeat",borderWidth:"2px 2px 0 0",bottom:0,left:0},Markers.Styles.MARKER_EDITOR_RESIZER);this.element=new Element("div",{id:"markerEditor"}).setStyle(b).insert(new Element("div").addClassName("resizer").addClassName("up").setStyle(d)).insert(new Element("div").addClassName("resizer").addClassName("down").setStyle(c));
this.mouseDownHandlerBinded=this.mouseDownHandler.bindAsEventListener(this);this.mouseUpHandlerBinded=this.mouseUpHandler.bindAsEventListener(this);this.mouseMoveHandlerBinded=this.mouseMoveMoveHandler.bindAsEventListener(this);this.element.observe("mousedown",this.mouseDownHandlerBinded);Event.observe(document.body,"mouseup",this.mouseUpHandlerBinded);if(Prototype.Browser.IE){document.onselectionstart=function(){return false
};document.ondragstart=function(){return false}}this.canvasInstance.editor=this;this.canvasInstance.canvasObject.insert(this.element);this.formType=this.canvasInstance.options.mode||"advanced";this.editForm=this.createForm();this.canvasInstance.canvasObject.insert(this.editForm);this.editForm.observe("submit",function(f){f.stop();this._saveAction(f)}.bind(this));if(this.formType=="advanced"){Event.observe("markerLabel","keyup",this.narrowOptions.bindAsEventListener(this))
}},createForm:function(){var a=new Element("form",{id:"markerEditorForm","class":"markerEditor"}).setStyle(Markers.Styles.MARKER_EDITOR_FORM).insert(new Element("label",{"for":"markerLabel","class":"title"}).update("Scrie un nume sau o eticheta:")).insert(new Element("input",{id:"markerLabel",type:"text",name:"note",maxlength:80}));if(this.formType=="advanced"){a=a.insert(new Element("p").addClassName("availableOptionsTitle").update("sau alege un utilizator dintre prieteni:")).insert(new Element("ul").addClassName("availableOptions"));
this.updateLabelOptions(this.canvasInstance.getLabelOptions(),a.down("ul"))}a=a.insert(new Element("div").addClassName("buttonsContainer").insert(new Element("button",{type:"button"}).addClassName("saveMarker").insert(new Element("span").update("Salveaza"))).insert(new Element("a",{href:"javascript://"}).addClassName("cancelMarker").update("Renunta")));a.delegate("click",{"button.saveMarker":this._saveAction.bind(this),".cancelMarker":this._closeAction.bind(this),"#markerEditorForm .availableOptions li *":this._saveUserAction.bind(this)});
return a},updateLabelOptions:function(a,b){if(Object.isUndefined(b)){b=this.editForm.down("ul.availableOptions").update()}a.each(function(d,c){b.insert(new Element("li").insert(new Element("input",{type:"checkbox",name:"id",value:d.id}).writeAttribute("id","markerLabel_"+c)).insert(new Element("label",{"for":"markerLabel_"+c,"class":"marker_label"}).update(d.value)))})},narrowOptions:function(b){if(b.keyCode==Event.KEY_ESC){this.hide();
return}var a=b.element().value;this.editForm.getInputs("checkbox").each(function(d){var e=d.next("label").innerHTML;var c=e.stripTags();if(c.indexOf(a)==-1){d.up().hide();if(e!=c){d.next("label").update(c)}}else{d.up().show();d.next("label").update(c.replace(a,'<span style="background-color: yellow">'+a+"</span>"))}})},isActive:function(){return this.active},show:function(){if(this.active){return}this.element.show();
this.active=true;this.currentPos=this.element.positionedOffset();this.currentDimensions=this.element.getDimensions();this.editForm.setStyle({top:this.currentPos[1]+"px",left:(this.currentPos[0]-this.EDIT_FORM_WIDTH-5)+"px"});this._resetForm();this.editForm.show();this.editForm.focusFirstElement();return this},hide:function(){if(!this.active){return}this.element.hide();this.editForm.hide();this.active=false;
return this},mouseDownHandler:function(a){if(a.element().hasClassName("resizer")){return}a.stop();this.dragStart={x:a.pointerX(),y:a.pointerY()};this.editForm.hide();Event.observe(document.body,"mousemove",this.mouseMoveHandlerBinded)},mouseUpHandler:function(a){if(a.element().hasClassName("resizer")){this.resizeHandler(a);return}if(this.active){this.editForm.show()}Event.stopObserving(document.body,"mousemove",this.mouseMoveHandlerBinded);
this.currentPos=this.element.positionedOffset();this.dragStart=null},mouseMoveMoveHandler:function(b){var a={x:b.pointerX(),y:b.pointerY()};b.stop();this.moveBy(a.x-this.dragStart.x,a.y-this.dragStart.y)},resizeHandler:function(c){var a=c.element();if(a.hasClassName("up")){if(this.currentScale==this.SCALES.last()){return}var b=this.SCALES[this.SCALES.indexOf(this.currentScale)+1];this.scale(b)}else{if(this.currentScale==this.SCALES.first()){return
}var d=this.SCALES[this.SCALES.indexOf(this.currentScale)-1];this.scale(d)}},scale:function(d){if(this.currentScale==this.SCALES.first()){this.element.select("div.down").first().show()}if(this.currentScale==this.SCALES.last()){this.element.select("div.up").first().show()}this.currentScale=d;var c={width:d*parseInt(Markers.Styles.MARKER_CONTAINER_PROPERTIES.width),height:d*parseInt(Markers.Styles.MARKER_CONTAINER_PROPERTIES.height)};
var e={x:0,y:0};var b=this.canvasInstance.getObjectDimensions();var a=parseInt(Markers.Styles.MARKER_PROPERTIES.borderWidth);if(this.currentPos[0]+c.width>b.width){e.x=b.width-(this.currentPos[0]+c.width+(2*a))}if(this.currentPos[1]+c.height>b.height){e.y=b.height-(this.currentPos[1]+c.height+(2*a))}this.moveBy(e.x,e.y);this.element.setStyle({width:c.width+"px",height:c.height+"px"});this.currentDimensions=c;
if(this.currentScale==this.SCALES.last()){this.element.select("div.up").first().hide()}if(this.currentScale==this.SCALES.first()){this.element.select("div.down").first().hide()}return this},moveBy:function(b,a){if(!b&&!a){return}var d=this.canvasInstance.getObjectDimensions();var c=parseInt(Markers.Styles.MARKER_PROPERTIES.borderWidth);if(((this.currentPos[0]+b)<0)||((this.currentPos[1]+a)<0)||((this.currentPos[0]+this.currentDimensions.width+c+b)>d.width)||((this.currentPos[1]+this.currentDimensions.height+c+a)>d.height)){return
}this.element.setStyle({top:(this.currentPos[1]+a)+"px",left:(this.currentPos[0]+b)+"px"});this.editForm.setStyle({top:(this.currentPos[1]+a)+"px",left:(this.currentPos[0]-this.EDIT_FORM_WIDTH+b)+"px"});return this},_saveAction:function(b){var c=this.editForm.serialize(true);if(!c.note){b.stop();new Effect.Highlight("markerLabel",{startcolor:"#FFAAAA"});return}c.x=this.currentPos[0];c.y=this.currentPos[1];
c.w=this.currentDimensions.width;c.h=this.currentDimensions.height;var a=new Markers.Marker();a.setLabel(c.note);a.setPosition(c.x,c.y);a.setDimension(c.w,c.h);if(this.canvasInstance.saveCallback){this.canvasInstance.saveCallback(c,a)}this.canvasInstance.add(a);this._closeAction(b)},_saveUserAction:function(a){$("markerLabel").value=a.findElement("li").down("label").innerHTML.stripTags();if(a.element().tagName.toLowerCase()=="label"){a.element().previous().checked=true
}this._saveAction(a)},_resetForm:function(){this.editForm.reset();if(this.formType=="advanced"){this.editForm.getInputs("checkbox").each(function(a){a.next("label").update(a.next("label").innerHTML.stripTags());a.up().show()})}},_closeAction:function(a){a.stop();this.hide()}});Markers.Marker=Class.create({element:null,canvasInstance:null,initialize:function(d){var c=Object.extend({position:"absolute",top:0,left:0},Markers.Styles.MARKER_CONTAINER_PROPERTIES);
var b=Object.extend({position:"relative",display:"none"},Markers.Styles.MARKER_PROPERTIES);var a=Object.extend({borderTopWidth:Markers.Styles.MARKER_PROPERTIES.borderWidth,borderTopStyle:Markers.Styles.MARKER_PROPERTIES.borderStyle,borderTopColor:Markers.Styles.MARKER_PROPERTIES.borderColor,position:"absolute",bottom:"0px",width:"100%"},Markers.Styles.MARKER_LABEL_PROPERTIES);this.element=new Element("div",{"class":"markerContainer"}).setStyle(c).insert(new Element("div",{"class":"marker"}).setStyle(b).insert(new Element("p",{"class":"markerTitle"}).setStyle(a)));
if(d){this.element.id="marker_"+d}Markers.Styles.MARKER_CONTAINER_PROPERTIES.zIndex++;return this},setId:function(a){this.element.id=a},getId:function(){return this.element.identify()},setLabel:function(a){this.element.down("p").update(a)},show:function(){if(this.canvasInstance.editorActive()){return false}this.element.down("div").show()},hide:function(){if(this.canvasInstance.editorActive()){return false
}this.element.down("div").hide()},remove:function(){this.element.remove()},setPosition:function(a,b){this.element.setStyle({top:b+"px",left:a+"px"})},setDimension:function(a,c){var b={width:a+"px",height:c+"px"};this.element.setStyle(b);this.element.down("div").setStyle(b)}});Markers.Styles={MARKER_CONTAINER_PROPERTIES:{zIndex:2,width:"104px",height:"104px"},MARKER_PROPERTIES:{borderWidth:"2px",borderStyle:"solid",borderColor:"#949e9f",width:"100px",height:"100px",zIndex:10},MARKER_LABEL_PROPERTIES:{fontFamily:"Verdana, Geneva, Arial, Helvetica, sans-serif",fontColor:"#010101",fontSize:"10px",backgroundColor:"#ffffff",margin:0,padding:0},MARKER_EDITOR_RESIZER:{width:"13px",height:"13px",borderStyle:"solid",borderColor:"#949e9f",position:"absolute",cursor:"pointer"},MARKER_EDITOR_FORM:{position:"absolute",zIndex:10,display:"none"}};
var markers=null;function createMarkers(){markers=new Markers.Canvas("pictureContainer");var a=$("friends").innerHTML.evalJSON();if(a&&$("friends").innerHTML.length>2){var b=[];$H(a).each(function(c){friend=c.value;b.push({id:friend.userid,value:friend.username})});markers.setLabelOptions(b)}$("object").delegate("mouseover",{".show-marker":function(c){markers.get(c.element().rel).show()}});$("object").delegate("mouseout",{".show-marker":function(c){markers.get(c.element().rel).hide()
}});markers.setSaveCallback(addNewMarker);return markers}function changePictureMarkers(){var b=carousel.getSelectedItem().down("a");var c=b.readAttribute("rel").split("|");var a=c[1];var d=b.next("div");if(!d){return}if(d.down("a")){d.show()}d.select("i").each(function(e){var f=e.innerHTML.evalJSON();markers.addNew(f.id,f.note,f.x,f.y,f.w,f.h)});$("objectDescription").insert({after:d})}function removeAllMarkers(b){if(markers.editorActive()){markers.cancelCreation()
}var a=b.memo.carousel.getSelectedItem().down("a");markers.removeAll();a.insert({after:$("objectDescription").next().hide()})}function removeMarker(c){var b=$("requestUrl").href.replace(/\/(view-collection|view)\.ajax/,"/remove-marker.ajax");var a=carousel.getSelectedItem().down("a").readAttribute("rel").split("|");new Ajax.Request(b,{parameters:{id:c.split("_")[1],albumId:a[0],fileId:a[1]},method:"GET"});
markers.remove(c);$(c+"_label").remove();if(!$("objectDescription").next().down("a")){$("objectDescription").next().hide()}}function addNewMarker(d,c){var b=$("requestUrl").href.replace(/\/(view-collection|view)\.ajax/,"/save-marker.ajax");var a=carousel.getSelectedItem().down("a").readAttribute("rel").split("|");new Ajax.Request(b,{parameters:Object.extend(d,{albumId:a[0],fileId:a[1]}),method:"POST",onSuccess:function(m){var g=m.responseText.evalJSON();
var k="marker_"+g.id;try{markers.changeId(c.getId(),k);var e=$("objectDescription").next();e.show();var n=new Element("span",{id:k+"_label"});e.insert(n);var j=new Element("a",{rel:k,"class":"show-marker",href:"javascript://",title:g.note}).update(g.note+" ");if(parseInt(g.marked_userid)>0){j.writeAttribute("href","/user/profile/view/id/"+g.marked_userid);j.addClassName("user")}else{j.addClassName("object")
}n.insert(j);var f=new Element("a",{rel:k,"class":"del-marker",href:"javascript://"}).update("[x] ");n.insert(f);var h=new Element("i",{style:"display:none"}).update(m.responseText);n.insert(h)}catch(l){console.log(l)}}})}var MachCarousel=Class.create(UI.Carousel,{selectedItem:null,selectedIndex:null,SELECTED_CLASS_NAME:"selected",initialize:function($super,b,a){$super(b,a);this.checkSelected();this.container.observe("click",this.clickHandler.bindAsEventListener(this))
},checkSelected:function(){this.selectedItem=this.elements.detect(function(a){if(a.hasClassName(this.SELECTED_CLASS_NAME)){return true}return false}.bind(this));if(this.selectedItem){this.selectedIndex=this.elements.indexOf(this.selectedItem);this.checkItemVisibility()}else{this.selectedItem=this.elements.first();this.selectedIndex=0}},checkItemVisibility:function(){var b=null;var c=Math.round(this.nbVisible);
var a=Math.round(this.currentIndex());if(this.selectedIndex>=a+c-1){b=this.selectedIndex}else{if(this.selectedIndex<=a){b=(a-c)<0?0:a-c+1}}if(b!=null){this.scrollTo(b)}},clickHandler:function(c){var a=c.element();if(!a.descendantOf(this.container)){return}var b=this.elements.detect(function(d){if(a.descendantOf(d)){return true}});if(Object.isUndefined(b)){return}c.stop();this.selectItem(b)},selectItem:function(a){if(Object.isNumber(a)){a=this.elements[a]
}if(this.selectedItem==a){return false}this.fire("beforeItemChange",{selectedItem:this.selectedItem});this.elements.each(function(b){b.removeClassName(this.SELECTED_CLASS_NAME)}.bind(this));this.selectedItem=a;this.selectedItem.addClassName(this.SELECTED_CLASS_NAME);this.selectedIndex=this.elements.indexOf(this.selectedItem);this.checkItemVisibility();this.fire("itemChanged",{selectedItem:this.selectedItem});
return true},hasNext:function(){var a=this.getItemsCount();return a&&(this.selectedIndex!=(a-1))},hasPrevious:function(){return this.getItemsCount()&&(this.selectedIndex!=0)},nextItem:function(){if(!this.hasNext()){return false}return this.selectItem(this.selectedIndex+1)},previousItem:function(){if(!this.hasPrevious()){return false}return this.selectItem(this.selectedIndex-1)},removeItem:function(a){if(Object.isUndefined(a)){a=this.selectedIndex
}this.elements=this.elements.without(this.elements[a]);if(a==this.selectedIndex){if(!this.nextItem()){if(!this.previousItem()){this.selectedIndex=null;this.selectedItem=null}}}},getNextItem:function(){if(!this.hasNext()){return false}return this.elements[this.selectedIndex+1]},getPreviousItem:function(){if(!this.hasPrevious()){return false}return this.elements[this.selectedIndex-1]},getSelectedItem:function(){return this.selectedItem
},getSelectedIndex:function(){return this.selectedIndex},getItemsCount:function(){return this.elements.size()}});function onItemChange(d){var e=$("largePicture");var a=$("object").previous();a.setStyle({height:e.getHeight()+"px"});e.up("div").setStyle({height:e.getHeight()+"px"});a.show();e.hide();var b=d.memo.selectedItem.down("a");var c=b.readAttribute("rel").split("|");new Ajax.Request($("requestUrl").readAttribute("href"),{method:"GET",parameters:{albumId:c[0],fileId:c[1]},onSuccess:function(j){b=b.readAttribute("href");
if($("albumLink")){$("albumLink").value=b}if($("yahoo_invite_link")){$("yahoo_invite_link").setAttribute("href",$("yahoo_invite_link").readAttribute("href").replace(/msg=.+/,"msg="+b))}var h=Paginators.get("Comments");h.refreshPagination=true;h.handleUpdate(j.responseText.evalJSON());Comments.resourceId=c[1];Comments.setParam("fileName",b.replace("http://","").split("/")[2]);var g=d.memo.carousel;var f=g.getSelectedIndex();
if(!f){$("previousObject").hide()}else{$("previousObject").show()}if(f==g.getItemsCount()-1){$("nextObject").hide()}else{$("nextObject").show()}},onFailure:function(){alert("Request failed!");if(window.console){window.console.log(arguments,this)}}})}function onObjectChange(d){try{var b=d.memo;if(typeof(b)!="object"){b=b.evalJSON()}if(b.type.picture==1){if($("sentiPlayer").tagName.toLowerCase()!="p"){swfobject.removeSWF("sentiPlayer");
$("playerContainer").insert(new Element("p",{id:"sentiPlayer"}).update($("playerAltContent").innerHTML)).hide()}$("largePicture").removeAttribute("src");$("largePicture").setAttribute("src",b.eventParams);$("largePicture").up("a").setAttribute("href",b.eventParams);$("largePicture").show();$("pictureContainer").show()}else{var a=$("object").previous();if($("sentiPlayer").tagName.toLowerCase()!="object"){$("pictureContainer").hide();
$("playerContainer").show();$("playerAltContent").update($("sentiPlayer").innerHTML);a.style.height="420px"}else{a.show()}var f={allowScriptAccess:"sameDomain",allowFullScreen:"true",movie:"http://static2.machteamsoft.ro/modules/newalbums/swf/player/PlayerV3.v0.swf",quality:"high",bgcolor:"#ffffff",wmode:"transparent",flashVars:b.eventParams};swfobject.embedSWF("http://static2.machteamsoft.ro/modules/newalbums/swf/player/PlayerV3.v0.swf","sentiPlayer","500","420","9.0.0","",b.eventParams,f,null,function(g){a.hide()
})}if(b.newTitle){document.title=b.newTitle.replace(/>/g,"\273")}if(b.album){var e=$("albums").down("h1").down(".album");if(e&&(e.readAttribute("rel")!=b.album.id)){e.setAttribute("href",b.album.link);e.setAttribute("title",b.album.title);e.setAttribute("rel",b.album.id);e.update(b.album.name)}}changePictureMarkers();refreshDependencies(b)}catch(c){if(console){console.log(c)}}}function refreshDependencies(b){var d=b.eventParams.length+"_"+(new Date()).getTime();
if($("contents")){var c=$("contents").src;if(c.indexOf("?")!=-1){c=c.replace(/\?cid=.+/,"")}c+="?cid="+d;$("contents").src=c}if($("adsObject")){var a=$("adsObject").src.replace(/\&cid=.+/,"");a+="&cid="+d;$("adsObject").src=a}}function setAlbumCover(){var b=$("requestUrl").readAttribute("href").replace(/\/(view-collection|view)\.ajax/,"/set-cover.ajax");var a=carousel.getSelectedItem().down("a").readAttribute("rel").split("|");
new Ajax.Request(b,{parameters:{albumId:a[0],fileId:a[1]},method:"GET"})}function displEditWindow(a){$("objTitle").value=$("media_view").down("div").down("h1").down("span").innerHTML.strip();$("objDescription").value=$("objectDescription").innerHTML.strip();Chat.Confirm.show("editObjectWindow",{title:$("editObjectWindow").readAttribute("title"),onSuccess:function(){editObject()},height:235,width:500,zIndex:5})
}function displMoveWindow(a){$("objTitle").value=$("media_view").down("div").down("h1").down("span").innerHTML.strip();$("objDescription").value=$("objectDescription").innerHTML.strip();Chat.Confirm.show("moveObjectWindow",{title:$("moveObjectWindow").readAttribute("title"),onSuccess:function(){editObject()},height:135,width:500,zIndex:5})}function editObject(){var b=$("requestUrl").readAttribute("href").replace(/\/(view-collection|view)\.ajax/,"/perform-edit.ajax");
var a=carousel.getSelectedItem().down("a").readAttribute("rel").split("|");new Ajax.Request(b,{method:"GET",parameters:{albumId:a[0],fileId:a[1],title:$("objTitle").value,description:$("objDescription").value,moveTo:$("albumRelocate").value},onSuccess:function(c){if(c.responseText=="MOVE"){redirectToNextAvailableFile()}Chat.Confirm.deny()}})}function redirectToNextAvailableFile(){var a=null;if(!(a=carousel.getNextItem())){a=carousel.getPreviousItem()
}if(!a){window.location.replace("/newalbums")}else{window.location.replace(a.down("a").readAttribute("href"))}return}function showDeleteConfirm(a){Chat.Confirm.show("confirmContent",{onSuccess:function(){deleteItem(a);return},height:90,width:350,zIndex:5})}function deleteItem(c){var b=$("requestUrl").readAttribute("href").replace(/\/(view-collection|view)\.ajax/,"/perform-delete.ajax");var a=carousel.getSelectedItem().down("a").readAttribute("rel").split("|");
new Ajax.Request(b,{parameters:{albumId:a[0],fileId:a[1]},method:"GET",onSuccess:function(){redirectToNextAvailableFile()}})}function selectPath(a){a.element().focus();a.element().select()}function reportAbuse(d,a){var b=$("overlayerReportComments");var c={user:d,info:$("comment_"+a).innerHTML,comment_id:a};new Ajax.Request("/newalbums/index/report-abuse.ajax",{method:"get",parameters:Object.toQueryString(c),onSuccess:function(e){if(e.responseText.indexOf("ok")>=0){if(Object.isUndefined(Chat)){alert($("response").innerHTML)
}else{Chat.Confirm.show($("overlayerReportComments").innerHTML,{title:b.readAttribute("title"),width:450,height:100,showEffect:Element.show,hideEffect:Element.hide})}}}})}function init(){document.observe("object:changed",onObjectChange);markers=createMarkers();$("largePicture").observe("load",function(){var a=$("object");a.previous().hide();a.down("div").setStyle({height:a.down("img").getHeight()+"px"})
});window.carousel=new MachCarousel("horizontal_carousel",{scrollInc:3});window.carousel.observe("itemChanged",onItemChange);window.carousel.observe("beforeItemChange",removeAllMarkers);$("content").delegate("click",{"#previousObject":function(){window.carousel.previousItem()},"#nextObject":function(){window.carousel.nextItem()},"#chStamp":setAlbumCover,"#albumLink":selectPath,".deletePhoto":showDeleteConfirm,"#markerEnableBtn":markers.create.bind(markers),".del-marker":function(a){removeMarker(a.element().rel)
}});if(!$("voteItem").hasClassName("disabled")){$("voteItem").observe("click",function(c){var b=$("requestUrl").readAttribute("href").replace(/\/(view-collection|view)\.ajax/,"/vote-object.ajax");var a=carousel.getSelectedItem().down("a").readAttribute("rel").split("|");new Ajax.Request(b,{method:"GET",parameters:{albumId:a[0],fileId:a[1],mark:c.findElement("a").innerHTML},onFailure:function(d){alert(d.responseText)
}})})}changePictureMarkers()}document.observe("dom:loaded",init);var Paginators={paginators:new Hash(),group:new Hash(),add:function(b,a){this.paginators.set(b,a);if(Object.isUndefined(this.group.get(b))){this.group.set(b,[a])}else{this.group.get(b).push(a)}return a},get:function(a){a=a||"default";return this.paginators.get(a)},getGroup:function(a){a=a||"default";return this.group.get(a)}};var Paginator=Class.create({sliderMinWidth:20,STYLE_SEO:"pagination-seo",STYLE_CLASSIC:"pagination-lite",STYLE_SLIDER:"pagination-slider",initialize:function(e,f,b){this.group=e||"default";
Paginators.add(this.group,this);this.uniqueId=this.group+f;this.handler=b;this.handler.parameters=$H(this.handler.parameters);this.currentPage=this.handler.config.currentPage;this.totalPages=this.handler.config.totalPages;this.page=null;this.refreshPagination=false;this.loading=false;if(this.totalPages>1){this.visible=true}else{this.hide()}var d=new RegExp("(pagination-(seo|lite|slider))","g");var c=$("paginationContainer_"+this.uniqueId).className;
var a=d.exec(c);if(a){this.style=a[1]}else{this.style=this.STYLE_SLIDER}if(this.style!=this.STYLE_SEO){this.goTo=$("goTo_"+this.uniqueId);if(this.style==this.STYLE_SLIDER){this.initSlider()}}},initSlider:function(){this.navigationBar=$("navigationBar_"+this.uniqueId);this.slider=$("slider_"+this.uniqueId);this.leftArrow=$("left_"+this.uniqueId);this.rightArrow=$("right_"+this.uniqueId);this.pageNumber=$("pageNumber_"+this.uniqueId);
if(this.visible){this.calculateWidths(true)}this.mouseXPos=0;this.clickXPos=0;this.startPos=0},calculateWidths:function(){this.barWidth=this.navigationBar.getWidth();this.sliderWidth=this.barWidth/this.totalPages;if(this.sliderWidth<this.sliderMinWidth){this.sliderWidth=this.sliderMinWidth;this.stepWidth=(this.barWidth-this.sliderWidth)/this.totalPages}else{this.stepWidth=this.sliderWidth}this.slider.style.width=this.sliderWidth+"px";
this.moveSlider("init",this.currentPage)},addListeners:function(a){if(this.style==this.STYLE_SEO){return}if(!a){this.bGoToPage=this.goToPage.bindAsEventListener(this)}if(this.style==this.STYLE_CLASSIC){Event.observe("form_goTo_"+this.uniqueId,"submit",this.bGoToPage)}else{if(!a){this.bClickOnBar=this.clickOnBar.bindAsEventListener(this);this.bMoveLeft=this.moveLeft.bindAsEventListener(this);this.bMoveRight=this.moveRight.bindAsEventListener(this);
this.bMouseDown=this.mouseDown.bindAsEventListener(this)}Event.observe(this.navigationBar.identify(),"mousedown",this.bClickOnBar);Event.observe(this.leftArrow.identify(),"click",this.bMoveLeft);Event.observe(this.rightArrow.identify(),"click",this.bMoveRight);Event.observe("lnk_"+this.goTo.identify(),"click",this.bGoToPage);Event.observe(this.slider.identify(),"mousedown",this.bMouseDown)}},findPos:function(a){var b=curtop=0;
if(a.offsetParent){b=a.offsetLeft;curtop=a.offsetTop;while((a=a.offsetParent)){b+=a.offsetLeft;curtop+=a.offsetTop}}return[b,curtop]},getXOffset:function(){var b=this.findPos(this.navigationBar);var a=this.mouseXPos-b[0];if(a<0){a=0}if(a>=this.barWidth){a=this.barWidth}return a},getTargetPage:function(b){switch(b){case"click":var c=this.getXOffset();var d={page:Math.ceil(this.totalPages*(c/this.barWidth)),xOffset:c};
if(d.page>this.currentPage){d.page=this.currentPage+1}if(d.page<this.currentPage){d.page=this.currentPage-1}return d;break;default:var a;if((a=this.startPos+(this.mouseXPos-this.clickXPos))<=this.barWidth&&a>=18){a=(a<(this.barWidth/2)?a-9:a+9);return{page:Math.ceil(this.totalPages*((a-9)/this.barWidth))}}else{if(a<18){return{page:1}}return{page:this.totalPages}}break}},updateCaption:function(a){this.page=a;
$(this.pageNumber).update(a+"/"+this.totalPages)},moveSlider:function(b,d){if(this.style!=this.STYLE_SLIDER){return}var c=(d?{page:parseInt(d)}:this.getTargetPage(b,d));if(!c.page){return null}else{if(b=="click"||d){if(Object.isUndefined(this.stepWidth)){return}this.slider.style.left=(18+(c.page-1)*parseFloat(this.stepWidth))+"px"}else{var a;var e=(this.mouseXPos-this.clickXPos);if((a=this.startPos+e)>18&&a<(this.barWidth-this.sliderWidth+18)){this.slider.style.left=a+"px"
}}}this.currentPage=d;this.updateCaption(c.page)},clickOnBar:function(a){this.mouseXPos=Event.pointerX(a);this.moveSlider("click");this.go()},mouseDown:function(a){Event.stop(a);this.clickXPos=Event.pointerX(a);this.startPos=parseFloat(this.slider.style.left);this.bMouseMove=this.mouseMove.bindAsEventListener(this);this.bMouseUp=this.mouseUp.bindAsEventListener(this);Event.observe(document.body,"mousemove",this.bMouseMove);
Event.observe(document.body,"mouseup",this.bMouseUp)},mouseMove:function(a){this.mouseXPos=Event.pointerX(a);this.moveSlider()},mouseUp:function(a){Event.stopObserving(document.body,"mousemove",this.mouseMoveBinded);if(!this.page){return}Event.stopObserving(document.body,"mousemove",this.bMouseMove);Event.stopObserving(document.body,"mouseup",this.bMouseUp);this.slider.style.left=18+(this.page-1)*this.stepWidth+"px";
this.go()},moveLeft:function(a){if(this.currentPage==1){Event.stop(a);return}var b=this.currentPage;this.slider.style.left=18+(b-2)*this.stepWidth+"px";this.updateCaption(--b);this.go(b)},moveRight:function(a){if(this.currentPage==this.totalPages){Event.stop(a);return}var b=this.currentPage;this.slider.style.left=18+b*this.stepWidth+"px";this.updateCaption(++b);this.go(b)},goToPage:function(b){b.stop();
var a=parseInt(this.goTo.value);if((0<a)&&(a<=this.totalPages)){this.moveSlider("goTo",a);this.go(a)}else{this.goTo.select()}},go:function(page){if(this.loading){return}if(this.style==this.STYLE_CLASSIC){window.location.replace(this.handler.url+"?"+(this.handler.queryString.length?this.handler.queryString+"&":"")+"page="+page);return}this.loading=true;if(!page){page=this.page}var createHandler=eval(this.handler.onCreate)||Prototype.emptyFunction;
var failureHandler=eval(this.handler.onFailure)||Prototype.emptyFunction;this.handler.parameters.set("page",page);this.handler.parameters.set("paginator",this.group);if(this.refreshPagination){this.handler.parameters.unset("cacheId");this.handler.parameters.set("refreshPagination",this.group)}else{this.handler.parameters.unset("refreshPagination")}createHandler(this);this.handler.parameters.each(function(item){if(item.value&&item.value.toString()=="[object Object]"){this.unset(item.key);
$H(item.value).each(function(it){var newKey=item.key+"["+it.key+"][]";this.set(newKey,it.value)},this)}},this.handler.parameters);var ajaxParameters={method:"get",parameters:this.buildQueryString(this.handler.parameters),onSuccess:function(tr){var successHandler=!(Object.isFunction(this.handler.onSuccess))?eval(this.handler.onSuccess)||Prototype.emptyFunction:this.handler.onSuccess;var response=null;
try{response=tr.responseText.evalJSON()}catch(ex){if(window.console){window.console.error("The pagination response is not a valid JSON")}}this.loading=false;try{successHandler(tr,response);this.handleUpdate(response)}catch(ex){if(window.console){console.log(ex)}}}.bind(this),onFailure:function(tr){this.loading=false;failureHandler(tr)}};if(!Object.isUndefined(this.handler.parameters.get("overlayer"))){ajaxParameters.overlayer={id:this.handler.parameters.get("overlayer"),autoReposition:!this.handler.fixedHeight}
}else{if(this.handler.update){ajaxParameters.overlayer={id:this.handler.update,autoReposition:!this.handler.fixedHeight}}}if(this.handler.message){ajaxParameters.message=this.handler.message}new Ajax.Request(this.handler.url,ajaxParameters);this.currentPage=page;this.updateFriends(page)},handleUpdate:function(a){if(this.handler.update){$(this.handler.update).update(a.results)}if(this.refreshPagination){Paginators.getGroup(this.group).each(function(b){b.rewind(a.handler.config);
b.setParameters(a.handler.parameters)});this.refreshPagination=false}},refresh:function(a){this.refreshPagination=true;if(!Object.isUndefined(a)){if(!Object.isHash(a)){throw ("'newParameters' must be a Hash object!")}this.setParameters(a);this.currentPage=0;var b=a.get("page");if(Object.isUndefined(b)){this.go(1)}else{this.go(b)}}else{this.go(this.currentPage)}},getHandler:function(){return this.handler
},setHandler:function(a){this.handler=a},setParameters:function(a){this.handler.parameters=$H(a);this.handler.queryString=this.buildQueryString(this.handler.parameters)},getParameters:function(){return this.handler.parameters},getCurrentPage:function(){return this.currentPage},updateFriends:function(a){$A(Paginators.getGroup(this.group)).each(function(b){b.moveSlider("goTo",a)})},hide:function(){$("paginationContainer_"+this.uniqueId).hide();
this.visible=false},show:function(){if(this.visible==false){$("paginationContainer_"+this.uniqueId).show();this.visible=true}},rewind:function(a){if(parseInt(a.totalPages)<2){this.hide()}else{this.show();this.totalPages=a.totalPages;this.currentPage=(a.currentPage?a.currentPage:1);this.calculateWidths();this.moveSlider("rewind",(a.currentPage?a.currentPage:1))}},buildQueryString:function(a){var b=[];
$H(a).each(function(c){if(Object.isArray(c.value)){c.value.each(function(d){b.push(c.key+"[]="+encodeURIComponent(d))})}else{b.push(c.key+"="+encodeURIComponent(c.value))}});return b.join("&")},_garbageCollector:function(){Event.stopObserving(this.navigationBar.identify(),"mousedown",this.bClickOnBar);Event.stopObserving(this.leftArrow.identify(),"click",this.bMoveLeft);Event.stopObserving(this.rightArrow.identify(),"click",this.bMoveRight);
Event.stopObserving("lnk_"+this.goTo.identify(),"click",this.bGoToPage);Event.stopObserving(this.slider.identify(),"mousedown",this.bMouseDown)}});var FormValidator=Class.create();FormValidator.prototype={initialize:function(a){if(typeof(a)!="object"){a={}}this.form=a.form||null;this.successCallback=a.onSuccess||Prototype.emptyFunction;this.failureCallback=a.onFailure||Prototype.emptyFunction;this.onValidateAllCallback=a.onValidateAll||Prototype.emptyFunction;
this.event=a.event||"none";this.onSubmit=a.onSubmit||null;this.invalid=[];this.successCallback=this.successCallback.bind(this);this.failureCallback=this.failureCallback.bind(this);this.onValidateAllCallback=this.onValidateAllCallback.bind(this);this.counter=0;if(this.form){this.form=$(this.form);Event.observe(this.form,"submit",this.submitter.bindAsEventListener(this))}this.validatorTypes=$H({email:this.emailValidator,length:this.lengthValidator,numeric:this.numericValidator,number:this.numberValidator,alpha:this.alphaValidator,alnum:this.alphaNumValidator,username:this.usernameValidator,size:this.sizeValidator,required:this.requiredValidator,equals:this.equalsValidator,regexp:this.regexpValidator,least:this.leastValidator});
this.validators=$H({})},submitter:function(a){var b=this.validateAll();if(!b&&a){a.stop()}if(b&&this.onSubmit){if(a){a.stop()}this.onSubmit()}},add:function(d){if(typeof($(d.id))=="undefined"&&typeof($(d.name))=="undefined"){throw"id or name of the validator is mandatory";return}if(typeof(d.type)=="undefined"){throw"type of the validator is mandatory"}var a=new Array();if(d.id){a=a.concat(d.id)}if(d.name){a=a.concat(d.name)
}var l=new Array();l=l.concat(d.message);if(Object.isFunction(d.type)){this.register("custom"+this.counter,d.type);d.type=["custom"+this.counter];this.counter++}var j=new Array();j=j.concat(d.type);var p=d.parameters||{};for(var h=0;h<a.length;h++){var c=a[h];var b=null;for(var o=0;o<j.length;o++){var k=j[o];var r=k.indexOf("|");if(r!=-1){var n=k.split("|");k=n[0];for(var g=1;g<n.length;g++){var q=n[g].indexOf("=");
var f=new Object();f[n[g].substr(0,q)]=n[g].substr(q+1);p=Object.extend(p,f)}}var e=l[o]=="undefined"?" ":l[o];if(typeof(this.validators.get(c))=="undefined"){b=$H({id:c,types:[k],successCallback:d.onSuccess||this.successCallback,failureCallback:d.onFailure||this.failureCallback,parameters:p||{},event:d.event||this.event,message:[e]})}else{b=this.validators.get(c);b.set("event",d.event||b.get("event"));
b.get("types").push(k);b.get("message").push(e);b.set("parameters",Object.extend(b.get("parameters"),p))}this.validators.set(c,b)}if(b.get("event")!="none"){Event.observe(c,b.get("event"),function(){this.validate(c)}.bind(this))}}},remove:function(a){this.validators.unset(a)},validate:function(f){var c=this.validators.get(f);for(ii=0;ii<c.get("types").length;ii++){var d=this.validatorTypes.get(c.get("types")[ii]);
try{var a=d(f,c.get("parameters"))}catch(b){if(window.console){window.console.log(b)}}if(a){try{c.get("successCallback")(f,ii)}catch(b){alert("Success callback error:"+b.message)}}else{var e=c.get("message")[ii];try{c.get("failureCallback")(f,e,ii)}catch(b){if(window.console){window.console.log(b)}}return false}}return true},validateAll:function(){this.invalid.clear();var b=this.validators.keys();if(!b.length){return true
}this.onValidateAllCallback(b);var a=true;for(var d=0;d<b.length;d++){good=this.validate(b[d]);if(!good){a=false}}if(this.invalid.length){var c=$(this.invalid[0]);if(Element.viewportOffset(c).top<150){c.focus();window.scrollBy(0,-150)}else{window.scrollBy(0,150);c.focus()}}return a},forceSuccess:function(a){a.each(function(b){this.validators.get(b).get("successCallback")(b)})},forceFailure:function(a){a.each(function(b){this.validators.get(b).get("failureCallback")(b)
})},register:function(b,a){this.validatorTypes.set(b,a)},$:function(a){var b=$A(document.getElementsByName(a));if(count(b)){return b[0]}else{return $(a)}},emailValidator:function(f,b){emailStr=$(f).value;if(!emailStr.length){return true}var e=emailStr.match("^(.+)@(.+)$");if(e==null){return false}if(e[1]!=null){var d=/^\"?[\w-_\.]*\"?$/;if(e[1].match(d)==null){return false}}if(e[2]!=null){var c=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
if(e[2].match(c)==null){var a=/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;if(e[2].match(a)==null){return false}}return true}return false},lengthValidator:function(b,a){if(a.max&&$(b).value.length>a.max){return false}if(a.min&&$(b).value.length<a.min){return false}return true},numericValidator:function(d,b){var a=/[^0-9]/;var c=$(d).value.search(a);if($(d).value.length>0&&c>=0){return false}return true
},numberValidator:function(){var a=$(id).value;if(a.length>0&&isNaN(a)){return false}return true},alphaValidator:function(d,b){var a=/[^a-z]/i;var c=$(d).value.search(a);if($(d).value.length>0&&c>=0){return false}return true},alphaNumValidator:function(d,b){var a=/[a-z]{1}[^a-z0-9]/i;var c=$(d).value.search(a);if($(d).value.length>0&&c>=0){return false}return true},usernameValidator:function(c,a){var b=/^[a-z]+[a-z0-9_]*$/i;
if(!$(c).value.match(b)){return false}return true},sizeValidator:function(c,a){var b=parseFloat($(c).value);if(b.length==0||isNaN(b)){return false}if(typeof(a.max)!="undefined"&&b>a.max){return false}if(typeof(a.min)!="undefined"&&b<a.min){return false}return true},requiredValidator:function(d,c){var a=$(d);var b=a.type;if(b=="checkbox"&&!a.checked){return false}if($F(d).length==0){return false}return true
},equalsValidator:function(c,b){var a=$(c);if(a.value!=$(b.id).value){return false}return true},leastValidator:function(c,a){var b=$A(document.getElementsByName(a.name));good=false;b.each(function(d){d=$(d);if(d.checked==true){good=true}});return good},regexpValidator:function(c,b){if($(c).value.length>0){var a;if(typeof(b.modifier)!="undefined"){a=new RegExp(b.pattern,b.modifier)}else{a=new RegExp(b.pattern)
}if(!a.match($(c).value)){return false}}return true}};
