jQuery.fn.center=function(opt){return this.each(function(){var t=jQuery(this);if(opt.animate&&opt.animate_width){t.width(opt.animate_width);if(opt.animate_object)opt.animate_object.animate({width:opt.animate_width});opt.width=opt.animate_width;}
opt=(opt)||{};opt.width=(opt.width)||jQuery(this).width();opt.height=(opt.height)||jQuery(this).height();opt.defaultWidth=(opt.defaultWidth)||400;if(opt.width==jQuery(window).width())opt.width=opt.defaultWidth;var leftPos=(jQuery(window).width()-opt.width)/2+jQuery(window).scrollLeft(),topPos=(jQuery(window).height()-opt.height)*0.3+jQuery(window).scrollTop();leftPos=(leftPos<0)?0:leftPos;topPos=(topPos<0)?0:topPos;t.css({position:"absolute"});if(opt.animate){t.animate({left:leftPos+'px',top:topPos+'px',width:opt.animate_width});}else{t.css({left:leftPos+'px',top:topPos+'px'});}});};jQuery.fn.middle=function(opt){return this.each(function(){var t=jQuery(this);opt=(opt)||{};opt.height=(opt.height)||jQuery(this).height();var topPos=(jQuery(window).height()-opt.height)/2+jQuery(window).scrollTop();topPos=topPos-70;topPos=(topPos<0)?0:topPos;t.css({position:"absolute"});if(opt.animate){t.animate({left:leftPos+'px',top:topPos+'px',width:opt.animate_width});}else if(opt.width){t.css({width:opt.width+'px',top:topPos+'px'});}else{t.css({top:topPos+'px'});}});};$.ajaxSetup({beforeSend:function(xhr){xhr.setRequestHeader("X-Requested-Type","ajax");xhr.setRequestHeader("X-Requested-Caller","jframe");}});jQuery.postJSON=function(_url,_data,_callback){return $.ajax({url:_url,data:_data,type:'POST',dataType:'json',timeout:1000,success:_callback});};jQuery.postTEXT=function(_url,_data){var bool=false;Common.ajaxLock(true);var html=$.ajax({url:_url,data:_data,type:'POST',dataType:'json',async:false,error:function(error){bool=true;return false;}}).responseText;Common.ajaxLock(false);if(bool){return null;}
return html;};
registerNS("jframe.core");jframe.core.Enums=Object.create({RUNTYPE:{DEBUG:1,RELEASE:2},LOGLEVEL:{TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,FATAL:5},getString:function(key,enumValue){var _self=this;if(!_self[key])return"";var retval="";for(var k in _self[key]){if(_self[key][k]==enumValue){retval=k;break;}}
return retval;},toString:function(){return"jframe.core.Enums";}},"$enums");
registerNS("jframe.core");jframe.core.Config={VERSION:"1.0",RUNTYPE:$enums.RUNTYPE.RELEASE,LOGLEVEL:$enums.LOGLEVEL.RELEASE,PLUGINPATH:"/js",toString:function(){return"jframe.core.config";}}
var $config=jframe.core.Config;
registerNS("jframe.core");jframe.core.Logger=function(classname){this.initialize(classname);}
jframe.core.Logger.wndHandle=null;jframe.core.Logger.docHandle=null;jframe.core.Logger.logElement=null;jframe.core.Logger.prototype={loglevel:null,classname:null,ieVer:0,useLogWindow:false,hasFireBug:false,winRef:null,docRef:null,logElement:null,timeSection:null,_startTime:{},_endTime:{},initialize:function(classname){if(classname)this.classname=classname;var agent=navigator.userAgent.toLowerCase();var ver=agent.split(';');if(agent.indexOf('msie')!=-1)
{this.ieVer=parseFloat(ver[1].slice(6,ver[1].length));}else{try{if(typeof(console.log)=="function")this.hasFireBug=true;}catch(err){}}
if($config.RUNTYPE==$enums.RUNTYPE.RELEASE)return;if(!this.hasFireBug&&this.useLogWindow){if(jframe.core.Logger.wndHandle){this.winRef=jframe.core.Logger.wndHandle;this.docRef=jframe.core.Logger.docHandle;this.logElement=jframe.core.Logger.logElement;}else{var wnd=Common.centerPopupWindow("","wndJframeLogger",{childWidth:800,childHeight:700});if(!wnd){}
else{window.top.consoleWindow=wnd;this.winRef=window.top.consoleWindow;this.docRef=this.winRef.document;jframe.core.Logger.wndHandle=this.winRef;jframe.core.Logger.docHandle=this.docRef;this.createBaseWnd();}}}
this.loglevel=$config.LOGLEVEL;},setClassName:function(classname){this.classname=classname;},getClassName:function(){return this.classname;},createBaseWnd:function(){this.docRef.open();this.docRef.write("<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN ");this.docRef.write("  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>\n\n");this.docRef.write("<html><head><title>jframe.core.logger - logging window</title><style>*{font-size:11px;font-family:verdana;}</style>\n");this.docRef.write("</head><body style='margin:0px;background-color:#efefef;'></body>\n");var mentdiv=this.docRef.createElement("DIV");mentdiv.style.backgroundColor="black";mentdiv.style.color="white";mentdiv.style.padding="10px";mentdiv.innerHTML="jframe.core.logger - logging window";this.docRef.body.appendChild(mentdiv);this.logElement=this.docRef.createElement("DIV");this.logElement.style.padding="4px";this.logElement.style.overflowY="scroll";this.logElement.style.height="600px";this.docRef.body.appendChild(this.logElement);jframe.core.Logger.logElement=this.logElement;this.winRef.focus();},appendToWnd:function(forecolor,backcolor,text){var divx=this.docRef.createElement("DIV");divx.innerHTML=text;divx.style.color=forecolor;divx.style.padding="2px";divx.style.backgroundColor=backcolor;this.logElement.appendChild(divx);},printLog:function(logLevel,msg){if($config.RUNTYPE==$enums.RUNTYPE.RELEASE||logLevel<this.loglevel)return;var logtype=(this.hasFireBug)?"firebug":"window";if(logtype=="firebug"){var consoleFunction="";switch(logLevel){case $enums.LOGLEVEL.TRACE:consoleFunction="log";break;case $enums.LOGLEVEL.DEBUG:consoleFunction="debug";break;case $enums.LOGLEVEL.INFO:consoleFunction="info";break;case $enums.LOGLEVEL.WARN:consoleFunction="warn";break;case $enums.LOGLEVEL.ERROR:consoleFunction="error";break;case $enums.LOGLEVEL.FATAL:consoleFunction="error";break;}
if(typeof(msg)=="object"||typeof(msg)=="function"){try{console[consoleFunction](msg);}catch(console_err){}}else{try{console[consoleFunction]("["+this.getClassName()+"]["+$enums.getString("LOGLEVEL",logLevel)+"] >> "+msg);}catch(console_err){}}}else if(logtype=="window"){if(!this.winRef||!this.docRef)return;var logcolor={fore:"#000000",back:"#ffffff"};switch(logLevel){case $enums.LOGLEVEL.TRACE:logcolor.fore="#000000";logcolor.back="#ffffff";break;case $enums.LOGLEVEL.DEBUG:logcolor.fore="#000000";logcolor.back="#ffffff";break;case $enums.LOGLEVEL.INFO:logcolor.fore="navy";logcolor.back="#ffffff";break;case $enums.LOGLEVEL.WARN:logcolor.fore="black";logcolor.back="yellow";break;case $enums.LOGLEVEL.ERROR:logcolor.fore="red";logcolor.back="yellow";break;case $enums.LOGLEVEL.FATAL:logcolor.fore="white";logcolor.back="red";break;}
if(typeof(msg)=="object"){var retval="";for(var k in msg)retval+="["+k+"] : "+msg[k]+"<br>\r\n";msg=retval;}
this.appendToWnd(logcolor.fore,logcolor.back,"["+this.getClassName()+"]["+$enums.getString("LOGLEVEL",logLevel)+"] >> "+msg);}},trace:function(msg){this.printLog($enums.LOGLEVEL.TRACE,msg);},debug:function(msg){this.printLog($enums.LOGLEVEL.DEBUG,msg);},info:function(msg){this.printLog($enums.LOGLEVEL.INFO,msg);},warn:function(msg){this.printLog($enums.LOGLEVEL.WARN,msg);},error:function(msg){this.printLog($enums.LOGLEVEL.ERROR,msg);},fatal:function(msg){this.printLog($enums.LOGLEVEL.FATAL,msg);},timeStart:function(sectionName){if($config.RUNTYPE==$enums.RUNTYPE.RELEASE)return;this.timeSection=sectionName;if(this.hasFireBug){console.time(this.timeSection);}else{this._startTime[this.timeSection]=new Date().getTime();var div=this.docRef.createElement("DIV");div.innerHTML="Performance check ["+this.timeSection+"]";div.style.color="green";div.style.padding="2px";div.style.backgroundColor="lavender";div.style.borderBottom="4px solid green";this.logElement.appendChild(div);}},timeEnd:function(sectionName){if($config.RUNTYPE==$enums.RUNTYPE.RELEASE)return;if(this.hasFireBug){console.timeEnd(sectionName);}else{this._endTime[sectionName]=new Date().getTime();var diff=this._endTime[sectionName]-this._startTime[sectionName];var div=this.docRef.createElement("DIV");div.innerHTML="Execution time : "+diff+" ms.";div.style.textAlign="right";div.style.padding="2px";div.style.backgroundColor="lavender";div.style.borderTop="4px solid green";this.logElement.appendChild(div);}},toString:function(){return"jframe.core.Logger";}};
registerNS("jframe.core");jframe.core.BaseClass=function(){};var $baseclass=jframe.core.BaseClass;jframe.core.BaseClass.prototype=Object.create({logger:null,debug:function(e){if(!this.isNull(this.printdebug)&&this.printdebug==false)return;this.logger.debug(e);},isNull:function(e){if(typeof(e)=="undefined"||e==null||e=="null")
return true;else
return false;},eventStop:function(e){if(e){if(e.stopPropagation)e.stopPropagation();else window.event.cancelBubble=true;}},isGetter:function(e){return this.isNull(e);}});jframe.core.Extend=function(objectSource,aliasname){var o;if(typeof(objectSource)=="object"&&typeof(aliasname)=="object"){o=Object.extend(objectSource,aliasname);o.logger=new jframe.core.Logger(o.toString());}else{o=Object.extend(new $baseclass,objectSource);o.logger=new jframe.core.Logger(o.toString());if(aliasname)
window[aliasname]=o;}
return o;}
jframe.core.importPlugin=function(pluginFile){importJS($config.PLUGINPATH+"/"+pluginFile+".js");}
var $extend=jframe.core.Extend;var $plugin=jframe.core.importPlugin;
jframe.core.TemplateData={}
jframe.core.TemplateLoader=function(){};jframe.core.TemplateLoader.prototype=$extend({buffer:{},loadData:function(){for(var k in jframe.core.TemplateData){for(var j in jframe.core.TemplateData[k]){this.buffer[k+"/"+j]={url:jframe.core.TemplateData[k][j],html:null};}}
this.logger.info(this.buffer);},getHtml:function(loadSection){var htmls="";this.logger.debug("getHtml started."+this.buffer);if(!this.buffer[loadSection].html){this.logger.debug("cached html is null. load html from webserver...");this.buffer[loadSection].html=$.ajax({url:this.buffer[loadSection].url,async:false}).responseText;htmls=this.buffer[loadSection].html;this.logger.info(this.buffer);}else{this.logger.debug("return html from cached buffer");htmls=this.buffer[loadSection].html;}
this.logger.debug("getHtml finished.");return htmls;},toString:function(){return"jframe.core.TemplateLoader";}},"$templateloader");
registerNS("jframe.core");jframe.core.TagLibrary=$extend({initialize:function(){this.logger.debug("initialize called.");var _self=this;$(document).ready(function(){_self.tagLoader();});},tagLoader:function(scanNode){this.logger.debug("tagLoader called.");var _self=this;var scanNode=(scanNode)||$(document);var node=scanNode.find("[jstag='true']");this.logger.debug("jstag total "+node.length+" found.");$(node).each(function(i){var o=$(this);var jstaglib=o.attr("jstaglib")||"";var jstagprop=o.attr("jstagprop")||"";var jstagpropJSON={};$(jstagprop.split(',')).each(function(){if(!this)return;var arr=this.split(':');jstagpropJSON[arr[0].trim()]=arr[1].trim();});_self.logger.debug("["+i+"] : "+jstaglib+"("+jstagprop+")");var taglibClass=null;try{taglibClass=eval(jstaglib);if(eval(jstaglib+".isClass")==true){_self.logger.info(jstaglib+".isClass found.");taglibClass=eval("new "+jstaglib);}}catch(exception){_self.logger.warn("jstaglibrary class ["+jstaglib+"] not found.");}
if(typeof(taglibClass)=="object"){taglibClass.initialize(o,jstagpropJSON);}});},toString:function(){return"jframe.core.TagLibrary";}},"$taglib");$taglib.initialize();
registerNS("jframe.core");jframe.core.FxSocketManager=$extend({CONFIG:{PATH:"/js/fxsock/FxSocket.swf",ID:"fxSockApp"},index:0,instances:[],createClientSocket:function(opt){opt=(opt)||{};opt.index=this.index;opt.id=(opt.id)||this.CONFIG.ID+""+this.index;this.logger.debug("createClientSocket called.");var fxsock=new jframe.core.FxSocket(opt);this.instances.push(fxsock);this.index++;return fxsock;},getInstance:function(index){var o=this.instances[index];if(!o)this.logger.error("getInstance error. - socket ["+index+"] not found.");return o;},toString:function(){return"jframe.core.FxSocketManager";}},"$socketManager");jframe.core.FxSocket=function(o){this.initialize(o);}
jframe.core.FxSocket.prototype=$extend({index:null,container:null,opt:null,FX:null,initialize:function(opt){opt=(opt)||{};var _self=this;var config=jframe.core.FxSocketManager.CONFIG;opt.src=(opt.src)||config.PATH+"?instanceIndex="+opt.index;this.index=opt.index;this.logger.debug("initialized.");this.logger.debug(opt);this.opt=opt;this.container=$("<div id='"+opt.id+"'></div>");$(document).ready(function(){$("body").append(_self.container);swfobject.embedSWF(opt.src,opt.id,"0","0","9.0.0","./expressInstall.swf");});},FX_initialized:function(){if(navigator.appName.indexOf("Microsoft")!=-1){this.FX=window[this.opt.id];}else{this.FX=document[this.opt.id];}
this.FX=document[this.opt.id];this.logger.debug("FX_initialized.");this.logger.debug(this.opt);if(this.opt.host&&this.opt.port){this.FX.connect(this.opt.host,this.opt.port);}},FX_onSocketConnect:function(){this.logger.debug("FX_onSocketConnect");if(this.opt.onConnect)this.opt.onConnect();},FX_onSocketData:function(recvData){this.logger.debug("FX_onSocketData");this.logger.debug(recvData);if(this.opt.onData)this.opt.onData(recvData);},FX_sendMessage:function(packet){this.logger.debug("FX_sendMessage");this.logger.debug(packet);this.FX.sendMessage(packet);},sendMessage:function(packet){this.FX_sendMessage(packet);},toString:function(){return"jframe.core.FxSocket";}});
jframe.core.InternalMessage=function(o){this.initialize(o);}
jframe.core.InternalMessage.prototype=$extend({json:null,initialize:function(json){this.logger.debug("internal message initialized."+typeof(json));if(json){if(typeof(json)=="object"){this.json=json;}else if(typeof(json)=="string"){this.json=eval("("+json+")");}}else{this.json={dataset:[]};}},get:function(key){if(!this.json)return null;return this.json[key];},getKeys:function(){if(!this.json)return null;var retval=[];for(var k in this.json){if(k!="dataset")retval.push(k);}
return retval;},getDs:function(){if(!this.json||!this.json.dataset||this.json.dataset.length==0)return null;var datasetIndex=0;if(arguments.length==0){datasetIndex=0;}else if(arguments.length>0){datasetIndex=parseInt(arguments[0],10);}
if(datasetIndex>=this.json.dataset.length){this.logger.error("invalid dataset index number - total dataset : "+this.json.dataset.length+" / get datasetindex : "+datasetIndex);return null;}
return this.json.dataset[datasetIndex];},getDsSize:function(){if(!this.json||!this.json.dataset)return 0;else return this.json.dataset.length;},setDs:function(dataset){if(this.json&&this.json.dataset){this.logger.debug("setDs called.");this.json.dataset.push(dataset);this.logger.debug(this.json);}},toString:function(){return"jframe.core.InternalMessage";}});jframe.core.InternalMessage.getInternalMessage=function(json){return new jframe.core.InternalMessage(json);}
$imsgParser=jframe.core.InternalMessage.getInternalMessage;
jframe.core.PagingBlock=$extend({_defOption:{scale:10,blockscale:10},log:function(e){this.logger.debug(e);},getPagingData:function(opt){this.log("getPagingData called");this.logger.debug(opt);var opt=(opt)||{};var page=(opt.page)||1;var scale=(opt.scale)||this._defOption.scale;var blockscale=(opt.blockscale)||this._defOption.blockscale;var total=(opt.total)||1;var totalPage=Math.ceil(total/scale);this.logger.debug("totalPage : "+totalPage);if(page>totalPage){this.logger.warn("now page is larger then total page.");page=totalPage;}
var x_10=blockscale;var x_9=x_10-1;var startPage;var endPage;var nowPage=page;startPage=Math.floor((nowPage-1)/x_10)*x_10+1;if(totalPage>startPage+x_9)
endPage=startPage+x_9;else
endPage=totalPage;this.log("startPage : "+startPage);this.log("endPage : "+endPage);this.log("nowPage : "+nowPage);this.log("totalPage : "+totalPage);var pagingData={prev:0,next:0,lists:[],totalpage:1}
pagingData.totalpage=totalPage;pagingData.prev=(startPage-1>0)?startPage-1:0;if(totalPage>0){for(var i=startPage;i<=endPage;i++){pagingData.lists.push({page:i,selected:(i==nowPage)});}}
pagingData.next=(endPage+1>totalPage)?0:endPage+1;this.log(pagingData);return pagingData;},toString:function(){return"jframe.core.PagingBlock";}});
registerNS("jframe.plugin.blockUI");jframe.plugin.blockUI=$extend({layerId:"jquery_plugin_blockui_wrapper_layer",layerObj:null,htmlObj:null,visible:false,lockObj:null,bLoad:false,isVisible:function(){return this.visible;},hide:function(){this.visible=false;this.logger.debug("hide called.");if(this.layerObj){this.layerObj.innerHTML="";this.layerObj.remove();this.layerObj=null;}
if(this.lockObj){this.lockObj.innerHTML="";this.lockObj.remove();this.lockObj=null;}
this.logger.debug("hide visible : "+this.isVisible());},show:function(data){this.logger.debug("show called.");var _self=this;var html=(data.html)||"";if(data.template)html=$templateloader.getHtml(data.template);if(data.url)html=$.ajax({url:data.url,async:false}).responseText;if(!this.layerObj){this.layerObj=$("<DIV id='"+this.layerId+"'></DIV>");$("body").append(this.layerObj);}
this.closeAttachLayer();this.htmlObj=$(html);this.layerObj.empty().append(this.htmlObj).show();var size={width:this.htmlObj.width(),height:this.htmlObj.height()};if(!size.width||!size.height){size={width:this.layerObj.find(".layerBox").width(),height:this.layerObj.find(".layerBox").height()};}
if(!size.width||!size.height){size={width:this.layerObj.width(),height:this.layerObj.height()};}
if(data.size){if(data.size.width)size.width=data.size.width;if(data.size.height)size.height=data.size.height;}
var minDimension={width:398,height:210};if(size.width<minDimension.width)size.width=minDimension.width;if(size.height<minDimension.height)size.height=minDimension.height;this.layerObj.find(".layBtnClose").bind("click",function(e){_self.hide();return false;});this.layerObj.find(".layerBox .layBtnClose a").bind("click",function(e){_self.hide();return false;});var docGap=20;var scrollTop=$(window).scrollTop();var dimensions={width:document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientWidth:document.body.clientWidth,height:document.compatMode=='CSS1Compat'&&!window.opera?document.documentElement.clientHeight:document.body.clientHeight}
try{this.layerObj.find(".idTabs").idTabs();}catch(err){}
if(!this.isVisible()){var iframe=$("<iframe id=\"jquery_plugin_blockui_iframe\" frameborder=0 style=\"position: absolute;left:0px;z-index:-1;top:0px;filter:alpha(opacity=0);\"></iframe>");this.layerObj.append(iframe);this.layerObj.find(".layerBox").css("zIndex",9999);if(data.defaulthide)this.layerObj.hide();this.layerObj.css("zIndex",9995);this.layerObj.center({width:size.width,height:size.height,left:"0",caller:"$blockUI"});this.layerObj.css({width:"100%",left:"0"});this.layerObj.find("#jquery_plugin_blockui_iframe").css({width:"100%",height:_self.layerObj.height(),left:"0"});if(this.lockObj){this.lockObj.innerHTML="";this.lockObj.remove();this.lockObj=null;}
if(navigator.appName.indexOf("Microsoft")>-1){if(navigator.appVersion.indexOf("MSIE 6")>-1){this.lockObj=$('<div style="display:none; border: medium none ; margin: 0pt; padding: 0pt; z-index: 9990; FILTER: alpha(opacity=10); opacity:0.1; width: 100%; height: '+$(document).height()+'px; top: 0pt; left: 0pt; background-color: rgb(0, 0, 0); position: absolute;" class="blockUI blockOverlay"/>');}}
if(!this.lockObj){this.lockObj=$('<div style="display:none; border: medium none ; margin: 0pt; padding: 0pt; z-index: 9990; FILTER: alpha(opacity=10); opacity:0.1; width: 100%; height: 100%; top: 0pt; left: 0pt; background-color: rgb(0, 0, 0); position: fixed;" class="blockUI blockOverlay"/>');}
$("body").append(this.lockObj);if(this.lockObj)
this.lockObj.show();this.visible=true;}},closeAttachLayer:function(){this.logger.debug("closeAttachLayer function started.");var _self=this;_self.logger.debug($(".zoomViewBox").length);if($(".zoomViewBox").length>0){$attachManager.beforeAttachIdx=-1;$("#attShowCaseBindingarea").find("li").removeClass("selected");$(".zoomViewBox .zoomView").html("");$(".zoomViewBox").hide();$(".ZeroClipboard").innerHTML="";$(".ZeroClipboard").remove();if($SpotDetailManager.current_spot_trackback_url!=""){$SpotDetailManager.clip1=new ZeroClipboard.Client();$SpotDetailManager.clip1.setText($SpotDetailManager.current_spot_trackback_url);$SpotDetailManager.clip1.addEventListener('complete',$SpotDetailManager.trackbackUrlCopyComplete);$SpotDetailManager.clip1.glue('spot_trackback_url');_self.logger.debug($SpotDetailManager.clip1);}
if($SpotDetailManager.current_spot_origin_trackback_url!=""){$SpotDetailManager.clip2=new ZeroClipboard.Client();$SpotDetailManager.clip2.setText($SpotDetailManager.current_spot_origin_trackback_url);$SpotDetailManager.clip2.addEventListener('complete',$SpotDetailManager.trackbackUrlCopyComplete);$SpotDetailManager.clip2.glue('origin_trackback_url');_self.logger.debug($SpotDetailManager.clip1);}}
this.logger.debug("closeAttachLayer function ended.");},reposition:function(opt){var _self=this;opt=(opt)||{};if(this.layerObj){this.layerObj.empty().append(this.htmlObj).show();var size={width:this.htmlObj.width(),height:this.htmlObj.height()};if(!size.width||!size.height){size={width:this.layerObj.width(),height:this.layerObj.height()};}}
if(this.layerObj){this.layerObj.center({width:size.width,height:size.height,caller:"$blockUI",animate:false,animate_width:(opt.animate_width)||0,animate_object:(opt.animate_object)||null});this.layerObj.css({width:"100%",left:"0"});this.layerObj.find("#jquery_plugin_blockui_iframe").css({width:_self.layerObj.width(),height:_self.layerObj.height()});}
if(this.bLoad)this.lockObj.empty().show();},toString:function(){return"jframe.plugin.blockUI";}},"$blockUI");