
Ext.BLANK_IMAGE_URL='resources/images/aero/s.gif';Ext.QuickTips.init();var TREE_NODES=[{text:'演出相片图集',url:'images/photo/',children:[{text:'华语音乐传媒大赏3 by esther',date:'2007-06-30',url:'images/photo/20070630/esther/',num:31,leaf:true,qtip:'<b>名称：</b>华语音乐传媒大赏3 by esther<br><b>日期：</b>2007-06-30<br><b>数量：</b>31'},{text:'华语音乐传媒大赏2 by gigi',date:'2007-06-30',url:'images/photo/20070630/gigi/',num:30,leaf:true,qtip:'<b>名称：</b>华语音乐传媒大赏2 by gigi<br><b>日期：</b>2007-06-30<br><b>数量：</b>30'},{text:'华语音乐传媒大赏1 by galil',date:'2007-06-30',url:'images/photo/20070630/galil/',num:81,leaf:true,qtip:'<b>名称：</b>华语音乐传媒大赏1 by galil<br><b>日期：</b>2007-06-30<br><b>数量：</b>81'},{text:'十大中文金曲2 by 网友',date:'2007-01-30',url:'images/photo/20070130/2/',num:22,leaf:true,qtip:'<b>名称：</b>十大中文金曲2 by 网友<br><b>日期：</b>2007-01-30<br><b>数量：</b>22'},{text:'十大中文金曲1',date:'2007-01-30',url:'images/photo/20070130/1/',num:17,leaf:true,qtip:'<b>名称：</b>十大中文金曲1<br><b>日期：</b>2007-01-30<br><b>数量：</b>17'},{text:'五一同一首歌走进广州',date:'2007-05-01',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'明星0距离演唱会',date:'2007-04-21',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'<电影之歌>演唱会全接触',date:'2007-01-13',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'中央雅鹿之夜永恒经典新年群星K 歌会',date:'2007-01-06',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'钦州国际海豚节<激情三娘湾>大型文艺晚会2',date:'2006-11-18',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'钦州国际海豚节<激情三娘湾>大型文艺晚会1',date:'2006-11-18',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'家桥驿社第8届筹款演唱会',date:'2005-09-24',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'上海世茂缤纷演唱会',date:'2004-09',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'盈科保险继续微笑会歌神',date:'2004-08',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'美国拉斯维加斯演唱会',date:'2004-11',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'Pics of the Las Vegas',date:'2004-11',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'音乐世界-陈慧娴迷你演唱会',date:'2003-11-17',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'旺角花园广场剪彩仪式',date:'2003-05-17',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'<深展信用卡之夜>群星演唱会',date:'2002-08',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'归来吧！慧娴广州演唱会特辑',date:'1998',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'陈慧娴几时再见演唱会',date:'1989',url:'images/photo/1989/',num:7,leaf:true,qtip:'<b>名称：</b>陈慧娴几时再见演唱会<br><b>日期：</b>1998<br><b>数量：</b>7'},{text:'陈慧娴小时候',url:'',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'},{text:'陈慧娴WallPaper',url:'1',leaf:true,qtip:'<b>名称：</b><br><b>日期：</b><br><b>数量：</b>'}]},{text:'珍贵图片',url:'',children:[{text:'1',url:'',leaf:true},{text:'2',url:'',leaf:true},{text:'3',url:'',leaf:true},{text:'4',url:'',leaf:true},{text:'5',url:'',leaf:true},{text:'6',url:'',leaf:true},{text:'7',url:'',leaf:true}]}];function MainLayout(){var layout=new Ext.BorderLayout(document.body,{north:{split:false,initialSize:25},west:{split:true,initialSize:250,collapsible:true,titlebar:true,animate:false},center:{autoScroll:true,titlebar:true}});layout.beginUpdate();layout.add('north',new Ext.ContentPanel('header',{fitToFrame:true}));layout.add('west',this.navPanel=new Ext.ContentPanel('nav',{fitToFrame:true,autoScroll:true,title:'快速导航'}));layout.add('center',this.contentPanel=new Ext.ContentPanel('content',{fitToFrame:true,autoScroll:true,title:'Content'}));layout.restoreState();layout.endUpdate();}
function NavTree(){this.tree=new Ext.tree.TreePanel('navtree',{animate:true,loader:new Ext.tree.TreeLoader()});var root=new Ext.tree.AsyncTreeNode({text:'慧娴剪影集',draggable:false,singleClickExpand:true,children:TREE_NODES});this.tree.setRootNode(root);this.tree.render();root.expand();root.expandChildNodes();root.collapseChildNodes();}
NavTree.prototype.addClickListener=function(fn){this.tree.addListener('click',fn);};function ContentImg(conf){this.albumNode=null;this.imgNo=-1;var tempDiv=ContentImg.CONTENT_IMG_TEMPLATE.append(Ext.get('content'),conf,true);this.imgEl=tempDiv.child('div');}
ContentImg.CONTENT_IMG_TEMPLATE=new Ext.Template('<div class="{contentImgDivClass}">'+'<div class="contentimgwrap"><a href="{href}" onclick="return false;"><div><img src="{src}" class="contentimg"></div></a></div>'+'<div id="{imgDescriptionId}" class="{imgDescriptionClass}">{imgDescription}</div>'+'</div>');ContentImg.CONTENT_IMG_TEMPLATE.compile();function showAlbumInContent(node,contentPanel){if(node.attributes['text']==contentPanel.getTitle()){return;}
Ext.get('content').select('div').remove();contentPanel.setTitle(node.attributes['text']);var childNodes=node.childNodes;for(var i=0;i<childNodes.length;i++){var contentImg=new ContentImg({contentImgDivClass:'contentalbumdiv',imgDescriptionClass:'albumdescription',href:childNodes[i].attributes['url']+'img1.jpg',src:childNodes[i].attributes['url']+'preview/preimg1.jpg',imgDescriptionId:'albumdescripton'+i,imgDescription:childNodes[i].attributes['qtip']});contentImg.imgEl.albumNode=childNodes[i];contentImg.imgEl.addListener('click',function(){showImgInContent(this.albumNode,contentPanel);});}}
function showImgInContent(node,contentPanel){if(node.attributes['text']==contentPanel.getTitle()){return;}
Ext.get('content').select('div').remove();var url=node.attributes['url'];var imgNum=node.attributes['num'];var text=node.attributes['text'];contentPanel.setTitle(text);for(var i=1;i<=imgNum;i++){var contentImg=new ContentImg({contentImgDivClass:'contentimgdiv',imgDescriptionClass:'imgdescription',href:url+'img'+i+'.jpg',src:url+'preview/preimg'+i+".jpg",imgDescriptionId:'imgdescription'+i,imgDescription:'PIC '+i});contentImg.imgEl.imgNo=i;contentImg.imgEl.addListener('click',function(){showImgDialog(text,url,this.imgNo,imgNum);});}}
function ImgDialog(){if(ImgDialog.IMG_DIALOG){return ImgDialog.IMG_DIALOG;}
this.title=null;this.imgNo=-1;this.imgNum=-1;this.url=null;this.imgWidth=-1;this.dialog=new Ext.BasicDialog('imgdialog',{width:400,minWidth:200,height:400,minHeight:200,modal:true,buttonAlign:'center'});ImgDialog.DIALOG_IMG_TEPLATE.append(this.dialog.body);this.IMG_A_EL=Ext.get('dialogimga');this.IMG_EL=Ext.get('dialogimg');this.IMG_LOADING_EL=Ext.get('dialogimgloading');ImgDialog.IMG_DIALOG=this;this.dialog.addButton('上一张',function(){if(ImgDialog.IMG_DIALOG.imgNo<=1){return;}else{ImgDialog.IMG_DIALOG.imgNo--;ImgDialog.IMG_DIALOG.freshAndShow(ImgDialog.IMG_DIALOG.title,ImgDialog.IMG_DIALOG.url,ImgDialog.IMG_DIALOG.imgNo,ImgDialog.IMG_DIALOG.imgNum);}},this);this.dialog.addButton('下一张',function(){if(ImgDialog.IMG_DIALOG.imgNo>=ImgDialog.IMG_DIALOG.imgNum){return;}else{ImgDialog.IMG_DIALOG.imgNo++;ImgDialog.IMG_DIALOG.freshAndShow(ImgDialog.IMG_DIALOG.title,ImgDialog.IMG_DIALOG.url,ImgDialog.IMG_DIALOG.imgNo,ImgDialog.IMG_DIALOG.imgNum);}},this);this.dialog.addListener('resize',function(o,width,height){ImgDialog.IMG_DIALOG.IMG_EL.setWidth((width<(ImgDialog.IMG_DIALOG.imgWidth+100))?(width-100):ImgDialog.IMG_DIALOG.imgWidth);});}
ImgDialog.DIALOG_IMG_TEPLATE=new Ext.Template('<div>'+'<div id="dialogimgloading" style="font-size:small;color:#7f7f7f;"><img src="../resources/images/default/grid/loading.gif">&nbsp;&nbsp;图片加载中...</div>'+'<a id="dialogimga" target="_blank"><div align="center"><img id="dialogimg"></div></a>'+'</div>');ImgDialog.DIALOG_IMG_TEPLATE.compile();ImgDialog.IMG_DIALOG=null;ImgDialog.prototype.show=function(){this.dialog.show();}
ImgDialog.prototype.freshAndShow=function(title,url,imgNo,imgNum){this.title=title;this.url=url;this.imgNo=imgNo;this.imgNum=imgNum;this.IMG_EL.hide();this.IMG_LOADING_EL.show();this.dialog.setTitle('('+this.imgNo+'/'+this.imgNum+') '+this.title);this.IMG_EL.dom.src=this.IMG_A_EL.dom.href=this.url+'img'+this.imgNo+'.jpg';this.dialog.show();var tempImgObject=new Image();tempImgObject.src=this.url+'img'+this.imgNo+".jpg";if(!tempImgObject.width){tempImgObject.onload=function(){var imgDialog=ImgDialog.IMG_DIALOG;if(this.src!=imgDialog.IMG_EL.dom.src){return;}
imgDialog.IMG_LOADING_EL.hide();imgDialog.IMG_EL.show();imgDialog.imgWidth=this.width;imgDialog.IMG_EL.setWidth((imgDialog.dialog.body.getWidth()<(imgDialog.imgWidth+100))?(imgDialog.dialog.body.getWidth()-100):imgDialog.imgWidth);imgDialog.dialog.show();};}else{this.IMG_LOADING_EL.hide();this.IMG_EL.show();this.imgWidth=tempImgObject.width;this.IMG_EL.setWidth((this.dialog.body.getWidth()<(this.imgWidth+100))?(this.dialog.body.getWidth()-100):this.imgWidth);this.dialog.show();}}
function showImgDialog(title,url,imgNo,imgNum){if(!ImgDialog.IMG_DIALOG){new ImgDialog();}
if((ImgDialog.IMG_DIALOG.url==url)&&(ImgDialog.IMG_DIALOG.imgNo==imgNo)){ImgDialog.IMG_DIALOG.show();return;}
ImgDialog.IMG_DIALOG.freshAndShow(title,url,imgNo,imgNum);}
function showFrame(){var layout=new MainLayout();var contentPanel=layout.contentPanel;var navTree=new NavTree();var treeRoot=navTree.tree.root;navTree.addClickListener(function(node,e){if((node.attributes['text']==contentPanel.getTitle())||(node==treeRoot)){return;}
if(node.isLeaf()){showImgInContent(node,contentPanel);}else{showAlbumInContent(node,contentPanel);}});showAlbumInContent(navTree.tree.root.firstChild,contentPanel);}
Ext.onReady(showFrame);