﻿browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) ||
((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))) version = "n3";
else version = "n2";

image1On = new Image();
image1On.src = "images/img_btncompany1.jpg";
image2On = new Image();
image2On.src = "images/img_btnfacilities1.jpg";
image3On = new Image();
image3On.src = "images/img_btnproducts1.jpg";
image4On = new Image();
image4On.src = "images/img_btnquality1.jpg";
image5On = new Image();
image5On.src = "images/img_btncontact1.jpg";
image6On = new Image();
image6On.src = "images/img_btnhome1.jpg";

image1 = new Image();
image1.src = "images/img_btncompany.gif";
image2 = new Image();
image2.src = "images/img_btnfacilities.gif"; 
image3 = new Image();
image3.src = "images/img_btnproducts.gif";
image4 = new Image();
image4.src = "images/img_btnquality.gif";  
image5 = new Image();
image5.src = "images/img_btncontact.gif";  
image6 = new Image();
image6.src = "images/img_btnhome.gif";  


function turnOn(imgName) {
if (version == "n3") { imgOn = eval(imgName + "On.src");
document.images[imgName].src = imgOn; }}
function turnOff(imgName) {
if (version == "n3") { imgOff = eval(imgName + ".src");
document.images[imgName].src = imgOff; }}


 function showMenu()
 { var lang_ver = unescape(params["ver"]);
   var img1a = "images/img_btncompany.gif";
   var img1b = "images/img_btncompany1.gif";

   document.write('<table width=170 >');
   document.write('<tr><td height="20px" bgcolor="#850707"></td></tr>');

   if (lang_ver == "jp")
   { document.write('<tr><td align=center><a href="index.html?ver=jp" onMouseOut="turnOff(\'image6\');return true;" onMouseOver="turnOn(\'image6\');return true;" ><img id="image6" src="images/img_btnhome.gif" border=0 alt="Home" /></a></td></tr>');
     document.write('<tr><td align=center><a href="company.html?ver=jp" onMouseOut="turnOff(\'image1\');return true;" onMouseOver="turnOn(\'image1\');return true;" ><img id="image1" src="images/img_btncompany.gif" border=0 alt="Company" /></a></td></tr>');     
     document.write('<tr><td align=center><a href="facility.html?ver=jp" onMouseOut="turnOff(\'image2\');return true;" onMouseOver="turnOn(\'image2\');return true;" ><img id="image2" src="images/img_btnfacilities.gif" border=0 alt="Facilities" /></a></td></tr>');
     document.write('<tr><td align=center><a href="product.html?ver=jp" onMouseOut="turnOff(\'image3\');return true;" onMouseOver="turnOn(\'image3\');return true;" ><img id="image3" src="images/img_btnproducts.gif" border=0 alt="Products" /></a></td></tr>');
     document.write('<tr><td align=center><a href="quality.html?ver=jp" onMouseOut="turnOff(\'image4\');return true;" onMouseOver="turnOn(\'image4\');return true;" ><img id="image4" src="images/img_btnquality.gif" border=0 alt="Quality" /></a></td></tr>');
     document.write('<tr><td align=center><a href="contact.html?ver=jp" onMouseOut="turnOff(\'image5\');return true;" onMouseOver="turnOn(\'image5\');return true;" ><img id="image5" src="images/img_btncontact.gif" border=0 alt="Contact" /></a></td></tr>');
   }
   else
   { document.write('<tr><td align=center><a href="index.html?ver=en" onMouseOut="turnOff(\'image6\');return true;" onMouseOver="turnOn(\'image6\');return true;" ><img id="image6" src="images/img_btnhome.gif" border=0 alt="Home" /></a></td></tr>');
     document.write('<tr><td align=center><a href="company.html?ver=en" onMouseOut="turnOff(\'image1\');return true;" onMouseOver="turnOn(\'image1\');return true;" ><img id="image1" src="images/img_btncompany.gif" border=0 alt="Company" /></a></td></tr>');
     document.write('<tr><td align=center><a href="facility.html?ver=en" onMouseOut="turnOff(\'image2\');return true;" onMouseOver="turnOn(\'image2\');return true;" ><img id="image2" src="images/img_btnfacilities.gif" border=0 alt="Facilities" /></a></td></tr>');
     document.write('<tr><td align=center><a href="product.html?ver=en" onMouseOut="turnOff(\'image3\');return true;" onMouseOver="turnOn(\'image3\');return true;" ><img id="image3" src="images/img_btnproducts.gif" border=0 alt="Products" /></a></td></tr>');
     document.write('<tr><td align=center><a href="quality.html?ver=en" onMouseOut="turnOff(\'image4\');return true;" onMouseOver="turnOn(\'image4\');return true;" ><img id="image4" src="images/img_btnquality.gif" border=0 alt="Quality" /></a></td></tr>');
     document.write('<tr><td align=center><a href="contact.html?ver=en" onMouseOut="turnOff(\'image5\');return true;" onMouseOver="turnOn(\'image5\');return true;" ><img id="image5" src="images/img_btncontact.gif" border=0 alt="Contact" /></a></td></tr>');
   }
   document.write('</table>');
 } 


 function showFooter()
 { document.write('<span class="footnote">Copyright Zamria Sdn. Bhd. 2007<br>All rights reserved.</span>');
 }

 function showTopBanner()
 {
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="800" height="80" id="topbanner" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain" />');
	document.write('<param name="movie" value="images/topbanner.swf" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="bgcolor" value="#000000" />');
	document.write('<embed src="images/topbanner.swf" quality="high" wmode="transparent" bgcolor="#000000" width="800" height="80" name="topbanner" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
 }


 function getParams() {
 var idx = document.URL.indexOf('?');
 var params = new Array();
 if (idx != -1) {
  var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
  for (var i=0; i<pairs.length; i++) {
   nameVal = pairs[i].split('=');
   params[nameVal[0]] = nameVal[1];
   }
  }
 return params;
 }
 params = getParams();

//--------------------------------------------------------------------------------------
// Preload and play audio files with event handler (MouseOver sound)
// designed by JavaScript Archive, (c)1999
// Get more free javascripts at http://jsarchive.8m.com

var aySound = new Array();
// Below: source for sound files to be preloaded
aySound[0] = "laser.wav";

// DO NOT edit below this line
document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//-->


//---------------------- Gallery script.---------------------------
// With image cross fade effect for those browsers that support it.
// Script copyright (C) 2004 www.cryer.co.uk.
// Script is free to use provided this copyright header is included.

function LoadGallery(pictureName,imageFile,titleCaption,captionText)
{
  if (document.all)
  {
    document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
    document.getElementById(pictureName).filters.blendTrans.Apply();
  }
  document.getElementById(pictureName).src = "images/" + imageFile;
  if (document.all)
  {
    document.getElementById(pictureName).filters.blendTrans.Play();
  }
  document.getElementById(titleCaption).innerHTML=captionText;
}

function LoadPicture(imgfile,ecap,jcap)
{ var lang_ver = unescape(params["ver"]);
  if (lang_ver == 'jp')
  {  LoadGallery('ProductGallery', imgfile, 'ProductGalleryCaption', '<li>' + jcap + '</li>'); 
  }
  else
  {  LoadGallery('ProductGallery', imgfile, 'ProductGalleryCaption', '<li>' + ecap + '</li>'); 
  }
}
