
function init() {
	
		var root = document.getElementById("menuList");
		var rootOffset = root.offsetLeft;
		getMenus(root, root);

}


function opendview(par) {

	
	url = '?3dview&par=' + par;

	re = /\//gi;
	newstr = par.replace(re, "");	
	re = /\./gi;
	newstr = newstr.replace(re, "");	
	
	dialogWindow=window.open(url, newstr, 'width = 450, height = 327, innerWidth = 450, innerHeight = 327, status = 0, toolbar = 0, titlebar = 0, menubar = 0, location = 0, scrollbars = 0');

}

function opendpict(par, w, h) { //, w, h

	//w = 1024;
	//h = 768
	url = '?dpict&par=' + par;

//	alert(url);
	
	re = /\//gi;
	newstr = par.replace(re, "");	
	re = /\./gi;
	newstr = newstr.replace(re, "");	
	
	h = h + 50;
	
	dialogWindow=window.open(url, newstr, 'width = '+w+', height = '+h+', innerWidth = '+w+', innerHeight = '+h+',resizable = 1, status = 0, toolbar = 0, titlebar = 0, menubar = 0, location = 0, scrollbars = 0');

}

function openddpict(par, w, h) {

	
	url = '?dpict&par=' + par;

//	alert(url);
	
	re = /\//gi;
	newstr = par.replace(re, "");	
	re = /\./gi;
	newstr = newstr.replace(re, "");	
	
	h = h + 50;
	
	dialogWindow=window.open(url, newstr, 'width = '+w+', height = '+h+', innerWidth = '+w+', innerHeight = '+h+',resizable = 1, status = 0, toolbar = 0, titlebar = 0, menubar = 0, location = 0, scrollbars = 0');

}

function openpan(par) {

	
	url = '?pan' + par;

	
	re = /\//gi;
	newstr = par.replace(re, "");	
	re = /\./gi;
	newstr = newstr.replace(re, "");	
	re = /&/gi;
	newstr = newstr.replace(re, "");	
	re = /=/gi;
	newstr = newstr.replace(re, "");	
	
//	alert(newstr);
	
	dialogWindow=window.open(url, newstr, 'width = 500, height = 320, innerWidth = 500, innerHeight = 320, status = 0, toolbar = 0, titlebar = 0, menubar = 0, location = 0, scrollbars = 0');

}



function getObj(name) {
  if (document.getElementById) {
  	
  	this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
		
  } else if (document.all) {
  	
		this.obj = document.all[name];
		this.style = document.all[name].style;
		
  } else if (document.layers) {
  	
		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;
}

