function findObj(theObj, theDoc) { var p, i, foundObj; if(!theDoc) theDoc = document; if( (p = theObj.indexOf("?")) > 0 && parent.frames.length) { theDoc = parent.frames[theObj.substring(p+1)].document; theObj = theObj.substring(0,p); } if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj]; for (i=0; !foundObj && i < theDoc.forms.length; i++) foundObj = theDoc.forms[i][theObj]; for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) foundObj = findObj(theObj,theDoc.layers[i].document); if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj); return foundObj; } function showHideLayers() { var i, visStr, obj, args = showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) { if ((obj = findObj(args[i])) != null) { visStr = args[i+2]; if (obj.style) { obj = obj.style; if(visStr == 'show') visStr = 'visible'; else if(visStr == 'hide') visStr = 'hidden'; } obj.visibility = visStr; } } } function moveLayerToMouseLoc(theLayer, offsetH, offsetV) { var obj; if ((findObj(theLayer))!=null) { if (document.all)//IE { document.getElementById(theLayer).style.pixelLeft = Math.max(0,mLoc.x +offsetH); document.getElementById(theLayer).style.pixelTop = Math.max(0,mLoc.y +offsetV); } else { document.getElementById(theLayer).style.left =Math.max(0,mLoc.x +offsetH); document.getElementById(theLayer).style.top =Math.max(0,mLoc.y +offsetV); } showHideLayers(theLayer,'','show'); } } function Point(x,y) { this.x = x; this.y = y; } mLoc = new Point(-500,-500); function mouseCoords(evt){ if(evt.pageX || evt.pageY){ mLoc.x = evt.pageX; mLoc.y = evt.pageY; } else{ mLoc.x = evt.clientX + document.body.scrollLeft - document.body.clientLeft; mLoc.y = evt.clientY + document.body.scrollTop - document.body.clientTop; }; } //HMPlayer: status of hmplayer function HMPlayerStatus(filename,filetype,playerpath,player,divname,divstatus,offsetX,offsetY) { this.filename=filename; this.filetype=filetype; this.playerpath=playerpath; this.player=player; this.divname=divname; this.divstatus=divstatus; this.offsetX=offsetX; this.offsetY=offsetY; } //HMPlayer:create hongen media player layer and flash object. function HMCreatLayer(theLayer,thePlayer) { if ((findObj(theLayer))==null) { document.write(""); } } function HMGetUrlPath() { return (location.pathname.substring(0,location.pathname.lastIndexOf('/')+1)); } function getFlashMovieObject(movieName) { if (window.document[movieName]) { return window.document[movieName]; } if (navigator.appName.indexOf("Microsoft Internet")==-1) { if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; } else { return document.getElementById(movieName); } } function HMPlayGO(event,filename,filetype) { evt = event || window.event; mouseCoords(evt); if(filename==gHMPlayer.filename && filetype==gHMPlayer.filetype) { if( gHMPlayer.divstatus == "show" ) { showHideLayers(gHMPlayer.divname,'','hide'); gHMPlayer.divstatus = "hide"; } else { showHideLayers(gHMPlayer.divname,'','show'); gHMPlayer.divstatus = "show"; } } else { gHMPlayer.filename = filename; gHMPlayer.divstatus = "show"; objSwf = getFlashMovieObject(gHMPlayer.player); objSwf.TGotoLabel("/","idle"); objDiv = findObj(gHMPlayer.divname); if( filetype != gHMPlayer.filetype ) { gHMPlayer.filetype = filetype; var w,h; switch(filetype) { case "mp3": w = 114; h=24; gHMPlayer.offsetX=-12; gHMPlayer.offsetY=180; //objDiv.style.borderWidth='0px'; break; case "swf": w = 200; h=150; gHMPlayer.offsetX=0; gHMPlayer.offsetY=-175; objDiv.style.borderStyle='ridge'; objDiv.style.backgroundColor = 'white'; objDiv.style.padding = '1px'; objDiv.style.borderWidth='2px'; break; case "flv": var s=location.href; if( s.indexOf("french")!=-1) { w = 200; h=150; gHMPlayer.offsetX=10; gHMPlayer.offsetY=-175; } else { w = 240; h=196; gHMPlayer.offsetX=10; gHMPlayer.offsetY=-220; } objDiv.style.borderStyle='ridge'; objDiv.style.backgroundColor = 'white'; objDiv.style.padding = '1px'; objDiv.style.borderWidth='2px'; break; } objSwf.width=w; objSwf.height=h; } objSwf.SetVariable("style",gHMPlayer.filetype); objSwf.SetVariable("skinName", gHMPlayer.playerpath + "flvskin"); //objSwf.SetVariable("streamName",HMGetUrlPath() + gHMPlayer.filename+"."+filetype); objSwf.SetVariable("streamName",filename+"."+filetype); objSwf.SetVariable("pName", gHMPlayer.playerpath + gHMPlayer.filetype + "player.swf"); objSwf.TGotoLabel("/",gHMPlayer.filetype); moveLayerToMouseLoc(gHMPlayer.divname,gHMPlayer.offsetX,gHMPlayer.offsetY); showHideLayers(gHMPlayer.divname,'','show'); } return false; } gHMPlayer=new HMPlayerStatus("0","0","../../player/","HMPlayer","HMDiv","hide",0,0); HMCreatLayer(gHMPlayer.divname,gHMPlayer.player); //***************************************************************