function WindowOnload(oNewOnloadFunction) {
    var oPreviousOnloadFunction = window.onload;
    window.onload = function() {
        if (oPreviousOnloadFunction) { oPreviousOnloadFunction(); }
        oNewOnloadFunction();
    }
}

function getObj(name) {
	if (document.getElementById) { // W3C DOM code
    	this.obj = document.getElementById(name);
    	this.style = document.getElementById(name).style;
	alert('1');
	}
	else if (document.all) { // Microsoft DOM code
	    this.obj = document.all[name];
	    this.style = document.all[name].style;
	alert('2');
	}
	else if (document.layers) { // Netscape DOM code
	alert('3');
	    this.obj = document.layers[name];
	    this.style = this.obj;
	}
}


function toHide(objid) {
	x = document.getElementById(objid);
	setTimeout("x.style.visibility = 'hidden'", 100);
}

function togglevis(x)
{
  x.style.visibility = (x.style.visibility=='visible') ? 'hidden' : 'visible';
}
function togglehfdm(x)
{
  x.className = (x.className=='treeshow') ? 'treehide' : 'treeshow';
}
function toggleimg(x)
{
  x.className = (x.className=='imgshow') ? 'imghide' : 'imgshow';
}



function submitf1()
{
  document.form1.submit();
}
function submitf2()
{
  document.form2.submit();
}

function submitform1()
{
  document.form1.submit();
  document.getElementById('uploadlayer').style.visibility = 'visible';
}
function submitform2()
{
  document.form2.submit();
  document.getElementById('uploadlayer').style.visibility = 'visible';
}
   
function submitform3()
{
  document.form1.submit();
}

function submitform4()
{
  document.form2.submit();
}
 
function checkedAll(x,y,z) {  
	var inpobj = document.getElementsByTagName('input');
	inpimg = document.getElementById(z); 
	impsplit = z.split("_"); 
	imgname = impsplit[0];
	imgpath1 = y+imgname+'set.gif';
	imgpath2 = y+imgname+'.gif';
	if (inpimg.src == imgpath2) { checked = true; inpimg.src = imgpath1; } else { checked = false; inpimg.src = imgpath2; }
	for (var i = 0; i < inpobj.length; i++) { 
		if (inpobj[i].style.fontSize == x) { inpobj[i].checked = checked; }
	//	alert(inpobj[i].style.fontSize);
	}
	
}

function checkedReset(xx,yy,zz) {   
	if (checked == true) { checked = false; }
	var inpobjx = document.getElementsByTagName('input');
	var inpimgx = document.getElementById(zz); 
	var impsplitx = zz.split("_"); 
	var imgnamex = impsplitx[0];	
	inpimgx.src = yy+imgnamex+'.gif'; 
	for (var j = 0; j < inpobjx.length; j++) { 
		if (inpobjx[j].className == xx) { inpobjx[j].checked = false; }
	}
}

function ImgReset(yyy,zzz) {   
	var inpimgi = document.getElementById(zzz); 
	var impspliti = zzz.split("_"); 
	var imgnamei = impspliti[0];	
	inpimgi.src = yyy+imgnamei+'.gif'; 
}


function collapsed(x,y,z)
{ 
	x.className = (x.className=='divvoorwc') ? 'divvoorwh' : 'divvoorwc';
	imgkid = 'imgk'+y;
	imgk = document.getElementById(imgkid);
	imgksrc = imgk.src;
	if (imgk.src != z+'blank2.gif') { imgk.src = (imgk.src==z+'vink.gif') ? z+'blank.gif' : z+'vink.gif'; }
}

function collapsek(x,y,z,i)
{ 
	x.className = (x.className=='divvoorwc') ? 'divvoorwh' : 'divvoorwc';
	imgkid = 'imgk'+y;
	imgk = document.getElementById(imgkid);
	imgksrc = imgk.src;
	imgk.src = (imgk.src==z+i+'.gif') ? z+'blank.gif' : z+i+'.gif';
}


// found at http://browsershots.org/
function setZoom(img, dir, width, height, margin, zIndex, delay) {
  setTimeout(function() {
    //if (img.dir==dir) {
      img.style.width=width;
      img.style.height=height;
      img.style.margin=margin;
      img.style.zIndex=zIndex;
      img.parentNode.parentNode.style.zIndex=zIndex;
//    }
  }, delay);
}
function larger(img, width, height) {
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  for (i=now+1; i<=10; i++) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    hw=(width/2)+30; 
    hh =(height/2)+30;
    m=(-hh*i/10)+'px 0 0 '+(-hw*i/10)+'px';
    setZoom(img, 'rtl', w, h, m, i, 20*(i-now));
  }
}
function smaller(img, width, height) {
  img.dir='ltr';
  now=parseInt(img.style.zIndex);
  for (i=now-1; i>=0; i--) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'ltr', w, h, m, i, 20*(now-i));
  }
}


function EvalSound(soundobj) {
	var thissound = document[soundobj];
	thissound.Play();
}
function setEmbed(ID, Src) {
    var element = document.getElementById(ID);
    element.innerHTML = '<embed src="'+Src+'" autostart="1" loop="0" height="0" width="0" type="'+getMimeType()+'"></embed>';
    //return element.innerHTML;
}// end function setEmbed 

function getMimeType(){
var mimeType = "application/x-mplayer2"; //default
var agt=navigator.userAgent.toLowerCase();
if (navigator.mimeTypes && agt.indexOf("windows")==-1) {
//non-IE, no-Windows
  var plugin=navigator.mimeTypes["audio/mpeg"].enabledPlugin;
  if (plugin) mimeType="audio/mpeg" //Mac/Safari & Linux/FFox
}//end no-Windows
return mimeType
}//end function getMimeType




