function iFrameHeight(id)
{
	if(document.getElementById && !(document.all)) {
		h = document.getElementById(id).contentDocument.body.scrollHeight;
		document.getElementById(id).style.height = h;
	}else if(document.all) {
		h = document.frames(id).document.body.scrollHeight;
		document.all[id].style.height = h;
	}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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 MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*****************************************
* Dissolving Image Rollover- By Roy Whittle (http://www.javascript-fx.com/)
* Featured on/available at http://www.dynamicdrive.com/
* This notice must stay intact for use
*****************************************/

//Generate transition CSS (transition=0 to 23)
document.write('<STYLE TYPE="text/css">.imgTrans{ filter:revealTrans(duration=0.4,transition=12) }</STYLE>');

//Uncomment the next line for fading rollovers instead of dissolving:
//document.write('<STYLE TYPE="text/css">.imgTrans{ filter:blendTrans(duration=0.4) }</STYLE>');

var onImages=new Array();
function Rollover(imgName, imgSrc)
{
	onImages[imgName] = new Image();
	onImages[imgName].src = imgSrc;
}

function turnOn(imgName){ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].apply();
	document.images[imgName].offSrc = document.images[imgName].src;
	document.images[imgName].src    = onImages[imgName].src;
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].play();
}

function turnOff(imgName){ 
	if(document.images[imgName].filters != null)
		document.images[imgName].filters[0].stop();
	document.images[imgName].src = document.images[imgName].offSrc;
}

//Specify name of participating images, plus paths to their onMouseover replacements:
Rollover("aboutus", "images/buttons/aboutus_on.gif");
Rollover("latestnews", "images/buttons/latestnews_on.gif");
Rollover("projects", "images/buttons/projects_on.gif");
Rollover("contactus", "images/buttons/contactus_on.gif");


//Pixelating Image slideshow
//Copyright Dynamic Drive 2001
//Visit http://www.dynamicdrive.com for this script

//specify interval between slide (in mili seconds)
var slidespeed=6000
//specify images
var slideimages=new Array(7)
slideimages[0]="images/Cyberport-c3-c4-Skylight_A.jpg"
slideimages[1]="images/Cyberport-c2-Cinema_Wall_View_A.jpg"
slideimages[2]="images/Cyberport-c2-Spire_Tower_A.jpg"
slideimages[3]="images/about-us-00A.jpg"
slideimages[4]="images/about-us-01A.jpg"
slideimages[5]="images/cyberport_c2c.jpg"
slideimages[6]=""
//specify corresponding links
var slidelinks=new Array("http://www.midiltd.com.hk","http://www.midiltd.com.hk")

//Albums Random
var tips = new Array(19)
tips[0] = "<img src=images/random/cyber_c1.jpg>"
tips[1] = "<img src=images/random/cyber_c2.jpg>"
tips[2] = "<img src=images/random/skyline_tower.jpg>"
tips[3] = "<img src=images/random/airport.jpg>"
tips[4] = "<img src=images/random/tvb_city.jpg>"
tips[5] = "<img src=images/random/tseung_kwan_ocean_shores.jpg>"
tips[6] = "<img src=images/random/tuen_mun_town_plaza.jpg>"
tips[7] = "<img src=images/random/kcrc_west_rail.jpg>"
tips[8] = "<img src=images/random/csw_government_office_building.jpg>"
tips[9] = "<img src=images/random/J387.jpg>"
tips[10] = "<img src=images/random/J389.jpg>"
tips[11] = "<img src=images/random/J414.jpg>"
tips[12] = "<img src=images/random/J423.jpg>"
tips[13] = "<img src=images/random/J430.jpg>"
tips[14] = "<img src=images/random/J432.jpg>"
tips[15] = "<img src=images/random/J433.jpg>"
tips[16] = "<img src=images/random/J459.jpg>"
tips[17] = "<img src=images/random/J602.jpg>"
tips[18] = "<img src=images/random/J603.jpg>"
tips[19] = "<img src=images/random/J731.jpg>"


var imageholder=new Array()
var ie55=window.createPopup
for (i=0;i<slideimages.length;i++){
	if(!loopstart){
		imageholder[i]=new Image()
		imageholder[i].src=slideimages[i]
		if(i == slideimages.length-2){
			var loopstart = true
		}
	}
}

function gotoshow(){
	window.location=slidelinks[whichlink]
}