KISSY.use("node,dom,ua,event,json", function(S, Node,DOM,UA,Event,JSON) {
S.getScript('/public/static/wdx/gongju/js/core.js');
S.getScript('/public/static/wdx/gongju/js/ks142.js');
var PAGE_SIZE=['默认','100%',1920,1440,1366,1280,1024,800,640,400,320,240],pageHeight=document.body.offsetHeight;
S.ready(function(){
var box=S.one('#photobox'),ps=S.one('#pagesize'),mbox=S.one('#modulebox'),con=S.one('#container'),ow="",w=0;
if(ow==''){
con.children().each(function(dd){
var a=dd.css('position')=='absolute' ? dd : dd.first();
if(a){
var d=a.getDOMNode(),_w=d.offsetLeft+d.offsetWidth;
if(d.offsetLeft>=0 && _w > w){
w = Math.min(1920,_w);
}
}
});
}
function changewidth(s,ov){
var _w=parseInt(s);
mbox.css('overflow-x',ov);
mbox.width(_w==NaN || s=='100%'? 'auto' : _w);
if(S.isNumber(_w) && _w>box.width()){
mbox.css({'position':'absolute','left':'50%','margin-left':0-parseInt(s)/2});
}else{
mbox.css({'position':'static','left':'0','margin':'0px auto'});
}
if(s!='100%' && w){
con.css({'left':(mbox.width()-w)/2,'width':w});
}else{
con.css('left',0);
}
}
document.body.style.overflow='hidden';
box.css({'overflow':'auto','z-index':1,'position':'relative'});
ps.css('z-index',2);
mbox.css({'border-left':'1px dashed #ccc','border-right':'1px dashed #ccc','overflow-x':'hidden'});
Event.delegate('#pagesize','click','.changesize',function(ev){
var e = ev.currentTarget,oe = S.all(e),s=oe.attr('data-size'),w=parseInt(s);
changewidth(s,parseInt(oe.attr('data-idx'))>2 ? 'hidden' : 'visible');
});
for(var i in PAGE_SIZE){
var _w = i > 1 ? PAGE_SIZE[i] : (i>0 ? '100%' : ow);
var m = S.all('
'+PAGE_SIZE[i]+'
');
ps.append(m);
}
Event.on(window,'resize',function(ev){
pageHeight=document.body.offsetHeight;
box.height(pageHeight-box.offset().top);
});
changewidth('','');
box.height(pageHeight-box.offset().top);
});
});
function firm()
{
window.close();
}