//Debiew/Copyright(c) 2008 portarte,inc. All rights reserved.
var title=null; var main=null; var indexpanel=null; var indexview=null; var frame=null; var canvas=null; var fademask=null; var b_canvas=null; var f_canvas=null; var map=null; var mapview=null; var scope=null; var touch=null; var tool=null; var subtool=null; var edittool=null; var indexbutton=null; var lefteffect=null; var righteffect=null; var mapmask=null; var credit=null; var helppanel=null; var canvas_margin=4; var default_size=200; var map_size=128; var image_format=".jpg"; var view_id=null; var effect_id=null; var effect_rate=20; var turn_step=40; var fade_step=0.2; var move_step=4; var current_fade=0; var effect_mode=0; var bc_count=0; var br_count=0; var fc_count=0; var fr_count=0; var frame_width=0; var frame_height=0; var current_spread=1; var target_spread=0; var block_count=0; var block_size=200; var point_x=-1; var point_y=-1; var drag_x=0; var drag_y=0; var offset_x=0; var offset_y=0; var drag_mode=0; var map_mode=0; var index_mode=1; var image_cache=new Array(); var edit_flag=0; var edit_mode=0; var editdrag_mode=0; var editresize_mode=0; var editslide_mode=0; var cursor_type=""; var edit_id=null; function get_time_stamp(){ time_stamp=new Date().getTime(); return time_stamp;}
function arr(num,col){ while(String(num).length<col){ num="0"+String(num);}
return String(num);}
function get_style(target_object,property_name){ if(target_object.currentStyle){ return target_object.currentStyle[property_name];}
else if( document.defaultView.getComputedStyle ){ return document.defaultView.getComputedStyle(target_object, null).getPropertyValue(property_name);}
return "";}
function ww(){ var ww=parseInt(document.body.clientWidth); if (parseInt(document.body.clientHeight)==0){ ww=parseInt(document.documentElement.clientWidth);}
if ((navigator.appVersion.indexOf("KHTML")>-1)&&((navigator.appVersion.indexOf("AppleWebKit/1")>-1)||(navigator.appVersion.indexOf("AppleWebKit/2")>-1)||(navigator.appVersion.indexOf("AppleWebKit/3")>-1)||(navigator.appVersion.indexOf("AppleWebKit/4")>-1))) { ww=parseInt(window.innerWidth);}
return ww;}
function wh(){ var wh=parseInt(document.body.clientHeight); if (parseInt(document.body.clientHeight)==0){ wh=parseInt(document.documentElement.clientHeight);}
if ((navigator.appVersion.indexOf("KHTML")>-1)&&((navigator.appVersion.indexOf("AppleWebKit/1")>-1)||(navigator.appVersion.indexOf("AppleWebKit/2")>-1)||(navigator.appVersion.indexOf("AppleWebKit/3")>-1)||(navigator.appVersion.indexOf("AppleWebKit/4")>-1))) { wh=parseInt(window.innerHeight);}
return wh;}
function load_image(object_name,image_src){ if (image_cache[image_src]){ if (image_cache[image_src].complete){ if (object_name!=""){ var target_object=document.getElementById(object_name); if (target_object){ if (target_object.firstChild){ if (target_object.firstChild.src!=image_cache[image_src].src){ target_object.innerHTML="<img src=\""+image_cache[image_src].src+"\" style=\"width:"+parseInt(target_object.style.width)+"px;height:"+parseInt(target_object.style.height)+"px;\">";}}
else{ target_object.innerHTML="<img src=\""+image_cache[image_src].src+"\" style=\"width:"+parseInt(target_object.style.width)+"px;height:"+parseInt(target_object.style.height)+"px;\">";}}}}}
else{ image_cache[image_src]=new Image(); image_cache[image_src].onload=function(){ if (object_name!=""){ var target_object=document.getElementById(object_name); if (target_object){ if (target_object.firstChild){ if (target_object.firstChild.src!=image_cache[image_src].src){ target_object.innerHTML="<img src=\""+image_cache[image_src].src+"\" style=\"width:"+parseInt(target_object.style.width)+"px;height:"+parseInt(target_object.style.height)+"px;\">";}}
else{ target_object.innerHTML="<img src=\""+image_cache[image_src].src+"\" style=\"width:"+parseInt(target_object.style.width)+"px;height:"+parseInt(target_object.style.height)+"px;\">";}}}}
image_cache[image_src].src=image_src;}}
function load_png(object_name,image_src){ var target_object=document.getElementById(object_name); target_object.firstChild.src=image_src; target_object.firstChild.style.width=get_style(target_object,"width"); target_object.firstChild.style.height=get_style(target_object,"height"); if (target_object.getAttribute("style")=="[object]"){ target_object.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + target_object.firstChild.src + ", sizingMethod=scale)"; target_object.firstChild.style.visibility="hidden";}}
function init(){ var object_html=""; object_html=object_html+"<iframe id=\"title\" src=\"title.html\" style=\"position:absolute;left:"+canvas_margin+"px;top:"+canvas_margin+"px;width:"+(ww()-(canvas_margin*2))+"px;border:0px;cursor: default;z-index:1;overflow:hidden;\" scrolling=\"no\"></iframe>"; object_html=object_html+"<div id=\"main\" style=\"position:absolute;cursor: default;left:"+canvas_margin+"px;top:"+canvas_margin+"px;width:"+(ww()-(canvas_margin*2))+"px;z-index:2;overflow:hidden;\"></div>"; object_html=object_html+"<div id=\"edittool\" style=\"position:absolute;left:"+(160+canvas_margin)+"px;top:"+canvas_margin+"px;height:32px;background-color: #EEEEEE;z-index:10001;visibility:hidden;\">"; object_html=object_html+"<table cellpadding=\"0px\" cellspacing=\"0px\">"; object_html=object_html+"<tr style=\"height:16px;\">"; object_html=object_html+"<td style=\"width:70px;text-align:right;font-size:10px;font-weight:bold;\">基本：</td>"; object_html=object_html+"<td style=\"text-align:left;\">"; if (!edit_mode){ object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_mode\" value=\"エディットモードへ\" style=\"width:100px;\" onclick=\"change_editmode(null)\"></input>";}
else{ object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_mode\" value=\"プレビューモードへ\" style=\"width:100px;\" onclick=\"change_editmode(null)\"></input>";}
object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_save\" value=\"目次とリンクを保存\" style=\"width:100px;\" onclick=\"save_edit()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_help\" value=\"ヘルプ\" style=\"width:40px;\" onclick=\"show_helpedit()\"></input>"; object_html=object_html+"</td>"; object_html=object_html+"<td style=\"width:70px;text-align:right;font-size:10px;font-weight:bold;\">スクリプト：</td>"; object_html=object_html+"<td style=\"text-align:left;\">"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_scriptchapter\" value=\"チャプタスクリプトを表示\" style=\"width:140px;\" onclick=\"script_chapter()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_scriptanchor\" value=\"アンカースクリプトを表示\" style=\"width:140px;\" onclick=\"script_anchor()\"></input>"; object_html=object_html+"</td>"; object_html=object_html+"</tr>"; object_html=object_html+"<tr style=\"height:16px;\">"; object_html=object_html+"<td style=\"width:70px;text-align:right;font-size:10px;font-weight:bold;\">目次：</td>"; object_html=object_html+"<td style=\"text-align:left;\">"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_addchapter\" value=\"チャプタ追加\" style=\"width:80px;\" onclick=\"add_chapter()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_addanchor\" value=\"アンカー追加\" style=\"width:80px;\" onclick=\"add_anchor()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_deleteindex\" value=\"削除\" style=\"width:40px;\" onclick=\"delete_index()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_upindex\" value=\"▲\" style=\"width:30px;\" onclick=\"up_index()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_downindex\" value=\"▼\" style=\"width:30px;\" onclick=\"down_index()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_deleteallindex\" value=\"全削除\" style=\"width:40px;\" onclick=\"delete_all_index()\"></input>"; object_html=object_html+"</td>"; object_html=object_html+"<td style=\"width:70px;text-align:right;font-size:10px;font-weight:bold;\">リンク：</td>"; object_html=object_html+"<td style=\"text-align:left;\">"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_addhyperlink\" value=\"追加\" style=\"width:40px;\" onclick=\"add_hyperlink()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_deletehyperlink\" value=\"削除\" style=\"width:40px;\" onclick=\"delete_hyperlink()\"></input>"; object_html=object_html+"<input type=\"button\" class=\"editbutton\" id=\"edittool_deleteallhyperlink\" value=\"全削除\" style=\"width:40px;\" onclick=\"delete_all_hyperlink()\"></input>"; object_html=object_html+"</td>"; object_html=object_html+"</tr>"; object_html=object_html+"</table>"; object_html=object_html+"</div>"; document.body.innerHTML=object_html; title=document.getElementById("title"); main=document.getElementById("main"); edittool=document.getElementById("edittool"); if (parseInt(get_style(title,"height"))){ main.style.top=parseInt(get_style(title,"height"))+canvas_margin*2; main.style.height=wh()-parseInt(get_style(title,"height"))-canvas_margin*3;}
else{ main.style.top=canvas_margin; main.style.height=wh()-canvas_margin*2;}
edittool.style.width=parseInt(ww()-parseInt(get_style(edittool,"left"))-(canvas_margin)); block_count=0; frame_width=parseInt(get_style(main,"width")); frame_height=parseInt(get_style(main,"height")); if (point_x<0 && point_y<0){ point_x=parseInt(block_count*block_size/2); point_y=parseInt(block_count*block_size/2);}
var object_html=""; object_html=object_html+"<div id=\"frame\" style=\"position:absolute;cursor: default;left:0px;top:0px;width:"+frame_width+"px;height:"+frame_height+"px;z-index:3;overflow:hidden;\">"; object_html=object_html+"<div id=\"canvas\" style=\"position:absolute;cursor: default;left:0px;top:0px;width:"+(max_block*default_size)+"px;height:"+(max_block*default_size)+"px;z-index:4;\"></div>"; object_html=object_html+"</div>"; object_html=object_html+"<div id=\"fademask\" style=\"position:absolute;cursor: default;left:0px;top:0px;width:"+frame_width+"px;height:"+frame_height+"px;background-color: #000000;z-index:5;visibility:hidden;\"></div>"; object_html=object_html+"<div id=\"indexpanel\" style=\"position:absolute;left:"+(canvas_margin)+"px;top:"+(canvas_margin)+"px;height:"+(frame_height-canvas_margin*2)+"px;cursor: default;z-index:5001;visibility:hidden;\"></div>"; object_html=object_html+"<div id=\"map\" style=\"position:absolute;left:"+(frame_width-map_size-canvas_margin*3)+"px;top:"+(canvas_margin)+"px;width:"+(map_size+canvas_margin*2)+"px;height:"+(map_size+canvas_margin*2)+"px;cursor: default;z-index:5002;overflow:hidden;\"></div>"; object_html=object_html+"<div id=\"mapview\" style=\"position:absolute;left:"+(frame_width-map_size-canvas_margin*3)+"px;top:"+(canvas_margin)+"px;width:"+(map_size+canvas_margin*2)+"px;height:"+(map_size+canvas_margin*2)+"px;cursor: default;z-index:5003;overflow:hidden;\"></div>"; object_html=object_html+"<div id=\"indexbutton\" style=\"position:absolute;cursor: pointer;z-index:6001;overflow:hidden;\" onclick=\"show_index()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool\" style=\"position:absolute;cursor: default;z-index:6002;overflow:hidden;\">"; object_html=object_html+"<div id=\"tool_leftedge\" style=\"position:absolute;cursor: default;\"><img></div>"; object_html=object_html+"<div id=\"tool_zoomin\" style=\"position:absolute;cursor: pointer;\" onclick=\"change_scale(1)\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_zoomout\" style=\"position:absolute;cursor: pointer;\" onclick=\"change_scale(-1)\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_fit\" style=\"position:absolute;cursor: pointer;\" onclick=\"fit_scale()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_leftendpage\" style=\"position:absolute;cursor: pointer;\" onclick=\"leftend_page()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_leftpage\" style=\"position:absolute;cursor: pointer;\" onclick=\"left_page()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_rightpage\" style=\"position:absolute;cursor: pointer;\" onclick=\"right_page()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_rightendpage\" style=\"position:absolute;cursor: pointer;\" onclick=\"rightend_page()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"tool_rightedge\" style=\"position:absolute;cursor: default;\"><img></div>"; object_html=object_html+"</div>"; object_html=object_html+"<div id=\"subtool\" style=\"position:absolute;cursor: default;z-index:6003;overflow:hidden;\">"; object_html=object_html+"<div id=\"subtool_leftedge\" style=\"position:absolute;cursor: default;\"><img></div>"; object_html=object_html+"<div id=\"subtool_getpdf\" style=\"position:absolute;cursor: pointer;\" onclick=\"get_pdf()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"subtool_help\" style=\"position:absolute;cursor: pointer;\" onclick=\"show_help()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"subtool_close\" style=\"position:absolute;cursor: pointer;\" onclick=\"window_close()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"subtool_rightedge\" style=\"position:absolute;cursor: default;\"><img></div>"; object_html=object_html+"</div>"; object_html=object_html+"<div id=\"helppanel\" style=\"position:absolute;;cursor: default;z-index:7001;visibility:hidden;\"></div>"; object_html=object_html+"<a id=\"credit\" href=\"http://www.debiew.com/\" target=\"_blank\" style=\"position:absolute;left:"+(frame_width-112-canvas_margin)+"px;top:"+(frame_height-16-canvas_margin)+"px;width:112px;height:16px;cursor:pointer;z-index:7002;\"><img src=\"image/credit.png\" style=\"border:0px;\"></a>"; main.innerHTML=object_html; indexbutton=document.getElementById("indexbutton"); tool=document.getElementById("tool"); subtool=document.getElementById("subtool"); indexbutton.style.left=canvas_margin; indexbutton.style.top=parseInt(frame_height-parseInt(get_style(indexbutton,"height")))-canvas_margin; tool.style.left=parseInt((frame_width-parseInt(get_style(tool,"width"))-parseInt(get_style(subtool,"width"))-canvas_margin)/2); tool.style.top=parseInt(frame_height-parseInt(get_style(tool,"height")))-canvas_margin; subtool.style.left=parseInt(parseInt(get_style(tool,"left"))+parseInt(get_style(tool,"width"))+canvas_margin); subtool.style.top=parseInt(frame_height-parseInt(get_style(subtool,"height")))-canvas_margin; load_button("indexbutton"); load_png("tool_leftedge","image/tool_leftedge.png"); load_png("tool_rightedge","image/tool_rightedge.png"); load_button("tool_zoomin"); load_button("tool_zoomout"); load_button("tool_fit"); load_button("tool_leftendpage"); load_button("tool_leftpage"); load_button("tool_rightpage"); load_button("tool_rightendpage"); load_png("subtool_leftedge","image/subtool_leftedge.png"); load_png("subtool_rightedge","image/subtool_rightedge.png"); load_button("subtool_getpdf"); load_button("subtool_help"); load_button("subtool_close"); indexpanel=document.getElementById("indexpanel"); frame=document.getElementById("frame"); canvas=document.getElementById("canvas"); fademask=document.getElementById("fademask"); map=document.getElementById("map"); mapview=document.getElementById("mapview"); helppanel=document.getElementById("helppanel"); credit=document.getElementById("credit"); load_png("credit","http://www.debiew.com/image/credit.png"); object_html=""; object_html=object_html+"<div id=\"indexframe\" style=\"position:absolute;cursor: default;left:0px;top:0px;width:"+parseInt(get_style(indexpanel,"width"))+"px;height:"+parseInt(get_style(indexpanel,"height"))+"px;\"></div>"; object_html=object_html+"<div id=\"indextext\" style=\"position:absolute;left:0px;top:"+canvas_margin+"px;cursor: pointer;overflow:hidden;visibility:hidden;\" onclick=\"load_index(0)\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"indeximage\" style=\"position:absolute;left:0px;top:"+canvas_margin+"px;cursor: pointer;overflow:hidden;visibility:hidden;\" onclick=\"load_index(1)\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"indexclose\" style=\"position:absolute;left:0px;top:"+canvas_margin+"px;cursor: pointer;overflow:hidden;\" onclick=\"hide_index()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<div id=\"indexview\" style=\"position:absolute;left:"+canvas_margin+"px;top:0px;width:"+(parseInt(get_style(indexpanel,"width"))-canvas_margin*2)+"px;height:0px;cursor: default;overflow:hidden;\"></div>"; indexpanel.innerHTML=object_html; indexview=document.getElementById("indexview"); document.getElementById("indextext").style.left=(canvas_margin); document.getElementById("indeximage").style.left=(canvas_margin*2+parseInt(get_style(document.getElementById("indextext"),"width"))); document.getElementById("indexclose").style.left=(parseInt(get_style(indexpanel,"width"))-canvas_margin-parseInt(get_style(document.getElementById("indexclose"),"width"))); indexview.style.top=(canvas_margin*2+parseInt(get_style(document.getElementById("indextext"),"height"))); indexview.style.height=(parseInt(get_style(indexpanel,"height"))-canvas_margin*3-parseInt(get_style(document.getElementById("indextext"),"height"))); load_button("indextext"); load_button("indeximage"); load_button("indexclose"); load_index(0); object_html=""; object_html=object_html+"<div id=\"indexframe\" style=\"position:absolute;cursor: default;left:0px;top:0px;width:"+parseInt(get_style(helppanel,"width"))+"px;height:"+parseInt(get_style(helppanel,"height"))+"px;\"></div>"; object_html=object_html+"<div id=\"helpclose\" style=\"position:absolute;left:0px;top:"+canvas_margin+"px;cursor: pointer;overflow:hidden;\" onclick=\"hide_help()\" onmouseover=\"rollover(this)\" onmouseout=\"rollout(this)\"><div class=\"object\"><img></div></div>"; object_html=object_html+"<iframe id=\"helpview\" src=\"help.html\" style=\"position:absolute;left:"+canvas_margin+"px;top:0px;width:"+(parseInt(get_style(helppanel,"width"))-canvas_margin*2)+"px;height:0px;border:0px;cursor: default;overflow:hidden;\" scrolling=\"no\"></iframe>"; helppanel.innerHTML=object_html; document.getElementById("helpclose").style.left=(parseInt(get_style(helppanel,"width"))-canvas_margin-parseInt(get_style(document.getElementById("helpclose"),"width"))); document.getElementById("helpview").style.top=(canvas_margin*2+parseInt(get_style(document.getElementById("helpclose"),"height"))); document.getElementById("helpview").style.height=(parseInt(get_style(helppanel,"height"))-canvas_margin*3-parseInt(get_style(document.getElementById("helpclose"),"height"))); load_button("helpclose"); helppanel.style.left=parseInt((frame_width-parseInt(get_style(helppanel,"width")))/2); helppanel.style.top=parseInt((frame_height-parseInt(get_style(helppanel,"height")))/2); window.onresize=init; document.onmousemove=mouse_move; document.onmouseup=mouse_up; fit_scale(); preload_page(); edit();}
function load_index(val){ clear_edit(); var i=0; var object_html=""; if (!val){ for(i=0;i<index.length;i=i+1){ if (!edit_mode){ if (index[i].split("^")[0]=="chapter"){ object_html=object_html+"<div id=\"index_"+i+"\" class=\""+index[i].split("^")[0]+"default\" name=\""+index[i].split("^")[0]+"\" style=\"position:relative;cursor: pointer;\" onclick=\"jump_page("+index[i].split("^")[2]+")\" onmouseover=\"focus_object(this)\" onmouseout=\"blur_object(this)\">"+index[i].split("^")[1]+"</div>";}
if (index[i].split("^")[0]=="anchor"){ object_html=object_html+"<div id=\"index_"+i+"\" class=\""+index[i].split("^")[0]+"default\" name=\""+index[i].split("^")[0]+"\" style=\"position:relative;cursor: pointer;\" onclick=\"show_anchor("+index[i].split("^")[2]+","+index[i].split("^")[3]+","+index[i].split("^")[4]+","+index[i].split("^")[5]+")\" onmouseover=\"focus_object(this)\" onmouseout=\"blur_object(this)\">"+index[i].split("^")[1]+"</div>";}}
else{ if (index[i].split("^")[0]=="chapter"){ object_html=object_html+"<div id=\"index_"+i+"\" class=\""+index[i].split("^")[0]+"default\" name=\""+index[i].split("^")[0]+"\" style=\"position:relative;cursor: pointer;\"><input type=\"text\" class=\"\" style=\"width:80%;\" value=\""+index[i].split("^")[1]+"\" onchange=\"update_index(this.parentNode)\"><input type=\"text\" class=\"\" style=\"width:20%;\" value=\""+index[i].split("^")[2]+"\" onchange=\"update_index(this.parentNode)\"></div>";}
if (index[i].split("^")[0]=="anchor"){ object_html=object_html+"<div id=\"index_"+i+"\" class=\""+index[i].split("^")[0]+"default\" name=\""+index[i].split("^")[0]+"\" style=\"position:relative;cursor: pointer;\"><input type=\"text\" class=\"\" style=\"width:100%;\" value=\""+index[i].split("^")[1]+"\" onchange=\"update_index(this.parentNode)\"><input type=\"hidden\" class=\"\" value=\""+index[i].split("^")[2]+","+index[i].split("^")[3]+","+index[i].split("^")[4]+","+index[i].split("^")[5]+"\"></div>";}}}
if (object_html==""){ load_index(1); return;}}
else{ for(i=1;i<=spread_count;i=i+1){ var hm=0; var vm=0; if (proportion>=1){ vm=parseInt((1-(1/proportion))*map_size/2);}
if (proportion<1){ hm=parseInt((1-proportion)*map_size/2);}
var pw=(map_size-hm*2); if ((i==1)&&(facing==1)&&(bind!=start_page)){ if (!bind){ pw=pw/2; hm=map_size/2;}
else{ pw=pw/2;}}
else if ((i==spread_count)&&(facing==1)&&((bind+start_page+page_count)%2==1)){ if (!bind){ pw=pw/2;}
else{ pw=pw/2; hm=map_size/2;}}
object_html=object_html+"<div class=\"thumbnaildefault\" name=\"thumbnail\" style=\"position:relative;cursor: pointer;\" onclick=\"jump_page("+i+")\" onmouseover=\"focus_object(this)\" onmouseout=\"blur_object(this)\"><div style=\"width:"+map_size+"px;height:"+(map_size-vm*2)+"px;margin:auto;border:1px transparent solid;\">"; object_html=object_html+"<div style=\"width:"+(pw)+"px;height:"+(map_size-vm*2)+"px;margin-left:"+(hm)+"px;margin-top:0px;overflow:hidden;\"><img src=\"contents/"+earr(job_id,i,3)+"/"+earr(job_id,0,3)+image_format+"\" style=\"margin-left:"+(-hm)+"px;margin-top:"+(-vm)+"px;\"></div>"; object_html=object_html+"</div></div>";}}
indexview.innerHTML=object_html; if (edit_mode){ for (i=0; i<indexview.childNodes.length; i++) { if (indexview.childNodes[i].getAttribute("name")=="chapter" || indexview.childNodes[i].getAttribute("name")=="anchor"){ indexview.childNodes[i].onmousedown=mouse_down;}}
if (document.getElementById(edit_id)){ focus_object(document.getElementById(edit_id));}
else{ edit_id=null;}}
if (index.length && indexpanel.style.visibility=="visible"){ document.getElementById("indextext").style.visibility="visible"; document.getElementById("indeximage").style.visibility="visible";}
else{ document.getElementById("indextext").style.visibility="hidden"; document.getElementById("indeximage").style.visibility="hidden";}}
function load_canvas(){ var r=0; var c=0; var m=0; bc_count=parseInt(frame_width/(block_size*2))+2; br_count=parseInt(frame_height/(block_size*2))+2; fc_count=parseInt(frame_width/block_size)+2; fr_count=parseInt(frame_height/block_size)+2; if (bc_count>(block_count/2)){ bc_count=block_count/2;}
if (br_count>(block_count/2)){ br_count=block_count/2;}
if (fc_count>block_count){ fc_count=block_count;}
if (fr_count>block_count){ fr_count=block_count;}
var object_html=""; if (proportion>=1){ m=parseInt((1-(1/proportion))*(block_count*block_size)/2);}
if (proportion<1){ m=parseInt((1-proportion)*(block_count*block_size)/2);}
if (proportion>=1){ object_html=object_html+"<div id=\"b_canvas\" class=\"object\" style=\"left:0px;top:"+m+"px;width:"+(block_size*block_count)+"px;height:"+(block_size*block_count-m*2)+"px;overflow:hidden;z-index:1001;\"></div>"; object_html=object_html+"<div id=\"f_canvas\" class=\"object\" style=\"left:0px;top:"+m+"px;width:"+(block_size*block_count)+"px;height:"+(block_size*block_count-m*2)+"px;overflow:hidden;z-index:2001;\"></div>";}
if (proportion<1){ object_html=object_html+"<div id=\"b_canvas\" class=\"object\" style=\"left:"+m+"px;top:0px;width:"+(block_size*block_count-m*2)+"px;height:"+(block_size*block_count)+"px;overflow:hidden;z-index:1001;\"></div>"; object_html=object_html+"<div id=\"f_canvas\" class=\"object\" style=\"left:"+m+"px;top:0px;width:"+(block_size*block_count-m*2)+"px;height:"+(block_size*block_count)+"px;overflow:hidden;z-index:2001;\"></div>";}
if (proportion>=1){ object_html=object_html+"<div id=\"lefteffect\" class=\"object\" style=\"left:0px;top:"+m+"px;width:"+((block_count/2)*block_size)+"px;height:"+(block_count*block_size-m*2)+"px;z-index:4001;overflow:hidden;\"></div>"; object_html=object_html+"<div id=\"righteffect\" class=\"object\" style=\"left:"+((block_count/2)*block_size)+"px;top:"+m+"px;width:"+((block_count/2)*block_size)+"px;height:"+(block_count*block_size-m*2)+"px;z-index:4002;overflow:hidden;\"></div>";}
if (proportion<1){ object_html=object_html+"<div id=\"lefteffect\" class=\"object\" style=\"left:"+m+"px;top:0px;width:"+((block_count/2)*block_size-m)+"px;height:"+(block_count*block_size)+"px;z-index:4001;overflow:hidden;\"></div>"; object_html=object_html+"<div id=\"righteffect\" class=\"object\" style=\"left:"+((block_count/2)*block_size)+"px;top:0px;width:"+((block_count/2)*block_size-m)+"px;height:"+(block_count*block_size)+"px;z-index:4002;overflow:hidden;\"></div>";}
object_html=object_html+"<div id=\"gutter\" class=\"gutter\" style=\"position:absolute;z-index:4003;\"><img></div>"; if (proportion>=1){ object_html=object_html+"<div id=\"touch\" style=\"position:absolute;cursor: move;left:0px;top:"+m+"px;width:"+(block_count*block_size)+"px;height:"+(block_count*block_size-m*2)+"px;z-index:4004;overflow:hidden;\"></div>";}
if (proportion<1){ object_html=object_html+"<div id=\"touch\" style=\"position:absolute;cursor: move;left:"+m+"px;top:0px;width:"+(block_count*block_size-m*2)+"px;height:"+(block_count*block_size)+"px;z-index:4004;overflow:hidden;\"></div>";}
object_html=object_html+"<div id=\"skin_corner_topleft\" class=\"skin\" style=\"position:absolute;z-index:4011;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_topleft\" class=\"skin\" style=\"position:absolute;z-index:4012;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_topleft\" class=\"skin\" style=\"position:absolute;z-index:4013;\"><img></div>"; object_html=object_html+"<div id=\"skin_center_top\" class=\"skin\" style=\"position:absolute;z-index:4014;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_topright\" class=\"skin\" style=\"position:absolute;z-index:4015;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_topright\" class=\"skin\" style=\"position:absolute;z-index:4016;\"><img></div>"; object_html=object_html+"<div id=\"skin_corner_topright\" class=\"skin\" style=\"position:absolute;z-index:4017;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_lefttop\" class=\"skin\" style=\"position:absolute;z-index:4018;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_lefttop\" class=\"skin\" style=\"position:absolute;z-index:4019;\"><img></div>"; object_html=object_html+"<div id=\"skin_center_left\" class=\"skin\" style=\"position:absolute;z-index:4020;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_leftbottom\" class=\"skin\" style=\"position:absolute;z-index:4021;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_leftbottom\" class=\"skin\" style=\"position:absolute;z-index:4022;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_righttop\" class=\"skin\" style=\"position:absolute;z-index:4023;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_righttop\" class=\"skin\" style=\"position:absolute;z-index:4024;\"><img></div>"; object_html=object_html+"<div id=\"skin_center_right\" class=\"skin\" style=\"position:absolute;z-index:4025;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_rightbottom\" class=\"skin\" style=\"position:absolute;z-index:4026;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_rightbottom\" class=\"skin\" style=\"position:absolute;z-index:4027;\"><img></div>"; object_html=object_html+"<div id=\"skin_corner_bottomleft\" class=\"skin\" style=\"position:absolute;z-index:4028;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_bottomleft\" class=\"skin\" style=\"position:absolute;z-index:4029;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_bottomleft\" class=\"skin\" style=\"position:absolute;z-index:4030;\"><img></div>"; object_html=object_html+"<div id=\"skin_center_bottom\" class=\"skin\" style=\"position:absolute;z-index:4031;\"><img></div>"; object_html=object_html+"<div id=\"skin_bar_bottomright\" class=\"skin\" style=\"position:absolute;z-index:4032;\"><img></div>"; object_html=object_html+"<div id=\"skin_cornerside_bottomright\" class=\"skin\" style=\"position:absolute;z-index:4033;\"><img></div>"; object_html=object_html+"<div id=\"skin_corner_bottomright\" class=\"skin\" style=\"position:absolute;z-index:4034;\"><img></div>"; object_html=object_html+"<div id=\"hyperlinkproperty\" style=\"position:absolute;padding:4px;border:2px #000000 solid;left:0px;top:0px;background-color: #EEEEEE;font-size:10px;font-weight:bold;z-index:4035;visibility:hidden;\">"; object_html=object_html+"タイトル：<input type=\"text\" id=\"hyperlinktitle\" class=\"\" style=\"width:280px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"<br>"; object_html=object_html+"URL：<input type=\"text\" id=\"hyperlinkurl\" class=\"\" style=\"width:200px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"　ターゲット：<input type=\"text\" id=\"hyperlinktarget\" class=\"\" style=\"width:40px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"<br>"; object_html=object_html+"X：<input type=\"text\" id=\"hyperlinkx\" class=\"\" style=\"width:40px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"　Y：<input type=\"text\" id=\"hyperlinky\" class=\"\" style=\"width:40px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"　幅：<input type=\"text\" id=\"hyperlinkw\" class=\"\" style=\"width:40px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"　高さ：<input type=\"text\" id=\"hyperlinkh\" class=\"\" style=\"width:40px;font-size:10px;\" value=\"\" onchange=\"update_hyperlink()\">"; object_html=object_html+"</div>"; canvas.innerHTML=object_html; f_canvas=document.getElementById("f_canvas"); b_canvas=document.getElementById("b_canvas"); lefteffect=document.getElementById("lefteffect"); righteffect=document.getElementById("righteffect"); touch=document.getElementById("touch"); if (demo_mode){ touch.style.backgroundImage="url('image/demo.gif')";}
touch.onmousedown=mouse_down;}
function load_hyperlink(){ clear_edit(); var i=0; var object_html=""; object_html=object_html+"<div style=\"position:absolute;left:0px;top:0px;width:"+parseInt(get_style(touch,"width"))+"px;height:"+parseInt(get_style(touch,"height"))+"px;background-color: #FFFFFF;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;\"></div>"; if (hyperlink[arr(current_spread,3)]){ for(i=0;i<hyperlink[arr(current_spread,3)].length;i=i+1){ if (!edit_mode){ object_html=object_html+"<a id=\"hyperlink_"+i+"\" class=\"hyperlinkdefault\" name=\"hyperlink\" title=\""+hyperlink[arr(current_spread,3)][i].split("^")[0]+"\" href=\""+hyperlink[arr(current_spread,3)][i].split("^")[1]+"\" target=\""+hyperlink[arr(current_spread,3)][i].split("^")[2]+"\" style=\"position:absolute;left:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[3])/1000*(block_count*block_size))+"px;top:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[4])/1000*(block_count*block_size))+"px;width:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[5])/1000*(block_count*block_size))+"px;height:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[6])/1000*(block_count*block_size))+"px;cursor: pointer;\" onmouseover=\"focus_object(this)\" onmouseout=\"blur_object(this)\"></a>";}
else{ object_html=object_html+"<div id=\"hyperlink_"+i+"\" class=\"hyperlinkhighlight\" name=\"hyperlink\"  style=\"position:absolute;left:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[3])/1000*(block_count*block_size))+"px;top:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[4])/1000*(block_count*block_size))+"px;width:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[5])/1000*(block_count*block_size))+"px;height:"+parseInt(parseInt(hyperlink[arr(current_spread,3)][i].split("^")[6])/1000*(block_count*block_size))+"px;cursor: pointer;\"></div>";}}}
var m=0; if (proportion>=1){ m=parseInt((1-(1/proportion))*(block_count*block_size)/2);}
if (proportion<1){ m=parseInt((1-proportion)*(block_count*block_size)/2);}
object_html=object_html+"<div id=\"curl_left\" class=\"curl\" style=\"position:absolute;left:0px;top:"+parseInt(get_style(touch,"height"))+"px;cursor: pointer;visibility:hidden;\" onclick=\"left_page()\"><img></div>"; object_html=object_html+"<div id=\"curl_right\" class=\"curl\" style=\"position:absolute;left:"+parseInt(get_style(touch,"width"))+"px;top:"+parseInt(get_style(touch,"height"))+"px;cursor: pointer;visibility:hidden;\" onclick=\"right_page()\"><img></div>"; touch.innerHTML=object_html; document.getElementById("curl_left").style.top=parseInt(get_style(document.getElementById("curl_left"),"top"))-parseInt(get_style(document.getElementById("curl_left"),"height")); document.getElementById("curl_right").style.left=parseInt(get_style(document.getElementById("curl_right"),"left"))-parseInt(get_style(document.getElementById("curl_right"),"width")); document.getElementById("curl_right").style.top=parseInt(get_style(document.getElementById("curl_right"),"top"))-parseInt(get_style(document.getElementById("curl_right"),"height")); if((!bind && current_spread>1)||(bind && current_spread<spread_count)){ document.getElementById("curl_left").style.visibility="visible";}
if((!bind && current_spread<spread_count)||(bind && current_spread>1)){ document.getElementById("curl_right").style.visibility="visible";}
load_png("curl_left","image/curl_left.png"); load_png("curl_right","image/curl_right.png"); if (edit_mode){ for (i=0; i<touch.childNodes.length; i++) { if (touch.childNodes[i].getAttribute("name")=="hyperlink"){ touch.childNodes[i].onmousedown=mouse_down;}}
if (document.getElementById(edit_id)){ focus_object(document.getElementById(edit_id));}
else{ edit_id=null;}}}
function load_map(){ var m=0; var object_html=""; if (proportion>=1){ m=parseInt((1-(1/proportion))*map_size/2);}
if (proportion<1){ m=parseInt((1-proportion)*map_size/2);}
object_html=object_html+"<div class=\"object\" style=\"left:"+canvas_margin+"px;top:"+canvas_margin+"px;width:"+map_size+"px;height:"+map_size+"px;\">"; if (proportion>=1){ object_html=object_html+"<div id=\"mapmask\" class=\"object\" style=\"left:0px;top:"+m+"px;width:"+(map_size)+"px;height:"+(map_size-m*2)+"px;overflow:hidden;\"><img class=\"object\" src=\"contents/"+earr(job_id,current_spread,3)+"/"+earr(job_id,0,3)+image_format+"\" style=\"left:0px;top:"+(-m)+"px;width:"+map_size+"px;height:"+map_size+"px;\"></div>";}
if (proportion<1){ object_html=object_html+"<div id=\"mapmask\" class=\"object\" style=\"left:"+m+"px;top:0px;width:"+(map_size-m*2)+"px;height:"+(map_size)+"px;overflow:hidden;\"><img class=\"object\" src=\"contents/"+earr(job_id,current_spread,3)+"/"+earr(job_id,0,3)+image_format+"\" style=\"left:"+(-m)+"px;top:0px;width:"+map_size+"px;height:"+map_size+"px;\"></div>";}
object_html=object_html+"<div id=\"scope\" class=\"object\" style=\"position:absolute;left:0px;top:0px;width:0px;height:0px;cursor: pointer;\"><div class=\"object\" style=\"left:0px;top:0px;width:0px;height:0px;background-color: #FFFFFF;filter:alpha(opacity=0);-moz-opacity:0;opacity:0;\"></div></div>"; object_html=object_html+"</div>"; mapview.innerHTML=object_html; scope=document.getElementById("scope"); mapmask=document.getElementById("mapmask"); scope.onmousedown=mouse_down;}
function masking(){ var t=parseInt(get_style(f_canvas,"top")); var l=parseInt(get_style(f_canvas,"left")); var b=parseInt(get_style(f_canvas,"top"))+parseInt(get_style(f_canvas,"height")); var r=parseInt(get_style(f_canvas,"left"))+parseInt(get_style(f_canvas,"width")); var p=parseInt(get_style(document.getElementById("skin_corner_topleft"),"width")); var h=parseInt(p/2); var g=parseInt(get_style(document.getElementById("gutter"),"width")); var c=0; if (facing){ c=1;}
if (((current_spread==1)||(target_spread==1))&&(facing==1)&&(bind!=start_page)){ if (!bind){ l=parseInt(get_style(f_canvas,"left"))+parseInt(parseInt(get_style(f_canvas,"width"))/2); mapmask.style.clip="rect(auto auto auto "+(parseInt(get_style(mapmask,"width"))/2)+"px)";}
else{ r=parseInt(get_style(f_canvas,"left"))+parseInt(parseInt(get_style(f_canvas,"width"))/2); mapmask.style.clip="rect(auto "+(parseInt(get_style(mapmask,"width"))/2)+"px auto auto)";}
c=0;}
else if (((current_spread==spread_count)||(target_spread==spread_count))&&(facing==1)&&((bind+start_page+page_count)%2==1)){ if (!bind){ r=parseInt(get_style(f_canvas,"left"))+parseInt(parseInt(get_style(f_canvas,"width"))/2); mapmask.style.clip="rect(auto "+(parseInt(get_style(mapmask,"width"))/2)+"px auto auto)";}
else{ l=parseInt(get_style(f_canvas,"left"))+parseInt(parseInt(get_style(f_canvas,"width"))/2); mapmask.style.clip="rect(auto auto auto "+(parseInt(get_style(mapmask,"width"))/2)+"px)";}
c=0;}
var hc=l+parseInt((r-l)/2); var vc=t+parseInt((b-t)/2); touch.style.left=l; touch.style.width=(r-l); document.getElementById("skin_corner_topleft").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(t-p)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_cornerside_topleft").style.cssText="position:absolute;left:"+(l)+"px;top:"+(t-p)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_bar_topleft").style.cssText="position:absolute;left:"+(l+p)+"px;top:"+(t-p)+"px;width:"+(hc-l-p-h*c)+"px;height:"+(p)+"px;"; if (c){ document.getElementById("skin_center_top").style.cssText="position:absolute;left:"+(hc-h)+"px;top:"+(t-p)+"px;width:"+(p)+"px;height:"+(p)+"px;visibility:visible;";}
else{ document.getElementById("skin_center_top").style.cssText="position:absolute;left:"+(hc-h)+"px;top:"+(t-p)+"px;width:"+(p)+"px;height:"+(p)+"px;visibility:hidden;";}
document.getElementById("skin_bar_topright").style.cssText="position:absolute;left:"+(hc+h*c)+"px;top:"+(t-p)+"px;width:"+(r-hc-p-h*c)+"px;height:"+(p)+"px;"; document.getElementById("skin_cornerside_topright").style.cssText="position:absolute;left:"+(r-p)+"px;top:"+(t-p)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_corner_topright").style.cssText="position:absolute;left:"+(r)+"px;top:"+(t-p)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_cornerside_lefttop").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(t)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_bar_lefttop").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(t+p)+"px;width:"+(p)+"px;height:"+(vc-t-p-h)+"px;"; document.getElementById("skin_center_left").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(vc-h)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_bar_leftbottom").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(vc+h)+"px;width:"+(p)+"px;height:"+(b-vc-p-h)+"px;"; document.getElementById("skin_cornerside_leftbottom").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(b-p)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_cornerside_righttop").style.cssText="position:absolute;left:"+(r)+"px;top:"+(t)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_bar_righttop").style.cssText="position:absolute;left:"+(r)+"px;top:"+(t+p)+"px;width:"+(p)+"px;height:"+(vc-t-p-h)+"px;"; document.getElementById("skin_center_right").style.cssText="position:absolute;left:"+(r)+"px;top:"+(vc-h)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_bar_rightbottom").style.cssText="position:absolute;left:"+(r)+"px;top:"+(vc+h)+"px;width:"+(p)+"px;height:"+(b-vc-p-h)+"px;"; document.getElementById("skin_cornerside_rightbottom").style.cssText="position:absolute;left:"+(r)+"px;top:"+(b-p)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_corner_bottomleft").style.cssText="position:absolute;left:"+(l-p)+"px;top:"+(b)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_cornerside_bottomleft").style.cssText="position:absolute;left:"+(l)+"px;top:"+(b)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_bar_bottomleft").style.cssText="position:absolute;left:"+(l+p)+"px;top:"+(b)+"px;width:"+(hc-l-p-h*c)+"px;height:"+(p)+"px;"; if (c){ document.getElementById("skin_center_bottom").style.cssText="position:absolute;left:"+(hc-h)+"px;top:"+(b)+"px;width:"+(p)+"px;height:"+(p)+"px;visibility:visible;";}
else{ document.getElementById("skin_center_bottom").style.cssText="position:absolute;left:"+(hc-h)+"px;top:"+(b)+"px;width:"+(p)+"px;height:"+(p)+"px;visibility:hidden;";}
document.getElementById("skin_bar_bottomright").style.cssText="position:absolute;left:"+(hc+h*c)+"px;top:"+(b)+"px;width:"+(r-hc-p-h*c)+"px;height:"+(p)+"px;"; document.getElementById("skin_cornerside_bottomright").style.cssText="position:absolute;left:"+(r-p)+"px;top:"+(b)+"px;width:"+(p)+"px;height:"+(p)+"px;"; document.getElementById("skin_corner_bottomright").style.cssText="position:absolute;left:"+(r)+"px;top:"+(b)+"px;width:"+(p)+"px;height:"+(p)+"px;"; if (c){ document.getElementById("gutter").style.cssText="position:absolute;left:"+(hc-parseInt(g/2))+"px;top:"+(t)+"px;width:"+(g)+"px;height:"+(b-t)+"px;visibility:visible;z-index:4003;";}
else{ document.getElementById("gutter").style.cssText="position:absolute;left:"+(hc-parseInt(g/2))+"px;top:"+(t)+"px;width:"+(g)+"px;height:"+(b-t)+"px;visibility:hidden;z-index:4003;";}
load_png("skin_corner_topleft","image/skin_corner_topleft.png"); load_png("skin_cornerside_topleft","image/skin_cornerside_topleft.png"); load_png("skin_bar_topleft","image/skin_bar_top.png"); load_png("skin_center_top","image/skin_center_top.png"); load_png("skin_bar_topright","image/skin_bar_top.png"); load_png("skin_cornerside_topright","image/skin_cornerside_topright.png"); load_png("skin_corner_topright","image/skin_corner_topright.png"); load_png("skin_cornerside_lefttop","image/skin_cornerside_lefttop.png"); load_png("skin_bar_lefttop","image/skin_bar_left.png"); load_png("skin_center_left","image/skin_center_left.png"); load_png("skin_bar_leftbottom","image/skin_bar_left.png"); load_png("skin_cornerside_leftbottom","image/skin_cornerside_leftbottom.png"); load_png("skin_cornerside_righttop","image/skin_cornerside_righttop.png"); load_png("skin_bar_righttop","image/skin_bar_right.png"); load_png("skin_center_right","image/skin_center_right.png"); load_png("skin_bar_rightbottom","image/skin_bar_right.png"); load_png("skin_cornerside_rightbottom","image/skin_cornerside_rightbottom.png"); load_png("skin_corner_bottomleft","image/skin_corner_bottomleft.png"); load_png("skin_cornerside_bottomleft","image/skin_cornerside_bottomleft.png"); load_png("skin_bar_bottomleft","image/skin_bar_bottom.png"); load_png("skin_center_bottom","image/skin_center_bottom.png"); load_png("skin_bar_bottomright","image/skin_bar_bottom.png"); load_png("skin_cornerside_bottomright","image/skin_cornerside_bottomright.png"); load_png("skin_corner_bottomright","image/skin_corner_bottomright.png"); load_png("gutter","image/gutter.png");}
function change_scale(val){ if (((val<=0)&&(block_count<=min_block)) || ((val>0)&&(block_count>=max_block))){ return;}
point_x=point_x/(block_count*block_size); point_y=point_y/(block_count*block_size); if (val>0){ block_count=block_count*2;}
else{ block_count=block_count/2;}
if (block_count<min_block){ block_count=min_block;}
if (block_count>max_block){ block_count=max_block;}
if (block_size!=default_size){ block_size=default_size;}
point_x=parseInt((block_count*block_size)*point_x); point_y=parseInt((block_count*block_size)*point_y); load_canvas(); load_map(); masking(); load_hyperlink(); view_point();}
function fit_scale(){ if (get_fit_count()!=block_count || point_x!=parseInt(block_count*block_size/2) || point_y!=parseInt(block_count*block_size/2)){ block_count=get_fit_count(); load_canvas(); point_x=parseInt(block_count*block_size/2); point_y=parseInt(block_count*block_size/2); load_map(); masking(); load_hyperlink(); view_point();}}
function get_fit_count(){ var fit_count=min_block; var w=0; var h=0; var overlook=0.9; while(1){ if (proportion>=1){ w=(fit_count*block_size); h=(1/proportion)*(fit_count*block_size);}
if (proportion<1){ w=(proportion)*(fit_count*block_size); h=(fit_count*block_size);}
if (frame_width<(w*overlook) || frame_height<(h*overlook)){ if (fit_count>min_block){ fit_count=fit_count/2;}
break;}
if (fit_count>=max_block){ break;}
fit_count=fit_count*2;}
return fit_count;}
function view_point(){ clearTimeout(view_id); var start_bc=(parseInt((point_x-frame_width/2)/(block_size*2))+1); if (start_bc<1){ start_bc=1;}
var end_bc=start_bc+bc_count-1; if (end_bc>(block_count/2)){ end_bc=block_count/2;}
var start_br=(parseInt((point_y-frame_height/2)/(block_size*2))+1); if (start_br<1){ start_br=1;}
var end_br=start_br+br_count-1; if (end_br>(block_count/2)){ end_br=block_count/2;}
var start_fc=(parseInt((point_x-frame_width/2)/block_size)+1); if (start_fc<1){ start_fc=1;}
var end_fc=start_fc+fc_count-1; if (end_fc>block_count){ end_fc=block_count;}
var start_fr=(parseInt((point_y-frame_height/2)/block_size)+1); if (start_fr<1){ start_fr=1;}
var end_fr=start_fr+fr_count-1; if (end_fr>block_count){ end_fr=block_count;}
var i=0; var r=0; var c=0; var cr=0; var sr=0; var er=0; var cc=0; var sc=0; var ec=0; canvas.style.left=parseInt(frame_width/2-point_x)+"px"; canvas.style.top=parseInt(frame_height/2-point_y)+"px"; if (block_count>min_block){ for(i=b_canvas.childNodes.length-1;i>=0;i=i-1){ r=parseInt("1"+b_canvas.childNodes[i].id.split("_")[1])-1000; c=parseInt("1"+b_canvas.childNodes[i].id.split("_")[2])-1000; if(r<start_br || r>end_br || c<start_bc || c>end_bc){ b_canvas.removeChild(b_canvas.childNodes[i]);}}
for (r=start_br;r<=end_br;r=r+1) { for (c=start_bc;c<=end_bc;c=c+1) { load_block(b_canvas,block_count/2,r,c,block_size*2);}}}
for(i=f_canvas.childNodes.length-1;i>=0;i=i-1){ r=parseInt("1"+f_canvas.childNodes[i].id.split("_")[1])-1000; c=parseInt("1"+f_canvas.childNodes[i].id.split("_")[2])-1000; if(r<start_fr || r>end_fr || c<start_fc || c>end_fc){ f_canvas.removeChild(f_canvas.childNodes[i]);}}
cc=(parseInt(point_x/block_size)+1); if (cc<start_fc){ cc=start_fc;}
if (cc>end_fc){ cc=end_fc;}
cr=(parseInt(point_y/block_size)+1); if (cr<start_fr){ cr=start_fr;}
if (cr>end_fr){ cr=end_fr;}
i=0; while(sr!=start_fr || er!=end_fr || sc!=start_fc || ec!=end_fc){ sr=cr-i; er=cr+i; sc=cc-i; ec=cc+i; if (sc<start_fc){ sc=start_fc;}
if (ec>end_fc){ ec=end_fc;}
if (sr<start_fr){ sr=start_fr;}
if (er>end_fr){ er=end_fr;}
for (r=sr;r<=er;r=r+1) { for (c=sc;c<=ec;c=c+1) { load_block(f_canvas,block_count,r,c,block_size);}}
i=i+1;}
if (get_fit_count()<block_count){ scope.style.width=parseInt(frame_width/(block_count*block_size)*map_size)+"px"; scope.style.height=parseInt(frame_height/(block_count*block_size)*map_size)+"px"; scope.style.left=parseInt(map_size/(block_count*block_size)*point_x-parseInt(scope.style.width)/2)+"px"; scope.style.top=parseInt(map_size/(block_count*block_size)*point_y-parseInt(scope.style.height)/2)+"px"; scope.firstChild.style.width=parseInt(frame_width/(block_count*block_size)*map_size)+"px"; scope.firstChild.style.height=parseInt(frame_height/(block_count*block_size)*map_size)+"px"; map.style.visibility="visible"; mapview.style.visibility="visible";}
else{ map.style.visibility="hidden"; mapview.style.visibility="hidden";}
view_id=setTimeout("review_point()",500);}
function review_point(){ clearTimeout(view_id); if (!effect_mode && !drag_mode && !map_mode){ view_point();}
view_id=setTimeout("review_point()",500);}
function load_block(target_canvas,bb,br,bc,bs){ var b=0; if (((current_spread==1)||(target_spread==1))&&(facing==1)&&(bind!=start_page)){ if (!bind){ b=1;}
else{ b=2;}}
else if (((current_spread==spread_count)||(target_spread==spread_count))&&(facing==1)&&((bind+start_page+page_count)%2==1)){ if (!bind){ b=2;}
else{ b=1;}}
var m=0; if (proportion>=1){ m=parseInt((1-(1/proportion))*(block_count*block_size)/2);}
if (proportion<1){ m=parseInt((1-proportion)*(block_count*block_size)/2);}
var new_object=null; if (!document.getElementById(arr(bb,3)+"_"+arr(br,3)+"_"+arr(bc,3))){ new_object=document.createElement("div"); if (proportion>=1){ new_object.innerHTML="<div id=\""+arr(bb,3)+"_"+arr(br,3)+"_"+arr(bc,3)+"\" class=\"object\" style=\"left:"+((bc-1)*bs)+"px;top:"+((br-1)*bs-m)+"px;width:"+(bs)+"px;height:"+(bs)+"px;\"></div>";}
if (proportion<1){ new_object.innerHTML="<div id=\""+arr(bb,3)+"_"+arr(br,3)+"_"+arr(bc,3)+"\" class=\"object\" style=\"left:"+((bc-1)*bs-m)+"px;top:"+((br-1)*bs)+"px;width:"+(bs)+"px;height:"+(bs)+"px;\"></div>";}
target_canvas.appendChild(new_object.lastChild); if (!(b==1 && bc<=bb/2)&&!(b==2 && bc>bb/2)){ load_image(arr(bb,3)+"_"+arr(br,3)+"_"+arr(bc,3),"contents/"+earr(job_id,current_spread,3)+"/"+earr(job_id,bb,3)+"_"+earr(job_id,br,3)+"_"+earr(job_id,bc,3)+image_format);}}
else{ if (!(b==1 && bc<=bb/2)&&!(b==2 && bc>bb/2)){ load_image(arr(bb,3)+"_"+arr(br,3)+"_"+arr(bc,3),"contents/"+earr(job_id,current_spread,3)+"/"+earr(job_id,bb,3)+"_"+earr(job_id,br,3)+"_"+earr(job_id,bc,3)+image_format);}
else{ document.getElementById(arr(bb,3)+"_"+arr(br,3)+"_"+arr(bc,3)).innerHTML="";}}}
function preload_page(){ var r=0; var c=0; if (get_fit_count()==block_count){ if (current_spread<spread_count){ for (r=1;r<=block_count;r=r+1) { for (c=1;c<=block_count;c=c+1) { load_image("","contents/"+earr(job_id,current_spread+1,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format);}}}
if (current_spread>1){ for (r=1;r<=block_count;r=r+1) { for (c=1;c<=block_count;c=c+1) { load_image("","contents/"+earr(job_id,current_spread-1,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format);}}}}}
function earr(cd,num,col){ var k=0; var r=0; var l=new Array(); var e="9u_oil2ws1vqj0ac"; num=arr(num,col); k=parseInt(cd.substr(7,1), 16); r=k%5; if (r==0){ l=new Array(3,2,1);}
if (r==1){ l=new Array(2,1,3);}
if (r==2){ l=new Array(3,1,2);}
if (r==3){ l=new Array(2,3,1);}
if (r==4){ l=new Array(1,3,2);}
num=e.substr(((parseInt(num.substr(l[0]-1,1))+k)%16),1)+e.substr(((parseInt(num.substr(l[1]-1,1))+k)%16),1)+e.substr(((parseInt(num.substr(l[2]-1,1))+k)%16),1); return num;}
function load_button(button_name){ var button_object=document.getElementById(button_name); button_object.firstChild.style.left="0px"; button_object.firstChild.style.top="0px"; button_object.firstChild.style.width=parseInt(get_style(button_object,"width"))+"px"; button_object.firstChild.style.height=parseInt(get_style(button_object,"height"))*2+"px"; button_object.firstChild.firstChild.src="image/"+button_name+".png"; button_object.firstChild.firstChild.style.width=parseInt(get_style(button_object.firstChild,"width"))+"px"; button_object.firstChild.firstChild.style.height=parseInt(get_style(button_object.firstChild,"height"))+"px"; if (button_object.getAttribute("style")=="[object]"){ button_object.firstChild.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + button_object.firstChild.firstChild.src + ", sizingMethod=scale)"; button_object.firstChild.firstChild.style.visibility="hidden";}}
function rollover(button_object){ button_object.firstChild.style.top="-"+parseInt(get_style(button_object,"height"))+"px";}
function rollout(button_object){ button_object.firstChild.style.top="0px";}
function show_index(){ indexpanel.style.visibility="visible"; if (index.length){ document.getElementById("indextext").style.visibility="visible"; document.getElementById("indeximage").style.visibility="visible";}
indexview.style.overflow="auto"; indexbutton.style.visibility="hidden";}
function hide_index(){ indexpanel.style.visibility="hidden"; document.getElementById("indextext").style.visibility="hidden"; document.getElementById("indeximage").style.visibility="hidden"; indexview.style.overflow="hidden"; indexbutton.style.visibility="visible";}
function focus_object(target_object){ if (target_object.getAttribute("name")=="chapter"){ target_object.className="chapterhighlight";}
if (target_object.getAttribute("name")=="anchor"){ target_object.className="anchorhighlight";}
if (target_object.getAttribute("name")=="thumbnail"){ target_object.className="thumbnailhighlight";}
if (target_object.getAttribute("name")=="hyperlink"){ if (edit_mode){ target_object.className="hyperlinkedit"; document.getElementById("hyperlinkproperty").style.left=parseInt(touch.style.left)+parseInt(target_object.style.left); document.getElementById("hyperlinkproperty").style.top=parseInt(touch.style.top)+parseInt(target_object.style.top)+parseInt(target_object.style.height)+canvas_margin; document.getElementById("hyperlinktitle").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[0]; document.getElementById("hyperlinkurl").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[1]; document.getElementById("hyperlinktarget").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[2]; document.getElementById("hyperlinkx").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[3]; document.getElementById("hyperlinky").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[4]; document.getElementById("hyperlinkw").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[5]; document.getElementById("hyperlinkh").value=hyperlink[arr(current_spread,3)][parseInt(target_object.id.split("_")[1])].split("^")[6]; document.getElementById("hyperlinkproperty").style.visibility="visible"; set_mouse_on(1);}
else{ target_object.className="hyperlinkhighlight";}}}
function blur_object(target_object){ if (target_object.getAttribute("name")=="chapter"){ target_object.className="chapterdefault";}
if (target_object.getAttribute("name")=="anchor"){ target_object.className="anchordefault";}
if (target_object.getAttribute("name")=="thumbnail"){ target_object.className="thumbnaildefault";}
if (target_object.getAttribute("name")=="hyperlink"){ if (edit_mode){ update_hyperlink(); target_object.className="hyperlinkhighlight"; document.getElementById("hyperlinkproperty").style.visibility="hidden"; set_mouse_on(0);}
else{ target_object.className="hyperlinkdefault";}}}
function mouse_down(event_value) { if (this==touch){ if (!editdrag_mode && !editresize_mode){ if (document.getElementById(edit_id)){ blur_object(document.getElementById(edit_id)); edit_id=null;}
drag_mode=1; set_mouse_on(0); drag_x=point_x; drag_y=point_y; if (document.all) { offset_x=event.clientX; offset_y=event.clientY;}
else if (touch.getElementsByTagName) { offset_x=event_value.pageX; offset_y=event_value.pageY;}}
return false;}
else if (this==scope){ map_mode=1; set_mouse_on(0); drag_x=parseInt(scope.style.left); drag_y=parseInt(scope.style.top); if (document.all) { offset_x=event.clientX-drag_x; offset_y=event.clientY-drag_y;}
else if (map.getElementsByTagName) { offset_x=event_value.pageX-drag_x; offset_y=event_value.pageY-drag_y;}
return false;}
else if (this.getAttribute("name")=="chapter" || this.getAttribute("name")=="anchor"){ if (document.getElementById(edit_id)){ blur_object(document.getElementById(edit_id))}
edit_id=this.id; focus_object(document.getElementById(edit_id)); return true; return false;}
else if (this.getAttribute("name")=="hyperlink"){ cursor_type=get_style(this,"cursor"); if (document.getElementById(edit_id)){ blur_object(document.getElementById(edit_id))}
edit_id=this.id; focus_object(document.getElementById(edit_id)); document.getElementById("hyperlinkproperty").style.visibility="hidden"; if(cursor_type=="pointer"){ editdrag_mode=1;}
else{ editresize_mode=1;}
set_mouse_on(0); drag_x=parseInt(document.getElementById(edit_id).style.left); drag_y=parseInt(document.getElementById(edit_id).style.top); if (document.all) { offset_x=event.clientX-drag_x; offset_y=event.clientY-drag_y;}
else if (this.getElementsByTagName) { offset_x=event_value.pageX-drag_x; offset_y=event_value.pageY-drag_y;}
return false;}
else{ return true;}}
function mouse_move(event_value) { var current_x=0; var current_y=0; if (drag_mode){ if (document.all) { current_x=drag_x-(event.clientX-offset_x); current_y=drag_y-(event.clientY-offset_y);}
else if (touch.getElementsByTagName) { current_x=drag_x-(event_value.pageX-offset_x); current_y=drag_y-(event_value.pageY-offset_y);}
if ((Math.abs(point_x-current_x))>move_step || (Math.abs(point_y-current_y))>move_step){ point_x=current_x; point_y=current_y; view_point(); return false;}
else{ return true;}}
else if (map_mode){ if (document.all) { current_x=event.clientX-offset_x; current_y=event.clientY-offset_y;}
else if (touch.getElementsByTagName) { current_x=event_value.pageX-offset_x; current_y=event_value.pageY-offset_y;}
if (current_x<0){ current_x=0;}
if (current_x+parseInt(scope.style.width)>map_size){ current_x=map_size-parseInt(scope.style.width);}
if (current_y<0){ current_y=0;}
if (current_y+parseInt(scope.style.height)>map_size){ current_y=map_size-parseInt(scope.style.height);}
scope.style.left=current_x; scope.style.top=current_y; return false;}
else if (editdrag_mode){ if (document.all) { current_x=event.clientX-offset_x; current_y=event.clientY-offset_y;}
else if (document.getElementById(edit_id).getElementsByTagName) { current_x=event_value.pageX-offset_x; current_y=event_value.pageY-offset_y;}
if (current_x<0){ current_x=0;}
if (current_x+parseInt(document.getElementById(edit_id).style.width)>parseInt(touch.style.width)){ current_x=parseInt(touch.style.width)-parseInt(document.getElementById(edit_id).style.width);}
if (current_y<0){ current_y=0;}
if (current_y+parseInt(document.getElementById(edit_id).style.height)>parseInt(touch.style.height)){ current_y=parseInt(touch.style.height)-parseInt(document.getElementById(edit_id).style.height);}
document.getElementById("hyperlinkx").value=pp(current_x); document.getElementById("hyperlinky").value=pp(current_y); document.getElementById(edit_id).style.left=op(pp(current_x)); document.getElementById(edit_id).style.top=op(pp(current_y)); return false;}
else if (editresize_mode){ if (document.all) { move_x=event.clientX-parseInt(main.style.left)-parseInt(frame.style.left)-parseInt(canvas.style.left)-parseInt(touch.style.left); move_y=event.clientY-parseInt(main.style.top)-parseInt(frame.style.top)-parseInt(canvas.style.top)-parseInt(touch.style.top);}
else if (document.getElementById(edit_id).getElementsByTagName) { move_x=event_value.pageX-parseInt(main.style.left)-parseInt(frame.style.left)-parseInt(canvas.style.left)-parseInt(touch.style.left); move_y=event_value.pageY-parseInt(main.style.top)-parseInt(frame.style.top)-parseInt(canvas.style.top)-parseInt(touch.style.top);}
move_x=pp(move_x); move_y=pp(move_y); rl=parseInt(document.getElementById("hyperlinkx").value); rt=parseInt(document.getElementById("hyperlinky").value); rr=parseInt(document.getElementById("hyperlinkx").value)+parseInt(document.getElementById("hyperlinkw").value); rb=parseInt(document.getElementById("hyperlinky").value)+parseInt(document.getElementById("hyperlinkh").value); if (cursor_type=="nw-resize"){ if (move_x>rr){ move_x=rr;}
if (move_x<0){ move_x=0;}
if (move_y>rb){ move_y=rb;}
if (move_y<0){ move_y=0;}
rl=move_x; rt=move_y;}
if (cursor_type=="sw-resize"){ if (move_x>rr){ move_x=rr;}
if (move_x<0){ move_x=0;}
if (move_y<rt){ move_y=rt;}
if (move_y>pp(parseInt(touch.style.height))){ move_y=pp(parseInt(touch.style.height));}
rl=move_x; rb=move_y;}
if (cursor_type=="ne-resize"){ if (move_x<rl){ move_x=rl;}
if (move_x>pp(parseInt(touch.style.width))){ move_x=pp(parseInt(touch.style.width));}
if (move_y>rb){ move_y=rb;}
if (move_y<0){ move_y=0;}
rt=move_y; rr=move_x;}
if (cursor_type=="se-resize"){ if (move_x<rl){ move_x=rl;}
if (move_x>pp(parseInt(touch.style.width))){ move_x=pp(parseInt(touch.style.width));}
if (move_y<rt){ move_y=rt;}
if (move_y>pp(parseInt(touch.style.height))){ move_y=pp(parseInt(touch.style.height));}
rr=move_x; rb=move_y;}
if (cursor_type=="w-resize"){ if (move_x>rr){ move_x=rr;}
if (move_x<0){ move_x=0;}
rl=move_x;}
if (cursor_type=="n-resize"){ if (move_y>rb){ move_y=rb;}
if (move_y<0){ move_y=0;}
rt=move_y;}
if (cursor_type=="e-resize"){ if (move_x<rl){ move_x=rl;}
if (move_x>pp(parseInt(touch.style.width))){ move_x=pp(parseInt(touch.style.width));}
rr=move_x;}
if (cursor_type=="s-resize"){ if (move_y<rt){ move_y=rt;}
if (move_y>pp(parseInt(touch.style.height))){ move_y=pp(parseInt(touch.style.height));}
rb=move_y;}
document.getElementById("hyperlinkx").value=rl; document.getElementById("hyperlinky").value=rt; document.getElementById("hyperlinkw").value=rr-rl; document.getElementById("hyperlinkh").value=rb-rt; document.getElementById(edit_id).style.left=op(rl); document.getElementById(edit_id).style.top=op(rt); document.getElementById(edit_id).style.width=op(rr-rl); document.getElementById(edit_id).style.height=op(rb-rt); return false;}
else{ return true;}}
function mouse_up(event_value) { if (drag_mode){ drag_mode=0; set_mouse_on(1); return false;}
else if (map_mode){ map_mode=0; set_mouse_on(1); point_x=((parseInt(scope.style.left))+(parseInt(scope.style.width)/2))*((block_count*block_size)/map_size); point_y=((parseInt(scope.style.top))+(parseInt(scope.style.height)/2))*((block_count*block_size)/map_size); view_point(); return false;}
else if (editdrag_mode){ editdrag_mode=0; set_mouse_on(1); update_hyperlink(); return false;}
else if (editresize_mode){ editresize_mode=0; set_mouse_on(1); update_hyperlink(); return false;}
else{ return true;}}
function set_mouse_on(mode_flag){ if (document.getElementById(edit_id)){ if (mode_flag){ document.onmousemove=null; document.getElementById(edit_id).onmousemove=mouse_on;}
else{ document.onmousemove=mouse_move; document.getElementById(edit_id).onmousemove=null; document.getElementById(edit_id).style.cursor="pointer";}}}
function mouse_on(event_value) { var target_object=this; var mouse_cursor="pointer"; var mouse_x=0; var mouse_y=0; var ol=parseInt(target_object.style.left); var ot=parseInt(target_object.style.top); var ow=parseInt(target_object.style.width); var oh=parseInt(target_object.style.height); var object_edge=4; if (document.all) { mouse_x=event.clientX-parseInt(main.style.left)-parseInt(frame.style.left)-parseInt(canvas.style.left)-parseInt(touch.style.left); mouse_y=event.clientY-parseInt(main.style.top)-parseInt(frame.style.top)-parseInt(canvas.style.top)-parseInt(touch.style.top);}
else if (this.getElementsByTagName) { mouse_x=event_value.pageX-parseInt(main.style.left)-parseInt(frame.style.left)-parseInt(canvas.style.left)-parseInt(touch.style.left); mouse_y=event_value.pageY-parseInt(main.style.top)-parseInt(frame.style.top)-parseInt(canvas.style.top)-parseInt(touch.style.top);}
if (mouse_x<=ol+object_edge && mouse_y<=ot+object_edge){ mouse_cursor="nw-resize";}
else if (mouse_x<=ol+object_edge && mouse_y>=ot+oh-object_edge){ mouse_cursor="sw-resize";}
else if (mouse_x>=ol+ow-object_edge && mouse_y<=ot+object_edge){ mouse_cursor="ne-resize";}
else if (mouse_x>=ol+ow-object_edge && mouse_y>=ot+oh-object_edge){ mouse_cursor="se-resize";}
else if (mouse_x<=ol+object_edge ){ mouse_cursor="w-resize";}
else if (mouse_y<=ot+object_edge ){ mouse_cursor="n-resize";}
else if (mouse_x>=ol+ow-object_edge){ mouse_cursor="e-resize";}
else if (mouse_y>=ot+oh-object_edge){ mouse_cursor="s-resize";}
target_object.style.cursor=mouse_cursor;}
function left_page(){ if (effect_mode){ return;}
if (!bind){ if (current_spread>1){ target_spread=current_spread-1; move_page("turn");}}
else{ if (current_spread<spread_count){ target_spread=current_spread+1; move_page("turn");}}}
function right_page(){ if (effect_mode){ return;}
if (!bind){ if (current_spread<spread_count){ target_spread=current_spread+1; move_page("turn");}}
else{ if (current_spread>1){ target_spread=current_spread-1; move_page("turn");}}}
function leftend_page(){ if (effect_mode){ return;}
if (!bind){ if (current_spread>1){ target_spread=1; move_page("turn");}}
else{ if (current_spread<spread_count){ target_spread=spread_count; move_page("turn");}}}
function rightend_page(){ if (effect_mode){ return;}
if (!bind){ if (current_spread<spread_count){ target_spread=spread_count; move_page("turn");}}
else{ if (current_spread>1){ target_spread=1; move_page("turn");}}}
function jump_page(val){ if (effect_mode){ return;}
if (val!=current_spread){ if (val>=1 && val<=spread_count){ target_spread=val; move_page("turn");}}
else{ fit_scale();}}
function show_anchor(sn,bc,x,y){ if (sn<1 || sn>spread_count){ return;}
if (bc<min_block || bc>max_block){ return;}
if (current_spread==sn && block_count==bc && point_x==op(x) && point_y==op(y)){ return;}
current_spread=sn; target_spread=sn; block_count=bc; point_x=op(x); point_y=op(y); if (block_size!=default_size){ block_size=default_size;}
move_page("fade");}
function get_pdf(){ window.open(job_name+".pdf","pdf","resizable=yes");}
function show_help(){ helppanel.style.visibility="visible"}
function hide_help(){ helppanel.style.visibility="hidden"}
function window_close(){ window.close();}
function move_page(effect_type){ effect_mode=1; effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}
function effect_page(effect_type){ if (effect_type=="turn"){ clearTimeout(effect_id); if (effect_mode==1){ fit_scale(); var r=0; var c=0; var mask_x=0; var mask_y=0; var target_object=null; var object_html=""; if (proportion>=1){ mask_x=0; mask_y=parseInt((1-(1/proportion))*(block_count*block_size)/2);}
if (proportion<1){ mask_x=parseInt((1-proportion)*(block_count*block_size)/2); mask_y=0;}
var b=0; if ((current_spread==1)&&(facing==1)&&(bind!=start_page)){ if (!bind){ b=1;}
else{ b=2;}}
else if ((current_spread==spread_count)&&(facing==1)&&((bind+start_page+page_count)%2==1)){ if (!bind){ b=2;}
else{ b=1;}}
if (b!=1){ for (r=1;r<=block_count;r=r+1) { for (c=1;c<=(block_count/2);c=c+1) { object_html=object_html+"<div class=\"object\" style=\"left:"+((c-1)*block_size-mask_x)+"px;top:"+((r-1)*block_size-mask_y)+"px;width:"+block_size+"px;height:"+block_size+"px;\"><img src=\"contents/"+earr(job_id,current_spread,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format+"\" style=\"width:"+block_size+"px;height:"+block_size+"px;\"></div>";}}}
object_html=object_html+"<div id=\"leftshadow\" class=\"object\" style=\"left:0px;top:0px;width:"+parseInt(lefteffect.style.width)+"px;height:"+parseInt(lefteffect.style.height)+"px;\"></div>"; lefteffect.innerHTML=object_html; set_opacity(lefteffect.lastChild,0); lefteffect.lastChild.style.backgroundColor="#000000"; object_html=""; if (b!=2){ for (r=1;r<=block_count;r=r+1) { for (c=(block_count/2)+1;c<=block_count;c=c+1) { object_html=object_html+"<div class=\"object\" style=\"left:"+((c-(block_count/2)-1)*block_size)+"px;top:"+((r-1)*block_size-mask_y)+"px;width:"+block_size+"px;height:"+block_size+"px;\"><img src=\"contents/"+earr(job_id,current_spread,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format+"\" style=\"width:"+block_size+"px;height:"+block_size+"px;\"></div>";}}}
object_html=object_html+"<div id=\"rightshadow\" class=\"object\" style=\"left:0px;top:0px;width:"+parseInt(righteffect.style.width)+"px;height:"+parseInt(righteffect.style.height)+"px;\"></div>"; righteffect.innerHTML=object_html; set_opacity(righteffect.lastChild,0); righteffect.lastChild.style.backgroundColor="#000000"; if ((!bind && current_spread<target_spread)||(bind && current_spread>target_spread)){ if ((current_spread==1)||(current_spread==spread_count)){ lefteffect.style.zIndex=4002; righteffect.style.zIndex=4001;}
else{ lefteffect.style.zIndex=4002; righteffect.style.zIndex=4001;}}
else{ if ((current_spread==1)||(current_spread==spread_count)){ lefteffect.style.zIndex=4001; righteffect.style.zIndex=4002;}
else{ lefteffect.style.zIndex=4001; righteffect.style.zIndex=4002;}}
masking(); touch.innerHTML=""; var b=0; if (((current_spread==1)||(target_spread==1))&&(facing==1)&&(bind!=start_page)){ if (!bind){ b=1;}
else{ b=2;}}
else if (((current_spread==spread_count)||(target_spread==spread_count))&&(facing==1)&&((bind+start_page+page_count)%2==1)){ if (!bind){ b=2;}
else{ b=1;}}
for (r=1;r<=block_count;r=r+1) { for (c=1;c<=block_count;c=c+1) { if (!(b==1 && c<=block_count/2)&&!(b==2 && c>block_count/2)){ load_image(arr(block_count,3)+"_"+arr(r,3)+"_"+arr(c,3),"contents/"+earr(job_id,target_spread,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format);}
else{ load_image("","contents/"+earr(job_id,target_spread,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format); document.getElementById(arr(block_count,3)+"_"+arr(r,3)+"_"+arr(c,3)).innerHTML="";}}}
b_canvas.innerHTML=""; effect_mode=2; effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}
if (effect_mode==2){ if ((!bind && current_spread<target_spread)||(bind && current_spread>target_spread)){ if ((parseInt(righteffect.style.left)+parseInt(righteffect.style.width)-turn_step)<(parseInt(lefteffect.style.left)+parseInt(lefteffect.style.width))){ righteffect.style.width="0px"; righteffect.style.left=(parseInt(lefteffect.style.left)+parseInt(lefteffect.style.width))+"px"; effect_mode=3;}
else{ set_opacity(righteffect.lastChild,(parseInt(lefteffect.style.left)+parseInt(lefteffect.style.width)-parseInt(righteffect.style.left))/parseInt(lefteffect.style.width)); righteffect.style.left=(parseInt(righteffect.style.left)-turn_step)+"px"; righteffect.style.clip="rect(auto auto auto "+((parseInt(lefteffect.style.left)+parseInt(lefteffect.style.width))-parseInt(righteffect.style.left))+"px)";}}
else{ if ((parseInt(lefteffect.style.left)+turn_step)>(parseInt(righteffect.style.left))){ lefteffect.style.width="0px"; lefteffect.style.left=(parseInt(righteffect.style.left))+"px"; effect_mode=3;}
else{ set_opacity(lefteffect.lastChild,(1-(parseInt(righteffect.style.left)-parseInt(lefteffect.style.left))/parseInt(righteffect.style.width))); lefteffect.style.left=(parseInt(lefteffect.style.left)+turn_step)+"px"; lefteffect.style.clip="rect(auto "+(parseInt(righteffect.style.left)-parseInt(lefteffect.style.left))+"px auto auto)";}}
effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}
if (effect_mode==3){ var r=0; var c=0; var mask_x=0; var mask_y=0; var object_html=""; if (proportion>=1){ mask_x=0; mask_y=parseInt((1-(1/proportion))*(block_count*block_size)/2);}
if (proportion<1){ mask_x=parseInt((1-proportion)*(block_count*block_size)/2); mask_y=0;}
if ((!bind && current_spread<target_spread)||(bind && current_spread>target_spread)){ for (r=1;r<=block_count;r=r+1) { for (c=1;c<=(block_count/2);c=c+1) { object_html=object_html+"<div class=\"object\" style=\"left:"+((c-1)*block_size-mask_x)+"px;top:"+((r-1)*block_size-mask_y)+"px;width:"+block_size+"px;height:"+block_size+"px;\"><img src=\"contents/"+earr(job_id,target_spread,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format+"\" style=\"width:"+block_size+"px;height:"+block_size+"px;\"></div>";}}
object_html=object_html+"<div id=\"rightshadow\" class=\"object\" style=\"left:0px;top:0px;width:"+parseInt(lefteffect.style.width)+"px;height:"+parseInt(lefteffect.style.height)+"px;\"></div>"; righteffect.innerHTML=object_html; set_opacity(righteffect.lastChild,1); righteffect.lastChild.style.backgroundColor="#000000"; righteffect.style.clip="rect(auto auto auto auto)"; lefteffect.style.zIndex=4001; righteffect.style.zIndex=4002;}
else{ for (r=1;r<=block_count;r=r+1) { for (c=block_count/2+1;c<=block_count;c=c+1) { object_html=object_html+"<div class=\"object\" style=\"left:"+((c-block_count/2-1)*block_size)+"px;top:"+((r-1)*block_size-mask_y)+"px;width:"+block_size+"px;height:"+block_size+"px;\"><img src=\"contents/"+earr(job_id,target_spread,3)+"/"+earr(job_id,block_count,3)+"_"+earr(job_id,r,3)+"_"+earr(job_id,c,3)+image_format+"\" style=\"width:"+block_size+"px;height:"+block_size+"px;\"></div>";}}
object_html=object_html+"<div id=\"leftshadow\" class=\"object\" style=\"left:0px;top:0px;width:"+parseInt(righteffect.style.width)+"px;height:"+parseInt(righteffect.style.height)+"px;\"></div>"; lefteffect.innerHTML=object_html; set_opacity(lefteffect.lastChild,1); lefteffect.lastChild.style.backgroundColor="#000000"; lefteffect.style.clip="rect(auto auto auto auto)"; lefteffect.style.zIndex=4002; righteffect.style.zIndex=4001;}
effect_mode=4; effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}
if (effect_mode==4){ if ((!bind && current_spread<target_spread)||(bind && current_spread>target_spread)){ if ((parseInt(righteffect.style.left)-turn_step)<(parseInt(lefteffect.style.left))){ lefteffect.innerHTML=""; righteffect.innerHTML=""; righteffect.style.width=parseInt(lefteffect.style.width)+"px"; righteffect.style.left=(parseInt(lefteffect.style.left)+parseInt(lefteffect.style.width))+"px"; lefteffect.style.zIndex=4001; righteffect.style.zIndex=4002; current_spread=target_spread; effect_mode=0; load_map(); masking(); load_hyperlink(); view_point(); preload_page();}
else{ set_opacity(righteffect.lastChild,1-parseInt(righteffect.style.width)/parseInt(lefteffect.style.width)); righteffect.style.width=(parseInt(righteffect.style.width)+turn_step)+"px"; righteffect.style.left=(parseInt(righteffect.style.left)-turn_step)+"px";}}
else{ if ((parseInt(lefteffect.style.left)+parseInt(lefteffect.style.width)+turn_step)>(parseInt(righteffect.style.left)+parseInt(righteffect.style.width))){ lefteffect.innerHTML=""; righteffect.innerHTML=""; lefteffect.style.width=parseInt(righteffect.style.width)+"px"; lefteffect.style.left=(parseInt(righteffect.style.left)-parseInt(righteffect.style.width))+"px"; lefteffect.style.zIndex=4001; righteffect.style.zIndex=4002; current_spread=target_spread; effect_mode=0; load_map(); masking(); load_hyperlink(); view_point(); preload_page();}
else{ set_opacity(lefteffect.lastChild,1-parseInt(lefteffect.style.width)/parseInt(righteffect.style.width)); lefteffect.style.width=(parseInt(lefteffect.style.width)+turn_step)+"px"; lefteffect.style.left=(parseInt(lefteffect.style.left))+"px";}}
effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}}
if (effect_type=="fade"){ clearTimeout(effect_id); if (effect_mode==1){ if (current_fade==0){ fademask.style.visibility="visible";}
if (current_fade==1){ effect_mode=2;}
else if ((current_fade+fade_step)>=1){ current_fade=1;}
else{ current_fade=current_fade+fade_step;}
set_opacity(fademask,current_fade); effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}
if (effect_mode==2){ effect_mode=3; load_canvas(); load_map(); masking(); load_hyperlink(); view_point(); effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}
if (effect_mode==3){ if ((current_fade-fade_step)<=0){ current_fade=0; effect_mode=0; fademask.style.visibility="hidden";}
else{ current_fade=current_fade-(fade_step/2);}
set_opacity(fademask,current_fade); effect_id=setTimeout("effect_page('"+effect_type+"')",effect_rate);}}}
function set_opacity(target_object,value){ target_object.style.filter="alpha(opacity="+(value*100)+")"; target_object.style.MozOpacity=value; target_object.style.opacity=value;}
function change_editmode(val){ if (val==null){ if (edit_mode){ edit_mode=0;}
else{ edit_mode=1;}}
else if (val){ edit_mode=1;}
else{ edit_mode=0;}
if (edit_mode){ document.getElementById("edittool_mode").value="プレビューモードへ"; document.getElementById("edittool_save").disabled=false; document.getElementById("edittool_scriptchapter").disabled=false; document.getElementById("edittool_scriptanchor").disabled=false; document.getElementById("edittool_addchapter").disabled=false; document.getElementById("edittool_addanchor").disabled=false; document.getElementById("edittool_deleteindex").disabled=false; document.getElementById("edittool_upindex").disabled=false; document.getElementById("edittool_downindex").disabled=false; document.getElementById("edittool_deleteallindex").disabled=false; document.getElementById("edittool_addhyperlink").disabled=false; document.getElementById("edittool_deletehyperlink").disabled=false; document.getElementById("edittool_deleteallhyperlink").disabled=false; load_index(0); load_hyperlink();}
else{ document.getElementById("edittool_mode").value="エディットモードへ"; document.getElementById("edittool_save").disabled=true; document.getElementById("edittool_scriptchapter").disabled=true; document.getElementById("edittool_scriptanchor").disabled=true; document.getElementById("edittool_addchapter").disabled=true; document.getElementById("edittool_addanchor").disabled=true; document.getElementById("edittool_deleteindex").disabled=true; document.getElementById("edittool_upindex").disabled=true; document.getElementById("edittool_downindex").disabled=true; document.getElementById("edittool_deleteallindex").disabled=true; document.getElementById("edittool_addhyperlink").disabled=true; document.getElementById("edittool_deletehyperlink").disabled=true; document.getElementById("edittool_deleteallhyperlink").disabled=true; load_index(0); load_hyperlink();}}
function save_edit(){ var index_data=""
index_data=index_data+"var index=new Array();\n"; for(i=0;i<index.length;i=i+1){ index_data=index_data+"index["+i+"]=\""+index[i]+"\";\n";}
var hyperlink_data=""
hyperlink_data=hyperlink_data+"var hyperlink=new Array();\n"; for(i=1;i<=spread_count;i=i+1){ if (hyperlink[arr(i,3)]){ hyperlink_data=hyperlink_data+"hyperlink[\""+arr(i,3)+"\"]=new Array();\n"; for(j=0;j<hyperlink[arr(i,3)].length;j=j+1){ hyperlink_data=hyperlink_data+"hyperlink[\""+arr(i,3)+"\"]["+j+"]=\""+hyperlink[arr(i,3)][j]+"\";\n";}}}
var request_parameter=null; request_parameter=$H({job_id:job_id,index_data:index_data,hyperlink_data:hyperlink_data}).toQueryString(); new Ajax.Request( "../../../../../../../save.html?ts="+get_time_stamp(), { method:"post", postBody:request_parameter, onSuccess:function(httpObject){ alert("目次とリンクを保存しました。");}, onFailure:function(){ alert("目次とリンクの保存に失敗しました。");}} );}
function show_helpedit(){ window.open("http://www.debiew.com/helpedit.html","helpedit","width=382,height=482,scrollbars=yes,location=no,menubar=no,left=10,top=30");}
function script_chapter(){ prompt("現在のチャプタを表示するためのJavaScript", "JavaScript:jump_page("+current_spread+")");}
function script_anchor(){ prompt("現在のアンカーを表示するためのJavaScript", "JavaScript:show_anchor("+current_spread+","+block_count+","+pp(point_x)+","+pp(point_y)+")");}
function add_chapter(){ if (indexpanel.style.visibility!="visible"){ show_index();}
if (document.getElementById(edit_id)){ index.splice(parseInt(edit_id.split("_")[1])+1,0,"chapter^新しいチャプタ^"+current_spread); edit_id="index_"+(parseInt(edit_id.split("_")[1])+1);}
else{ index.splice(index.length,0,"chapter^新しいチャプタ^"+current_spread); edit_id="index_"+(index.length-1);}
load_index(0);}
function add_anchor(){ if (indexpanel.style.visibility!="visible"){ show_index();}
if (document.getElementById(edit_id)){ index.splice(parseInt(edit_id.split("_")[1])+1,0,"anchor^新しいアンカー^"+current_spread+"^"+block_count+"^"+pp(point_x)+"^"+pp(point_y)); edit_id="index_"+(parseInt(edit_id.split("_")[1])+1);}
else{ index.splice(index.length,0,"anchor^新しいアンカー^"+current_spread+"^"+block_count+"^"+pp(point_x)+"^"+pp(point_y)); edit_id="index_"+(index.length-1);}
load_index(0);}
function delete_index(){ if (document.getElementById(edit_id)){ if (document.getElementById(edit_id).getAttribute("name")=="chapter" || document.getElementById(edit_id).getAttribute("name")=="anchor"){ index.splice(parseInt(edit_id.split("_")[1]),1); edit_id=null; load_index(0);}}}
function delete_all_index(){ if (confirm("ブック内のすべての目次を削除します。\nよろしいですか？")){ index=new Array(); edit_id=null; load_index(0);}}
function up_index(){ if (document.getElementById(edit_id)){ if (document.getElementById(edit_id).getAttribute("name")=="chapter" || document.getElementById(edit_id).getAttribute("name")=="anchor"){ if (parseInt(edit_id.split("_")[1])>0){ index.splice(parseInt(edit_id.split("_")[1])-1,0,index[parseInt(edit_id.split("_")[1])]); index.splice(parseInt(edit_id.split("_")[1])+1,1); edit_id="index_"+(parseInt(edit_id.split("_")[1])-1); load_index(0);}}}}
function down_index(){ if (document.getElementById(edit_id)){ if (document.getElementById(edit_id).getAttribute("name")=="chapter" || document.getElementById(edit_id).getAttribute("name")=="anchor"){ if (parseInt(edit_id.split("_")[1])<index.length-1){ index.splice(parseInt(edit_id.split("_")[1])+2,0,index[parseInt(edit_id.split("_")[1])]); index.splice(parseInt(edit_id.split("_")[1]),1); edit_id="index_"+(parseInt(edit_id.split("_")[1])+1); load_index(0);}}}}
function add_hyperlink(){ var hyperlink_size=100; var l=point_x-parseInt(touch.style.left)-op(hyperlink_size/2); var t=point_y-parseInt(touch.style.top)-op(hyperlink_size/2); if (l<0){ l=0;}
if (l+op(hyperlink_size)>parseInt(touch.style.width)){ l=parseInt(touch.style.width)-op(hyperlink_size);}
if (t<0){ t=0;}
if (t+op(hyperlink_size)>parseInt(touch.style.height)){ t=parseInt(touch.style.height)-op(hyperlink_size);}
if (!hyperlink[arr(current_spread,3)]){ hyperlink[arr(current_spread,3)]=new Array();}
hyperlink[arr(current_spread,3)].splice(hyperlink[arr(current_spread,3)].length,0,"新しいリンク^http://www.debiew.com/^_blank^"+pp(l)+"^"+pp(t)+"^"+hyperlink_size+"^"+hyperlink_size); edit_id="hyperlink_"+(hyperlink[arr(current_spread,3)].length-1); load_hyperlink();}
function delete_hyperlink(){ if (document.getElementById(edit_id)){ if (document.getElementById(edit_id).getAttribute("name")=="hyperlink"){ hyperlink[arr(current_spread,3)].splice(parseInt(edit_id.split("_")[1]),1); edit_id=null; load_hyperlink();}}}
function delete_all_hyperlink(){ if (confirm("ブック内のすべてのリンクを削除します。\nよろしいですか？")){ hyperlink=new Array(); edit_id=null; load_hyperlink();}}
function update_index(index_object){ index[parseInt(index_object.id.split("_")[1])]=(index_object.getAttribute("name"))+"^"+(index_object.firstChild.value)+"^"+(index_object.lastChild.value);}
function update_hyperlink(){ var hyperlink_object=document.getElementById(edit_id); var hyperlinktitle=document.getElementById("hyperlinktitle").value; var hyperlinkurl=document.getElementById("hyperlinkurl").value; var hyperlinktarget=document.getElementById("hyperlinktarget").value; var hyperlinkx=parseInt(document.getElementById("hyperlinkx").value); var hyperlinky=parseInt(document.getElementById("hyperlinky").value); var hyperlinkw=parseInt(document.getElementById("hyperlinkw").value); var hyperlinkh=parseInt(document.getElementById("hyperlinkh").value); hyperlink[arr(current_spread,3)][parseInt(hyperlink_object.id.split("_")[1])]=hyperlinktitle+"^"+hyperlinkurl+"^"+hyperlinktarget+"^"+hyperlinkx+"^"+hyperlinky+"^"+hyperlinkw+"^"+hyperlinkh; hyperlink_object.style.left=op(hyperlinkx); hyperlink_object.style.top=op(hyperlinky); hyperlink_object.style.width=op(hyperlinkw); hyperlink_object.style.height=op(hyperlinkh); focus_object(hyperlink_object);}
function clear_edit(){ document.onmousemove=mouse_move; if (document.getElementById("hyperlinkproperty")){ document.getElementById("hyperlinkproperty").style.visibility="hidden";}}
function pp(val){ return parseInt(val/(block_count*block_size)*1000);}
function op(val){ return parseInt(val/1000*(block_count*block_size));}
