﻿// JavaScript Document 
//<!--
/**** code generated by Dreamweaver ****/
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function openWindow(url, target)
{
		window.open(url, target);
}
function openWindowExact (url, width, height) {
	newWindow =window.open(url, "_blank","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars, resizable=no, width=" + width + ",height=" + height);
	newWindow.window.moveTo (0,0);
}
function openWindowExact2 (url, width, height) {
	newWindow = window.open(url, "_blank","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, width=" + width + ",height=" + height);
	newWindow.window.moveTo (0,0);
}


function openWindow (url) {
	newWindow =window.open(url, "_blank","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, width=600,height=500");
	newWindow.window.moveTo (0,0);
}
function openWindow2(url) 
{
	newWindow =window.open(url, "_blank","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, width=600,height=500");
	newWindow.window.moveTo (0,0);
}
function openWindow3(url) 
{
	newWindow = window.open(url, "_blank","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=no, width=800,height=600");
	
	newWindow.window.moveTo (0,0);
}
function openMarquee (url) {
	window.open(url, "_blank","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=no, resizable=no, width=500,height=165");
}
/*
function counter() {
		getObject("counter").innerHTML = '<img style="width:0px; height:0px; visible:hidden;"  src="http://fastcounter.bcentral.com/fastcounter?3305666+6611339" />'
}

function counter2() {
		getObject("counter").innerHTML = '<img style="width:0px; height:0px; visible:hidden;"  src="http://fastcounter.bcentral.com/fastcounter?3305666+6611339" /><img style="width:0px; height:0px; visible:hidden;"  src="http://fastcounter.bcentral.com/fastcounter?3305666+6611337" />'
}
*/
	
function playMovie (url, title) {			
		newWindow=window.open('','_blank','width=400,height=345, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no');
		text = "";
		text +='<html><head><title>';
		text += title;
		text += '</title></head><body style="margin:0px 0px 0px 0px;">';
		text += '<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" width="400" height="345" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" id="WinMediPlay" type="application/x-oleobject"><param name="src" value="';
		text += url;
		text += '" /><param name="autoStart" value="true" /><param name="showControls" value="true" /> <param name="ShowStatusBar" value="true"> <embed type="video/x-ms-asf-plugin" pluginspace="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="';
		text += url;
		text += '" name="mediaplayer" showcontrols=2 showdisplay=0 showstatusbar=0 autostart=1  width="400" HEIGHT="345"></embed>           </object> ';
		text += '</body></html>';
		
		var tmp = newWindow.document;		
		
		tmp.write(text);
		tmp.close();		
		
	}
		
function getObject(id) 
{
	if (document.getElementById)
		return document.getElementById(id);
	else if (document.all)
		return document.all[id];
	else if (document.layers)
		return document.layers[id];
	else
		return "";
}

function getStyle(obj) {
	if (obj.style) 
		return obj.style;
	else if (obj.css) 
		return obj.css;
	else
		return "";
}

function findPosX(o)
{
	var obj = o;
	 var curleft = 0;
	 if (document.getElementById || document.all)
	 {
	  while (obj.offsetParent)
	  {
	   curleft += obj.offsetLeft
	   obj = obj.offsetParent;
	  }
	 }
	 else if (document.layers)
	  curleft += obj.x;
	 return curleft;
}

function findPosY(o)
{
	var obj = o;
	 var curtop = 0;
	 if (document.getElementById || document.all)
	 {
	  while (obj.offsetParent)
	  {
	   curtop += obj.offsetTop
	   obj = obj.offsetParent;	   
	  }
	 }
	 else if (document.layers)
	  curtop += obj.y;
	 return curtop;
}

function getWidth(obj) {
	if (document.layers) { //NS
		return  obj.document.width;						
	} else {
		return obj.offsetWidth;					
	}
}
function getHeight(obj) {
	if (document.layers) { //NS
		return  obj.document.height;						
	} else {
		return obj.offsetHeight;					
	}
}
var rootPath;
// hardcode setting, photos path
var photoPath = "http://203.198.161.217/~photo/photos/";

function init() {	
	photoPath = "http://203.198.161.217/~photo/photos/";	
	//initMenu('mainHeader', 'http://www.dcfwmsam.edu.hk/test/');
	//initMenu('mainHeader', rootPath);
	writeHeader();
	writeFooter();
}
function init2() {	
	photoPath = "http://203.198.161.217/~photo/photos/";	
	//initMenu('mainHeader', 'http://www.dcfwmsam.edu.hk/test/');
	//initMenu('mainHeader', rootPath);
	writeFooter();
}
function writeHeader () {
	//write menu
	header_text = '<embed src="http://www.dcfwmsam.edu.hk/menu2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="970" height="97"></embed>';
	getObject("mainHeader").innerHTML = header_text;
}
function writeFooter () {	
	//write counter
	footer_text = '';
	footer_text += "<hr>[<a href='http://www.dcfwmsam.edu.hk/default.asp' >主頁</a>]|[<a href='http://www.dcfwmsam.edu.hk/sitemap.asp' >網頁指南</a>|[<a href='http://www.dcfwmsam.edu.hk/statistic.asp' >瀏覽統計</a>]<br> 胡素貞博士紀念學校上午校&copy;2003-2008, 不得轉載";
	footer_text += '<div style="position:absolute;bottom:0px;visibility:hidden; width:0px; height:0px;font-size:1px;"><a href="http://freelogs.com/stats/d/dcfwmsamcounter1/" target="_top"><img border="0" alt="Free Web Counter" src="http://xyz.freelogs.com/counter/index.php?u=dcfwmsamcounter1&s=blkrefl" ALIGN="middle" HSPACE="4" VSPACE="2"></a><script src=http://xyz.freelogs.com/counter/script.php?u=dcfwmsamcounter1></script><br><a style="font-size:12" href="http://www.freelogs.com/create.php" target="_top"><font style="font-size:12" color="#666666">Free Hit Counter</font></a><a href="http://freelogs.com/stats/d/dcfwmsamcounter2/" target="_top"><img border="0" alt="Free Web Counter" src="http://xyz.freelogs.com/counter/index.php?u=dcfwmsamcounter2&s=marble" ALIGN="middle" HSPACE="4" VSPACE="2"></a><script src=http://xyz.freelogs.com/counter/script.php?u=dcfwmsamcounter2></script><br><a style="font-size:12" href="http://www.freelogs.com/create.php" target="_top"><font style="font-size:12" color="#666666">Free Hit Counter</font></a></div>';
	getObject("mainFooter").innerHTML = footer_text;
	document.body.style.backgroundImage = "url(" + rootPath + "images/bg.jpg" +")";
	
}
function popup_init () {
	//write counter
	footer_text = '';
	footer_text += "<p>胡素貞博士紀念學校上午校&copy;2003-2008, 不得轉載</p>";
	footer_text += '<div style="position:absolute;bottom:0px;visibility:hidden; width:0px; height:0px;font-size:1px;"><a href="http://freelogs.com/stats/d/dcfwmsamcounter2/" target="_top"><img border="0" alt="Free Web Counter" src="http://xyz.freelogs.com/counter/index.php?u=dcfwmsamcounter2&s=marble" ALIGN="middle" HSPACE="4" VSPACE="2"></a><script src=http://xyz.freelogs.com/counter/script.php?u=dcfwmsamcounter2></script><br><a style="font-size:12" href="http://www.freelogs.com/create.php" target="_top"><font style="font-size:12" color="#666666">Free Hit Counter</font></a></div>';
	getObject("popupFooter").innerHTML = footer_text;
	
}

function preloadFunctionMenu (){
	MM_preloadImages('../../../images/functions/buttons/info_btn_f2.jpg','../../../images/functions/buttons/info_btn_f3.jpg','../../../images/functions/buttons/prize_btn_f2.jpg','../../../images/functions/buttons/prize_btn_f3.jpg','../../../images/functions/buttons/photo_btn_f2.jpg','../../../images/functions/buttons/photo_btn_f3.jpg','../../../images/functions/buttons/video_btn_f2.jpg','../../../images/functions/buttons/video_btn_f3.jpg','../../../images/functions/buttons/schedule_btn_f2.jpg', '../../../images/functions/buttons/schedule_btn_f3.jpg', '../../../images/functions/buttons/procedure_btn_f2.jpg', '../../../images/functions/buttons/procedure_btn_f3.jpg');
}
function preloadPhotoAlbumMenu () {
	MM_preloadImages('../../../images/functions/album_buttons/album1_f2.jpg','../../../images/functions/album_buttons/album1_f3.jpg','../../../images/functions/album_buttons/album2_f2.jpg','../../../images/functions/album_buttons/album2_f3.jpg','../../../images/functions/album_buttons/album3_f2.jpg','../../../images/functions/album_buttons/album3_f3.jpg','../../../images/functions/album_buttons/album4_f2.jpg','../../../images/functions/album_buttons/album4_f3.jpg','../../../images/functions/album_buttons/album5_f2.jpg','../../../images/functions/album_buttons/album5_f3.jpg','../../../images/functions/album_buttons/album6_f2.jpg','../../../images/functions/album_buttons/album6_f3.jpg','../../../images/functions/album_buttons/album7_f2.jpg','../../../images/functions/album_buttons/album7_f3.jpg','../../../images/functions/album_buttons/album8_f2.jpg','../../../images/functions/album_buttons/album8_f3.jpg','../../../images/functions/album_buttons/album9_f2.jpg','../../../images/functions/album_buttons/album9_f3.jpg');
}

//-->