/*/20100906153933/public/javascripts/lang/en/viewer_all.js built Mon Sep 06 17:41:14 +0200 2010 - last modified 2010-09-01 09:51:23*/
try{String.prototype.capitalize=function(){if(typeof this.charAt!="function"){dbg.error("capitalize called on a string witch does not have chatAt function",{string:this,type:(typeof this),arguments:arguments});
return this
}return this.charAt(0).toUpperCase()+this.substring(1,this.length)
};
String.prototype.htmlTrim=function(){var a=String.fromCharCode(160);
return(this||"").replace(new RegExp("^[s"+a+"]+|[s"+a+"]+$","g"),"")
};
String.prototype.truncate=function(a){if(this.length>a){return this.substring(0,a-3)+"..."
}else{return this+""
}};
String.prototype.remove_accents=function(){var a=this+"";
var b=[["ÀÁÂÃÄÅ","A"],["àáâãäå","a"],["ÈÉÊË","E"],["èéêë","e"],["Ç","C"],["ç","c"],["ìíîï","i"],["ÌÍÎÏ","I"],["ÒÓÔÕÖØ","O"],["òóôõöø","o"],["œ","oe"],["ß","ss"],["ÙÚÛÜ","u"],["ùúûü","u"],["ÿ","y"],["Ñ","N"],["ñ","n"]].each(function(d){for(var e=0;
e<d[0].length;
e++){a=a.replace(new RegExp(d[0].charAt(e),"g"),d[1])
}});
return a
};
String.prototype.to_alphanumeric=function(){return this.remove_accents().replace(/\W+/g,"_")
};
String.prototype.UTF8encode=function(){string=this.replace(/\r\n/g,"\n");
var a="";
for(var d=0;
d<string.length;
d++){var b=string.charCodeAt(d);
if(b<128){a+=String.fromCharCode(b)
}else{if((b>127)&&(b<2048)){a+=String.fromCharCode((b>>6)|192);
a+=String.fromCharCode((b&63)|128)
}else{a+=String.fromCharCode((b>>12)|224);
a+=String.fromCharCode(((b>>6)&63)|128);
a+=String.fromCharCode((b&63)|128)
}}}return a
};
String.prototype.UTF8decode=function(){var a="";
var d=0;
var g=0;
var e=0;
var b=0;
utftext=this;
while(d<utftext.length){g=utftext.charCodeAt(d);
if(g<128){a+=String.fromCharCode(g);
d++
}else{if((g>191)&&(g<224)){b=utftext.charCodeAt(d+1);
a+=String.fromCharCode(((g&31)<<6)|(b&63));
d+=2
}else{b=utftext.charCodeAt(d+1);
c3=utftext.charCodeAt(d+2);
a+=String.fromCharCode(((g&15)<<12)|((b&63)<<6)|(c3&63));
d+=3
}}}return a
};
function str_repeat(b,a){for(var c=[];
a>0;
c[--a]=b){}return(c.join(""))
}function sprintf(){var g=0,e,h=arguments[g++],k=[],d,j,l,b;
while(h){if(d=/^[^\x25]+/.exec(h)){k.push(d[0])
}else{if(d=/^\x25{2}/.exec(h)){k.push("%")
}else{if(d=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(h)){if(((e=arguments[d[1]||g++])==null)||(e==undefined)){throw ("In sprintf, Too few arguments. (string="+arguments[0])
}if(/[^s]/.test(d[7])&&(typeof(e)!="number")){throw ("In sprintf, Expecting number but found "+typeof(e)+" (string="+arguments[0])
}switch(d[7]){case"b":e=e.toString(2);
break;
case"c":e=String.fromCharCode(e);
break;
case"d":e=parseInt(e);
break;
case"e":e=d[6]?e.toExponential(d[6]):e.toExponential();
break;
case"f":e=d[6]?parseFloat(e).toFixed(d[6]):parseFloat(e);
break;
case"o":e=e.toString(8);
break;
case"s":e=((e=String(e))&&d[6]?e.substring(0,d[6]):e);
break;
case"u":e=Math.abs(e);
break;
case"x":e=e.toString(16);
break;
case"X":e=e.toString(16).toUpperCase();
break
}e=(/[def]/.test(d[7])&&d[2]&&e>0?"+"+e:e);
l=d[3]?d[3]=="0"?"0":d[3].charAt(1):" ";
b=d[5]-String(e).length;
j=d[5]?str_repeat(l,b):"";
k.push(d[4]?e+j:j+e)
}else{throw ("In sprintf, unknow error string="+arguments[0])
}}}h=h.substring(d[0].length)
}return k.join("")
}String.prototype.obfuscate=function(){var b="";
for(var a=0;
a<this.length;
++a){b+=String.fromCharCode(5^this.charCodeAt(a))
}return b
};
String.prototype.obfuscate36=function(){var b="";
for(var a=0;
a<this.length;
++a){b+=(this.charCodeAt(a)+a+1).toString(36)
}return b
};
oburl=function(a,b){if(a.match("files/users")){if(b){a=a.replace(/[^\/]+(...)$/,"sitew_protected.$1")
}else{a=a.replace(/[^\/]+$/,"sitew_protected.swf")
}}else{r=a.match(/(.*?\/)(\w+)-((.*?)(\.[^\.]+$)|(.*))/);
a=r[1]+"sitew_protection/"+r[2].obfuscate36()+"-"+r[4]+(b?"":".swf")
}return a
}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/string",exp)
},window.dbg?0:1000)
}try{var Class={create:function(){return function(){this.initialize.apply(this,arguments)
}
}};
Object.extend=function(a,d,b){for(var c in d){if(b&&a[c]){a[b+c]=a[c]
}a[c]=d[c]
}return a
}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in prototype_small",exp)
},window.dbg?0:1000)
}try{(function(){var _jQuery=window.jQuery,_$=window.$;
var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)
};
var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;
jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;
if(selector.nodeType){this[0]=selector;
this.length=1;
return this
}if(typeof selector=="string"){var match=quickExpr.exec(selector);
if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)
}else{var elem=document.getElementById(match[3]);
if(elem){if(elem.id!=match[3]){return jQuery().find(selector)
}return jQuery(elem)
}selector=[]
}}else{return jQuery(context).find(selector)
}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector)
}}return this.setArray(jQuery.makeArray(selector))
},jquery:"1.2.6",size:function(){return this.length
},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num]
},pushStack:function(elems){var ret=jQuery(elems);
ret.prevObject=this;
return ret
},setArray:function(elems){this.length=0;
Array.prototype.push.apply(this,elems);
return this
},each:function(callback,args){return jQuery.each(this,callback,args)
},index:function(elem){var ret=-1;
return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)
},attr:function(name,value,type){var options=name;
if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)
}else{options={};
options[name]=value
}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))
}})
},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined
}return this.attr(key,value,"curCSS")
},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))
}var ret="";
jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])
}})
});
return ret
},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;
while(elem.firstChild){elem=elem.firstChild
}return elem
}).append(this)
}return this
},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)
})
},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)
})
},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem)
}})
},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)
}})
},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this)
})
},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)
})
},end:function(){return this.prevObject||jQuery([])
},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)
});
return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems)
},clone:function(events){var ret=this.map(function(){try{if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");
container.appendChild(clone);
try{return jQuery.clean([container.innerHTML])[0]
}catch(e){$(container).find("object").show().hide();
return jQuery.clean([container.innerHTML])[0]
}}else{return this.cloneNode(true)
}}catch(e2){dbg.error("exeption in clone",{msie:jQuery.browser.msie,exception:e2,html_element:this})
}});
var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null
}});
if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return
}var events=jQuery.data(this,"events");
for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)
}}})
}return ret
},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)
})||jQuery.multiFilter(selector,this))
},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true))
}else{selector=jQuery.multiFilter(selector,this)
}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;
return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector
})
},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))))
},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0
},hasClass:function(selector){return this.is("."+selector)
},val:function(value){if(value===undefined){var elem=this[0];
if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text
}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";
if(index<0){return null
}for(var i=one?index:0,max=one?index+1:options.length;
i<max;
i++){var option=options[i];
if(option.selected){value=jQuery(option).val();
if(one){return value
}values.push(value)
}}return values
}return(elem.value||"").replace(/\r/g,"")
}return undefined
}if(value.constructor==Number){value+=""
}return this.each(function(){if(this.nodeType!=1){return
}if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)
}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);
jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)
});
if(!values.length){this.selectedIndex=-1
}}else{this.value=value
}}})
},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value)
},replaceWith:function(value){return this.after(value).remove()
},eq:function(i){return this.slice(i,i+1)
},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments))
},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)
}))
},andSelf:function(){return this.add(this.prevObject)
},data:function(key,value){var parts=key.split(".");
parts[1]=parts[1]?"."+parts[1]:"";
if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
if(data===undefined&&this.length){data=jQuery.data(this[0],key)
}return data===undefined&&parts[1]?this.data(parts[0]):data
}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)
})
}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)
})
},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;
return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);
if(reverse){elems.reverse()
}}var obj=this;
if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"))
}var scripts=jQuery([]);
jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;
if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem)
}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove())
}callback.call(obj,elem)
}});
scripts.each(evalScript)
})
}};
jQuery.fn.init.prototype=jQuery.fn;
function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})
}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")
}if(elem.parentNode){elem.parentNode.removeChild(elem)
}}function now(){return +new Date
}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;
if(target.constructor==Boolean){deep=target;
target=arguments[1]||{};
i=2
}if(typeof target!="object"&&typeof target!="function"){target={}
}if(length==i){target=this;
--i
}for(;
i<length;
i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];
if(target===copy){continue
}if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy)
}else{if(copy!==undefined){target[name]=copy
}}}}}return target
};
var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};
jQuery.extend({noConflict:function(deep){window.$=_$;
if(deep){window.jQuery=_jQuery
}return jQuery
},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"")
},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body
},globalEval:function(data){data=jQuery.trim(data);
if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
script.type="text/javascript";
if(jQuery.browser.msie){script.text=data
}else{script.appendChild(document.createTextNode(data))
}head.insertBefore(script,head.firstChild);
head.removeChild(script)
}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()
},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;
var id=elem[expando];
if(!id){id=elem[expando]=++uuid
}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}
}if(data!==undefined){jQuery.cache[id][name]=data
}return name?jQuery.cache[id][name]:id
},removeData:function(elem,name){elem=elem==window?windowData:elem;
var id=elem[expando];
if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];
name="";
for(name in jQuery.cache[id]){break
}if(!name){jQuery.removeData(elem)
}}}else{try{delete elem[expando]
}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)
}}delete jQuery.cache[id]
}},each:function(object,callback,args){var name,i=0,length=object.length;
if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break
}}}else{for(;
i<length;
){if(callback.apply(object[i++],args)===false){break
}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break
}}}else{for(var value=object[0];
i<length&&callback.call(value,i,value)!==false;
value=object[++i]){}}}return object
},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)
}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value
},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className
}})
},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)
}).join(" "):""
}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1
}},swap:function(elem,options,callback){var old={};
for(var name in options){old[name]=elem.style[name];
elem.style[name]=options[name]
}callback.call(elem);
for(var name in options){elem.style[name]=old[name]
}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;
var padding=0,border=0;
jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;
border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0
});
val-=Math.round(padding+border)
}if(jQuery(elem).is(":visible")){getWH()
}else{jQuery.swap(elem,props,getWH)
}return Math.max(0,val)
}return jQuery.curCSS(elem,name,force)
},curCSS:function(elem,name,force){var ret,style=elem.style;
function color(elem){if(!jQuery.browser.safari){return false
}var ret=defaultView.getComputedStyle(elem,null);
return !ret||ret.getPropertyValue("color")==""
}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");
return ret==""?"1":ret
}if(jQuery.browser.opera&&name=="display"){var save=style.outline;
style.outline="0 solid black";
style.outline=save
}if(name.match(/float/i)){name=styleFloat
}if(!force&&style&&style[name]){ret=style[name]
}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"
}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
var computedStyle=defaultView.getComputedStyle(elem,null);
if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name)
}else{var swap=[],stack=[],a=elem,i=0;
for(;
a&&color(a);
a=a.parentNode){stack.unshift(a)
}for(;
i<stack.length;
i++){if(color(stack[i])){swap[i]=stack[i].style.display;
stack[i].style.display="block"
}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";
for(i=0;
i<swap.length;
i++){if(swap[i]!=null){stack[i].style.display=swap[i]
}}}if(name=="opacity"&&ret==""){ret="1"
}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()
});
ret=elem.currentStyle[name]||elem.currentStyle[camelCase];
if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
style.left=ret||0;
ret=style.pixelLeft+"px";
style.left=left;
elem.runtimeStyle.left=rsLeft
}}}}return ret
},clean:function(elems,context){var ret=[];
context=context||document;
if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document
}jQuery.each(elems,function(i,elem){if(!elem){return
}if(elem.constructor==Number){elem+=""
}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"
});
var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");
var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=wrap[1]+elem+wrap[2];
while(wrap[0]--){div=div.lastChild
}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];
for(var j=tbody.length-1;
j>=0;
--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])
}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)
}}elem=jQuery.makeArray(div.childNodes)
}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return
}if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem)
}else{ret=jQuery.merge(ret,elem)
}});
return ret
},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined
}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;
name=notxml&&jQuery.props[name]||name;
if(elem.tagName){var special=/href|src|style/.test(name);
if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex
}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"
}elem[name]=value
}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue
}return elem[name]
}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)
}if(set){elem.setAttribute(name,""+value)
}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);
return attr===null?undefined:attr
}if(msie&&name=="opacity"){if(set){elem.zoom=1;
elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")
}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""
}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()
});
try{if(set){elem[name]=value
}}catch(exp){var data={name:name,value:value};
var codes={html_element:"$(arguments.caller[1]).html()",id:"$(arguments.caller[1]).attr('id')",class_:"$(arguments.caller[1]).attr('class')"};
for(var test in codes){try{eval("data."+test+"="+codes[test])
}catch(exp){}}dbg.error("Error setting attribute",data)
}return elem[name]
},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")
},makeArray:function(array){var ret=[];
if(array!=null){var i=array.length;
if(i==null||array.split||array.setInterval||array.call){ret[0]=array
}else{while(i){ret[--i]=array[i]
}}}return ret
},inArray:function(elem,array){for(var i=0,length=array.length;
i<length;
i++){if(array[i]===elem){return i
}}return -1
},merge:function(first,second){var i=0,elem,pos=first.length;
if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem
}}}else{while(elem=second[i++]){first[pos++]=elem
}}return first
},unique:function(array){var ret=[],done={};
try{for(var i=0,length=array.length;
i<length;
i++){var id=jQuery.data(array[i]);
if(!done[id]){done[id]=true;
ret.push(array[i])
}}}catch(e){ret=array
}return ret
},grep:function(elems,callback,inv){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])
}}return ret
},map:function(elems,callback){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){var value=callback(elems[i],i);
if(value!=null){ret[ret.length]=value
}}return ret.concat.apply([],ret)
}});
var userAgent=navigator.userAgent.toLowerCase();
jQuery.browser={version:(userAgent.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};
var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";
jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});
jQuery.each({parent:function(elem){return elem.parentNode
},parents:function(elem){return jQuery.dir(elem,"parentNode")
},next:function(elem){return jQuery.nth(elem,2,"nextSibling")
},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")
},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")
},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")
},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)
},children:function(elem){return jQuery.sibling(elem.firstChild)
},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)
}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);
if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)
}return this.pushStack(jQuery.unique(ret))
}
});
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;
return this.each(function(){for(var i=0,length=args.length;
i<length;
i++){jQuery(args[i])[original](this)
}})
}
});
jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");
if(this.nodeType==1){this.removeAttribute(name)
}},addClass:function(classNames){jQuery.className.add(this,classNames)
},removeClass:function(classNames){jQuery.className.remove(this,classNames)
},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames)
},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);
jQuery.removeData(this)
});
if(this.parentNode){this.parentNode.removeChild(this)
}}},empty:function(){jQuery(">*",this).remove();
while(this.firstChild){this.removeChild(this.firstChild)
}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)
}
});
jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();
jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px")
}
});
function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0
}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");
jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2])
},"#":function(a,i,m){return a.getAttribute("id")==m[2]
},":":{lt:function(a,i,m){return i<m[3]-0
},gt:function(a,i,m){return i>m[3]-0
},nth:function(a,i,m){return m[3]-0==i
},eq:function(a,i,m){return m[3]-0==i
},first:function(a,i){return i==0
},last:function(a,i,m,r){return i==r.length-1
},even:function(a,i){return i%2==0
},odd:function(a,i){return i%2
},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a
},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a
},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling")
},parent:function(a){return a.firstChild
},empty:function(a){return !a.firstChild
},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0
},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden"
},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden"
},enabled:function(a){return !a.disabled
},disabled:function(a){return a.disabled
},checked:function(a){return a.checked
},selected:function(a){return a.selected||jQuery.attr(a,"selected")
},text:function(a){return"text"==a.type
},radio:function(a){return"radio"==a.type
},checkbox:function(a){return"checkbox"==a.type
},file:function(a){return"file"==a.type
},password:function(a){return"password"==a.type
},submit:function(a){return"submit"==a.type
},image:function(a){return"image"==a.type
},reset:function(a){return"reset"==a.type
},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button")
},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)
},has:function(a,i,m){return jQuery.find(m[3],a).length
},header:function(a){return/h\d/i.test(a.nodeName)
},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem
}).length
}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];
while(expr&&expr!=old){old=expr;
var f=jQuery.filter(expr,elems,not);
expr=f.t.replace(/^\s*,\s*/,"");
cur=not?elems=f.r:jQuery.merge(cur,f.r)
}return cur
},find:function(t,context){if(typeof t!="string"){return[t]
}if(context&&context.nodeType!=1&&context.nodeType!=9){return[]
}context=context||document;
var ret=[context],done=[],last,nodeName;
while(t&&last!=t){var r=[];
last=t;
t=jQuery.trim(t);
var foundToken=false,re=quickChild,m=re.exec(t);
if(m){nodeName=m[1].toUpperCase();
for(var i=0;
ret[i];
i++){for(var c=ret[i].firstChild;
c;
c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c)
}}}ret=r;
t=t.replace(re,"");
if(t.indexOf(" ")==0){continue
}foundToken=true
}else{re=/^([>+~])\s*(\w*)/i;
if((m=re.exec(t))!=null){r=[];
var merge={};
nodeName=m[2].toUpperCase();
m=m[1];
for(var j=0,rl=ret.length;
j<rl;
j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;
for(;
n;
n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);
if(m=="~"&&merge[id]){break
}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true
}r.push(n)
}if(m=="+"){break
}}}}ret=r;
t=jQuery.trim(t.replace(re,""));
foundToken=true
}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift()
}done=jQuery.merge(done,ret);
r=ret=[context];
t=" "+t.substr(1,t.length)
}else{var re2=quickID;
var m=re2.exec(t);
if(m){m=[0,m[2],m[3],m[1]]
}else{re2=quickClass;
m=re2.exec(t)
}m[2]=m[2].replace(/\\/g,"");
var elem=ret[ret.length-1];
if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);
if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0]
}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[]
}else{for(var i=0;
ret[i];
i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];
if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param"
}r=jQuery.merge(r,ret[i].getElementsByTagName(tag))
}if(m[1]=="."){r=jQuery.classFilter(r,m[2])
}if(m[1]=="#"){var tmp=[];
for(var i=0;
r[i];
i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];
break
}}r=tmp
}ret=r
}t=t.replace(re2,"")
}}if(t){var val=jQuery.filter(t,r);
ret=r=val.r;
t=jQuery.trim(val.t)
}}if(t){ret=[]
}if(ret&&context==ret[0]){ret.shift()
}done=jQuery.merge(done,ret);
return done
},classFilter:function(r,m,not){m=" "+m+" ";
var tmp=[];
for(var i=0;
r[i];
i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;
if(!not&&pass||not&&!pass){tmp.push(r[i])
}}return tmp
},filter:function(t,r,not){var last;
while(t&&t!=last){last=t;
var p=jQuery.parse,m;
for(var i=0;
p[i];
i++){m=p[i].exec(t);
if(m){t=t.substring(m[0].length);
m[2]=m[2].replace(/\\/g,"");
break
}}if(!m){break
}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3])
}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not)
}else{if(m[1]=="["){var tmp=[],type=m[3];
for(var i=0,rl=r.length;
i<rl;
i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];
if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||""
}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a)
}}r=tmp
}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;
for(var i=0,rl=r.length;
i<rl;
i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);
if(!merge[id]){var c=1;
for(var n=parentNode.firstChild;
n;
n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++
}}merge[id]=true
}var add=false;
if(first==0){if(node.nodeIndex==last){add=true
}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true
}}if(add^not){tmp.push(node)
}}r=tmp
}else{var fn=jQuery.expr[m[1]];
if(typeof fn=="object"){fn=fn[m[2]]
}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}")
}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r)
},not)
}}}}}return{r:r,t:t}
},dir:function(elem,dir){var matched=[],cur=elem[dir];
while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)
}cur=cur[dir]
}return matched
},nth:function(cur,result,dir,elem){result=result||1;
var num=0;
for(;
cur;
cur=cur[dir]){if(cur.nodeType==1&&++num==result){break
}}return cur
},sibling:function(n,elem){var r=[];
for(;
n;
n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)
}}return r
}});
jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return
}if(jQuery.browser.msie&&elem.setInterval){elem=window
}if(!handler.guid){handler.guid=this.guid++
}if(data!=undefined){var fn=handler;
handler=this.proxy(fn,function(){return fn.apply(this,arguments)
});
handler.data=data
}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments)
}});
handle.elem=elem;
jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
type=parts[0];
handler.type=parts[1];
var handlers=events[type];
if(!handlers){handlers=events[type]={};
if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)
}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)
}}}}handlers[handler.guid]=handler;
jQuery.event.global[type]=true
});
elem=null
},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return
}var events=jQuery.data(elem,"events"),ret,index;
if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))
}}else{if(types.type){handler=types.handler;
types=types.type
}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
type=parts[0];
if(events[type]){if(handler){delete events[type][handler.guid]
}else{for(var h in events[type]){if(!parts[1]||events[type][h].type==parts[1]){delete events[type][h]
}}}for(ret in events[type]){break
}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)
}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))
}}}ret=null;
delete events[type]
}}})
}for(ret in events){break
}if(!ret){var handle=jQuery.data(elem,"handle");
if(handle){handle.elem=null
}jQuery.removeData(elem,"events");
jQuery.removeData(elem,"handle")
}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);
if(type.indexOf("!")>=0){type=type.slice(0,-1);
var exclusive=true
}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data)
}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined
}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;
if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});
data[0][expando]=true
}data[0].type=type;
if(exclusive){data[0].exclusive=true
}var handle=jQuery.data(elem,"handle");
if(handle){val=handle.apply(elem,data)
}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false
}if(event){data.shift()
}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));
if(ret!==undefined){val=ret
}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;
try{elem[type]()
}catch(e){}}this.triggered=false
}return val
},handle:function(event){var val,ret,namespace,all,handlers;
event=arguments[0]=jQuery.event.fix(event||window.event);
namespace=event.type.split(".");
event.type=namespace[0];
namespace=namespace[1];
all=!namespace&&!event.exclusive;
handlers=(jQuery.data(this,"events")||{})[event.type];
for(var j in handlers){var handler=handlers[j];
if(handler&&(all||handler.type==namespace)){event.handler=handler;
event.data=handler.data;
ret=handler.apply(this,arguments);
if(val!==false){val=ret
}if(ret===false){event.preventDefault();
event.stopPropagation()
}}}return val
},fix:function(event){if(event[expando]==true){return event
}var originalEvent=event;
event={originalEvent:originalEvent};
var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
for(var i=props.length;
i;
i--){event[props[i]]=originalEvent[props[i]]
}event[expando]=true;
event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault()
}originalEvent.returnValue=false
};
event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation()
}originalEvent.cancelBubble=true
};
event.timeStamp=event.timeStamp||now();
if(!event.target){event.target=event.srcElement||document
}if(event.target.nodeType==3){event.target=event.target.parentNode
}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement
}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;
event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)
}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode
}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey
}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))
}return event
},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;
return proxy
},special:{ready:{setup:function(){bindReady();
return
},teardown:function(){return
}},mouseenter:{setup:function(){if(jQuery.browser.msie){return false
}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);
return true
},teardown:function(){if(jQuery.browser.msie){return false
}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);
return true
},handler:function(event){if(withinElement(event,this)){return true
}event.type="mouseenter";
return jQuery.event.handle.apply(this,arguments)
}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false
}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);
return true
},teardown:function(){if(jQuery.browser.msie){return false
}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);
return true
},handler:function(event){if(withinElement(event,this)){return true
}event.type="mouseleave";
return jQuery.event.handle.apply(this,arguments)
}}}};
jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)
})
},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);
return(fn||data).apply(this,arguments)
});
return this.each(function(){jQuery.event.add(this,type,one,fn&&data)
})
},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)
})
},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn)
})
},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn)
},toggle:function(fn){var args=arguments,i=1;
while(i<args.length){jQuery.event.proxy(fn,args[i++])
}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;
event.preventDefault();
return args[this.lastToggle++].apply(this,arguments)||false
}))
},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut)
},ready:function(fn){bindReady();
if(jQuery.isReady){fn.call(document,jQuery)
}else{jQuery.readyList.push(function(){return fn.call(this,jQuery)
})
}return this
}});
jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;
if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document)
});
jQuery.readyList=null
}jQuery(document).triggerHandler("ready")
}}});
var readyBound=false;
function bindReady(){if(readyBound){return
}readyBound=true;
if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false)
}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return
}try{document.documentElement.doScroll("left")
}catch(error){setTimeout(arguments.callee,0);
return
}jQuery.ready()
})()
}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return
}for(var i=0;
i<document.styleSheets.length;
i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,0);
return
}}jQuery.ready()
},false)
}if(jQuery.browser.safari){var numStyles;
(function(){if(jQuery.isReady){return
}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,0);
return
}if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length
}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,0);
return
}jQuery.ready()
})()
}jQuery.event.add(window,"load",jQuery.ready)
}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)
}
});
var withinElement=function(event,elem){var parent=event.relatedTarget;
while(parent&&parent!=elem){try{parent=parent.parentNode
}catch(error){parent=elem
}}return parent==elem
};
jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind()
});
jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url)
}var off=url.indexOf(" ");
if(off>=0){var selector=url.slice(off,url.length);
url=url.slice(0,off)
}callback=callback||function(){};
var type="GET";
if(params){if(jQuery.isFunction(params)){callback=params;
params=null
}else{params=jQuery.param(params);
type="POST"
}}var self=this;
jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);
self.each(callback,[res.responseText,status,res])
}}});
return this
},serialize:function(){return jQuery.param(this.serializeArray())
},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this
}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))
}).map(function(i,elem){var val=jQuery(this).val();
return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val}
}):{name:elem.name,value:val}
}).get()
}});
jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)
}
});
var jsc=now();
jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data=null
}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})
},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")
},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")
},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data={}
}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})
},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)
},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));
var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase(),requestDone=false;
if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data)
}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"
}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"
}}s.dataType="json"
}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;
if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")
}s.url=s.url.replace(jsre,"="+jsonp+"$1");
s.dataType="script";
window[jsonp]=function(tmp){requestDone=true;
if(!window[jsonp].aborted){data=tmp;
success();
complete()
}window[jsonp]=undefined;
try{delete window[jsonp]
}catch(e){}if(head){head.removeChild(script)
}};
window[jsonp].aborted=false;
window[jsonp].abort=function(){this.aborted=true
}
}if(s.dataType=="script"&&s.cache==null){s.cache=false
}if(s.cache===false&&type=="GET"){var ts=now();
var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");
s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")
}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;
s.data=null
}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")
}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;
if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");
script.src=s.url;
if(s.scriptCharset){script.charset=s.scriptCharset
}if(!jsonp){var done=false;
script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){requestDone=done=true;
if(!script.aborted){success();
complete()
}head.removeChild(script)
}};
script.aborted=false;
script.abort=function(){this.aborted=true
}
}head.appendChild(script);
if(s.timeout>0){setTimeout(function(){if(requestDone){return
}if(jsonp){window[jsonp].abort()
}else{script.abort()
}if(s.error){s.error("timeout")
}},s.timeout)
}if(jsonp){return window[jsonp]
}if(script){return script
}return undefined
}var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)
}else{xhr.open(type,s.url,s.async)
}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)
}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")
}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)
}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;
xhr.abort();
return false
}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])
}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;
if(ival){clearInterval(ival);
ival=null
}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";
if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter)
}catch(e){s.parsererror=e;
status="parsererror"
}}if(status=="success"){var modRes;
try{modRes=xhr.getResponseHeader("Last-Modified")
}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes
}if(!jsonp){success()
}}else{jQuery.handleError(s,xhr,status)
}complete();
if(s.async){xhr=null
}}};
if(s.async){var ival=setInterval(onreadystatechange,13);
if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();
if(!requestDone){onreadystatechange("timeout")
}}},s.timeout)
}}try{xhr.send(s.data)
}catch(e){jQuery.handleError(s,xhr,null,e)
}if(!s.async){onreadystatechange()
}function success(){if(s.success){s.success(data,status)
}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])
}}function complete(){if(s.complete){s.complete(xhr,status)
}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])
}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}}return xhr
},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)
}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])
}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined
}catch(e){}return false
},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined
}catch(e){}return false
},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
if(xml&&data.documentElement.tagName=="parsererror"){throw"the navigator was unable to parse this xml : "+data.documentElement.textContent
}if(filter){data=filter(data,type)
}if(type=="script"){jQuery.globalEval(data)
}if(type=="json"){data=eval("("+data+")")
}return data
},param:function(a){var s=[];
if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value))
})
}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this))
})
}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]))
}}}return s.join("&").replace(/%20/g,"+")
}});
jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";
if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");
this.style.display=elem.css("display");
if(this.style.display=="none"){this.style.display="block"
}elem.remove()
}}).end()
},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");
this.style.display="none"
}).end()
},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]()
})
},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback)
},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback)
},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback)
},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback)
},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback)
},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)
},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);
return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false
}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;
for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)
}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");
opt.overflow=this.style.overflow
}}if(opt.overflow!=null){this.style.overflow="hidden"
}opt.curAnim=jQuery.extend({},prop);
jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);
if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)
}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;
if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";
if(unit!="px"){self.style[name]=(end||1)+unit;
start=((end||1)/e.cur(true))*start;
self.style[name]=start+unit
}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start
}e.custom(start,end,unit)
}else{e.custom(start,val,"")
}}});
return true
})
},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;
type="fx"
}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type)
}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn)
}else{queue(this,type).push(fn);
if(queue(this,type).length==1){fn.call(this)
}}})
},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;
if(clearQueue){this.queue([])
}this.each(function(){for(var i=timers.length-1;
i>=0;
i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)
}timers.splice(i,1)
}}});
if(!gotoEnd){this.dequeue()
}return this
}});
var queue=function(elem,type,array){if(elem){type=type||"fx";
var q=jQuery.data(elem,type+"queue");
if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array))
}}return q
};
jQuery.fn.dequeue=function(type){type=type||"fx";
return this.each(function(){var q=queue(this,type);
q.shift();
if(q.length){q[0].call(this)
}})
};
jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};
opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;
opt.old=opt.complete;
opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()
}if(jQuery.isFunction(opt.old)){opt.old.call(this)
}};
return opt
},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p
},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum
}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;
this.elem=elem;
this.prop=prop;
if(!options.orig){options.orig={}
}}});
jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)
}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);
if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block"
}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop]
}var r=parseFloat(jQuery.css(this.elem,this.prop,force));
return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0
},custom:function(from,to,unit){this.startTime=now();
this.start=from;
this.end=to;
this.unit=unit||this.unit||"px";
this.now=this.start;
this.pos=this.state=0;
this.update();
var self=this;
function t(gotoEnd){return self.step(gotoEnd)
}t.elem=this.elem;
jQuery.timers.push(t);
if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;
for(var i=0;
i<timers.length;
i++){if(!timers[i]()){timers.splice(i--,1)
}}if(!timers.length){clearInterval(jQuery.timerId);
jQuery.timerId=null
}},13)
}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.show=true;
this.custom(0,this.cur());
if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px"
}jQuery(this.elem).show()
},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.hide=true;
this.custom(this.cur(),0)
},step:function(gotoEnd){var t=now();
if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;
this.pos=this.state=1;
this.update();
this.options.curAnim[this.prop]=true;
var done=true;
for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false
}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;
this.elem.style.display=this.options.display;
if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"
}}if(this.options.hide){this.elem.style.display="none"
}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])
}}}if(done){this.options.complete.call(this.elem)
}return false
}else{var n=t-this.startTime;
this.state=n/this.options.duration;
this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
this.now=this.start+((this.end-this.start)*this.pos);
this.update()
}return true
}};
jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now
},scrollTop:function(fx){fx.elem.scrollTop=fx.now
},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)
},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit
}}});
jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;
if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";
if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();
add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop)
}else{add(elem.offsetLeft,elem.offsetTop);
while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);
if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent)
}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true
}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;
offsetParent=offsetParent.offsetParent
}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop)
}if(mozilla&&css(parent,"overflow")!="visible"){border(parent)
}parent=parent.parentNode
}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop)
}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop))
}}results={top:top,left:left}
}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true))
}function add(l,t){left+=parseInt(l,10)||0;
top+=parseInt(t,10)||0
}return results
};
jQuery.fn.extend({position:function(){var left=0,top=0,results;
if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();
offset.top-=num(this,"marginTop");
offset.left-=num(this,"marginLeft");
parentOffset.top+=num(offsetParent,"borderTopWidth");
parentOffset.left+=num(offsetParent,"borderLeftWidth");
results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}
}return results
},offsetParent:function(){var offsetParent=this[0].offsetParent;
while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent
}return jQuery(offsetParent)
}});
jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;
jQuery.fn[method]=function(val){if(!this[0]){return
}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val
}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]
}
});
jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";
jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)
};
jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0)
}
})
})()
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in jquery-1.2.6.js",exp)
},window.dbg?0:1000)
}try{if(window.Image==undefined){Image=function(){return $("<img/>")[0]
}
}}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/image",exp)
},window.dbg?0:1000)
}try{Array.prototype.forEach=function(d,c){for(var b=0,a=this.length;
b<a;
b++){d.call(c,this[b],b,this)
}};
Array.prototype.each=function(d,c){for(var b=0,a=this.length;
b<a;
b++){d.call(c,this[b],this)
}};
Array.prototype.each_with_index=function(d,c){for(var b=0,a=this.length;
b<a;
b++){d.call(c,b,this[b],this)
}};
Array.prototype.collect=function(g,e){var c=new Array();
for(var d=0,b=this.length;
d<b;
d++){c.push(g.call(e,this[d],this))
}return c
};
Array.prototype.find_index=function(d,c){for(var b=0,a=this.length;
b<a;
b++){if(d.call(c,this[b],this)){return b
}}return null
};
Array.prototype.find=function(d,c){for(var b=0,a=this.length;
b<a;
b++){if(d.call(c,this[b],this)){return this[b]
}}return null
};
Array.prototype.find_all=function(g,e){var c=[];
for(var d=0,b=this.length;
d<b;
d++){if(g.call(e,this[d],this)){c.push(this[d])
}}return c
};
Array.prototype.include=function(c){for(var b=0,a=this.length;
b<a;
b++){if(this[b]==c){return true
}}return false
};
Array.prototype.includeOne=function(e){var c=false;
for(var d=0,b=this.length;
!c&&d<b;
d++){c|=e.include(this[d])
}return c
};
Array.prototype.removeAt=function(a){return this.splice(a,1)[0]
};
Array.prototype.remove=function(b){var a=this.indexOf(b);
if(a>=0){return this.splice(a,1)[0]
}};
Array.prototype.removeAll=function(b){var a=this.indexOf(b);
while(a>=0){this.splice(a,1);
a=this.indexOf(b)
}return this
};
Array.prototype.to_h=function(d,c){c=c||"id";
d=d||{};
for(var b=0,a=this.length;
b<a;
b++){this[b][c]=this[b][c]||0;
d[this[b][c]||0]=this[b]
}return d
};
Array.prototype.insertAt=function(c,d){var a=this.slice(0,d);
a.push(c);
return a.concat(this.slice(d))
};
Array.prototype.max=function(){var b=this[0];
var a=this.length;
for(var c=1;
c<a;
c++){if(this[c]>b){b=this[c]
}}return b
};
Array.prototype.min=function(){var c=this[0];
var a=this.length;
for(var b=1;
b<a;
b++){if(this[b]<c){c=this[b]
}}return c
}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/array",exp)
},window.dbg?0:1000)
}try{if(!this.JSON_){JSON_=function(){function f(n){return n<10?"0"+n:n
}Date.prototype.toJSON=function(){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"
};
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};
function stringify(value,whitelist){var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;
switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];
if(c){return c
}c=a.charCodeAt();
return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)
})+'"':'"'+value+'"';
case"number":return isFinite(value)?String(value):"null";
case"boolean":case"null":return String(value);
case"object":if(!value){return"null"
}if(typeof value.toJSON==="function"){return stringify(value.toJSON())
}a=[];
if(typeof value.length==="number"&&!(value.propertyIsEnumerable("length"))){l=value.length;
for(i=0;
i<l;
i+=1){a.push(stringify(value[i],whitelist)||"null")
}return"["+a.join(",")+"]"
}if(whitelist){l=whitelist.length;
for(i=0;
i<l;
i+=1){k=whitelist[i];
if(typeof k==="string"){v=stringify(value[k],whitelist);
if(v){a.push(stringify(k)+":"+v)
}}}}else{for(k in value){if(typeof k==="string"){v=stringify(value[k],whitelist);
if(v){a.push(stringify(k)+":"+v)
}}}}return"{"+a.join(",")+"}"
}}var blacklistType=[];
if(window.HTMLDocument){blacklistType.push(HTMLDocument)
}if(window.XMLDocument){blacklistType.push(XMLDocument)
}if(window.Document){blacklistType.push(Document)
}function stringify_safe(value,opts,depth){try{var a,i,k,l,r=/["\\\x00-\x1f\x7f-\x9f]/g,v;
opts=opts||{};
opts.blacklist=opts.blacklist||["responseXML"];
opts.start_time=opts.start_time||(new Date());
opts.width=opts.width||1;
depth=depth||1;
switch(typeof value){case"string":return r.test(value)?'"'+value.replace(r,function(a){var c=m[a];
if(c){return c
}c=a.charCodeAt();
return"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16)
})+'"':'"'+value+'"';
case"number":return isFinite(value)?String(value):"null";
case"boolean":case"null":return String(value);
case"object":if(!value){return"null"
}if(typeof value.toJSON==="function"){return stringify_safe(value.toJSON(),opts,depth)
}a=[];
depth+=1;
opts.width+=1;
if(depth>(opts.max_depth||12)){return'"<TooDeep>"'
}if(opts.width>(opts.max_width||(1000))){return'"<TooWide>"'
}if((new Date())-opts.start_time>(opts.max_calculation_time||(5000))){return'"<MaxCalcutionTime>"'
}if(value.nodeType){return stringify_safe($(value))
}if(value.jquery){return stringify({id:value.attr("id"),class_:value.attr("class"),inner_html:value.html()})
}if(typeof value.length==="number"&&!(value.propertyIsEnumerable&&value.propertyIsEnumerable("length"))){l=Math.min(value.length,opts.max_length||1000);
for(i=0;
i<l;
i+=1){a.push(stringify_safe(value[i],opts,depth)||"null")
}return"["+a.join(",")+"]"
}for(k in value){if((new Date())-opts.start_time>(opts.max_calculation_time||(5000))){return'"<MaxCalcutionTime>"'
}if(typeof k==="string"){try{if(value[k]&&value[k].constructor&&blacklistType.include(value[k].constructor)){v='"<'+value[k].constructor+'>"'
}else{if(opts.blacklist&&opts.blacklist.include(k)){v='"<BlacklistedProperty>"'
}else{if(k=="xhr"){v=stringify_safe({status:value[k].status,readyState:value[k].readyState,responseText:value[k].responseText,timeout:value[k].timeout},opts,depth)
}else{v=stringify_safe(value[k],opts,depth)
}}}}catch(exp){v='"<UnreadableProperty '+(exp.toString())+'>"'
}if(v){a.push(stringify(k)+":"+v)
}}}return"{"+a.join(",")+"}";
case"undefined":return'"<undefined>"';
case"function":return null;
default:return'"<UnstringifiableType '+(typeof value)+'>"'
}}catch(expp){return'"<UnstringifiableType '+value.constructor+' >"'
}}return{stringify_safe:stringify_safe,stringify:stringify,parse:function(text,filter){var j;
function walk(k,v){var i,n;
if(v&&typeof v==="object"){for(i in v){if(Object.prototype.hasOwnProperty.apply(v,[i])){n=walk(i,v[i]);
if(n!==undefined){v[i]=n
}}}}return filter(k,v)
}if(/^[\],:{}\s]*$/.test(text.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(:?[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");
return typeof filter==="function"?walk("",j):j
}throw new SyntaxError("parseJSON")
}}
}()
}}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/json",exp)
},window.dbg?0:1000)
}try{function getFlashVersion(){var version="",n=navigator;
if(n.plugins&&n.plugins.length){for(var plugin_no=0;
plugin_no<n.plugins.length;
plugin_no++){if(n.plugins[plugin_no].name.indexOf("Shockwave Flash")!=-1){version=n.plugins[plugin_no].description.split("Shockwave Flash ")[1];
break
}}}else{if(window.ActiveXObject){for(var plugin_no=10;
plugin_no>=2;
plugin_no--){try{if(eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash."+plugin_no+"');")){version=plugin_no;
break
}}catch(e){}}}}return version
}function checkCompatibility(){var b=[];
if(screen.width<1024||screen.height<700){b.push("screen")
}if(($.browser.msie&&$.browser.version<7)||($.browser.msie&&$.browser.version>=9)||($.browser.safari&&$.browser.version<400)||($.browser.opera&&$.browser.version<9)||($.browser.opera&&$.browser.version>=9.5)||($.browser.mozilla&&$.browser.version<1.8)){b.push("browser")
}var a=getFlashVersion();
if(a==""){a="0"
}if(parseFloat(a)<9){b.push("flash")
}return b
}}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/check_compatibility",exp)
},window.dbg?0:1000)
}try{$(window).unload(function(){if(window.page_log==undefined){window.page_log=[]
}window.page_log.push([new Date(),"Window unload event"])
});
var AjaxQueue=Class.create();
AjaxQueue.prototype={initialize:function(a){this.url=a.url;
this.id=a.initial_id||0;
this.delay_between_requests=a.delay_between_requests||5000;
this.global_data=a.global_data||{};
this.queue_size_limit=a.queue_size_limit||500000;
this.debug=a.debug||false;
this.success=a.success||null;
this.send_delay=a.send_delay||0;
this.queue=[];
this.request_pending=false;
this.last_request_time=null;
this.unsuccessfull_request=0
},send:function(b){if(this.debug){this.queue.push({date:new Date(),page_log:page_log,data:b,id:this.id})
}else{this.queue.push({date:new Date(),data:b,id:this.id})
}this.id+=1;
var a=this;
if(this.send_delay>0){setTimeout(function(){a._dequeue()
},this.send_delay)
}else{this._dequeue()
}},_dequeue:function(){if(!this.request_pending&&this.queue.length>0){var d;
var a=this;
if(this.last_request_time&&(d=((new Date())-this.last_request_time)-this.delay_between_requests)<0){setTimeout(function(){a._dequeue()
},-d)
}else{this.last_request_time=new Date();
this.request_pending=true;
var b=this.queue;
this.queue=[];
var c={global_data:this.global_data,items:b};
if(this.debug){c.unsuccessfull_request=this.unsuccessfull_request;
c.request_time=this.last_request_time;
c=JSON_.stringify_safe(c)
}else{c=JSON_.stringify(c)
}if(c.length>this.queue_size_limit){dbg.error("AjaxQueue data too big, truncated to 100000 characters",c.substr(0,100000));
this.request_pending=false;
this._dequeue();
return
}jQuery.ajax({url:this.url,simple_ajax:true,type:"POST",contentType:"application/json",data:c,cache:false,timeout:120000,success:this.success,complete:function(e){a.request_pending=false;
a._dequeue()
},error:function(j,g,h){a.unsuccessfull_request+=1;
if(a.debug){dbg.error("AjaxQueue request failed",{queue:a.url,xhr:j,status:g,e:h,request_time:a.last_request_time})
}if(a.delay_between_requests<30000){a.delay_between_requests+=5000
}a.queue=b.concat(a.queue)
}})
}}}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/ajax_queue",exp)
},window.dbg?0:1000)
}try{(function(h){var g={};
try{g.cookie=document.cookie
}catch(d){g.cookie="Not Readable"
}try{g.screen=[screen.width,screen.height]
}catch(c){g.screen="Not Readable"
}try{g.flash=getFlashVersion()
}catch(c){g.flash="Not Readable"
}try{g.location=document.location.href
}catch(b){g.location="Not Readable"
}try{g.referer=document.referrer
}catch(a){g.referer="Not Readable"
}var e=new AjaxQueue({url:"/log/js_exception",debug:true,global_data:g});
window.onerror=function(m,l,n){if(!(typeof l=="string"&&l.match(/google-analytics|^chrome:/))){var p={};
try{p.url=l
}catch(k){}try{p.line_no=n
}catch(j){}try{h.ajax({simple_ajax:true,url:p.url,success:function(t){var q=t.split("\n");
p.source=t.substr(0,2000);
if(n!=0){var s=n-1
}try{p["line "+(n-1)]=q[s-1]
}catch(u){}try{p["line "+n]=q[s]
}catch(u){}try{p["line "+(n+1)]=q[s+1]
}catch(u){}e.send(["window_onerror",[m,p]])
},error:function(t,s,q){p.source="unreadable";
p.reason_unreadable_source={xhr:t,error:s,exp:q};
e.send(["window_onerror",[m,p]])
}})
}catch(o){dbg.error(m+" (Not dumped content)",{error:m,url:l,code:n,undumpable_exeption:o})
}}};
dbg={error:function(){e.send(["debug_error",arguments]);
console.error(JSON_.stringify_safe(arguments))
},log:function(){e.send(["debug_log"].concat(arguments))
},client_infos:g};
jQuery.log=function(l,k,m){if(!m){m=Object.extend({date:new Date(),notry:1,logged_infos:k},g)
}else{m.notry+=1
}JSON_.stringify_safe(m);
var j={url:"/log/"+l,simple_ajax:true,type:"POST",dataType:"text",contentType:"application/json",data:JSON_.stringify_safe(m),cache:false,error:function(){setTimeout(function(){jQuery.log(l,k,m)
},5000)
}};
h.ajax(j)
}
})(jQuery)
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/error_log",exp)
},window.dbg?0:1000)
}try{if(!("console" in window)||!("log" in console)){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];
window.console={};
for(var i=0;
i<names.length;
++i){window.console[names[i]]=function(){}
}}}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in lib/firebug/firebugx.js",exp)
},window.dbg?0:1000)
}try{jQuery.fn.enableImg=function(a){return this.each(function(){if(a==null){a=true
}var b=this.src.match(/^(.*\/)dis-(.*)/);
if(b&&a){this.src=b[1]+b[2]
}else{if(!b&&!a){var c=this.src.match(/^(.*\/)(.*)/);
this.src=c[1]+"dis-"+c[2]
}}})
};
jQuery.fn.setImage=function(d,b,e,k){if(e==null){e=Math.min(b,d.width);
k=true
}if(k){var a=parseInt(d.width*Math.min(e,d.height)/d.height);
b=Math.min(b,d.width);
if(a>=b){e=parseInt(d.height*b/d.width)
}else{b=a
}}var c=Math.max(b,e);
var j;
var g=(/flickr\.com/.test(d.url))?[100,240]:[150,300];
if(c>g[1]||(d.width==b&&d.height==e)){j=d.url
}else{if(c>g[0]){j=d.thumbnails.normal
}else{j=d.thumbnails.small
}}return this.each(function(){try{this.src=j;
this.style.width=b+"px";
this.style.height=e+"px"
}catch(h){dbg.error("Can not set Image size.",{error:h,w:b,h:e})
}})
};
jQuery.fn.setFlash=function(d,a,g){var b=d.url;
var e=function(){return"__setFlash"+parseInt(Math.random()*1000000)
};
var j=e();
while($("#"+j).length>0){j=e()
}var c=new FlashObject(b,j,a,g,"7","transparent");
c.addParam("scale","scale");
c.addParam("wmode","transparent");
c.addVariable("lzproxied","false");
c.write(this[0]);
return j
};
jQuery.fn.setVideo=function(e,a,j,d){if(!d){d={}
}var b=e.url;
var g=function(){return"__setVideo"+parseInt(Math.random()*1000000)
};
var k=g();
while($("#"+k).length>0){k=g()
}if(b.match(/youtube/i)){b+="&fs=1&showsearch=0&rel=0";
if(d.autoplay){b+="&autoplay=1"
}var c=new FlashObject(b,k,a,j,"7","transparent");
c.addParam("allowfullscreen","true");
c.addParam("quality","high");
c.addParam("scale","scale");
c.addParam("wmode","transparent");
if(d.autoplay){c.addParam("autoplay","1")
}c.write(this[0])
}return k
};
jQuery.fn.sizeload=function(a,b){var c=this;
return this.each(function(){var j=0;
var g=100;
var h=20000/g;
var e=this;
if(this.tagName=="IMG"){$(this).addClass("noHTC");
var d=setInterval(function(){j++;
if(e.width>0&&e.height>0){clearInterval(d);
var k=e.width;
var l=e.height;
$(e).removeClass("noHTC");
a.apply(e,[k,l])
}else{if(j>h){clearInterval(d);
$(e).removeClass("noHTC");
if(b){b.apply(e)
}}}},g)
}else{var d=setInterval(function(){var k=0;
var l=0;
try{k=e.TGetProperty("/",8);
l=e.TGetProperty("/",9)
}catch(m){dbg.error("TGetProperty Error")
}j++;
if(k>0&&l>0){clearInterval(d);
a.call(e,k,l)
}else{if(j>h){clearInterval(d);
if(b){b.apply(e)
}}}},g)
}})
};
jQuery.fn.returnKey=function(a){return this.each(function(){$(this).bind("keypress",function(c){try{var b;
if(c&&c.which){c=c;
b=c.which
}else{if(typeof event!="undefined"){c=event;
b=c.keyCode
}}if(b==13){a();
return false
}}catch(c){}})
})
};
jQuery.fn.rememberFocus=function(){return this.each(function(){$(this).focus(function(){this.focused=true
}).blur(function(){this.focused=false
})
})
};
jQuery.fn.positionFixed=function(){var a=this[0];
while(a){if($(a).css("position")=="fixed"){return true
}a=a.offsetParent
}return false
};
jQuery.fn.emptyDom=function(){return this.each(function(){while(this.firstChild){this.removeChild(this.firstChild)
}})
};
jQuery.fn.appendStyle=function(a){var b=null;
if(""!=$.trim(a)){b=$("head",this).append("<style>"+a+"</style>").find("style:last");
if($.browser.safari){b.append(" ")
}}return b
};
jQuery.fn.highlight=function(c){var b=10,d=500;
c=c||5000;
for(var a=0;
a<c;
a+=b+d){this.fadeOut(b).fadeIn(d)
}return this
};
jQuery.inViewPort=function(c,b){var d=[{left:c.left,top:c.top},{left:c.left+c.width,top:c.top},{left:c.left+c.width,top:c.top+c.height},{left:c.left,top:c.top+c.height}];
var a=b||{top:$(window).scrollTop(),left:$(window).scrollLeft(),bottom:$(window).scrollTop()+$(window).height(),right:$(window).scrollLeft()+$(window).width()};
ret=d.find(function(g){return(g.left<a.left||g.top<a.top||g.top>a.bottom||g.left>a.right)
})==null;
return ret
};
jQuery.intersect=function(b,a){return((b.left+b.width>a.left)&&(b.top+b.height>a.top)&&(b.left<a.left+a.width)&&(b.top<a.top+a.height))
};
jQuery.positionAround=function(g,c,h,d){var b=(h||0);
var e={};
if(g.top){if($.inViewPort(g,d)){e={top:g.top,left:g.left}
}else{e={top:d.bottom-g.height,left:d.right-g.width}
}}else{e={top:c.y+20,left:c.x+20}
}var a=false;
do{switch(b){case 0:case 13:g.left=c.x+Math.floor(c.w/2-g.width/2);
g.top=c.y+c.h;
break;
case 1:case 12:g.left=c.x+Math.floor(c.w/2-g.width/2);
g.top=c.y-g.height;
break;
case 2:g.left=c.x-g.width;
g.top=c.y+c.h;
break;
case 3:g.left=c.x+c.w;
g.top=c.y+c.h;
break;
case 4:g.left=c.x+c.w;
g.top=c.y-g.height;
break;
case 5:g.left=c.x-g.width;
g.top=c.y-g.height;
break;
case 6:g.left=0;
g.top=0;
break;
case 10:g.left=c.x-g.width;
g.top=c.y;
break;
case 11:g.left=c.x+c.w;
g.top=c.y;
break;
default:g.left=e.left;
g.top=e.top;
a=true
}b++
}while(!$.inViewPort(g,d)&&!a);
return{top:g.top,left:g.left}
};
jQuery.fn.restrictTo=function(e,c,a,d,g,b){return this.each(function(){var j=$(this);
var h=$.browser;
if(!b){b="change blur";
if(h.safari||h.msie){b+=" paste"
}b+=" "+(h.mozilla?"input dragdrop":"keypress")
}switch(e){case"int":if(!c){c=0
}if(!a){a=999999
}j.unbind(b).bind(b,function(l){var k=$(this);
setTimeout(function(){var n=parseInt(k.val().replace(/[^0-9]/g,"").replace(/^0*/,"")||0);
var m=n;
if(d){d.apply(k,[n,c,a])
}if(n<c){n=c
}if(n>a){n=a
}k.val(n);
if(g){g.apply(k,[n,c,a])
}},0)
});
break;
case"price":if(!c){c=0
}if(!a){a=999999.99
}j.unbind(b).bind(b,function(m){var k=$(this);
var o=parseFloat(k.attr("min"))||c;
var l=parseFloat(k.attr("max"))||a;
var n=(m.type=="input"||m.type=="keypress"||m.type=="paste");
setTimeout(function(){var w=0;
var t=k.val().replace(/,/g,".").replace(/\.{2,}/g,".");
if(t.match(/^0.+\./)){w=-1;
t=t.replace(/^0/,"")
}var u=parseFloat(t.replace(/[^0-9.]/g,""))||0;
u=parseInt(u*100+0.001)/100;
if(d){d.apply(k,[u,o,l])
}if(u<o){u=o
}if(u>l){u=l
}var q=sprintf("%.2f",u);
if(n){if(t.length!=q.length&&(w!=0||sprintf("%.2f",parseFloat(t))!=q)){while(t.charAt(w)&&q.charAt(w)&&t.charAt(w)==q.charAt(w)){w++
}}else{w+=k.caret().begin
}}k.val(q);
if(g){g.apply(k,[u,o,l])
}if(n){k.caret(w)
}},0)
})
}})
};
jQuery.fn.caret=function(c,a){try{if(this.length==0){return
}if(typeof c=="number"){a=(typeof a=="number")?a:c;
return this.each(function(){if(this.setSelectionRange){this.focus();
this.setSelectionRange(c,a)
}else{if(this.createTextRange){var e=this.createTextRange();
e.collapse(true);
e.moveEnd("character",a);
e.moveStart("character",c);
e.select()
}}})
}else{if(this[0].setSelectionRange){c=this[0].selectionStart;
a=this[0].selectionEnd
}else{if(document.selection&&document.selection.createRange){var b=document.selection.createRange();
c=0-b.duplicate().moveStart("character",-100000);
a=c+b.text.length
}}return{begin:c,end:a}
}}catch(d){console.error(d);
return{begin:0,end:0}
}};
jQuery.fn.collect=Array.prototype.collect;
jQuery.fn.to_a=function(){return jQuery.makeArray(this)
};
jQuery.fn.hash_size=function(c){var b=0,a;
for(a in c){if(c.hasOwnProperty(a)){b++
}}return b
};
jQuery.fn.hash_to_a=function(b,d){var c=[],a;
for(a in b){if(b.hasOwnProperty(a)){c.push(d?d(a):a)
}}return c
};
jQuery.fn.scrollIntoView=function(){try{this[0].scrollIntoView("true")
}catch(a){dbg.error("Can not scrollIntoView")
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/jquery",exp)
},window.dbg?0:1000)
}try{var tb_pathToImage="http://st1.sitew.org/images/loadingAnimation.gif?1202218600";
var flash_objects;
imgLoader=new Image();
imgLoader.src=tb_pathToImage;
/*!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/
$(document).ready(function(){tb_init("a.thickbox, area.thickbox, input.thickbox")
});
function tb_init(a){$(a).click(function(){var c=this.title||this.name||null;
var b=this.href||this.alt;
var d=this.rel||false;
tb_show(c,b,d);
this.blur();
return false
})
}function tb_show(s,b,g){flash_objects=flash_objects||$("object:not(#sm2movieembed,#SWFUpload_0)").parent().filter(":visible");
flash_objects.hide();
if(typeof document.body.style.maxHeight==="undefined"){$("body","html").css({height:"100%",width:"100%"});
$("html").css("overflow","hidden");
if(document.getElementById("TB_HideSelect")===null){$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove)
}}else{if(document.getElementById("TB_overlay")===null){$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
$("#TB_overlay").click(tb_remove)
}}if(tb_detectMacXFF()){$("#TB_overlay").addClass("TB_overlayMacFFBGHack")
}else{$("#TB_overlay").addClass("TB_overlayBG")
}if(s===null){s=""
}$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");
$("#TB_load").show();
decoration=$("<div class=tb_tl></div><div class=tb_t></div><div class=tb_tr></div><div class=tb_l></div><div class=tb_c></div><div class=tb_r></div><div class=tb_bl></div><div class=tb_b></div><div class=tb_br></div>");
if(g){TB_PrevHTML="";
TB_NextHTML="";
TB_imageCount="";
TB_FoundURL=false;
TB_TempArray=g;
if(b<g.length-1){TB_NextHTML='<div id="TB_next"></div>'
}if(b>0){TB_PrevHTML='<div id="TB_prev"></div>'
}var d=tb_getPageSize();
var q=d[0]-150;
var o=d[1]-150;
var h=g[b].height;
var l=g[b].width;
if(l>q){h=h*(q/l);
l=q;
if(h>o){l=l*(o/h);
h=o
}}else{if(h>o){l=l*(o/h);
h=o;
if(l>q){h=h*(q/l);
l=q
}}}TB_WIDTH=Math.max(300,l+30);
TB_HEIGHT=h+30;
$("#TB_window").append(decoration).find("div.tb_c").append("<div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton'><img src='http://st3.sitew.org/images/icons/close.gif?1202833765'></a></div><center><a href='' id='TB_ImageOff'></a></center><div>"+TB_imageCount+TB_PrevHTML+TB_NextHTML+"</div>");
if(!g[b].url.match(/\.swf$/)){$("#TB_ImageOff").append("<img id='TB_Image' src='"+g[b].url+"' width='"+l+"' height='"+h+"'/>")
}else{var k=new FlashObject(g[b].url,"TB_ImageOff",l,h,"7","transparent");
k.addParam("scale","scale");
k.addParam("wmode","transparent");
k.addVariable("lzproxied","false");
k.write("TB_ImageOff")
}if(typeof s=="object"){Misc.poll(function(){return s.list[b]!=undefined
},function(){if(s.list[b]){$("<div class=tb_image_description>").text(s.list[b]).insertAfter($("#TB_ImageOff"))
}})
}$("#TB_window div.tb_t,#TB_window div.tb_b,#TB_window div.tb_c").width(TB_WIDTH);
$("#TB_window div.tb_l,#TB_window div.tb_r,#TB_window div.tb_c").height(TB_HEIGHT);
$("#TB_closeWindowButton").click(tb_remove);
if(!(TB_PrevHTML==="")){function j(){if($(document).unbind("click",j)){$(document).unbind("click",j)
}$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(s,b-1,g);
return false
}$("#TB_prev").click(j)
}if(!(TB_NextHTML==="")){function p(){$("#TB_window").remove();
$("body").append("<div id='TB_window'></div>");
tb_show(s,b+1,g);
return false
}$("#TB_next").click(p)
}document.onkeydown=function(t){if(t==null){keycode=event.keyCode
}else{keycode=t.which
}if(keycode==27){tb_remove()
}else{if(keycode==190){if(!(TB_NextHTML=="")){document.onkeydown="";
p()
}}else{if(keycode==188){if(!(TB_PrevHTML=="")){document.onkeydown="";
j()
}}}}};
tb_position();
$("#TB_load").remove();
if(!(TB_NextHTML=="")){$("#TB_ImageOff").click(p)
}else{$("#TB_ImageOff").click(tb_remove)
}$("#TB_window").css({display:"block"});
tbimgPreloaderList=[];
if(TB_NextHTML!=""){var n=new Image();
n.src=g[b+1].url;
tbimgPreloaderList.push(n)
}if(TB_PrevHTML!=""){var m=new Image();
m.src=g[b-1].url;
tbimgPreloaderList.push(m)
}}else{var a=b.replace(/^[^\?]+\??/,"");
var c=tb_parseQuery(a);
TB_WIDTH=(c.width*1)+30||630;
TB_HEIGHT=(c.height*1)+40||440;
ajaxContentW=TB_WIDTH-30;
ajaxContentH=TB_HEIGHT-50;
if(b.indexOf("TB_iframe")!=-1){urlNoQuery=b.split("TB_");
$("#TB_iframeContent").remove();
if(c.modal!="true"){$("#TB_window").append(decoration).find(".tb_c").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+s+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' >Close</a></div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+30)+"px;height:"+(ajaxContentH+17)+"px;' > </iframe>")
}else{$("#TB_overlay").unbind();
$("#TB_window").append(decoration).find(".tb_c").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW+29)+"px;height:"+(ajaxContentH+17)+"px;'> </iframe>")
}}else{if($("#TB_window").css("display")!="block"){if(c.modal!="true"){$("#TB_window").append(decoration).find(".tb_c").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+s+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>Close</a></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>")
}else{$("#TB_overlay").unbind();
$("#TB_window").append(decoration).find(".tb_c").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+(ajaxContentH+17)+"px;'></div>")
}}else{$("#TB_ajaxContent")[0].style.width=ajaxContentW+"px";
$("#TB_ajaxContent")[0].style.height=ajaxContentH+"px";
$("#TB_ajaxContent")[0].scrollTop=0;
$("#TB_ajaxWindowTitle").html(s)
}}var e=($("#TB_ajaxContent").length!=0)?$("#TB_ajaxContent"):$("#TB_iframeContent");
$("#TB_window div.tb_t,#TB_window div.tb_b").width(TB_WIDTH);
$("#TB_window div.tb_l,#TB_window div.tb_r,#TB_window div.tb_c").height(TB_HEIGHT);
$("#TB_closeWindowButton").click(tb_remove);
if(b.indexOf("TB_inline")!=-1){$("#TB_ajaxContent").append($("#"+c.inlineId).children());
$("#TB_window").unload(function(){$("#"+c.inlineId).append($("#TB_ajaxContent").children())
});
tb_position();
$("#TB_load").remove();
$("#TB_window").css({display:"block"});
if(c.tb_top&&c.tb_left){$("#TB_window").css({top:c.tb_top+"px",left:c.tb_left+"px",margin:0,position:"absolute"})
}if(c.tb_background){$("#TB_overlay").css("background-color",c.tb_background)
}}else{if(b.indexOf("TB_iframe")!=-1){tb_position();
if($.browser.safari){$("#TB_load").remove();
$("#TB_window").css({display:"block"})
}}else{$("#TB_ajaxContent").load(b+="&random="+(new Date().getTime()),function(){tb_position();
$("#TB_load").remove();
tb_init("#TB_ajaxContent a.thickbox");
$("#TB_window").css({display:"block"})
})
}}}if(c&&!c.modal){document.onkeyup=function(t){if(t==null){keycode=event.keyCode
}else{keycode=t.which
}if(keycode==27){tb_remove()
}}
}}function tb_showIframe(){$("#TB_load").remove();
$("#TB_window").css({display:"block"})
}function tb_remove(a){if(flash_objects){flash_objects.show();
flash_objects=null
}$("#TB_imageOff").unbind("click");
$("#TB_closeWindowButton").unbind("click");
if(a){$("#TB_window").hide();
$("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove()
}else{$("#TB_window").fadeOut("fast",function(){$("#TB_window,#TB_overlay,#TB_HideSelect").trigger("unload").unbind().remove()
})
}$("#TB_load").remove();
if(typeof document.body.style.maxHeight=="undefined"){$("body","html").css({height:"auto",width:"auto"});
$("html").css("overflow","");
$("html").hide().show()
}document.onkeydown="";
document.onkeyup="";
return false
}function tb_position(){$("#TB_window").css({marginLeft:"-"+parseInt((TB_WIDTH/2),10)+"px",width:TB_WIDTH+"px"});
if(!(jQuery.browser.msie&&jQuery.browser.version<7)){$("#TB_window").css({marginTop:"-"+parseInt((TB_HEIGHT/2),10)+"px"})
}}function tb_parseQuery(d){var e={};
if(!d){return e
}var a=d.split(/[;&]/);
for(var c=0;
c<a.length;
c++){var h=a[c].split("=");
if(!h||h.length!=2){continue
}var b=unescape(h[0]);
var g=unescape(h[1]);
g=g.replace(/\+/g," ");
e[b]=g
}return e
}function tb_getPageSize(){var c=document.documentElement;
var a=window.innerWidth||self.innerWidth||(c&&c.clientWidth)||document.body.clientWidth;
var b=window.innerHeight||self.innerHeight||(c&&c.clientHeight)||document.body.clientHeight;
arrayPageSize=[a,b];
return arrayPageSize
}function tb_detectMacXFF(){var a=navigator.userAgent.toLowerCase();
if(a.indexOf("mac")!=-1&&a.indexOf("firefox")!=-1){return true
}}}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in thickbox",exp)
},window.dbg?0:1000)
}try{var SignalController=Class.create();
SignalController.prototype={initialize:function(){this.functionMap={};
this.idMap={};
this.results={}
},emit:function(a){if(this.functionMap[a]){for(var b=0;
b<this.functionMap[a].length;
b++){this.safeCall(this.functionMap[a][b],arguments)
}}},safeCall:function(c,b){try{c.apply(this,b)
}catch(d){data={exp:d,arguments:b};
try{data.function_name=c.name
}catch(a){}try{data.function_code=c.toString()
}catch(a){}dbg.error("Exception in signal receiver",data)
}},emitVariable:function(a){if(this.results[a]==undefined){this.emit.apply(this,arguments);
this.results[a]=arguments
}},getVariable:function(b,a){if(this.results[b]!=undefined){this.safeCall(a,this.results[b])
}else{this.connect(b,a)
}},connect:function(b,a,c){if(!this.functionMap[b]){this.functionMap[b]=new Array();
this.idMap[b]=new Array()
}this.functionMap[b].push(a);
this.idMap[b].push(c)
},disconnect:function(b,c){if(typeof c=="function"){var a=this.functionMap[b].indexOf(c)
}else{var a=this.idMap[b].indexOf(c)
}this.functionMap[b].splice(a,1);
this.idMap[b].splice(a,1)
}};
sigCtl=new SignalController();
var Signal=Class.create();
Signal.prototype={initialize:function(a){this.id=a
},connect:function(b,a){sigCtl.connect(b,a,this.id)
},disconnect:function(a){sigCtl.disconnect(a,this.id)
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/signal_controller",exp)
},window.dbg?0:1000)
}try{if($.browser.msie&&$.browser.version.substring(0,1)=="6"){var isIE6=true
}else{var isIE6=false
}var Misc={poll:function(j,a,d){if(j()){a.apply(b)
}else{var h=0;
var c=100;
var g=20000/c;
var b=this;
var e=setInterval(function(){h++;
if(j()){clearInterval(e);
a.apply(b)
}else{if(h>g){clearInterval(e);
if(d){d.apply(b)
}}}},c)
}},pollVariable:function(b,a,c){this.poll(function(){return window[b]!=undefined
},a,c)
},deepCloneObj:function(myObj){eval("var f="+JSON_.stringify(myObj));
return f
},deferred_timers:[],deferred_timers_2:[],deferred:function(e,d,c,b){b=b||e;
c=c||10000;
d=d||1000;
var a=this.deferred_timers_2.find(function(g){return g[0]==b
});
if(a&&(new Date()-a[2])>c){a[2]=new Date()
}else{if(a){clearTimeout(a[1])
}else{a=[b,null,new Date()];
this.deferred_timers_2.push(a)
}}a[1]=setTimeout(e,d)
},deferred_method:function(c,d,b){b=b||1000;
var a=this.deferred_timers.find(function(g){return g[1]==d&&g[0]==c
});
if(a){clearTimeout(a[2])
}else{a=[c,d,null];
this.deferred_timers.push(a)
}a[2]=setTimeout(function(){d.apply(c)
},b)
},_nbr_try:{},try_forever:function(a){try{a()
}catch(b){this._nbr_try[a]=this._nbr_try[a]||0;
this._nbr_try[a]+=1;
if(this._nbr_try[a]==100){dbg.error("Misc.try_forever: still does not succed after 100 try",{exp:b,func:a.toString()})
}setTimeout(function(){Misc.try_forever(a)
},100)
}}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/misc",exp)
},window.dbg?0:1000)
}try{var ga_loaded=false;
function googleAnalytics(b,a){if(!ga_loaded){ga_loaded=true;
setTimeout(function(){$.ajax({url:"http://www.google-analytics.com/ga.js",dataType:"script",cache:true,simple_ajax:true});
googleAnalytics(b,a)
},1000)
}else{Misc.pollVariable("_gat",function(){if(b=="viewer"){$.cookie("__utmv",null);
var d=_gat._getTracker("UA-3091699-6");
d._setVar(document.referrer);
if(v.selectedPageFg){d._trackPageview(v.selectedPageFg.getUrl())
}sigCtl.connect("Version.hashChanged",function(e,g){d._trackPageview(g.getUrl())
});
if(a){var c=_gat._getTracker(a);
c._trackPageview(v.selectedPageFg.getUrl());
sigCtl.connect("Version.hashChanged",function(e,g){c._trackPageview(g.getUrl())
})
}}else{if(!googleAnalytics.pageTracker){googleAnalytics.pageTracker=_gat._getTracker("UA-3091699-2")
}if(b.match(/^goal/)){googleAnalytics.pageTracker._trackPageview(b)
}else{if(document.referrer&&(ref=document.referrer.match(/^http:\/\/([^\/]+)/))){googleAnalytics.pageTracker._setCustomVar(1,"referrer_domain",ref[1],2)
}googleAnalytics.pageTracker._trackPageview()
}}})
}}googleAnalytics.event=function(b,c,a,e){var d=arguments;
Misc.poll(function(){return googleAnalytics.pageTracker
},function(){googleAnalytics.pageTracker._trackEvent.apply(this,d)
})
}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/google_analytics",exp)
},window.dbg?0:1000)
}try{$().ready(function(){$("a.sitew,span.sitew").html("<a href='http://www.en.sitew.com' style='text-decoration:none'><span style='color:#0F85A9;font-weight:600'>Site</span><span style='color:#fc6800;font-weight:800'>W</span></a>")
})
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/seo",exp)
},window.dbg?0:1000)
}try{(function(c){var b=false;
var a=[];
jQuery.ori_ajax=jQuery.ajax;
jQuery.ajaxSettings.timeout=60000;
jQuery.full_ajax=function(g){if(g.contentType=="json"){g.contentType="application/json";
g.data=JSON_.stringify(g.data)
}if(g.simple_ajax){return jQuery.ori_ajax(g)
}var h=new ProgressController(g.name||sprintf("Loading %s",g.url));
g.progress_handler=h;
var e=0;
var j=g.error_to_json?g.success:g.error;
g.time_of_request=new Date();
var d=g.success;
g.success=function(l,k){try{h.update(80);
if(d){d(l,k)
}h.update(100)
}catch(m){h.update(100);
dbg.error("Exception in Ajax success method",{exeption:m,request:g,result_data:l,result_status:k})
}};
g.error=function(m,k,l){h.paused=true;
e+=1;
a.push({request:g,callback:j,xhr:m,status:k,exp:l,progressHandler:h});
if(b){return
}b=true;
if(k=="timeout"){mess="Sorry, a connection timeout problem occurred. Please, check your Internet connection.";
jQuery.ajaxSettings.timeout=60000+(e)*20000
}else{if(k=="parsererror"){mess="Sorry, data received from the server is incorrect.";
dbg.error("Ajax parsererror",{xhr:m,request:g})
}else{if(typeof m.status!="undefined"){if(m.status==401){mess='Sorry, you have been logged out, you should login <a href=\'/site/login\' onclick=\'window.open("/site/login?type=popup","login","menubar=no, status=no, scrollbars=no, menubar=no, width=400, height=400");return false;\' target=_blank>here</a> before retrying.'
}else{if(m.status==500){mess="Sorry, a problem occurred on the server, Please retry later or reload this page by hitting F5."
}else{if(m.status==502){mess="Sorry, your proxy has some problems connecting with our servers. Please retry in few seconds."
}else{if(m.status==503){mess="Please wait few seconds between searches."
}else{if(m.status==0||m.status>10000){mess="Sorry, a network communication error occurred. Please check your Internet connection."
}else{mess="Sorry, an unexpected network communication error occurred. Retry and if the problem persist, try reloading this page by hitting F5.";
dbg.error("Ajax error with not managed status code",{xhr:m,request:g})
}}}}}}else{mess="Sorry, an unexpected problem occurred while communicating with the server. Retry and if the problem persist, try reloading this page by hitting F5.";
dbg.error("Ajax error with no error code",{xhr:m,request:g})
}}}cancel_ajax=function(n){if(!g.autoretry){statusController.hide()
}if(!g.noDbg){dbg.error("User cancelled "+a.length+" requests after "+(e)+" try",a)
}a.each(function(o){try{o.progressHandler.update(80);
if(o.request.error_to_json&&o.callback){o.callback({errors:[o.status]},o.status)
}else{if(o.callback){o.callback(o.xhr,o.status,o.exp)
}}}catch(p){dbg.error("Exception on an ajax error callback",{request:o,exp_catched:p})
}finally{o.progressHandler.update(100)
}});
a=[];
b=false
};
retry_ajax=function(){if(!g.autoretry){statusController.hide()
}b=false;
a.each(function(n){n.progressHandler.update(0);
jQuery.ori_ajax(n.request)
});
a=[]
};
if(g.autoretry&&e<g.autoretry){setTimeout(function(){retry_ajax()
},5000+(e)*5000)
}else{if(g.autoretry){sigCtl.emit("Ajax.allRetryFailed");
cancel_ajax()
}else{statusController.message(mess+"<br><a href='#' onclick='retry_ajax()'>Retry</a> <a href='#' onclick='cancel_ajax()'>Cancel</a>","warning",-1,10)
}}};
return jQuery.ori_ajax(g)
}
})(jQuery)
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/jquery_ajax_common",exp)
},window.dbg?0:1000)
}try{var ProgressController=Class.create();
ProgressController.prototype={initialize:function(a){},update:function(a,b){}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/progress_controller_stub",exp)
},window.dbg?0:1000)
}try{jQuery.iUtil={getPosition:function(h){var a=0;
var k=0;
var j=h.style;
var g=false;
if(jQuery(h).css("display")=="none"){var b=j.visibility;
var d=j.position;
g=true;
j.visibility="hidden";
j.display="block";
j.position="absolute"
}var c=h;
while(c){a+=c.offsetLeft+(c.currentStyle&&!jQuery.browser.opera?parseInt(c.currentStyle.borderLeftWidth)||0:0);
k+=c.offsetTop+(c.currentStyle&&!jQuery.browser.opera?parseInt(c.currentStyle.borderTopWidth)||0:0);
c=c.offsetParent
}c=h;
while(c&&c.tagName&&c.tagName.toLowerCase()!="body"){a-=c.scrollLeft||0;
k-=c.scrollTop||0;
c=c.parentNode
}if(g==true){j.display="none";
j.position=d;
j.visibility=b
}return{x:a,y:k}
},getPositionLite:function(b){var a=0,c=0;
while(b){a+=b.offsetLeft||0;
c+=b.offsetTop||0;
b=b.offsetParent
}return{x:a,y:c}
},getSize:function(j){var a=jQuery.css(j,"width");
var d=jQuery.css(j,"height");
var g=0;
var l=0;
var k=j.style;
if(jQuery(j).css("display")!="none"){g=j.offsetWidth;
l=j.offsetHeight
}else{var b=k.visibility;
var c=k.position;
k.visibility="hidden";
k.display="block";
k.position="absolute";
g=j.offsetWidth;
l=j.offsetHeight;
k.display="none";
k.position=c;
k.visibility=b
}return{w:a,h:d,wb:g,hb:l}
},getSizeLite:function(a){return{wb:a.offsetWidth||0,hb:a.offsetHeight||0}
},getClient:function(c){var b,a,d;
if(c){a=c.clientWidth;
b=c.clientHeight
}else{d=document.documentElement;
a=window.innerWidth||self.innerWidth||(d&&d.clientWidth)||document.body.clientWidth;
b=window.innerHeight||self.innerHeight||(d&&d.clientHeight)||document.body.clientHeight
}return{w:a,h:b}
},getScroll:function(k){var d=0,b=0,a=0,g=0,c=0,j=0;
if(k&&k.nodeName.toLowerCase()!="body"){d=k.scrollTop;
b=k.scrollLeft;
a=k.scrollWidth;
g=k.scrollHeight;
c=0;
j=0
}else{if(document.documentElement){d=document.documentElement.scrollTop;
b=document.documentElement.scrollLeft;
a=document.documentElement.scrollWidth;
g=document.documentElement.scrollHeight
}else{if(document.body){d=document.body.scrollTop;
b=document.body.scrollLeft;
a=document.body.scrollWidth;
g=document.body.scrollHeight
}}c=self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
j=self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0
}return{t:d,l:b,w:a,h:g,iw:c,ih:j}
},getMargins:function(k,d){var h=jQuery(k);
var g=h.css("marginTop")||"";
var j=h.css("marginRight")||"";
var a=h.css("marginBottom")||"";
var c=h.css("marginLeft")||"";
if(d){return{t:parseInt(g)||0,r:parseInt(j)||0,b:parseInt(a)||0,l:parseInt(c)}
}else{return{t:g,r:j,b:a,l:c}
}},getPadding:function(k,d){var h=jQuery(k);
var g=h.css("paddingTop")||"";
var j=h.css("paddingRight")||"";
var a=h.css("paddingBottom")||"";
var c=h.css("paddingLeft")||"";
if(d){return{t:parseInt(g)||0,r:parseInt(j)||0,b:parseInt(a)||0,l:parseInt(c)}
}else{return{t:g,r:j,b:a,l:c}
}},getBorder:function(k,d){var h=jQuery(k);
var g=h.css("borderTopWidth")||"";
var j=h.css("borderRightWidth")||"";
var a=h.css("borderBottomWidth")||"";
var c=h.css("borderLeftWidth")||"";
if(d){return{t:parseInt(g)||0,r:parseInt(j)||0,b:parseInt(a)||0,l:parseInt(c)||0}
}else{return{t:g,r:j,b:a,l:c}
}},getPointer:function(b){var a=b.pageX||(b.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))||0;
var c=b.pageY||(b.clientY+(document.documentElement.scrollTop||document.body.scrollTop))||0;
return{x:a,y:c}
},traverseDOM:function(a,b){b(a);
a=a.firstChild;
while(a){jQuery.iUtil.traverseDOM(a,b);
a=a.nextSibling
}},purgeEvents:function(a){jQuery.iUtil.traverseDOM(a,function(c){for(var b in c){if(typeof c[b]==="function"){c[b]=null
}}})
},centerEl:function(d,c){var a=jQuery.iUtil.getScroll();
var b=jQuery.iUtil.getSize(d);
if(!c||c=="vertically"){jQuery(d).css({top:a.t+((Math.max(a.h,a.ih)-a.t-b.hb)/2)+"px"})
}if(!c||c=="horizontally"){jQuery(d).css({left:a.l+((Math.max(a.w,a.iw)-a.l-b.wb)/2)+"px"})
}},fixPNG:function(b,d){var a=jQuery('img[@src*="png"]',b||document),c;
a.each(function(){c=this.src;
this.src=d;
this.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+c+"')"
})
}};
[].indexOf||(Array.prototype.indexOf=function(b,d){d=(d==null)?0:d;
var a=this.length;
for(var c=d;
c<a;
c++){if(this[c]==b){return c
}}return -1
})
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in lib/interface/source/iutil",exp)
},window.dbg?0:1000)
}try{if(typeof deconcept=="undefined"){var deconcept=new Object()
}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()
}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()
}deconcept.SWFObject=function(g,d,o,j,l,n,p,k,a,e){if(!document.getElementById){return
}this.DETECT_KEY=e?e:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(g){this.setAttribute("swf",g)
}if(d){this.setAttribute("id",d)
}if(o){this.setAttribute("width",o)
}if(j){this.setAttribute("height",j)
}if(l){this.setAttribute("version",new deconcept.PlayerVersion(l.toString().split(".")))
}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true
}if(n){this.addParam("bgcolor",n)
}var b=p?p:"high";
this.addParam("quality",b);
this.setAttribute("useExpressInstall",false);
this.setAttribute("doExpressInstall",false);
var m=(k)?k:window.location;
this.setAttribute("xiRedirectUrl",m);
this.setAttribute("redirectUrl","");
if(a){this.setAttribute("redirectUrl",a)
}};
deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;
this.setAttribute("useExpressInstall",true)
},setAttribute:function(a,b){this.attributes[a]=b
},getAttribute:function(a){return this.attributes[a]
},addParam:function(a,b){this.params[a]=b
},getParams:function(){return this.params
},addVariable:function(a,b){this.variables[a]=b
},getVariable:function(a){return this.variables[a]
},getVariables:function(){return this.variables
},getVariablePairs:function(){var a=new Array();
var b;
var c=this.getVariables();
for(b in c){a[a.length]=b+"="+c[b]
}return a
},getSWFHTML:function(){var d="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");
this.setAttribute("swf",this.xiSWFPath)
}d='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';
d+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';
var c=this.getParams();
for(var a in c){d+=[a]+'="'+c[a]+'" '
}var b=this.getVariablePairs().join("&");
if(b.length>0){d+='flashvars="'+b+'"'
}d+="/>"
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");
this.setAttribute("swf",this.xiSWFPath)
}d='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';
d+='<param name="movie" value="'+this.getAttribute("swf")+'" />';
var c=this.getParams();
for(var a in c){d+='<param name="'+a+'" value="'+c[a]+'" />'
}var b=this.getVariablePairs().join("&");
if(b.length>0){d+='<param name="flashvars" value="'+b+'" />'
}d+="</object>"
}return d
},write:function(a){if(this.getAttribute("useExpressInstall")){var b=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(b)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title)
}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof a=="string")?document.getElementById(a):a;
c.innerHTML=this.getSWFHTML();
return true
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))
}}return false
}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){var c=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];
if(a&&a.description){c=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))
}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var d=1;
var b=3;
while(d){try{b++;
d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+b);
c=new deconcept.PlayerVersion([b,0,0])
}catch(g){d=null
}}}else{try{var d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")
}catch(g){try{var d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
c=new deconcept.PlayerVersion([6,0,21]);
d.AllowScriptAccess="always"
}catch(g){if(c.major==6){return c
}}try{d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
}catch(g){}}if(d!=null){c=new deconcept.PlayerVersion(d.GetVariable("$version").split(" ")[1].split(","))
}}}return c
};
deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;
this.minor=a[1]!=null?parseInt(a[1]):0;
this.rev=a[2]!=null?parseInt(a[2]):0
};
deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false
}if(this.major>a.major){return true
}if(this.minor<a.minor){return false
}if(this.minor>a.minor){return true
}if(this.rev<a.rev){return false
}return true
};
deconcept.util={getRequestParameter:function(d){var c=document.location.search||document.location.hash;
if(d==null){return c
}if(c){var b=c.substring(1).split("&");
for(var a=0;
a<b.length;
a++){if(b[a].substring(0,b[a].indexOf("="))==d){return b[a].substring((b[a].indexOf("=")+1))
}}}return""
}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){var c=document.getElementsByTagName("OBJECT");
for(var b=c.length-1;
b>=0;
b--){c[b].style.display="none";
for(var a in c[b]){if(typeof c[b][a]=="function"){c[b][a]=function(){}
}}}};
if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)
};
window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);
deconcept.unloadSet=true
}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]
}
}var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in flashobject",exp)
},window.dbg?0:1000)
}try{jQuery.cookie=function(b,k,n){if(typeof k!="undefined"){n=n||{};
if(k===null){k="";
n.expires=-1
}var e="";
if(n.expires&&(typeof n.expires=="number"||n.expires.toUTCString)){var g;
if(typeof n.expires=="number"){g=new Date();
g.setTime(g.getTime()+(n.expires*24*60*60*1000))
}else{g=n.expires
}e="; expires="+g.toUTCString()
}var m=n.path?"; path="+(n.path):"";
var h=n.domain?"; domain="+(n.domain):"";
var a=n.secure?"; secure":"";
document.cookie=[b,"=",encodeURIComponent(k),e,m,h,a].join("")
}else{var d=null;
if(document.cookie&&document.cookie!=""){var l=document.cookie.split(";");
for(var j=0;
j<l.length;
j++){var c=jQuery.trim(l[j]);
if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));
break
}}}return d
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/cookie",exp)
},window.dbg?0:1000)
}try{var Property=Class.create();
Property.handlePropertyNode=function(a,b){$("input[type=text]",b).rememberFocus().each(function(d,g){var e=g.name;
g.value=a[e];
var c=statusController;
$(g).change(function(){var h=a.validate(e,g.value);
if(h){g.value=a[e];
c.message(h,"error")
}})
});
$("input[type=checkbox]",b).each(function(c,e){var d=e.name;
e.checked=a[d];
$(e).change(function(){a.validate(d,e.checked)
})
})
};
Property.prototype={initialize:function(a){this.xml=a;
this.radioCounter=0;
this.checkboxCounter=0;
this.inputCounter=0;
this.optionCounter=0
},getDefault:function(){var data={};
var val;
$(this.xml[0].childNodes).each(function(i,n){if(n.nodeType==1&&$(n).attr("name")&&$(n).attr("default")){try{eval("val="+$(n).attr("default"));
data[$(n).attr("name")]=val
}catch(ex){dbg.error("Can't get property default value for "+$(n).attr("name")+" with "+$(n).attr("default"))
}}});
return data
},toNode:function(c){var a=this;
var b=$("<p></p>");
$(this.xml[0].childNodes).each(function(h,k){if(k.nodeType==1&&(!$(k).attr("plans")||$(k).attr("plans").split(",").include(v.planid.toString()))){var d=$("<"+($(k).attr("node")||"div")+"/>");
var e=$(k).attr("help");
if(e){HelpTag(e.replace(/\&apos;/g,"'")).appendTo(d)
}var j=$(k).attr("title");
if(j){$("<span>"+j+" </span>").appendTo(d)
}var g=propertyConverter["convert"+k.tagName.capitalize()].call(propertyConverter,c,$(k));
if(g.defaultAction&&$(k).attr("default_action")=="true"){a.defaultAction=g.defaultAction
}if(g.node){d.append($(g.node))
}b.append(d)
}});
return b
},defaultAction:function(){}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/property",exp)
},window.dbg?0:1000)
}try{var Content=Class.create();
Content.prototype={initialize:function(a){this.htmlText=a
},toNode:function(cpt){var self=this;
var node=$("<div class='componentBody'>"+this.htmlText+"</div>");
node.find("[uitype=editor],[uitype=captcha]").each(function(i,n){eval("self._convert"+$(n).attr("uitype").capitalize()+"(cpt,$(n))")
});
return node
},_convertEditor:function(b,a){a.mousedown(function(){return false
}).click(function(c){if(b.page.selectCpt(b)){editorController.select(b,a)
}})
},_convertCaptcha:function(c,b){var a=Math.random();
b.append("<img width=110 height=36 src=/simple_captcha/simple_captcha?simple_captcha_key="+a+" captcha_key="+a+" class='captcha_img'><input type='text' maxlength='3' name='captcha' class='captcha_field'>")
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/content",exp)
},window.dbg?0:1000)
}try{var UI={initialize:function(){},loadDefault:function(){},onDisplay:function(a){},onSelect:function(){},onDeselect:function(){},onPropertyChanged:function(){},advancedProperties:function(){},onMoveZStart:function(){},onMoveZStop:function(){},onMoveStart:function(){},onMove:function(){},onMoveStop:function(){},onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onRemove:function(){},onEdit:function(){this.component.propertyDefaultAction()
},onShow:function(){},onSave:function(){},onHide:function(){},onHashChange:function(){}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/components/ui",exp)
},window.dbg?0:1000)
}try{var ComponentType=Class.create();
ComponentType.prototype={initialize:function(dom,class_name){dom=$(dom);
this.metadata=dom.find("metadata");
if(""!=$.trim(dom.find("style").text())){var f=$("head").prepend("<style class='"+this.metadata.find("name").text()+"'>"+dom.find("style").text()+"</style>").find("style:last");
if($.browser.safari){f.append(" ")
}}eval(dom.find("script").text());
dom.find("includes link").each(function(){$(document.createElement("link")).attr({type:"text/css",rel:"stylesheet",media:"screen"}).prependTo($("head")).attr("href",$(this).attr("href"))
});
this.help=this.metadata.find("help").text().replace(/\&apos;/g,"'");
this.width=100;
this.height=100;
var max=this.metadata.find("max");
if(max[0]){this.max={fg:parseInt(max.attr("fg")),bg:parseInt(max.attr("bg"))}
}var size=this.metadata.find("size");
if(size[0]){var w=size.attr("width");
var h=size.attr("height");
if(w){this.width=w
}if(h){this.height=h
}}this.content=new Content(dom.find("content").text());
this.properties=new Property(dom.find("properties"));
this.counter=0
},getCounter:function(){return this.counter++
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/model/component_type",exp)
},window.dbg?0:1000)
}try{var UI_List={};
var ComponentTypeFileController=Class.create();
ComponentTypeFileController.prototype={initialize:function(a,b){this.component_type=a;
this.lang=b;
this.status="not_loaded";
this.waiting_list=new Array()
},fileLoad:function(b){if(versionController){versionController.bindButtons(false)
}if(this.status=="not_loaded"){this.status="loading";
var a=this;
this.waiting_list.push(b);
$.ajax({type:"GET",url:"/javascripts/application/components/"+this.lang+"/"+this.component_type.class_name+".xml",dataType:"xml",name:sprintf("Downloading %s blocks",this.component_type.title.capitalize()),cache:false,success:function(c){a.fileReceived(c)
},error:function(d,c){statusController.message(sprintf("%s block could not be downloaded.<br/>Please check your Internet connection and try again.",a.component_type.title.toLowerCase()).capitalize(),"warning",10000,5);
a.extendFail()
}})
}else{if(this.status=="loading"){this.waiting_list.push(b)
}else{this.extendUi(b)
}}},fileReceived:function(c){var b=new ProgressController(sprintf("Loading %s blocks",this.component_type.title.capitalize()));
Object.extend(this.component_type,new ComponentType(c,this.component_type.class_name));
var a=Class.create();
Object.extend(a.prototype,UI);
Object.extend(a.prototype,UI_List[this.component_type.class_name]);
UI_List[this.component_type.class_name]=a;
this.status="loaded";
while(this.waiting_list.length>0){this.extendUi(this.waiting_list.pop())
}b.update(100)
},extendUi:function(b){b.component_type=this.component_type;
var a=this;
setTimeout(function(){b.ui=new UI_List[a.component_type.class_name](b);
b.ui.component=b;
b.uiExtended();
if(versionController){versionController.bindButtons(true)
}},0)
},extendFail:function(){while(this.waiting_list.length>0){var a=this.waiting_list.pop();
if(!a.id){a.page.rmCpt(a)
}}this.status="not_loaded";
if(versionController){versionController.bindButtons(true)
}}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/component_type_file_controller",exp)
},window.dbg?0:1000)
}try{var ComponentTypeController=Class.create();
ComponentTypeController.prototype={initialize:function(c,d){this.lang=d;
var a=this;
this.file_controller_list=new Array();
for(var b=0;
b<c.length;
b++){this.file_controller_list.push(new ComponentTypeFileController(c[b],this.lang))
}this.cpt_width=55
},extendUi:function(a){for(var b=0;
b<this.file_controller_list.length;
b++){if(this.file_controller_list[b].component_type.id==a.component_type_id){this.file_controller_list[b].fileLoad(a);
break
}}},showCptName:function(d,a){var e=d.offset();
var c=($.browser.msie&&$.browser.version.substring(0,1)=="6")?0:$().scrollTop();
var b=($.browser.msie&&$.browser.version.substring(0,1)=="6")?0:$().scrollLeft();
$("#cpttp_t").html(a).css({top:e.top+50-c,left:e.left-this.cpt_width-b}).show()
},hideCptName:function(){$("#cpttp_t").hide()
},fillList:function(e){var n=0,l=[{s:"starter",h:"Starter blocks",n:$("#cpttp_s"),c:0},{s:"premium",h:"Premium and Pro blocks",n:$("#cpttp_p"),c:0}];
var m=e.find(".list").empty();
if(m.length==0){m=$("<div class='list'></div>").appendTo(e);
l.each(function(c){["tl","tr","br","bl","b","l","r"].each(function(q){$("<div class='"+q+"'></div>").prependTo(c.n)
});
c.n.prepend($('<img src="http://st0.sitew.org/images/icons/drop.png?1272384009" class="close" title="Hide the block list"/>').click(function(){$(this).parent().slideUp("fast")
}))
})
}l.each(function(c){c.n.hide().find(".cpttp_menu_content").empty();
c.p=$("<span class='showMenu' href='#'><img class='icon' src='/images/packages/icons/"+c.s+"/48.png'/></a></span>").prepend(HelpTag(c.h))
});
var j=$(window).width(),h=this.cpt_width,p=45,b=480,d=160,k=40,a=30;
var g=Math.floor((j-(b+d))/h)-1;
var o=this;
this.file_controller_list.each(function(x){var w=x.component_type;
var c=$("<span class='addComponent' href='#'><img class='icon' src='/images/types/"+w.class_name+"/48.png'/></span>");
if(w.pack==0&&n<g){n+=1;
c.appendTo(m)
}else{var t=w.pack==0?0:1;
l[t].c+=1;
c.appendTo(l[t].n.find(".cpttp_menu_content"))
}c.addClass("clickable").prepend(HelpTag(w.description));
c.hover(function(){o.showCptName(c,w.title)
},function(){o.hideCptName()
});
if(v.planid<w.pack){c.mousedown(function(){if(w.pack==1){statusController.message("You need to <a href='http://www.sitew.com/My-websites?upgrade=1' target=_blank><b>upgrade</b></a> your website to have access to the <b>Premium and Pro blocks</b>...","warning")
}else{statusController.message("You need to <a href='http://www.sitew.com/My-websites?upgrade=2' target=_blank><b>upgrade</b></a> your website to have access to the <b>Pro blocks</b>...","warning")
}}).find("img.icon").enableImg(false).after("<img src='http://st2.sitew.org/images/icons/locked.png?1272384009' style='position:absolute;bottom:0;left:25px'>");
return
}if(!($.browser.msie&&$.browser.version.substring(0,1)=="6")){c=c.find("img.icon")
}var A={x:0,y:0};
var y;
var u=null,B;
var z=document.documentElement;
var q;
if(!$.browser.msie){q=function(C){B.left=C.pageX+"px";
B.top=C.pageY+"px"
}
}else{q=function(C){B.left=C.clientX+z.scrollLeft+"px";
B.top=C.clientY+z.scrollTop+"px";
return false
}
}var s=function(E){u.remove();
$().unbind("mouseup",s);
$().unbind("mousemove",q);
var D=jQuery.iUtil.getPosition($("#pages")[0]);
var C={x:E.pageX-D.x,y:E.pageY-D.y};
if(E.clientY>100){v.getSelectedPage().addCpt(w.id,C)
}else{if(E.pageY==y.y&&E.pageX==y.x){v.getSelectedPage().addCpt(w.id)
}}};
c.mousedown(function(C){editorController.deselect();
u=$(this).clone().appendTo($("body")).css({position:"absolute","z-index":10000});
B=u[0].style;
y={x:C.pageX,y:C.pageY};
q(C);
$().mousemove(q);
$().mouseup(s);
return false
})
});
l.each_with_index(function(q,c){if(c.c>0){c.p.bind((v.planid<q)?"click":"mouseover",function(){l.each(function(w){if(c.n!=w.n){w.n.hide()
}});
if(c.n.is(":hidden")){var t=0,s=0,u=0;
t=$(this).offset().left-$(window).scrollLeft()-c.c*h/2-k/2;
t=(t>b)?t:b;
s=c.c*h;
if(j-(b+k*2)<s){var s=Math.floor((j-(b+k*2))/h)*h;
t=b
}u=Math.ceil(c.c/(s/h))*p;
if(t>=h&&u>=p&&t!=Infinity&&u!=Infinity){c.n.css({left:t,width:s,height:u}).slideDown("fast");
if($.browser.msie&&$.browser.version.substring(0,1)=="6"){c.n.attr("style","left:expression(documentElement.scrollLeft+body.scrollLeft + "+t+"+ 'px');width:"+s+"px")
}c.n.find(".l, .r").height(u-a);
c.n.find(".b").width(s)
}else{statusController.message("Your browser is not large enough.<br>Enlarge its window to display the block list!","warning",3000)
}}})
}else{c.p.hover(function(){o.showCptName(c.p,c.h)
},function(){o.hideCptName()
})
}});
if(l[0].c>0){n+=1;
l[0].p.appendTo(m)
}l[1].p.appendTo(m);
n+=1;
if(l[1].c==0){l[1].p
}m.width(n*this.cpt_width)
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/component_type_controller",exp)
},window.dbg?0:1000)
}try{var ComponentController=Class.create();
ComponentController.prototype={initialize:function(b){this.component=b;
this.node=b.node;
this.selectHandleEnabled=false;
$("#cpt_ctrl_tools").children().clone().appendTo(this.node);
if(this.component.component_type.class_name=="UI_Menu"){this.node.find("span.upper,span.downer").remove()
}this.cptOver=this.node.find("div.cptOver").addClass("invisible");
if(this.component.component_type.class_name=="UI_Menu"){this.cptOver.hide();
this.addSelectHandle("all")
}this.editBtn=this.node.find("table.editBtn").hide();
this.gotoBg=this.node.find("div.gotoBg").hide();
this.cptSelected=this.node.find("div.cptSelected");
this.cptCtrl=this.node.find("div.Ctrl").hide();
this.pageList=$("#cptCopy");
this.resizeSelectedBackground();
this.node.find("span.selecter").append(HelpTag("<h3>Block actions</h3>"+sprintf("<b>Move</b> Drag drop it from a part of its area or use %s or Arrow keys<br/>","<img src='http://st0.sitew.org/images/icons/move.gif?1202744559'/> ")+"<b>Resize</b> Use anchors surrounding it or Ctrl key + Arrows<br/><b>Deselect</b> Click on an empty area of the page.<br/><b>Edit</b> Click on the pen <img src='http://st2.sitew.org/images/icons/edit_orig.gif?1205425728'/> in the center of the block or in this toolbar.<br/><b>Duplicate</b> Click on the button <img src='http://st1.sitew.org/images/icons/clone.gif?1205425728'/> to duplicate the block.<br/><b>Change options</b> use the properties displayed on the bottom left of the screen.<br/>"+sprintf("<b>Change layer</b>%s raises to top, %s lowers to background.<br/>","<img src='http://st3.sitew.org/images/icons/raise.gif?1202740007'/>","<img src='http://st3.sitew.org/images/icons/lower.gif?1202740007'/>")+"<b>Delete</b> <img src='http://st1.sitew.org/images/icons/trash16.gif?1219751217'/> or Del key"));
var g=this.component;
var a=this;
this.node.find(".cptOver, .editBtn, span.mover").mousedown(function(h){if(g.page.selectCpt(g)){jQuery.iDrag.draginit.apply(this,[h])
}return false
});
this.node.mousedown(function(h){g.page.version.eventTargetSelected=h.target
});
this.node.find("span.upper").addClass("clickable").mouseup(function(h){g.page.moveToTop(g);
return true
});
this.node.find("span.downer").addClass("clickable").mouseup(function(){g.page.moveToBottom(g);
return true
});
this.node.mousedown(function(){a.pageList.hide()
});
this.node.mouseup(function(){a.pageList.hide()
});
this.node.find("span.cloner").addClass("clickable").click(function(){if(g.component_type.class_name=="UI_Menu"){a.copyTo(v.page_bg)
}else{var j=$.iUtil.getPosition(this);
var h=$.iUtil.getSize(this);
a.pageList.css({top:j.y+h.hb,left:j.x+h.wb-a.pageList.width()});
editorController.deselect();
var e=$("ul",a.pageList).empty();
$("<li>Current page</li>").appendTo(e).mouseup(function(){a.copyTo(g.page);
a.pageList.hide();
return false
});
if(g.page!=v.page_bg){$("<li class='break'>Background page</li>").appendTo(e).mouseup(function(){a.copyTo(v.page_bg);
a.pageList.hide();
return false
})
}v.pages_fg.each(function(k){if(g.page!=k){$("<li>"+k.name+"</li>").appendTo(e).mouseup(function(){a.copyTo(k);
a.pageList.hide();
return false
})
}});
e.find("li:even").css({"background-color":"white"});
a.pageList.show();
return false
}});
this.node.find("span.remover").addClass("clickable").mousedown(function(){return false
}).mouseup(function(){if(confirm("Do you really want to remove this block?")){g.page.rmCpt(g);
return true
}});
this.node.Draggable({zIndex:10000,ghosting:false,scrollBottomLimit:20,scrollTopLimit:65+20,snapDistance:5,containment:"#body",handle:".cptOver, .editBtn, span.mover",onStart:function(){g.page.setHeight(10000);
g.moveStart()
},onStop:function(){g.moveStop()
},onDrag:function(e,h){g.move(e,h)
}});
this.node[0].dragCfg.dhe.unbind("mousedown",jQuery.iDrag.draginit);
$("#dragHelper").css("overflow","visible");
this.node.Resizable({onStart:function(){g.resizeStart();
g.page.setHeight(10000)
},onResize:function(e,h){g.resize();
a.resizeSelectedBackground();
return{sizes:e,position:h}
},onStop:function(){var q={width:g.W(),height:g.H()};
var h={top:g.Y(),left:g.X()};
var j=jQuery.iUtil.getPosition(a.node[0]);
var e=jQuery.iUtil.getSize(a.node[0]);
var k=$("#body")[0];
var o=jQuery.iUtil.getPosition(k);
var m=jQuery.iUtil.getSize(k);
var l=j.y-h.top;
var n=j.x-h.left;
if(j.y<o.y){j.y=o.y
}if(j.x<o.x){j.x=o.x
}if(j.y+e.h>o.y+m.h){e.h=o.y+m.h-j.y
}if(j.x+e.w>o.x+m.w){e.w=o.x+m.w-j.x
}j.y-=l;
j.x-=n;
g._setXYZWH({x:j.x,y:j.y,w:e.w,h:e.h});
g.resizeStop();
a.resizeSelectedBackground()
},handlers:{ne:this.node.find("div.NE"),nw:this.node.find("div.NW"),se:this.node.find("div.SE"),sw:this.node.find("div.SW")},minWidth:1,minHeight:1,maxWidth:3000,maxHeight:5000,minTop:0,minLeft:0,maxRight:5000,maxBottom:20000,scrollBottomLimit:20,scrollTopLimit:65+20});
this.node.hover(function(){if(g.page.selectedCpt!=g&&g.component_type.class_name!="UI_Menu"){a.cptOver.removeClass("invisible");
if(!g.page.selectable){a.cptOver.addClass("unselectable");
a.editBtn.hide();
a.gotoBg.show()
}else{a.gotoBg.hide();
a.editBtn.show();
a.cptOver.attr({title:""})
}}},function(){if(g.page.selectedCpt!=g){a.cptOver.addClass("invisible").removeClass("unselectable");
a.editBtn.hide().removeClass("unselectable")
}a.gotoBg.hide();
g.node.css("cursor","auto")
});
var d=function(){g.edit();
a.editBtn.hide();
a.cptOver.hide()
};
this.editBtn.find("img").hover(function(){a.editBtn.addClass("mouseover")
},function(){a.editBtn.removeClass("mouseover")
}).mouseup(d);
try{this.editBtn.dblclick(d)
}catch(c){dbg.error("editBtn.dblclick error",c)
}this.node.find("span.editer").addClass("clickable").mouseup(d)
},enable:function(a){if(a){this.cptCtrl.show();
this.resizeSelectedBackground();
this.cptOver.removeClass("invisible unselectable");
this.editBtn.show();
this.gotoBg.hide();
sigCtl.emit("ComponentController.enable",this.node)
}else{editorController.deselect();
this.pageList.hide();
this.cptCtrl.hide();
if(this.component.component_type.class_name!="UI_Menu"){this.cptOver.show().addClass("invisible")
}this.editBtn.hide()
}this.displaySelectHandle(!a)
},setAspectRatio:function(a){this.node[0].resizeOptions.ratio=a
},resizeSelectedBackground:function(){var a=this.component.W();
var b=this.component.H();
this.cptSelected.width(a).height(b);
this.cptOver.width(a).height(b);
this.editBtn.width(a).height(b);
var c=Math.min(a,b);
if(c>512){c=256
}else{if(c>256){c=128
}else{if(c>128){c=64
}else{if(c>64){c=32
}else{c=16
}}}}this.editBtn.find("img").attr({src:"/images/edit/edit_"+c+".jpg"})
},addSelectHandle:function(a){if(a=="linux"){if((new String(navigator.platform)).search("Linux|X11")!=-1){this.selectHandleEnabled=true;
this.displaySelectHandle(true)
}}else{if(a=="all"){this.selectHandleEnabled=true;
this.displaySelectHandle(true)
}}},displaySelectHandle:function(b){if(this.selectHandleEnabled){if(!this.selectHandleNode){var a=this;
this.selectHandleNode=$('<a class="selectHandle" href="#"><img src="http://st0.sitew.org/images/icons/select.png?1272384009" border="0"/></a>').appendTo(this.node).mousedown(function(d){var c=a.component;
c.page.selectCpt(c);
return false
})
}if(b&&this.component.page.selectable){this.selectHandleNode.show()
}else{if(b&&(this.component.component_type.class_name=="UI_Menu")){this.selectHandleNode.show()
}else{this.selectHandleNode.hide()
}}}},copyTo:function(a){this.component.deselect();
this.component.clone(a)
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/component_controller",exp)
},window.dbg?0:1000)
}try{var ProgressController_={progress_objects:{},object_id:0,busy:function(){return this.last_shown!=null
},last_shown:null};
var ProgressController=Class.create();
ProgressController.prototype={initialize:function(a){this.id=ProgressController_.object_id;
ProgressController_.progress_objects[this.id]=this;
this.name=a;
ProgressController_.object_id+=1;
this.update(0);
this.paused=false
},update:function(b,e){this.paused=false;
this.progress=b;
var d=0;
var h;
var c=0;
var a=101;
var j;
for(h in ProgressController_.progress_objects){var g=ProgressController_.progress_objects[h].progress;
if(g<a){a=g;
j=h
}d+=g;
c+=1
}if(d==100*c){statusController.progressMessage("Done",100);
ProgressController_.progress_objects={};
ProgressController_.last_shown=null;
sigCtl.emit("Progress.allFinished")
}else{if(ProgressController_.last_shown==null){sigCtl.emit("Progress.begin",JSON_.stringify(ProgressController_))
}if(b<100&&!e){ProgressController_.last_shown=this.id
}else{if(ProgressController_.last_shown==null||ProgressController_.progress_objects[ProgressController_.last_shown].progress>=100){ProgressController_.last_shown=j
}}statusController.progressMessage(ProgressController_.progress_objects[ProgressController_.last_shown].name,d/c)
}}};
setInterval(function(){for(var a in ProgressController_.progress_objects){if(!ProgressController_.progress_objects[a].paused){ProgressController_.progress_objects[a].update(ProgressController_.progress_objects[a].progress+(100-ProgressController_.progress_objects[a].progress)/30,true)
}}},400)
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/progress_controller",exp)
},window.dbg?0:1000)
}try{var ModelTransfer={type:"POST",dataType:"json",error_to_json:true,cache:false};
var Model=Class.create();
Model.prototype={initialize:function(){this.type="Model"
},m_get:function(){var a=this;
$.ajax(Object.extend({url:"/json/get",name:"Loading page",data:{type:this.type,id:this.id},success:function(b){if(b.access_denied){a.showing=false;
a.requestSent=false;
secCtrl.popup();
return false
}else{a.showing=true;
a.requestSent=true;
a.getCallback(b)
}}},ModelTransfer))
},m_copy:function(c,d,a){var b=this;
$.ajax(Object.extend({url:"/json/copy"+c,name:"Copy in progress",data:d,success:function(e){b.getCallback(e);
if(a){a(b)
}}},ModelTransfer))
},getCallback:function(b){if(!b.errors){if(b.attributes){for(var c in b.attributes){this[c]=b.attributes[c]
}}for(var d in b){if(d!="attributes"){if(!b[d]){this[d]=null
}else{if(b[d].constructor==Array){for(var a=0;
a<(b[d].length);
a++){this[d].push(new window[d.capitalize()](this));
this[d][this[d].length-1].getCallback(b[d][a])
}}else{this[d]=new window[d.capitalize()](this);
this[d].getCallback(b[d])
}}}}}else{sigCtl.emit("Model.error",{action:"get",errors:b.errors,item:this})
}if(this.loaded){this.loaded()
}},m_post:function(){var a=this;
$.ajax(Object.extend({url:"/json/post",name:"Updating items",data:Object.extend({type:this.type,id:this.id},this.to_json()),success:function(b){return a.postCallback(b)
}},ModelTransfer))
},postCallback:function(a){if(this.saveChildren){this.saveChildren()
}if(!a.success){sigCtl.emit("Model.error",{action:"post",errors:a.errors,item:this});
this.setHasChanged();
return false
}},m_delete:function(b){if(this.id){var a=this;
$.ajax(Object.extend({url:"/json/delete",name:"Deleting removed items",data:{type:this.type,id:this.id},success:function(c){a.deleteCallback(c);
b(c)
}},ModelTransfer))
}},deleteCallback:function(a){if(!a.success){sigCtl.emit("Model.error",{action:"delete",errors:a.errors,item:this})
}},m_put:function(b){var a=this;
if(!b){b=this.to_json()
}$.ajax(Object.extend({url:"/json/put",name:"Saving new items",data:Object.extend({type:this.type},b),success:function(c){return a.putCallback(c)
}},ModelTransfer))
},putCallback:function(a){if(a.success){this.id=a.id;
if(a.idserver){this.idserver=a.idserver
}if(this.saveChildren){this.saveChildren()
}}else{sigCtl.emit("Model.error",{action:"put",errors:a.errors,item:this});
this.setHasChanged();
return false
}},save:function(){if(this.id){if(this.hasChanged){this.m_post();
this.hasChanged=false
}else{return false
}}else{this.m_put()
}return true
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/model/model",exp)
},window.dbg?0:1000)
}try{var Page=Class.create();
Object.extend(Page.prototype,new Model);
Object.extend(Page.prototype,{initialize:function(){},pageInit:function(a){this.version=a;
this.type="Page";
this.cpts=new Array();
this.cptToDelete=new Array();
this.selectedCpt=null;
this.requestSent=false;
this.selectable=true;
this.nbr_components=0;
this.nbrComponentsDisplayed=0;
this.hasChanged=false;
this.level=0;
this.order=0;
this.myheight=0;
this.showing=false;
this.node=$("#pages")
},create:function(){this.requestSent=true
},show:function(){var a=this;
if(!this.showing){this.showing=true;
this.loadComponents(function(){a.display()
})
}},to_json:function(){var a={name:this.name,version_id:this.version.id,order:this.order,level:this.level,security:JSON_.stringify(this.security),pageid:this.pageid};
if(this.seo){a.seo=JSON_.stringify(this.seo)
}return a
},toJSON:function(){return{type:"page",name:this.name,version_id:this.version.id,id:this.id,cpts:this.cpts}
},loadComponents:function(a){if(a){this.postLoading=a
}if(this.nbr_components>0){if(!this.requestSent){this.requestSent=true;
this.m_get()
}else{if(this.extended){this.cptsDisplayed()
}this.loaded()
}}else{this.requestSent=true;
this.cptsDisplayed();
this.loaded()
}},addCpt:function(d,b){if(!v.selectedPageFg){$("#bg_wng_msg").highlight(2000)
}else{if(d==5&&this.selectable){return v.page_bg.addCpt(d,b)
}}this.setHasChanged();
var a=new Cpts(this);
push_origin={function_name:"page.addcpt",type_id:d};
this.pushCpt(a);
a.setStartupXYZWH=b;
a.create(d);
return a
},pushCpt:function(a){if(a.id&&this.cpts.find(function(b){return b.id==a.id
})){dbg.error("Pushing a cpt already present",{cpt_pushed:a,version:v,push_origin:push_origin})
}this.cpts.push(a);
this.nbr_components+=1;
return a
},rmCpt:function(c){this.deselectCpt();
this.nbr_components-=1;
this.nbrComponentsDisplayed-=1;
if(this.countType){this.countType[c.component_type_id]-=1
}var b=JSON_.stringify_safe(this.cpts);
var a=this.cpts.length;
this.cpts.remove(c);
if(a!=this.cpts.length+1){dbg.error("Error removing component",{cpts_before_remove:b,cpts:this.cpts,cpt_to_remove:c})
}if(this.cpts.indexOf(c)>=0){dbg.error("Cpt still present in list after remove",{cpts:this.cpts,index:this.cpts.indexOf(c),cpt_to_remove:c,cpts_before_remove:b})
}if(c.id&&this.cpts.find(function(d){return c.id==d.id
})){dbg.error("Cpt with same id exist after remove",{cpts:this.cpts,cpt_to_remove:c,cpts_before_remove:b})
}c.remove();
if(c.id){this.cptToDelete.push(c)
}this.setHasChanged();
this.version.checkHeight()
},selectCpt:function(b){var a=this;
if(b.component_type.class_name=="UI_Menu"){a=v.selectedPageFg||this
}if(!a.selectable&&v.selectedPageFg){$("#bgPage").highlight();
statusController.message("This block is on the background.<br>Click on the <i>Background</i> button on the left to modify it.","warning")
}else{if(b!=a.selectedCpt){if(a.selectedCpt){a.selectedCpt.deselect()
}a.selectedCpt=b;
b.select();
propertyController.show(b)
}}return a.selectable
},deselectCpt:function(){if(this.selectedCpt){this.selectedCpt.deselect()
}this.selectedCpt=null;
propertyController.show(this)
},cptDisplayed:function(a){this.nbrComponentsDisplayed+=1;
if(this.nbrComponentsDisplayed==this.nbr_components){this.cptsDisplayed()
}},cptsDisplayed:function(){this.extended=true;
this.version.checkHeight();
this.showing=false;
if(this.getClass()=="page_bg"){sigCtl.emitVariable("PageBg.shown")
}sigCtl.emit("Page.shown",this)
},loaded:function(){if(this.postLoading){this.postLoading();
this.postLoading=null
}if($.browser.msie&&$.browser.version<8){setTimeout(function(){if(v.mode=="editor"){$("#pages").hide(1).show(1)
}},0)
}},saveChildren:function(){var a=this;
this.cptToDelete.each(function(b){b.m_delete(function(c){if(c.success){a.cptToDelete.remove(b)
}else{a.setHasChanged();
return false
}})
});
this.cpts.each(function(b){b.save()
})
},remove:function(){this.hide();
for(var a=this.cpts.length-1;
a>=0;
a--){this.cpts[a].remove()
}delete this.cpts
},zOnTop:function(){var a=0;
for(var b=this.cpts.length-1;
b>=0;
b--){if(a<this.cpts[b].Z()){a=this.cpts[b].Z()
}}if(a>=this.maxZIndex-1){a=this.setAllZIndeces().max
}if(a==0){return(this.maxZIndex-this.minZIndex)/2+this.minZIndex
}else{return a
}},moveToTop:function(b){var a=this.zOnTop();
if(b.Z()!=a){b.setXYZWH({z:this.zOnTop()+2})
}},moveToBottom:function(b){var a=b.Z();
for(var d=this.cpts.length-1;
d>=0;
d--){if(a>this.cpts[d].Z()){a=this.cpts[d].Z()
}}if(a!=b.Z()){if(a<=this.minZIndex+2){a=this.setAllZIndeces().min
}b.setXYZWH({z:(a-2)})
}},setAllZIndeces:function(){this.cpts.sort(function(d,c){return d.Z()-c.Z()
});
var a=(this.maxZIndex-this.minZIndex)/2+this.minZIndex-this.cpts.length;
for(var b=0;
b<this.cpts.length;
b++){this.cpts[b].setXYZWH({z:a});
a+=2
}return{min:this.cpts[0].Z(),max:this.cpts[this.cpts.length-1].Z()}
},display:function(){for(var a=this.cpts.length-1;
a>=0;
a--){this.cpts[a].node.show();
this.cpts[a].ui.onShow()
}},hide:function(){for(var a=this.cpts.length-1;
a>=0;
a--){this.cpts[a].node.hide();
this.cpts[a].ui.onHide()
}if(this.selectedCpt){this.selectedCpt.deselect()
}this.selectedCpt=null
},height:function(){return this.myheight
},setHeight:function(c){this.node.height(c);
var b=$().scrollTop();
$("#pageContainer").height(c);
$().scrollTop(b);
if(isIE6){$("#body").hide().show()
}},setSecurity:function(a){this.security=a;
this.setHasChanged()
},setHasChanged:function(){this.hasChanged=true;
this.version.setHasChanged()
},checkHeight:function(){var a=0;
this.cpts.each(function(d){if(!d.node.is(":visible")){return
}var b=d.Y()+d.H();
if(b>a){a=b
}});
this.myheight=a;
return a
},checkWidth:function(){var a=0;
this.cpts.each(function(g){var d=g.component_type.class_name;
var b=g.X();
var e=b+g.W()-400;
if(Math.abs(b-400)>a){a=Math.abs(b-400)
}if(e>a){a=e
}});
return a
},checkType:function(b){var a=this.getTypeMax(b);
if(a||a==0){this.countType=this.countType||{};
this.countType[b.component_type_id]=(this.countType[b.component_type_id]+1)||1;
if(this.countType[b.component_type_id]>a){statusController.message(sprintf("This block can not be added (this page can not contain more than %s).<br>Please add this block on another page...",a),"warning",5000,5);
this.rmCpt(b);
return false
}}return true
}});
var Pages_fg=Class.create();
Object.extend(Pages_fg.prototype,new Page);
Object.extend(Pages_fg.prototype,{initialize:function(a){this.visible=true;
this.pageInit(a);
this.maxZIndex=10000;
this.minZIndex=5000;
this.security={};
this.cptUrl=null;
this.cptTitle=null
},clone:function(a){var b=new Pages_fg(a);
b.create();
this.cpts.sort(function(d,c){return d.Z()-c.Z()
});
this.cpts.each(function(d){d.clone(b)
});
b.nbr_components=0;
return b
},getClass:function(){return"page_fg"
},getHash:function(a,b){b=b||this.cptUrl;
var c=this.name.to_alphanumeric()+"."+this.pageid;
if(!a&&b){c+=b
}return c
},getUrl:function(a,b){b=b||this.cptUrl;
return"/"+this.getHash(a,b)+((!a&&b)?"":".htm")
},getTitle:function(){if(this.cptTitle){return this.cptTitle
}else{if(this.seo&&this.seo.title&&this.seo.title!=""){return this.seo.title
}else{return this.name
}}},setCptUrl:function(a,b){if(this.cptUrl!=a){this.cptUrl=a;
if(b){this.cptTitle=b
}v.setHash(this)
}},getStatName:function(){return(this.cptUrl?this.name+this.cptUrl:this.name)
},validate:function(a,b){switch(a){case"name":if(this.name==b){return
}else{if(b==""){return"Name cannot be empty."
}else{this.name=b;
sigCtl.emit("Page.name.changed");
this.setHasChanged();
return
}}break;
case"security":this.setSecurity(b);
break
}},getPropertyNode:function(){if(!this.propertyNode){this.propertyNode=$("#page_property").clone();
this.propertyNode.HandleHelpTooltip();
Property.handlePropertyNode(this,this.propertyNode)
}return this.propertyNode
},getIcon:function(a){return"http://st0.sitew.org/images/icons/page16.png?1201252313"
},getName:function(){return"Webpage"
},getTypeMax:function(a){if(a.component_type&&a.component_type.max){return a.component_type.max.fg
}else{return null
}},previous:function(){var a=null;
var b=0;
while(!a&&b<v.pages_fg.length){if(this.version.pages_fg[b]==this){a=b
}b++
}if(a>0){return this.version.pages_fg[a-1]
}else{return null
}},parentPage:function(){var a=this.previous();
while(a!=null&&a.level>=this.level){a=a.previous()
}return a
}});
var Page_bg=Class.create();
Object.extend(Page_bg.prototype,new Page);
Object.extend(Page_bg.prototype,{initialize:function(a){this.pageInit(a);
this.maxZIndex=5000;
this.minZIndex=0
},getClass:function(){return"page_bg"
},getPropertyNode:function(){return this.version.getPropertyNode()
},displayHandles:function(){for(var a=this.cpts.length-1;
a>=0;
a--){if(this.cpts[a].ctrl){this.cpts[a].ctrl.displaySelectHandle(true)
}}},getIcon:function(a){return"http://st3.sitew.org/images/icons/cubepage16.png?1201252313"
},getName:function(){return"Background page"
},getTypeMax:function(a){if(a.component_type&&a.component_type.max){return a.component_type.max.bg
}else{return null
}}})
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/model/page",exp)
},window.dbg?0:1000)
}try{jQuery.viewer_ajax=function(a){if(!a.autoretry){a.autoretry=5
}return jQuery.full_ajax(a)
};
jQuery.ajax=jQuery.viewer_ajax
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/jquery_ajax_viewer",exp)
},window.dbg?0:1000)
}try{var Cpts=Class.create();
Object.extend(Cpts.prototype,new Model);
Object.extend(Cpts.prototype,{initialize:function(a){this.page=a;
this.type="Component";
this.ui=UI
},remove:function(){try{this.ui.onRemove()
}catch(a){dbg.error("UI.onRemove Error",{cpt_to_remove:this,exception:a})
}this.node.remove()
},select:function(){},to_json:function(){return{}
},loaded:function(){if(!this.preloaded){this.node=$("<div class='component'></div>").appendTo(this.page.node)
}else{this.node=$("#cpt_"+this.id)
}componentTypeController.extendUi(this)
},uiExtended:function(){if(!this.page.checkType(this)){return
}this.display()
},isDisplayed:function(){return(this.page.getClass()=="page_bg"||v.getSelectedPage()==this.page)
},display:function(){if(!this.preloaded){this.node=$("<div class='component'></div>");
this.node.appendTo(this.page.node);
this.componentBody=this.component_type.content.toNode(this).addClass(this.component_type.class_name).appendTo(this.node);
this._setXYZWH({x:this.x,y:this.y,z:this.z,w:this.w,h:this.h});
delete this.x;
delete this.y;
delete this.w;
delete this.h
}else{this.componentBody=this.node.children(":first");
if(this.componentBody.hasClass("to_rebuild")){this.componentBody.append(this.component_type.content.toNode(this).children())
}}if(!this.isDisplayed()){this.node.hide()
}try{eval("this.data="+this.data)
}catch(exp){dbg.error("Error in data from component id "+this.id,this.data)
}if(!this.data){this.data={}
}this.ui.onDisplay(this.componentBody);
if(this.isDisplayed()){this.ui.onShow()
}this.page.cptDisplayed(false)
},ask:function(d,e,c,a){if(this.idserver){var b={data:d};
a=a||this.componentBody;
if(a.find("[uitype=captcha]").length==1){b.captcha_key=a.find("[uitype=captcha] img").attr("captcha_key");
b.captcha=a.find("[uitype=captcha] input").val()
}$.ajax({type:"POST",url:"/json/cpt_ask/"+this.idserver+","+this.component_type.id,name:sprintf("Loading %s block data",this.component_type.title.toLowerCase()).capitalize(),data:JSON_.stringify(b),success:function(g){if(g.errors){c(g.errors)
}else{e(g)
}},error:function(){c(["Error communicating with the server"])
},dataType:"json",contentType:"application/json"})
}else{c(["Save or publish the website to be able to use this function."])
}},moveStart:function(){this.ui.onMoveStart()
},moveStop:function(){editorController.resume();
v.checkHeight();
this.ui.onMoveStop()
},move:function(a,b){this.ui.onMove(a,b)
},resizeStart:function(){this.ui.onResizeStart()
},resizeStop:function(){v.checkHeight();
this.ui.onResizeStop()
},resize:function(){this.ui.onResize()
},moveZStart:function(){this.ui.onMoveZStart()
},moveZStop:function(){this.ui.onMoveZStop()
},X:function(){return parseInt(this.node.css("left"))
},Y:function(){return parseInt(this.node.css("top"))
},Z:function(){return this.z
},W:function(){return parseInt(this.node.css("width"))
},H:function(){return parseInt(this.node.css("height"))
},setXYZWH:function(a){var b=false;
if(this.node.filter(":hidden").length==1){b=true;
this.node.show()
}if((a.x||a.x==0)&&a.x==this.X()){delete a.x
}if((a.y||a.y==0)&&a.y==this.Y()){delete a.y
}if((a.z||a.z==0)&&a.z==this.Z()){delete a.z
}if((a.w||a.w==0)&&a.w==this.W()){delete a.w
}if((a.h||a.h==0)&&a.h==this.H()){delete a.h
}if(a.x||a.x==0||a.y||a.y==0){this.moveStart()
}if(a.w||a.w==0||a.h||a.h==0){this.resizeStart()
}if(a.z||a.z==0){this.moveZStart()
}this._setXYZWH(a);
if(a.x||a.x==0||a.y||a.y==0){this.moveStop()
}if(a.w||a.w==0||a.h||a.h==0){this.resizeStop()
}if(a.z||a.z==0){this.moveZStop()
}if(b){this.node.hide()
}},setSize:function(a){this._setXYZWH(a);
v.checkHeight()
},_setXYZWH:function(a){if(a.x||a.x==0){this.node.css("left",a.x.toString()+"px")
}if(a.y||a.y==0){this.node.css("top",a.y.toString()+"px")
}if(a.z||a.z==0){this.z=a.z
}if(!this.isSelected){this.node.css("z-index",this.component_type.class_name=="UI_Menu"?9999:a.z)
}if(a.w){this.node.css("width",a.w.toString()+"px")
}if(a.h){this.node.css("height",a.h.toString()+"px")
}},setAspectRatio:function(){},statusLoading:function(){this.prog=new ProgressController(sprintf("%s block building",this.component_type.title.toLowerCase()).capitalize());
return this.prog
},statusLoaded:function(){this.prog.update(100)
}})
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/model/component_view",exp)
},window.dbg?0:1000)
}try{var Version=Class.create();
Object.extend(Version.prototype,new Model);
Object.extend(Version.prototype,{initialize:function(c,b){this.mode="viewer";
this.type="Version";
this.id=c;
this.pages_fg=new Array();
this.selectedPageFg=null;
this.getCallback(b);
this.pages_fg.sort(function(e,d){return e.order-d.order
});
this.page_bg.show();
this.minwidth=$().width()-16;
var a=this;
sigCtl.connect("Page.shown",function(g,d){sigCtl.getVariable("PageBg.shown",function(){if(d.getClass()!="page_bg"){a.checkWidth()
}})
});
sigCtl.getVariable("PageBg.shown",function(){$(window).resize(function(){a.checkWidth()
})
})
},setTitle:function(a){document.title=this.name+" > "+a.getTitle()
},loaded:function(){},getIdFromUrl:function(a){return this.extractId(a,/^\/\w*\.(\w+)((\/.+)|\.htm)$/)
},getIdFromHash:function(){return this.extractId(document.location.hash,/^\#\w*\.(\w+)((\/.+))?$/)
},extractId:function(b,c){var a=b.match(c);
if(a){return[a[1],a[3]]
}else{return null
}},getIdFromBBIframe:function(){try{var b=window.frames.back_button.document.body.innerHTML.match(/^.+\.([^\/]+)(\/.+)?$/);
return[b[1],b[2]]
}catch(c){return null
}},selectPageFromUrl:function(b){if($.cookie("error404")){return this.error404()
}var c=null;
if(typeof b=="string"){b=[b]
}if(!b){if(document.location.hash.length>1){b=this.getIdFromHash()
}else{if(document.location.pathname!="/"){b=this.getIdFromUrl(document.location.pathname)
}else{c=this.pages_fg[0]
}}}if(!c&&b){c=this.pages_fg.find(function(d){return d.pageid==b[0]
})
}if(!c){if(this.sent_404){return
}this.sent_404=true;
var a=this;
$.ajax({cache:false,dataType:"json",simple_ajax:true,url:document.location.href.replace(document.location.pathname+"#","/")+".htm",success:function(d){if(d.url){a.selectPageFromUrl(d.url);
a.hash=null;
a.setHash(a.selectedPageFg)
}else{a.error404()
}a.sent_404=false
},error:function(d){a.error404();
a.sent_404=false
}})
}else{if(b){c.setCptUrl(b[1])
}this.selectPageFg(c)
}},error404:function(){this.selectPageFg(this.pages_fg[0]);
this.hash=null;
this.setHash(this.pages_fg[0]);
$.cookie("error404",null);
alert("This page does not exist. You are redirected to the Homepage.")
},selectPageFg:function(a){if(a!=this.selectedPageFg){$("#TB_window").unbind("unload");
tb_remove();
this.setHash(a);
if(this.selectedPageFg){this.selectedPageFg.hide()
}window.scroll(window.scrollX,0);
this.selectedPageFg=a;
a.show();
sigCtl.emit("Version.selectPageFg",a)
}},setHash:function(g){var e=g.getHash();
if(this.hash!=e){sigCtl.emit("Version.hashChanged",g);
this.setTitle(g);
this.hash=e;
var d="#"+e;
if($.browser.msie&&parseInt($.browser.version)<8){document.location=d;
bb_frame_loaded=false;
if($("#back_button").attr("src")!="/test/back_button?d="+e){$("#back_button").attr("src","/test/back_button?d="+e)
}}else{if(document.location.hash!=d){document.location=d
}}for(var h=g.cpts.length-1;
h>=0;
h--){g.cpts[h].ui.onHashChange()
}}},getSelectedPage:function(){return this.selectedPageFg
},checkHeight:function(){Misc.deferred_method(this,this._checkHeight,200)
},_checkHeight:function(){var a=Math.max(this.page_bg.checkHeight(),this.min_height);
if(this.selectedPageFg){a=Math.max(a,this.selectedPageFg.checkHeight())
}this.page_bg.setHeight(a)
},checkWidth:function(g){var b=this;
try{var c=g?0:this.page_bg.checkWidth();
var d=$(window).width()/2;
if($.browser.safari){$("html").css("height","101%");
d-=8
}var a=Math.max(d,this.minwidth/2);
a=Math.max(a,c);
if(!g&&this.selectedPageFg){a=Math.max(a,this.selectedPageFg.checkWidth())
}$("#body.body").width(Math.min(a*2,4000));
b.horizontalScroll()
}catch(h){setTimeout(function(){b.checkWidth()
},150)
}},horizontalScroll:function(){window.scroll(($().width()-$(window).width())/2,window.scrollY)
},show:function(){$("#body.body, #theme_body").show();
this.page_bg.show();
if(this.selectedPageFg){this.selectedPageFg.show()
}this.checkHeight()
},hide:function(){if(this.selectedPageFg){this.selectedPageFg.hide()
}this.page_bg.hide();
$("#body.body, #theme_body").hide()
}})
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/model/version_view",exp)
},window.dbg?0:1000)
}try{var statController={session_id:null,log:function(b,c){var d={session_id:this.session_id,name:b,category:c,site_id:this.site_id,referer_url:document.referrer,date:(new Date()),screen_w:screen.width,screen_h:screen.height,flash_version:getFlashVersion()};
var a=this;
jQuery.ajax({type:"POST",url:"/stat/log",data:d,simple_ajax:true,success:function(e){a.session_id=e.session_id
},dataType:"json"})
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/stat_controller",exp)
},window.dbg?0:1000)
}try{var StatusController=Class.create();
StatusController.prototype={initialize:function(a){this.node=a
},message:function(c,b,d,a){},progressMessage:function(b,a){$(".loading_img").width(20+200*a/100+"px");
if(a==100){this.node.fadeOut(500)
}else{this.node.show()
}},hide:function(){this.node.hide()
}}
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/status_controller_view",exp)
},window.dbg?0:1000)
}try{if(isIE6){$().ready(function(){$(window).resize(function(){$("#body").hide().show()
})
})
}function filt2(s,b){with(this){var f="DXImageTransform.Microsoft.AlphaImageLoader";
var sM=(currentStyle.backgroundRepeat=="no-repeat")?"crop":"scale";
s=(s||"").replace(/\(/g,"%28").replace(/\)/g,"%29");
if(s&&!(/IMG|INPUT/.test(nodeName)&&!b)&&currentStyle.width=="auto"&&currentStyle.height=="auto"){style.width=offsetWidth+"px";
style.height=clientHeight+"px";
if(currentStyle.display=="inline"){style.display="inline-block"
}}if(filters[f]){filters[f].enabled=s?true:false;
if(s){with(filters[f]){src=s
}}}else{if(s){style.filter="progid:"+f+'(src="'+s+'",sizingMethod="'+sM+'")'
}}}}function iePNGFix2(init){with(this){if(typeof blankImg=="undefined"){var blankImg="http://st1.sitew.org/images/spacer.gif?1195420963"
}if(!/MSIE (5\.5|6)/.test(navigator.userAgent)){return
}var isSrc=false;
var isBg=true;
var isClass=!init&&((this.className!=this._png_class)&&(this.className||this._png_class));
if(!(isSrc||isBg||isClass)){return
}this._png_class=this.className;
var blank=blankImg.match(/([^\/]+)$/)[1];
if(isClass&&((style.backgroundImage.indexOf("url(")==-1)||(style.backgroundImage.indexOf(blank)>-1))){setTimeout(function(){try{this.style.backgroundImage=""
}catch(e){}},0);
return
}if(isSrc&&this.src&&/IMG|INPUT/.test(nodeName)){if((/\.png([^\.]+|$)/i).test(src)){filt2.call(this,src,1);
src=blankImg
}else{if(src.indexOf(blank)==-1){filt2.call(this)
}}}var bgSrc=currentStyle.backgroundImage||style.backgroundImage;
if((bgSrc+this.src).indexOf(blank)==-1){var bgPNG=bgSrc.match(/^url[("']+(.*\.png[^\)"']*)[\)"']+[^\)]*$/i);
if(bgPNG){style.backgroundImage='url("'+blankImg+'")';
filt2.call(this,bgPNG[1],0);
var tags=["a","input","select","textarea","iframe","object"],t=tags.length,tFix=[];
while(t--){var elms=all.tags(tags[t]),e=elms.length;
while(e--){tFix.push(elms[e])
}}var t=tFix.length;
while(t--){tFix[t].style.position="relative"
}}else{filt2.call(this)
}}}}}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/helpers/ie6",exp)
},window.dbg?0:1000)
}try{var SecurityController=Class.create();
SecurityController.prototype={initialize:function(){this.atm=null;
this.isIE6=($.browser.msie&&$.browser.version.substring(0,1)=="6");
this.pop=true;
var b=this.n=$("<div id=sec_node><div class=sec_border><div class=sec_fix><b>The access to this page is restricted.</b><br/><small>Click on the button below to access the security form</small><br/><input type=submit value='Show protected content'/></div><div class=sec_ad>Secured by <a style='text-decoration: none;' href='http://www.en.sitew.com'><span style='color: #0F85A9; font-weight: 600'>Site</span><span style='color: #FC6800; font-weight: 800'>W</span></a></div></div></div>").prependTo("body");
sigCtl.connect("Version.selectPageFg",function(c,d){a.pop=true;
b.slideUp()
});
var a=this;
this.btn=b.find("input").click(function(){if(a.isIE6){b.hide();
$(window).scrollTop(0).scrollLeft(0);
setTimeout(function(){a.tb()
},200)
}else{b.slideUp();
a.tb()
}})
},popup:function(){if(this.pop){this.btn.click()
}else{if(this.isIE6){this.n.css("width",$(window).width()).hide().show()
}else{this.n.slideDown()
}}this.pop=false
},tb:function(){tb_show(null,"/security/form/"+v.site_id+"?host="+window.location.host+"&pageid="+v.selectedPageFg.pageid+"&r="+Math.random()+"TB_iframe=1");
$("#TB_window").unload(function(){v.selectedPageFg.m_get()
})
},adult_tb:function(){var a=this;
clearTimeout(this.atm);
tb_remove();
if($.cookie("adult_check")!="ok"){v.hide();
if(!this.sigOwner){this.sigOwner=true;
sigCtl.getVariable("User.site_owner",function(b,c){a.owner=c.owner;
setTimeout(function(){a.adult_tb()
},0)
})
}else{v.hide();
tb_show(null,"/security/adult/"+v.site_id+(a.owner?"?o=1&":"?")+"TB_iframe=1&modal=true");
$("#TB_window").unload(function(){a.adult_tb()
})
}}else{v.show()
}}};
$().ready(function(){secCtrl=new SecurityController()
})
}catch(exp){setTimeout(function(){dbg.error(exp.message.toString()+" Exception in application/controllers/security_controller_view",exp)
},window.dbg?0:1000)
}if(window.page_log==undefined){window.page_log=[]
}window.page_log.push([new Date(),"Executed aggregated file viewer_all"]);
if(window.js_list){js_list.push("viewer_all")
};