/*/20100908150457/public/javascripts/lang/en/viewer.js built Wed Sep 08 17:06:49 +0200 2010 - last modified 2010-09-07 17:48:19*/
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(f){if(f.errors){c(f.errors)
}else{e(f)
}},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(f,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("The 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(f){var e=f.getHash();
if(this.hash!=e){sigCtl.emit("Version.hashChanged",f);
this.setTitle(f);
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 g=f.cpts.length-1;
g>=0;
g--){f.cpts[g].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(f){var b=this;
try{var c=f?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(!f&&this.selectedPageFg){a=Math.max(a,this.selectedPageFg.checkWidth())
}$("#body.body").width(Math.min(a*2,4000));
b.horizontalScroll()
}catch(g){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"]);
if(window.js_list){js_list.push("viewer")
};