/****************************************************************
 Quirksmode DHTML micro API (Version B) [modified] *************/

function getObj(name)
{
 if(document.getElementById)
 {
	 if(document.getElementById(name))
	 {
		 this.obj = document.getElementById(name);
		 this.style = document.getElementById(name).style;
	 }
 }
 else if (document.all)
 {
	 if(document.all[name])
	 {
		 this.obj = document.all[name];
		 this.style = document.all[name].style;
	 }
 }
 else if (document.layers)
 {
	 if(document.layers[name])
	 {
		 this.obj = getObjNN4(document,name);
		 this.style = this.obj;
	 }
 }
}

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

/****************************************************************
 window.onload Event Loader ************************************/
 
//function something() { some_code; }
//addDOMLoadEvent(something);
//addDOMLoadEvent(function() { some_code; });

function addDOMLoadEvent(f){if(!window.__ADLE){var n=function(){if(arguments.callee.d)return;arguments.callee.d=true;if(window.__ADLET){clearInterval(window.__ADLET);window.__ADLET=null}for(var i=0;i<window.__ADLE.length;i++){window.__ADLE[i]()}window.__ADLE=null};if(document.addEventListener)document.addEventListener("DOMContentLoaded",n,false);/*@cc_on @*//*@if (@_win32)document.write("<scr"+"ipt id=__ie_onload defer src=//0><\/scr"+"ipt>");var s=document.getElementById("__ie_onload");s.onreadystatechange=function(){if(this.readyState=="complete")n()};/*@end @*/if(/WebKit/i.test(navigator.userAgent)){window.__ADLET=setInterval(function(){if(/loaded|complete/.test(document.readyState)){n()}},10)}window.onload=n;window.__ADLE=[]}window.__ADLE.push(f)};

/****************************************************************
 Menu Functions ************************************************/
function openMenu(obj)
{
	var subMenu = new getObj(obj);
	if(subMenu.obj && subMenu.style.display!='block')
	{
		subMenu.style.display='block';
	}
};

function closeMenu(obj)
{
	var subMenu = new getObj(obj);
	if(subMenu.obj && subMenu.style.display!='none')
	{
		subMenu.style.display='none';
	}
};
/****************************************************************
 thermaer_atad Popup *******************************************/

function popUpWindow(imgsrc, wid, heig, scrollb)
{
  var pUWidth = wid;
  var pUHeight = heig;
  var pULeft = 50;
  var pUTop = 50;
	var pUScroll = 0;
	if(typeof(scrollb) != 'undefined')
	{
		if(scrollb==0) { pUScroll=0; }
		else {
			pUScroll = 1;
		}
	}
	if(screen)
	{
    if(screen.availWidth > pUWidth){ pULeft = (screen.availWidth - pUWidth) / 2; }
		if(screen.availHeight > pUHeight){ pUTop = (screen.availHeight - pUHeight) / 2; }
	}
	var pUstring = "toolbar=0, scrollbars=" + pUScroll + ", location=0, statusbar=0, menubar=0, resizable=1, left=" + pULeft + ", top=" + pUTop + ", width=" + pUWidth + ", height=" + pUHeight;
	pUWindow = window.open (imgsrc,"pU", pUstring);
	pUWindow.focus();
};

/****************************************************************
 mediaInspector ************************************************/
function mediaInspector()
{
  var mediaInspector = document.getElementById('mediaInspector');
  if (mediaInspector.currentStyle) {
    var zIndex = mediaInspector.currentStyle['zIndex'];
  } else if (window.getComputedStyle) {
    var zIndex = window.getComputedStyle(mediaInspector, '').getPropertyValue("z-index");
  }
  switch (parseInt(zIndex)) {
    case 1:
      // @media aural code
	  	return 'aural';
      break;
    case 2:
      // @media braille code
	  	return 'braille';
      break; 
    case 3:
      // @media embossed code
			return 'embossed';
      break;
    case 4:
      // @media handheld code
	  	return 'handheld';
      break;
    case 5:
      // @media print code
	  	return 'print';
      break;
    case 6:
      // @media projection code
	  	return 'projection';
      break;
    case 7:
      // @media screen code
	  	return 'screen';
      break;
    case 8:
      // @media tty code
	  	return 'tty';
      break;
    case 9:
      // @media tv code
	  	return 'tv';
      break;
  }
};

