﻿

// When the page loads:
window.onload=function(){

  if (document.getElementsByTagName) {
    // Get all the tags of type object in the page.
      var objs = document.getElementsByTagName("object");
      for (i=0; i<objs.length; i++) {
        // Get the HTML content of each object tag
        // and replace it with itself.
        objs[i].outerHTML = objs[i].outerHTML;
      }
   }
}
function loadFlash(){
  if (document.getElementsByTagName) {
    // Get all the tags of type object in the page.
      var objs = document.getElementsByTagName("object");
      for (i=0; i<objs.length; i++) {
        // Get the HTML content of each object tag
        // and replace it with itself.
        objs[i].outerHTML = objs[i].outerHTML;
      }
   }
}
function openNewWindow(file )
{

window.open('pdf/products/'+file,'','height=550,width=650,status=yes,resizable,menubar=no,location=no');

}
function openProductWindow(cat, id )
{

window.open('productdetails.aspx?cat='+cat+'&id='+id,'','height=680,width=670,status=no,resizable=no, menubar=no,location=no');

}
function openToolsWindow(page )
{

window.open(page,'','height=540,width=570,status=no,resizable=no, menubar=no,location=no');

}
function openEngineerList(file)
{
window.open(file,'','height=650,width=700,status=yes,resizable,menubar=no,location=no');

}
function openProductNewWindow(type, file)
{
if (type=="products")
{
window.open(file,'','height=650,width=650,status=yes,resizable, menubar=no,location=no');
}
else
{
  
  window.open(file,'');
}

}

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];}
}
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_preloadImages() { //v3.0

//alert("preloading arguments ="+MM_preloadImages.arguments.length);
if (document.images) {
        var imgFiles = MM_preloadImages.arguments;
        if (document.preloadArray == null) {
            document.preloadArray = new Array();
        }
        var i = document.preloadArray.length;
  
        with (document) {
            for (var j = 0; j < imgFiles.length; j++) {
           /// alert("img "+ imgFiles[j]);
                if (imgFiles[j].charAt(0) != "#") {
                    document.preloadArray[i] = new Image();
                    document.preloadArray[i++].src = imgFiles[j];
                }
            }
        }
    }
}
/* Show  or hide a message on the status bar */
function showStatus(msg)
{
    window.status = msg;
    return true;
}
function hideStatus()
{
    window.status = '';
    return true;
}


function bgMOver(id) {

id.bgColor="#A4BCD5";
return true;
}
function bgMOut(id) {

id.bgColor="#f8f8f8";
return true;
}



function detectFlash(){

var flashinstalled = 0;
var flashversion = 0;
MSDetect = false;

//Detect IE5.5+


if (navigator.appVersion.indexOf("MSIE")!=-1)
{

if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		flashinstalled = 2;
		if (x.description)
		{
			y = x.description;
			flashversion = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		flashinstalled = 1;
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		flashinstalled = 2;
		flashversion = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;
	else
		flashinstalled = 1;
}
else
	MSDetect = true;

}
else
{
  MSDetect = true;
  }
return MSDetect;

}

function disableStatus()
 {
 
window.status.enabled= false;
 }