function init_link(s1){LinkObj={timer:undefined,audioPlayer:undefined,seq:0,deviation:1,curScale:1.0,mpbWidth:228,mpbHeight:174,scrapeTxt:'',ttaObj:undefined,ttaLR:true,ttaN:0,ttaPlaying:false,followTTa:false,markTTaArea:false,arTTaMP3:[],arLinkUnit:[],arPolygon:[],arPolyUnitIdx:[],arInfoidx:[],arHtRules:[],arHighlight:[],outClip:[],userClip:[] };LinkObj.audioPlayer=document.getElementById('linkoutaudio');if(s1!=="")LinkObj.arHtRules.push(s1);LinkObj.show_linkData2=function(leftRight,sdir,fname,parentObj){var sa=LinkInfo.get_indexPtr(sdir,fname);var srule,pidx,uidx,rect,ardim,img;for(var i=0,alen=sa.length;i=0;i--){LinkPtrObj.leftLink.removeChild(nodes[i]);} if(!LinkPtrObj.rightLink)return;var nodes=LinkPtrObj.rightLink.childNodes;for(var i=nodes.length-1;i>=0;i--){LinkPtrObj.rightLink.removeChild(nodes[i]);} if(SoundItemObj){SoundItemObj.unload();SoundItemObj=undefined;}} LinkObj.refresh_linkData=function(){LinkObj.remove_linkData();show_linkData();} LinkObj.add_outClip=function(divobj,imgobj,uidx,pidx,leftRight,nkd,nw,nh){var iconobj=new IconObj(divobj,imgobj,uidx,pidx,leftRight,nkd,nw,nh);LinkObj.outClip.push(iconobj);return iconobj;} LinkObj.opening_highlight=function(s){LinkObj.highlightTurn=true;var n=PermitMan.get_directGoPerm("showboard",s,"","");if(n<0)return;go_general(n,"system");} LinkObj.loc_linkData=function(){var i,alen,uidx,pidx;for(i=0,alen=LinkObj.arPolygon.length;i2){if(CataInfo.incview==="d")fname=arfname[1];else if(CataInfo.incview==="m")fname=arfname[2];} var arstr,contw,conth,ext;var odv=false;if(fname.substr(0,1)==="@"){arstr=fname.split(",");contw=parseInt(arstr[1]);conth=parseInt(arstr[2]);fname=arstr[3];ext=arstr[0].substr(1);odv=true;} else{if(!LinkInfo.arFlashLink[fname]||LinkInfo.arFlashLink[fname].indexOf(":")<0)return;arstr=LinkInfo.arFlashLink[fname].split(":");contw=parseInt(arstr[3]);conth=parseInt(arstr[4]);ext=get_extension(fname).toLowerCase();} var tw=contw+WinInfo.get_contexWidth();var th=conth+WinInfo.get_contexHeight();if(CataInfo.incview==="m"){if(tw>stageWidth){tw=stageWidth;th=Math.floor(tw*conth/contw)+WinInfo.get_contexHeight();} if(th>stageHeight){th=stageHeight;tw=Math.floor((stageHeight-WinInfo.get_contexHeight())*contw/conth);}} NewinObj.titleHeight=WinInfo.get_titleHeight(SkinInfo.nwclass);var pidx=linkunit.pointer;var qstr="w="+tw+"&h="+th+"&idx="+uidx+"&d="+SkinInfo.mainmenu+"."+SkinInfo.nwclass+"."+CataInfo.incview+"."+CataInfo.cataLang;var s="
";s+=(FileInfo.embedTag==="iframe")?"":"";if(ext==="youtube"){s+="";} else if(ext==="mp4"||ext==="ogg"||ext==="webm"){s+="\n";} else if(ext==="gif"){s+="\n";} else{if(CataInfo.incview==="m"){if(linkunit.callDevice==="mouseup")alert('Mobile web browser does not support the flash contents!(support-1)');return;} var fsrc,flashvars;if(ext==="flv"){fsrc=ServerInfo.serverUrl+"/skin5/flvview.swf";flashvars="charset="+CataInfo.cataCharset+"&lolang="+CataInfo.cataLang+"&ext="+ServerInfo.progExt+"&url="+ServerInfo.serverUrl+"&fname="+fname;} else{fsrc=FileInfo.flashFilePath(fname);flashvars="";} s+="\n";s+=LinkObj.get_flashParam(fsrc,flashvars)+"\n";} befX=Math.floor((stageWidth-tw)/2);befY=Math.floor((stageHeight-th)/2);Action.set_mainState("ctrwin");newinDiv.style.width=tw+"px";newinDiv.style.height=th+"px";newinDiv.style.left=befX+"px";newinDiv.style.top=befY+"px";newinDiv.innerHTML=s;newinDiv.style.visibility="visible";} LinkObj.load_sfa=function(leftRight,uidx,linkunit,basemc){if(PermitMan.get_staLinkPerm()===false)return;if(LinkObj.has_linkPointer(linkunit.pointer)!==-1)return;var arfname=linkunit.get_actRule();var arflen=arfname.length;var fname=arfname[0];if(arflen===2&&CataInfo.incview==="m")fname=arfname[1];else if(arflen>2){if(CataInfo.incview==="d")fname=arfname[1];else if(CataInfo.incview==="m")fname=arfname[2];} var arstr,contw,conth,ext;var odv=false;if(fname.substr(0,1)==="@"){arstr=fname.split(",");if(arstr.length==4)fname=arstr[3];else fname=arstr[1];ext=arstr[0].substr(1);odv=true;} else{ext=get_extension(fname).toLowerCase();} var pidx=linkunit.pointer;var rect=LinkInfo.arLinkPoly[pidx].boundRect;var posx=Math.floor(rect.x*LinkPtrObj.wRatio);if(leftRight===false)posx+=(Action.drawCondition<1)?ScreenInfo.smImageWidth:ScreenInfo.bigImageWidth;var posy=Math.floor(rect.y*LinkPtrObj.hRatio);var pw=Math.floor(rect.width*LinkPtrObj.wRatio);var ph=Math.floor(rect.height*LinkPtrObj.hRatio);var obj=document.createElement("div");obj.id="linkdiv"+pidx;obj.style.cssText="z-index:3;display:block;position:absolute;left:"+posx+"px;top:"+posy+"px;width:"+pw+"px;height:"+ph+"px";var s="";if(ext==="youtube"){s+="";} else if(ext==="mp4"||ext==="ogg"||ext=="webm"){s+="\n";} else if(ext==="gif"){s+="\n";} else{if(CataInfo.incview==="m"){if(linkunit.callDevice==="mouseup")alert('Mobile web browser does not support the flash contents!');return;} var fsrc,flashvars;if(ext==="flv"){fsrc=ServerInfo.serverUrl+"/skin5/flvview.swf";flashvars="charset="+CataInfo.cataCharset+"&lolang="+CataInfo.cataLang+"&ext="+ServerInfo.progExt+"&url="+ServerInfo.serverUrl+"&fname="+fname;} else{fsrc=FileInfo.flashFilePath(fname);flashvars="";} s+="\n";s+=LinkObj.get_flashParam(fsrc,flashvars)+"\n";} obj.innerHTML=s;linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,undefined,uidx,pidx,leftRight,1,0,0);} LinkObj.get_flashParam=function(fsrc,flashvars){var s="\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"Your browser does not support the flash element.\n";return s;} LinkObj.support_video=function(s){if(!!document.createElement('video').canPlayType){var videoElem=document.createElement("video");if(s==="ogg"){var oggTest=videoElem.canPlayType('video/ogg; codecs="theora, vorbis"');if(oggTest==="probably"||oggTest==="maybe")return true;} else if(s==="mp4"){var h264Test=vidTest.canPlayType('video/mp4; codecs="avc1.42E01E"');if(h264Test==="probably"||h264Test==="maybe")return true;} else if(s==="webm"){var webmTest=vidTest.canPlayType('video/webm; codecs="vp8, vorbis"');if(webmTest==="probably"||webmTest==="maybe")return true;}} return false;} LinkObj.video_failed=function(e,nkd){console.log(e.target.childNodes[1].src+" : ");switch(e.target.error.code){case e.target.error.MEDIA_ERR_ABORTED:console.log('You aborted the video playback.(failed-1)');break;case e.target.error.MEDIA_ERR_NETWORK:console.log('Network Error.(failed-2)');break;case e.target.error.MEDIA_ERR_DECODE:console.log('The browser does not support the <video>');break;case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:console.log('The browser does not support this video codec.(failed-4)');break;default:console.log('An unknown error occurred.(failed-5)');break;} if(nkd===1){unload_newin("ctrwin");ctrwinSvg=undefined;}} LinkObj.go_winToFullscr=function(){newinDiv.style.left="0px";newinDiv.style.top="0px";newinDiv.style.width=stageWidth+"px";newinDiv.style.height=stageHeight+"px";document.getElementById('newin_obj').className="newinobjFull";newinDiv.addEventListener('mousemove',LinkObj.do_mousemoveFullscr);document.getElementById('newin_frame').style.zIndex=3;} LinkObj.go_winToNormalscr=function(){newinDiv.style.left=befX+"px";newinDiv.style.top=befY+"px";newinDiv.style.width=ctrwinSvg.svgWidth+"px";newinDiv.style.height=ctrwinSvg.svgHeight+"px";document.getElementById('newin_obj').className="newinobjE"+SkinInfo.nwclass;newinDiv.removeEventListener('mousemove',LinkObj.do_mousemoveFullscr);document.getElementById('newin_frame').style.zIndex=1;document.getElementById('newin_frame').style.visibility="visible";} LinkObj.do_mousemoveFullscr=function(e){if(e.clientY0&&Action.togetherEnlarge===true&&leftRight===false)posx+=ScreenInfo.bigImageWidth;var posy=Math.floor(rect.y*LinkPtrObj.hRatio);obj.style.left=posx+"px";obj.style.top=posy+"px";if(LinkInfo.sameIconSize===false){var s="\n";obj.innerHTML=s;} else{obj.innerHTML="\n";} linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,document.getElementById("linkico"+pidx),uidx,pidx,leftRight,2,newImg.naturalWidth,newImg.naturalHeight);} newImg.src=fsrc;} LinkObj.go_iconlink=function(leftRight,uidx,basemc){LinkObj.go_link(leftRight,uidx,LinkObj.arLinkUnit[uidx],basemc);} LinkObj.load_linkImage=function(leftRight,uidx,linkunit){var pidx=linkunit.pointer;if(document.getElementById("linkdivimg"+pidx))return;var fname,stitle="";var pos=linkunit.rule.indexOf(",");if(pos!=-1){stitle=linkunit.rule.substr(0,pos);fname=linkunit.rule.substr(pos+1);} else{fname=linkunit.rule;} var rect=LinkInfo.arLinkPoly[pidx].boundRect;var posx=Math.floor(rect.x*LinkPtrObj.wRatio);if(Action.drawCondition<1&&leftRight===false)posx+=ScreenInfo.smImageWidth;else if(Action.drawCondition>0&&Action.togetherEnlarge===true&&leftRight===false)posx+=ScreenInfo.bigImageWidth;var posy=Math.floor(rect.y*LinkPtrObj.hRatio);var fsrc=FileInfo.imageFilePath(fname,"","*");var newImg=new Image();newImg.onload=function(){var tw=newImg.naturalWidth+16;var th=newImg.naturalHeight+37;if(Action.drawCondition<1){if(posx+tw>smRect.right)posx=smRect.right-tw;if(posy+th>smRect.bottom-smRect.y)posy=smRect.bottom-smRect.y-th;else if(posyScreenInfo.bigImageRect.right)posx=ScreenInfo.bigImageRect.right-tw;if(posycataRect.bottom-ScreenInfo.bigImageRect.y)posy=cataRect.bottom-ScreenInfo.bigImageRect.y-th;} var obj=document.createElement("div");obj.id="linkdivimg"+pidx;obj.style.cssText="z-index:5;display:block;position:absolute;left:"+posx+"px;top:"+posy+"px;width:"+tw+"px;height:"+th+"px;";obj.innerHTML="
"+templ_newinImglink(pidx,leftRight,tw,th,stitle)+"
\n";linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,newImg,uidx,pidx,leftRight,3,newImg.naturalWidth,newImg.naturalHeight);} newImg.src=fsrc;} LinkObj.load_linkString=function(leftRight,uidx,linkunit){var pidx=linkunit.pointer;if(document.getElementById("linkdivimg"+pidx))return;var showstr=linkunit.rule;var obj=document.createElement("div");obj.className="imgnewin_frame_p_hide";obj.innerHTML=showstr;linkoutDiv.appendChild(obj);var tw=obj.clientWidth+16;var th=obj.clientHeight+37;linkoutDiv.removeChild(obj);var rect=LinkInfo.arLinkPoly[pidx].boundRect;var posx=Math.floor(rect.x*LinkPtrObj.wRatio);if(leftRight===false)posx+=(Action.drawCondition<1)?ScreenInfo.smImageWidth:ScreenInfo.bigImageWidth;var posy=Math.floor(rect.y*LinkPtrObj.hRatio);if(Action.drawCondition<1){if(posx+tw>smRect.right)posx=smRect.right-tw;if(posy+th>smRect.bottom-smRect.y)posy=smRect.bottom-smRect.y-th;else if(posyScreenInfo.bigImageRect.right)posx=ScreenInfo.bigImageRect.right-tw;if(posycataRect.bottom-ScreenInfo.bigImageRect.y)posy=cataRect.bottom-ScreenInfo.bigImageRect.y-th;} var obj=document.createElement("div");obj.id="linkdivimg"+pidx;obj.style.cssText="z-index:6;display:block;position:absolute;left:"+posx+"px;top:"+posy+"px;width:"+tw+"px;height:"+th+"px;";obj.innerHTML="
"+templ_newinImglink(pidx,leftRight,tw,th,LinkInfo.imgLinkTitle)+"

"+showstr+"

\n";linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,undefined,uidx,pidx,leftRight,6,0,0);} LinkObj.unload_linkImage=function(pidx,leftRight){var oidx=LinkObj.has_linkPointer(pidx);if(oidx!==-1)LinkObj.outClip.splice(oidx,1);var obj=document.getElementById("linkdivimg"+pidx);obj.innerHTML="";linkoutDiv.removeChild(obj);} LinkObj.load_outDocu=function(leftRight,uidx,linkunit,shead){var pidx=linkunit.pointer;if(document.getElementById("linkdivimg"+pidx))return;var aaa=linkunit.rule.split(",");var nw=parseInt(aaa[0]);var nh=parseInt(aaa[1]);var stitle=(aaa.length>3)?aaa[3]:"";var fsrc=FileInfo.imageFilePath(aaa[2],"","*");fsrc+=aaa[2].indexOf("?")>0?"&uidx="+uidx:"?uidx="+uidx var ow=nw,oh=nh;var tw=nw+2,th=nh+20;var posx=0,posy=0;var s="";if(shead==="[odh]"){if(Action.drawCondition<1){posx=Math.floor((smRect.width-tw)/2);posy=Math.floor((smRect.height-th)/2);} else{posx=Math.floor((stageWidth-tw)/2)-EncObj.encX;posy=Math.floor((stageHeight-th)/2)-EncObj.encY;} s+="
"+templ_newinImglink(pidx,leftRight,tw,th,stitle)+"
";s+="";} else{if(stageWidth"+templ_newinImg2link(pidx,tw,th,stitle)+"";s+="";} var obj=document.createElement("div");obj.id="linkdivimg"+pidx;obj.style.cssText="z-index:1;display:block;position:absolute;left:"+posx+"px;top:"+posy+"px;width:"+tw+"px;height:"+th+"px;border:1px solid #0081fa;";obj.innerHTML=s;if(shead==="[odh]"){linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,undefined,uidx,pidx,leftRight,9,ow,oh);} else{Action.set_mainState("outdoc");newin2Div.appendChild(obj);LinkObj.add_outClip(obj,undefined,uidx,pidx,leftRight,10,ow,oh);}} LinkObj.unload_outDocu=function(pidx){Action.restoreState();var oidx=LinkObj.has_linkPointer(pidx);if(oidx!==-1)LinkObj.outClip.splice(oidx,1);var obj=document.getElementById("linkdivimg"+pidx);obj.innerHTML="";newin2Div.removeChild(obj);} LinkObj.make_iconswapShape=function(leftRight,uidx,linkunit){var swpunit,tunit,swpidx=-1;var alen=LinkObj.arLinkUnit.length;for(var i=0;i";linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,newImg,swiuidx,pidx,leftRight,4,newImg.naturalWidth,newImg.naturalHeight);} newImg.src=fsrc;} LinkObj.remove_swapImage=function(pidx,oidx,leftRight){var obj=document.getElementById("linkdiv"+pidx);obj.innerHTML="";linkoutDiv.removeChild(obj);LinkObj.outClip.splice(oidx,1);} LinkObj.make_maskImage=function(leftRight,uidx,linkunit){var swsunit=undefined;var alen=LinkObj.arLinkUnit.length;for(var i=0;i";linkoutDiv.appendChild(obj);LinkObj.add_outClip(obj,newImg,uidx,pidx,leftRight,5,newImg.naturalWidth,newImg.naturalHeight);} newImg.src=fsrc;} LinkObj.load_linkSound=function(leftRight,uidx,linkunit,basemc){if(SoundInfo.soundCtrlLoc==="linkout"){if(LinkObj.ttaPlaying===true&&LinkObj.arTTaMP3.indexOf(uidx)>=0){SoundItemObj.play_interSound(uidx);return;} LinkObj.ttaPlaying=false;LinkObj.markTTaArea=true;if(SoundItemObj){SoundItemObj.unload();SoundItemObj=undefined;} LinkObj.load_sounditem(leftRight,uidx,linkunit,undefined);} else{if(soundctrlSvg)soundctrlSvg.play_interSound(uidx);else{var urlstr=FileInfo.soundFilePath(LinkObj.arLinkUnit[uidx].rule,"","*");load_soundcontrol(uidx,leftRight,urlstr);}}} LinkObj.load_ttaSound=function(leftRight,uidx,linkunit,basemc){if(LinkObj.ttaPlaying===true)return;var ttaunit,areaunit,tunit;for(var i=0,alen=LinkObj.arLinkUnit.length;i9&&Action.togetherEnlarge==true)posx+=ScreenInfo.bigImageWidth;} var posy=Math.floor(rect.y*LinkPtrObj.hRatio);var obj=document.createElement("div");obj.id="linkdiv"+pidx;obj.className="linkdivsoundctrl";obj.style.left=posx+"px";obj.style.top=posy+"px";obj.innerHTML=templ_sounditem();linkoutDiv.appendChild(obj);LinkObj.ttaObj=obj;LinkObj.ttaLR=leftRight;LinkObj.ttaN=pidx;} LinkObj.remove_outClip=function(){LinkObj.remove_ttaClip();var nodes=linkoutDiv.childNodes;for(var i=nodes.length-1;i>=0;i--){linkoutDiv.removeChild(nodes[i]);} LinkObj.outClip.length=0;} LinkObj.remove_ttaClip=function(){if(LinkObj.ttaObj==undefined)return;linkoutDiv.removeChild(LinkObj.ttaObj);LinkObj.ttaObj=undefined;LinkObj.ttaPlaying=false;} LinkObj.has_linkPointer=function(n){if(LinkObj.outClip.length===0)return-1;for(var i=0;i=0){LinkObj.arHighlight.push(LinkObj.arPolygon[i]);SoundItemObj.playedUnitIdx.push(k);}} if(LinkObj.arHighlight.length===0)return;LinkObj.start_highlight();} LinkObj.show_markAreaPtr=function(pidx){if(pidx!=undefined)LinkObj.arHtRules.push(pidx);LinkObj.arHighlight=new Array();var k;for(var i=0;i=0){LinkObj.arHighlight.push(LinkObj.arPolygon[i]);SoundItemObj.playedUnitIdx.push(k);}} if(LinkObj.arHighlight.length===0)return;LinkObj.start_highlight();} LinkObj.start_highlight=function(){if(LinkInfo.markingKind==="S"){for(var i=0;iaw||oy<0||oy>ah||qx<0||qx>aw||qy<0||qy>ah)continue;ax=ox*ratioW;ay=(ah-oy)*ratioH;bx=qx*ratioW;by=(ah-qy)*ratioH;parentObj.appendChild(LinkObj.get_searchRect(ax,by,bx-ax,ay-by));}} LinkObj.get_searchTxt=function(s){for(var i=0;i=0)return SearchInfo.arqtxt[i];} return"";} LinkObj.get_searchTxtCase=function(s){for(var i=0;i=0)return SearchInfo.arqtxt[i];} return"";} LinkObj.remove_searchData=function(){var nodes=LinkPtrObj.leftSearch.childNodes;for(var i=nodes.length-1;i>=0;i--){LinkPtrObj.leftSearch.removeChild(nodes[i]);} if(ScreenInfo.onesmc==true)return;var nodes=LinkPtrObj.rightSearch.childNodes;for(var i=nodes.length-1;i>=0;i--){LinkPtrObj.rightSearch.removeChild(nodes[i]);}} LinkObj.refresh_searchResult=function(){LinkObj.remove_searchData();show_searchResult();} LinkObj.get_svgPoints=function(poly,posx,posy){var s=Math.floor(poly.points[0].x*LinkPtrObj.wRatio-posx)+","+Math.floor(poly.points[0].y*LinkPtrObj.hRatio-posy);for(var i=1;i3)isFax=false;continue;} else{isFax=false;continue;}} r=s.substr(pos+1).split(" ");ox=parseFloat(r[0]);oy=parseFloat(r[1]);qx=parseFloat(r[2]);qy=parseFloat(r[3]);if(ox<0||ox>aw||oy<0||oy>ah||qx<0||qx>aw||qy<0||qy>ah)continue;ax=Math.floor(ox*ratioW);ay=Math.floor((ah-oy)*ratioH);bx=Math.floor(qx*ratioW);by=Math.floor((ah-qy)*ratioH);if(SearchInfo.coordTeleLink===true){if(exchangeNum===""){exchangeNum=LinkObj.get_exchangeNum(stext);if(exchangeNum!==""){cx=ax,cy=ay;continue;}} rtxt=LinkObj.get_phoneTxt(stext);if(rtxt===""){rtxt=LinkObj.get_phone2Txt(stext);if(rtxt!==""){if(exchangeNum!==""){rtxt=exchangeNum+rtxt;ax=cx,ay=cy;} else rtxt=SearchInfo.areaCode+rtxt;}} exchangeNum="";if(rtxt!==""){var newrect=LinkObj.get_searchRect(ax,by,bx-ax,ay-by);newrect.setAttribute("class","pntrcsr");newrect.setAttribute("onclick","LinkObj.call_telephone('"+rtxt+"')");parentObj.appendChild(newrect);continue;}} if(SearchInfo.coordWebLink===true){rtxt=LinkObj.get_weblinkTxt(stext);if(rtxt==="")continue;var newrect=LinkObj.get_searchRect(ax,by,bx-ax,ay-by);newrect.setAttribute("class","pntrcsr");newrect.setAttribute("onclick","simpleLink('"+rtxt+"',3)");parentObj.appendChild(newrect);}}} LinkObj.get_phoneTxt=function(s){var stRegex1=/0(\d{1,2})[\)-](\d{3,4})-(\d{4})/;var matches=stRegex1.exec(s);if(matches)return"0"+matches[1]+matches[2]+matches[3];return"";} LinkObj.get_exchangeNum=function(s){var stRegex1=/(\d{3,4})/;if((s.length===3||s.length===4)&&stRegex1.exec(s))return s;return"";} LinkObj.get_phone2Txt=function(s){var stRegex2=/(\d{3,4})-(\d{4})/;matches=stRegex2.exec(s);if(matches)return matches[1]+matches[2];return"";} LinkObj.get_weblinkTxt=function(s){var wRegex1=/(http|https):\/\/([a-z0-9]+\.)?[a-z0-9][a-z0-9-]*\.[a-z]{2,6}(\/)?/i;var matches=wRegex1.exec(s);if(matches)return s;var wRegex2=/^(www\.)[a-z0-9][a-z0-9-]*\.[a-z]{2,6}(\/)?/i;matches=wRegex2.exec(s);if(matches)return"http://"+s;return"";} LinkObj.get_searchRect=function(ax,ay,aw,ah){var newrect=document.createElementNS("http://www.w3.org/2000/svg","rect");newrect.setAttribute("fill",SearchInfo.searchColor);newrect.setAttribute("fill-opacity",SearchInfo.searchAlpha);newrect.setAttribute("x",ax);newrect.setAttribute("y",ay);newrect.setAttribute("width",aw);newrect.setAttribute("height",ah);return newrect;} LinkObj.do_scrapeDown=function(e,bool){tempB=bool;clickX=(bool===true)?e.clientX-smRect.x:e.clientX-smRect.centerPt.x;clickY=e.clientY-smRect.y;e.preventDefault();if(bool===true&&SmcObj.leftApproved===true&&LinkPtrObj.leftImg!=undefined&&FileInfo.coordFile[LinkPtrObj.leftDir]===true){if(DataMan.arCoordData[LinkPtrObj.leftDir]==undefined)ConnectMan.load_coordData(LinkPtrObj.leftDir,"scrape");} if(bool===false&&SmcObj.rightApproved===true&&LinkPtrObj.rightImg!=undefined&&FileInfo.coordFile[LinkPtrObj.rightDir]===true){if(DataMan.arCoordData[LinkPtrObj.rightDir]==undefined)ConnectMan.load_coordData(LinkPtrObj.rightDir,"scrape");} Action.mouseDragClip=LinkObj;} LinkObj.do_mouseDrag=function(e){if(tempB===true&&DataMan.arCoordData[LinkPtrObj.leftDir]!==4)return;if(tempB===false&&DataMan.arCoordData[LinkPtrObj.rightDir]!==4)return;if(Action.mouseDragged===false){Action.mouseDragged=true;if(tempB===true){tempS=SmcObj.leftImgGrp.getAttribute("class");SmcObj.leftImgGrp.setAttribute("class","normcsr");} else{tempS=SmcObj.rightImgGrp.getAttribute("class");SmcObj.rightImgGrp.setAttribute("class","normcsr");}} if(tempB===true){befX=e.clientX-smRect.x;LinkObj.show_scrapeData(true,PageInfo.cataDir,PageInfo.currentPage,LinkPtrObj.leftSearch);} else{befX=e.clientX-smRect.centerPt.x;LinkObj.show_scrapeData(false,PageInfo.cataDir,PageInfo.currentPage+1,LinkPtrObj.rightSearch);} befY=e.clientY-smRect.y;return true;} LinkObj.show_scrapeData=function(bool,sdir,npage,parentObj){if(!SearchInfo.arSearchSize[PageInfo.cataDir][npage]||!SearchInfo.arSearchCoords[PageInfo.cataDir][npage])return;LinkObj.remove_searchData();var arPageSize=SearchInfo.arSearchSize[sdir][npage].split("x");var aw=parseFloat(arPageSize[0]);var ah=parseFloat(arPageSize[1]);var ratioW=(Action.drawCondition<1)?ScreenInfo.smImageWidth/aw:ScreenInfo.bigImageWidth/aw;var ratioH=(Action.drawCondition<1)?ScreenInfo.smImageHeight/ah:ScreenInfo.bigImageHeight/ah;var restr=SearchInfo.arSearchCoords[sdir][npage].replace(/^\s*|\s*$/g,'');var lines=restr.split("\n");LinkObj.scrapeTxt="";var bl,pos,ax,ay,bx,by,ox,oy,qx,qy,s,r;var alen=lines.length;if(SearchInfo.scrape==="rect"){for(var i=0;iaw||oy<0||oy>ah||qx<0||qx>aw||qy<0||qy>ah)continue;ax=Math.floor(ox*ratioW);ay=Math.floor((ah-qy)*ratioH);bx=Math.floor(qx*ratioW);by=Math.floor((ah-oy)*ratioH);if(clickX<=ax&&ax<=befX&&clickY<=ay&&ay<=befY){LinkObj.scrapeTxt+=" "+s.substr(0,pos);parentObj.appendChild(LinkObj.get_searchRect(ax,ay,bx-ax,by-ay));}}} else if(SearchInfo.scrape==="line"){for(var i=0;iaw||oy<0||oy>ah||qx<0||qx>aw||qy<0||qy>ah)continue;ax=Math.floor(ox*ratioW);ay=Math.floor((ah-qy)*ratioH);bx=Math.floor(qx*ratioW);by=Math.floor((ah-oy)*ratioH);bl=false;if(clickY<=ay&&by2&&EncObj.guidewidth===1)LinkObj.show_linkData2(false,LinkPtrObj.rightDir,LinkPtrObj.rightName,LinkPtrObj.rightLink);else LinkObj.show_linkData2(false,LinkPtrObj.rightDir,LinkPtrObj.rightName,LinkPtrObj.rightLink);} if(LinkInfo.markingVar!=="")LinkObj.show_markAreaRule('');if(SoundInfo.soundAppKind==="P"){if(SoundInfo.arLeftMP3.length>0){var k=SoundInfo.arLeftMP3[0];var urlstr=FileInfo.soundFilePath(LinkObj.arLinkUnit[k].rule,"","*");load_soundcontrol(k,true,urlstr);} else if(SoundInfo.arRightMP3.length>0){var k=SoundInfo.arRightMP3[0];var urlstr=FileInfo.soundFilePath(LinkObj.arLinkUnit[k].rule,"","*");load_soundcontrol(k,false,urlstr);}}} function show_searchResult(){if(SmcObj.leftApproved===true&&LinkPtrObj.leftImg!=undefined&&DataMan.arCoordData[LinkPtrObj.leftDir]==undefined){ConnectMan.load_coordData(LinkPtrObj.leftDir,"search");return;} if(SmcObj.rightApproved===true&&LinkPtrObj.rightImg!=undefined&&DataMan.arCoordData[LinkPtrObj.rightDir]==undefined){ConnectMan.load_coordData(LinkPtrObj.rightDir,"search");return;} if(LinkPtrObj.leftImg!=undefined&&DataMan.arCoordData[LinkPtrObj.leftDir]===4){if(SearchInfo.searchMark===true)LinkObj.show_searchData(true,LinkPtrObj.leftDir,LinkPtrObj.storedPage,LinkPtrObj.leftSearch);if(SearchInfo.useCoords===true)LinkObj.show_coordsData(true,LinkPtrObj.leftDir,LinkPtrObj.storedPage,LinkPtrObj.leftSearch);} if(LinkPtrObj.rightImg!=undefined&&DataMan.arCoordData[LinkPtrObj.rightDir]===4){if(SearchInfo.searchMark===true)LinkObj.show_searchData(false,LinkPtrObj.rightDir,LinkPtrObj.storedPage+1,LinkPtrObj.rightSearch);if(SearchInfo.useCoords===true)LinkObj.show_coordsData(false,LinkPtrObj.rightDir,LinkPtrObj.storedPage+1,LinkPtrObj.rightSearch);}} function show_picData(){if(SmcObj.leftApproved===true&&LinkPtrObj.leftImg!=undefined&&FileInfo.picdataFile[LinkPtrObj.leftDir]==true&&DataMan.arPicData[LinkPtrObj.leftDir]==undefined){ConnectMan.load_descriptData(LinkPtrObj.leftDir);return;} if(SmcObj.rightApproved===true&&LinkPtrObj.rightImg!=undefined&&FileInfo.picdataFile[LinkPtrObj.rightDir]==true&&DataMan.arPicData[LinkPtrObj.rightDir]==undefined){ConnectMan.load_descriptData(LinkPtrObj.rightDir);return;} var res="";if(LinkPtrObj.leftImg!=undefined&&FileInfo.picdataFile[LinkPtrObj.leftDir]==true&&DataMan.arPicData[LinkPtrObj.leftDir]==4){if(LinkInfo.arImgDescript[LinkPtrObj.leftDir][LinkPtrObj.leftName]){res+=LinkInfo.arImgDescript[LinkPtrObj.leftDir][LinkPtrObj.leftName];}} if(LinkPtrObj.rightImg!=undefined&&FileInfo.picdataFile[LinkPtrObj.rightDir]==true&&DataMan.arPicData[LinkPtrObj.rightDir]==4){if(LinkInfo.arImgDescript[LinkPtrObj.rightDir][LinkPtrObj.rightName]){res+=(res=="")?LinkInfo.arImgDescript[LinkPtrObj.rightDir][LinkPtrObj.rightName]:"
"+LinkInfo.arImgDescript[LinkPtrObj.rightDir][LinkPtrObj.rightName];}} if(res!=""){descriptDiv.style.visibility="visible";descriptDiv.innerHTML=res;} else{descriptDiv.style.visibility="hidden";descriptDiv.innerHTML="";} descriptDiv.style.left=(cataRect.centerPt.x-descriptDiv.clientWidth/2)+"px";} function load_pagesoundData(){SoundInfo.currState=0;if(SmcObj.leftApproved===true&&LinkPtrObj.leftUrl!==""){if(FileInfo.seqFile[LinkPtrObj.leftDir]==="X"){if(SoundInfo.arPageSoundFile[LinkPtrObj.leftDir][LinkPtrObj.leftName]!=undefined)SoundInfo.currState=1;} else{if(FileInfo.pagesoundFile[LinkPtrObj.leftDir]===true&&DataMan.arSoundData[LinkPtrObj.leftDir]==undefined){ConnectMan.load_soundData(LinkPtrObj.leftDir);return;} if(FileInfo.pagesoundFile[LinkPtrObj.leftDir]===true&&DataMan.arSoundData[LinkPtrObj.leftDir]===4){if(SoundInfo.arPageSoundFile[LinkPtrObj.leftDir][LinkPtrObj.leftName]!=="")SoundInfo.currState=1;}}} if(SmcObj.rightApproved===true&&LinkPtrObj.rightUrl!==""){if(FileInfo.seqFile[LinkPtrObj.rightDir]==="X"){if(SoundInfo.arPageSoundFile[LinkPtrObj.rightDir][LinkPtrObj.rightName]!==""){SoundInfo.currState=(SoundInfo.currState===1)?3:2;}} else{if(FileInfo.pagesoundFile[LinkPtrObj.rightDir]===true&&DataMan.arSoundData[LinkPtrObj.rightDir]==undefined){ConnectMan.load_soundData(LinkPtrObj.rightDir);return;} if(FileInfo.pagesoundFile[LinkPtrObj.rightDir]===true&&DataMan.arSoundData[LinkPtrObj.rightDir]===4){if(SoundInfo.arPageSoundFile[LinkPtrObj.rightDir][LinkPtrObj.rightName]!==""){SoundInfo.currState=(SoundInfo.currState==1)?3:2;}}}} if(SoundInfo.currState===1||SoundInfo.currState===3){var urlstr=FileInfo.soundFilePath(SoundInfo.get_pageSoundFile(1),"","*");load_soundcontrol(-1,true,urlstr);} else if(SoundInfo.currState===2){var urlstr=FileInfo.soundFilePath(SoundInfo.get_pageSoundFile(2),"","*");load_soundcontrol(-1,false,urlstr);}} function load_soundcontrol(uidx,leftRight,urlstr){if(urlstr!==""){LinkObj.audioPlayer.setAttribute("src",urlstr);LinkObj.audioPlayer.load();} var tw=250,th=30;var qstr="w="+tw+"&h="+th+"&idx="+uidx+"&lr="+leftRight;var s=(FileInfo.embedTag==="iframe")?"":"";soundDiv.innerHTML=s;soundDiv.style.width=tw+"px";soundDiv.style.height=th+"px";loc_soundcontrol();if(uidx===-1)soundDiv.style.visibility="visible";else{var linkunit=LinkObj.arLinkUnit[uidx];if(linkunit.option1!=="[hln]")soundDiv.style.visibility="visible";}} function loc_soundcontrol(){if(Action.drawCondition<3){if(CataInfo.incview==="m"){soundDiv.style.left=(winRect.right-soundDiv.clientWidth-5)+"px";soundDiv.style.top=(smRect.bottom+soundDiv.clientHeight>cataRect.bottom)?(smRect.bottom-5-soundDiv.clientHeight)+"px":(smRect.bottom+5)+"px";} //else{soundDiv.style.left=smRect.centerPt.x+"px";soundDiv.style.top=(smRect.bottom+5)+"px";} else{soundDiv.style.left=(smRect.right-250)+"px";soundDiv.style.top=(smRect.bottom+5)+"px";} soundDiv.style.zIndex=31;soundDiv.style.opacity=1;} else{var tw=250,th=30;soundDiv.style.left=(cataRect.right-tw-5)+"px";soundDiv.style.top=(cataRect.bottom-th-5)+"px";soundDiv.style.zIndex=45;soundDiv.style.opacity=0.7;}} function unload_soundcontrol(){soundctrlSvg.unload();soundDiv.style.visibility="hidden";soundDiv.innerHTML="";soundctrlSvg=undefined;} ImgwinObj={curobj:undefined,befX:0,befX:0,befW:0,befH:0,limitX:0,limitR:0,limitT:0,limitB:0};ImgwinObj.do_mousedownTitle=function(e,obj,n,leftRight){clickX=e.clientX;clickY=e.clientY;Action.mouseDragClip=obj;ImgwinObj.curobj=document.getElementById("linkdivimg"+n);ImgwinObj.befX=parseInt(ImgwinObj.curobj.style.left.replace("px",""));ImgwinObj.befY=parseInt(ImgwinObj.curobj.style.top.replace("px",""));ImgwinObj.befW=ImgwinObj.curobj.clientWidth;ImgwinObj.befH=ImgwinObj.curobj.clientHeight;if(Action.drawCondition<1){ImgwinObj.limitX=cataRect.x-smRect.x;ImgwinObj.limitR=cataRect.right-smRect.x;ImgwinObj.limitT=cataRect.y-smRect.y;ImgwinObj.limitB=cataRect.bottom-smRect.y;} else{ImgwinObj.limitX=cataRect.x-ScreenInfo.bigImageRect.x;ImgwinObj.limitR=cataRect.right-ScreenInfo.bigImageRect.x;ImgwinObj.limitT=cataRect.y-ScreenInfo.bigImageRect.y;ImgwinObj.limitB=cataRect.bottom-ScreenInfo.bigImageRect.y;}} ImgwinObj.do_mouseDrag=function(e){e.preventDefault();var posX=e.clientX-clickX+ImgwinObj.befX;var posY=e.clientY-clickY+ImgwinObj.befY;if(posXImgwinObj.limitR-ImgwinObj.befW)posX=ImgwinObj.limitR-ImgwinObj.befW;if(posYImgwinObj.limitB-ImgwinObj.befH)posY=ImgwinObj.limitB-ImgwinObj.befH;ImgwinObj.curobj.style.left=posX+"px";ImgwinObj.curobj.style.top=posY+"px";return true;} ImgwinObj.do_mouseUp=function(e){} ImgwinObj.do_touchEnd=function(){} function templ_newinImglink(pidx,b,w,h,s){var ws;ws="" +"" +"" +"" +"" +"" +"" +"" +"" +"" +""+s+"" +"" +"" +"" +"";return ws;} function templ_newinImg2link(pidx,w,h,s){var ws;ws="" +"" +"" +"" +""+s+"" +"" +"" +"" +"";return ws;} function init_sounditem(n){SoundItemObj={playTime:0,idx:0,sndState:'play',linkunit:undefined,timer:undefined,followPaused:false,playedUnitIdx:[]};if(LinkObj.ttaPlaying===true)SoundItemObj.idx=LinkObj.arTTaMP3[0];else SoundItemObj.idx=n;SoundItemObj.audioLoaded=function(){SoundItemObj.playTime=LinkObj.audioPlayer.duration;LinkObj.audioPlayer.removeEventListener('loadeddata',SoundItemObj.audioLoaded);} SoundItemObj.audioEnded=function(){LinkObj.audioPlayer.removeEventListener('ended',SoundItemObj.audioEnded);if(LinkObj.markTTaArea===true)LinkObj.remove_highlight();if(LinkObj.ttaPlaying===false)return;var k=LinkObj.arTTaMP3.indexOf(SoundItemObj.idx);if(k===-1){console.log("audioEnded: arTTaMP3 array index error");return;} k++;var boolStop=false;if(k>=LinkObj.arTTaMP3.length)boolStop=true;else{for(i=k;i=LinkObj.arTTaMP3.length)boolStop=true;} if(boolStop===true){SoundItemObj.idx=0;SoundItemObj.sndState="stop";return;} SoundItemObj.idx=LinkObj.arTTaMP3[k];if(LinkObj.followTTa===true)SoundItemObj.timer=window.setTimeout(SoundItemObj.audioEnded2,SoundItemObj.playTime*1000);else SoundItemObj.audioEnded2();} SoundItemObj.audioEnded2=function(){SoundItemObj.linkunit=LinkObj.arLinkUnit[SoundItemObj.idx];LinkObj.audioPlayer.setAttribute("src",FileInfo.soundFilePath(SoundItemObj.linkunit.rule,"","*"));LinkObj.audioPlayer.load();LinkObj.audioPlayer.addEventListener('loadeddata',SoundItemObj.audioLoaded);LinkObj.audioPlayer.play();LinkObj.audioPlayer.addEventListener('ended',SoundItemObj.audioEnded);if(LinkObj.markTTaArea===true)LinkObj.show_markAreaPtr(SoundItemObj.linkunit.pointer);} SoundItemObj.play_interSound=function(n){SoundItemObj.idx=n;SoundItemObj.linkunit=LinkObj.arLinkUnit[SoundItemObj.idx];LinkObj.audioPlayer.removeEventListener('ended',SoundItemObj.audioEnded);if(LinkObj.markTTaArea===true)LinkObj.remove_highlight();if(LinkObj.followTTa===true&&SoundItemObj.timer){window.clearTimeout(SoundItemObj.timer);SoundItemObj.timer=undefined;} SoundItemObj.currMode="play";LinkObj.audioPlayer.setAttribute("src",FileInfo.soundFilePath(SoundItemObj.linkunit.rule,"","*"));LinkObj.audioPlayer.load();LinkObj.audioPlayer.addEventListener('loadeddata',SoundItemObj.audioLoaded);LinkObj.audioPlayer.play();LinkObj.audioPlayer.addEventListener('ended',SoundItemObj.audioEnded);if(LinkObj.markTTaArea===true)LinkObj.show_markAreaPtr(SoundItemObj.linkunit.pointer);} SoundItemObj.playbtnClick=function(){if(SoundItemObj.sndState==="play")return;if(SoundItemObj.sndState==="pause"){if(SoundItemObj.followPaused===true)SoundItemObj.timer=window.setTimeout(SoundItemObj.audioEnded2,SoundItemObj.playTime*1000);else LinkObj.audioPlayer.play();} else if(SoundItemObj.sndState==="stop")SoundItemObj.audioEnded2();SoundItemObj.sndState="play";SoundItemObj.followPaused=false;} SoundItemObj.pausebtnClick=function(){if(SoundItemObj.sndState==="pause"||SoundItemObj.sndState==="stop")return;LinkObj.audioPlayer.pause();if(LinkObj.followTTa===true&&SoundItemObj.timer){window.clearTimeout(SoundItemObj.timer);SoundItemObj.timer=undefined;SoundItemObj.followPaused=true;} SoundItemObj.sndState="pause";} SoundItemObj.stopbtnClick=function(){SoundItemObj.unload();SoundItemObj.sndState="stop";LinkObj.remove_ttaClip();} SoundItemObj.unload=function(){if(LinkObj.markTTaArea===true)LinkObj.remove_highlight();if(LinkObj.followTTa===true&&SoundItemObj.timer){window.clearTimeout(SoundItemObj.timer);SoundItemObj.timer=undefined;} SoundItemObj.playedUnitIdx=[];LinkObj.audioPlayer.pause();LinkObj.audioPlayer.removeEventListener('ended',SoundItemObj.audioEnded);LinkObj.audioPlayer.src="";} SoundItemObj.linkunit=LinkObj.arLinkUnit[SoundItemObj.idx];LinkObj.audioPlayer.setAttribute("src",FileInfo.soundFilePath(SoundItemObj.linkunit.rule,"","*"));LinkObj.audioPlayer.load();LinkObj.audioPlayer.addEventListener('loadeddata',SoundItemObj.audioLoaded);LinkObj.audioPlayer.play();LinkObj.audioPlayer.addEventListener('ended',SoundItemObj.audioEnded);if(LinkObj.markTTaArea===true)LinkObj.show_markAreaPtr(SoundItemObj.linkunit.pointer);LinkObj.audioPlayer.volume=1;} function show_loginClip(){if(SmcObj.leftApproved===false){loginDiv=document.getElementById("loginsect");loginDiv.style.display="block";loginDiv.style.left=(cataRect.x+(ScreenInfo.smImageWidth-loginDiv.clientWidth)/2)+"px";loginDiv.style.top=(cataRect.centerPt.y-loginDiv.clientHeight/2)+"px";} else if(SmcObj.rightApproved===false){loginDiv=document.getElementById("loginsect");loginDiv.style.display="block";loginDiv.style.left=(cataRect.centerPt.x+(ScreenInfo.smImageWidth-loginDiv.clientWidth)/2)+"px";loginDiv.style.top=(cataRect.centerPt.y-loginDiv.clientHeight/2)+"px";}} function hide_loginClip(){loginDiv.style.display="none";loginDiv=undefined;} function templ_sounditem(){var ws="" +"" +"";return ws;}