/*COIN -Copyright (c)2008 InfoPlayer.jp. All Rights Reserved/concept design ID-G
このプログラムの無断転載と無断利用、複製、流用、改ざん、改変、転載、リバースエンジニアリング、並びにそれに伴う本サイトプログラムの無断での使用を禁じます。
 */
(function(){var coIn=function(){$o=this;return this instanceof coIn?this.create():new coIn()};window.coIn=coIn;coIn.prototype={create:function(){jQuery.inherit(coIn,coinDI);var self=this;this.initDI("template/coinip.tpl");$o.newUrl="infoplayer.do#o=";var d=this.imgDir;$o.wizNew={};$o.noChange=true;$o.type.swidth=28;this.hashRedef($o.type,{"-2":d+"news.gif","-1":d+"enqs.gif","0":d+"infos.gif","1":d+"urls.gif","2":d+"pics.gif","3":d+"sounds.gif","4":d+"movies.gif","5":d+"files.gif","6":d+"docs.gif"},"s");jQuery("#oInfoW_btnOpen").click(function(){$o.infoWrite()});jQuery("#oGrid_btnAdd").click(function(){$o.gridCellAdd()});jQuery("#oInfoW_btnWTxt").click(function(){$o.wizEntry("txt")});jQuery("#oInfoW_btnWImg").click(function(){$o.wizEntry("img")});jQuery("#oInfoW_btnWSnd").click(function(){$o.wizEntry("snd")});jQuery("#oInfoW_btnWMov").click(function(){$o.wizEntry("mov")});jQuery(function(){
/*@cc_on
eval((function(props) {var code = [];for (var i = 0,l = props.length;i<l;i++){var p = props[i];window['_'+p]=window[p];code.push(p+'=_'+p);}return 'var '+code.join(',');})('document self top parent alert setInterval clearInterval setTimeout clearTimeout'.split(' ')));
@*/
if($o.IE6){jQuery(".btnFlat").hover(function(){jQuery(this).css("color","red")},function(){jQuery(this).css("color","black")});jQuery(".btnText").hover(function(){jQuery(this).css("color","red")},function(){jQuery(this).css("color","gray")})}jQuery().oDecoButton();$o.moving=true;jQuery(window).scroll(function(){jQuery().oDialog("refresh")}).resize(function(){jQuery().oDialog("refresh")});if(typeof(_o)!="undefined"){jQuery().o.setHistory(false);$o.checkReadOnly("noDialog");if($o.nowTop.topCoinId>=1){self.TopCoinLoad($o.nowTop.topCoinId)}else{$o.urlInt=jQuery.historyInit($o.pageload)}}})},refreshInterfaces:function(emp){$o.refreshTitle(emp);jQuery("#oInfo_cellNo").html("");if(emp){$o.jQRV.empty();return}var jQSd=jQuery("#oSound_btnImg").hide(),tp=$o.cnt.contentType,txt=(tp<3);jQuery("#oGrid_btnAdd").ifShow($o.free);jQuery("#oHeader_theme span").html($o.tp.theme.themeWord);jQuery("#oHeader_sid span").html($o.tp.coinCd);if($o.filter.selected!=null){$o.refreshFilterButton()}jQuery("#oDoc_btnOpen").hide();jQuery("#oInfo_Media").isShow(!txt);jQuery("#oDisp_size").isShow(txt);if(txt){if((_o.mode!="view")&&($o.jQp.css("display")!="none")){$o.playPanel.close()}}else{clearInterval($o.interval);if((tp==3)||(tp==4)){if(tp==3){jQSd.show()}$o.playPanel.open();jQuery("#oPlay_icon > img",$o.jQp).attr("src",$o.type[$o.cnt.contentType].icon)}else{if(tp==6){jQuery("#oFilter_icons").html("");jQuery("#oDoc_btnOpen").show()}}jQuery("#oDisp_btnHistory").oToggleEffect($o.historySW)}$o.drawRoot()},refreshTitle:function(){var jQT=jQuery("#oTitle_title");jQT.html($o.o.title);jQuery("#oTitle_info").html($o.o.titleInfo);jQuery("#oTitle_status").html($o.dateFormat($o.o.createdTime)+"&nbsp;"+$o.checkNanashi($o.o.hname));$o.titleScroll(0)},updateInfoList:function(coinInfos){$o.nowInfos=coinInfos;var jQS=jQuery("#oInfo_slider");var c=jQuery().o.opt.cellCode,id=-1;if((c!=-1)&&($o.cells[c])){id=$o.cells[c].coinCellId}$o.root[$o.root.no].coinCellId=id;var jQl=$o.jQIV,html=null,jQEq=jQuery("#oInfo_Enq,#oEnq_btnView"),jt=$o.jTmp._templates,t=null;if((c<0)||(c==null)){t=($o.filter.selected==null)?((jQuery().o.opt.free)?jt.no_select_free:jt.no_select):jt.no_data}else{jQuery("#cellNo").html("Coin No."+$o.nowTop.coins.coinId+" / Cell No."+jQuery().o.grid.getCellNo(c));if(($o.cells[c])&&(coinInfos.length>0)){normal();return}t=(jQuery().o.opt.oneCell)?jt.one_cell:(($o.enquetes[c])?jt.enqonly_cell:jt.blank_cell)}if(!t){return}jQS.hide();$o.jQIV.html("");jQuery("#oInfo_message",$o.jQIF).html(t.get({count:$o.cellCount},[],document.body));function normal(){jQuery("#oInfo_message",$o.jQIF).html("");var title,info,chk=false,id,sid,ncol,tp,img,nm,func=null,infoNew="",ab=false;var output="<table class='oInfoTable'><tbody>",el=coinInfos.length-1,nw="",ni="";$o.nowInfos.parts={};for(var n=0;n<=el;n++){var i=coinInfos[n];0;iid=i.coinInfoId;sid=i.subCoinCd;tp=i.contentType;img=$o.type[tp].icon;ab=false;if(i.title==null){i.title=""}if(i.titleInfo==null){i.titleInfo=""}if(tp<2){if(tp<0){tp=0}title="";info=i.information;img=$o.type[tp].icon;func="";if((tp==1)&&(!i.abone)){var p=$o.isPartsTag(info);if(p){$o.nowInfos.parts[String(n)]=p;func="href='javascript:$o.partsViewer("+String(n)+");'";info=info.replace(p,"");if(info.length==0){info="&nbsp;&nbsp;"}}else{var u=info.match(/<a href="(.*)" target="_blank">?/);func="href='"+RegExp.$1+"' target='_blank'"}}}else{title=i.title+"<br>";info=i.titleInfo;switch(tp){case 2:img=$o.contentsDir.ithumb(i);case 3:case 4:case 5:case 6:func="href='javascript:$o.nextCoin("+n+");'";break;case 7:func="href='javascript:$o.docViewer('"+$o.contentsDir.file(i)+"');'";break}}info=(info==null)?"":"<font color='#000'>"+info+"</font>";if(i.abone){title=$o._.deleted;info="";img=$o.type[tp].icon+"' class='oAboneIcon'"}infoNew=(i.itsNew)?"New":"";if(n==el){nw="<span class='oInfoNew'>NEW</span>";ni=" oInfoNewImg"}nm=$o.toNanashi(i.hname)+"&nbsp;&nbsp;";output+="<tr><td class='oInfoTag"+ni+"' rowspan=2><a title='"+$o.type[tp].tip+"' "+func+"><img src='"+img+"'"+ni+"></a></td><td class='oInfoCell'><span style='text-align:left; float:left;'>No."+(n+1)+nw+"</span></span><span class='oInfoTime'>"+nm+$o.dateFormat(i.createdTime)+"</span><br>"+title+"</td></tr><tr><td class='oInfoCell'>"+info+"</td></tr><tr colspan=2 class='oInfoSpace'></tr>"}jQl.html(output+"</tbody></table>");var sc={v:true,frameDiv:$o.jQIF,viewDiv:$o.jQIV,slider:jQS,toLast:false};if($o.showLast){sc.toLast=true}$o.showLast=false;$o.scrollTo(0,sc);if(jQl.height()<=$o.jQIF.height()){jQS.hide()}else{jQS.innerShow()}$o.moving=false;$o.topLoading=false}},partsViewer:function(no){if(typeof($o.nowInfos.parts)!="object"){return}_o.player.div.hide();var jQW=jQuery("#oWizard"),p=$o.nowInfos.parts[no][0],m=p.match(/width="([0-9]+)".*height="([0-9]+)"/),w=Number(m[1]),h=Number(m[2]);w=(isNaN(w))?478:w+50;h=(isNaN(h))?400:h+53;jQW.html($o.jTmp._templates.partsViewer.get({},[],document.body));jQuery(".oMessage",jQW).height(h-50);jQW.oDecoButton().oWizard(null,1,{mode:"",step:1,modal:["on"],width:w,height:[h]},function(){jQuery("#oParts_parts").html(""+p).show()});jQuery("#oParts_btnClose").click(function(){jQW.oWizard("close")})},drawInfo:function(c,callback){if((c>=0)&&($o.jQIm.css("display")!="none")){$o.jQIm.hide()}var p=null,id=null,r=true;if($o.cells[c]){id=$o.cells[c].coinCellId}switch($o.wizEnq.step){case 1:case 4:return;break;case 2:$o.receiveEnqueteData(c);r=false;break;case 3:$o.wizard(3,($o.enquetes[c])?5:4,$o.wizEnq);r=false;break}$o.receiveInfoByCellCode(c,callback)},formItem:function(formItem,ret,fn){var v,r={},cl;(formItem.length)?cl=formItem.length:cl=1;for(var i=0;i<cl;i++){(cl==1)?v=ck.value:v=ck[i].value;fn(v,ret)}return ret},createTopCoin:function(fn){var topCoin={publicType:4,theme:{themeCd:$o.wizNew.themeCd},category:{categoryId:$o.wizNew.categoryId}};$o.root={no:-1};var coin=$o.setNewCoin();coin.parentCoinId=null;$o.root={no:0};$o.jQLd.oAjaxMon($o._.saving,true);CoinCan.createTopCoin(topCoin,coin,function(topCoin){$o.jQLd.oAjaxMon();$o.nowTop=topCoin;$o.tp=$o.nowTop;$o.o=$o.nowTop.coins;jQuery("#oWizard").find("#oUpload_sid").text(topCoin.coinCd).end().find("#oUpload_url").text("http://"+location.host+$o.topDir+$o.newUrl+topCoin.coinCd).end();if(jQuery.isFunction(fn)){fn()}})},setNewCoin:function(opt){var w=$o.wizNew,u=w.uploadInfo;if(w.grid==0){var r=jQuery().o.grid.getRecommend(u.width,u.height)}else{var r=jQuery().o.grid.getRecommend(u.width,u.height,32);r.w=r.h=r.size}if((u.contentType>2)||(w.grid==1)){w.grid=0;r={w:1,h:1}}var parent=null;if($o.root[0]){parent=$o.root[$o.root.no].coinId}var coins=jQuery.extend({topCoinId:($o.nowTop.topCoinId)?($o.nowTop.topCoinId):null,parentCoinId:parent,contentId:u.contentId,title:w.title,titleInfo:w.titleInfo,uid:1,gridColor:"#000000",cellColor:"#F0F0F00A",cellStyle:0,publicType:4,subContentId:(u.subContentId>0)?u.subContentId:0,cellPatternId:w.grid,cellW:r.w,cellH:r.h,hname:w.hname},opt);return coins},addCell:function(cl,fn){var cell={coinId:cl.coinId,cellCode:cl.cellCode,cellW:Math.floor(cl.cellW),cellH:Math.floor(cl.cellH)};$o.jQLd.oAjaxMon($o._.saving,true);CoinCan.addCell(cell,function(cell){$o.jQLd.oAjaxMon();if(jQuery.isFunction(fn)){fn(cell)}return cell})},addCellArray:function(cl,fn){var cd=jQuery().o.cell2CellCode(cl);$o.cells[cd]={coinId:$o.o.coinId,cellCode:jQuery().o.cell2CellCode(cl),cellW:cl.cellW,cellH:cl.cellH,modified:1};$o.cellCount++;jQuery().o.grid.show()},jump:function(){var cd=document.frmJump.sid.value;if($o.isNotFound(1,cd)){return}CoinCan.checkCD(cd,function(ct){if(!$o.isNotFound(ct,cd)){location.href=$o.newUrl+cd}})},gridCellAdd:function(){$o.checkReadOnly(null,function(){$o.wizAddCell()})},wizAddCell:function(){if($o.wizNew.addcell){return}jQuery().o.cursor.jumpCellNo(-1);var fntMode={b:false,i:false},fntRGB=null,jQD=jQuery().o.opt.disp.div,d=jQD.offset();$o.wizNew={mode:"",sending:false,addcell:true,step:1,modal:["grid","grid","on","on","on"],cellCode:null,offset:{top:d.top+jQD.height()+1,left:d.left},width:jQD.width(),height:[104,148]};jQuery.extend($o.wizAddCell,{close:function(md,fn){diag(md,fn)}});var jQW=jQuery("#oWizard");jQW.html($o.jTmp._templates.addcell_wiz.get({},[],document.body)).oDecoButton().hide();var jQWn=jQW.children("#oWiz_window");jQuery("#oAdd_btnPosEsc",jQW).click(function(){endAim();diag()});jQuery("#oAdd_btnSizeEsc",jQW).click(function(){diag("esc")});jQuery("#oAdd_btnSizeOk",jQW).click(function(){$o.checkReadOnly(function(){diag("esc")},function(){$o.wizNew.cellCode=jQuery().o.opt.cellCode;$o.wizNew.cell=$o.clone($o.cells[$o.wizNew.cellCode]);$o.showCell(true,function(){if(jQuery().o.rect.hit($o.wizNew.cell)){jQuery().oDialog("error","既にセルがあります","指定した場所は、他の方がセルを配置しました。<br>そのセルに情報を書き込んでください。",$o._.yes,function(){diag("esc")})}else{jQuery().o.rect.toggle(false);jQW.o.setMode("");$o.wizEntry()}},function(){diag("esc")})})});jQW.oWizard(null,1,$o.wizNew);jQuery().o.aim.toggle(true);jQW.o.setMode("adjust");var v=jQuery().o.opt.rect.visible;$o.wizNew.cell=jQuery().o.rect.toggle(false);jQuery().o.grid.click(function(e,cl){cl=jQuery().o.aim.set(cl);if(jQuery().o.rect.hit(cl)){jQuery().oDialog("error","セルが重なります","セルの配置は、重ねることはできません。<br>再度、調整して下さい",$o._.yes)}else{$o.addCellArray(cl);endAim();jQuery().o.rect.set(cl);jQuery().o.rect.toggle(true);jQW.oWizard(1,2,$o.wizNew)}});jQuery().o.grid.mouseover(function(e,c){jQuery().o.aim.set(c)});function endAim(){jQuery().o.grid.click(null);jQuery().o.grid.mouseover(null);jQuery().o.aim.toggle(false)}function diag(mode,fn){var cd=($o.wizNew.addCell)?$o.wizNew.cell.cellCode:jQuery().o.opt.cellCode;jQuery().o.rect.toggle(false);jQW.fadeOut($o.noIE(200),function(){jQuery(this).empty();if(jQuery.isFunction(fn)){fn()}});if((mode=="esc")||(mode=="wesc")){delete $o.cells[cd];delete $o.wizNew}jQW.o.setMode("");if($o.wizNew.addCell){jQuery().o.cursor.setCellCode(cd);delete $o.wizNew;return}$o.showCell(function(){$o.wizNew={};if(!mode){jQuery().o.cursor.setCellCode(cd)}});$o.wizNew.step=0}},dialogIE6:function(){if(!jQuery.browser.msie){return}var jQ=jQuery("#oModal");if(jQ.css("display")!="none"){var o=jQuery("#oDisplay").offset();jQ.css({position:"absolute",left:-o.left,top:-o.top}).width(jQuery(document.body).width()).height(jQuery(document.body).height())}if(!$o.jQDg.length){return}if($o.jQDg.css("display")=="none"){return}var wd=jQuery(window),dc=jQuery(document.body),h=dc.height(),w=dc.width();$o.jQDg.width(w).height(h);var jW=jQuery("#oDiag_window",$o.jQDg),y=wd.scrollTop()+((wd.height()-jW.height())>>1),x=(wd.width()-jW.width())>>1;jW.css({left:x,top:y})}}})();
