function setContHeight(pixels) {
	myMenu= document.getElementById("menycontainer");
	if (myMenu!=null)
		myMenu.style.height= ""+ pixels +"px";
	cont= document.getElementById("content");
	if (cont!=null)
		cont.style.height= ""+ pixels +"px";
}

	function findPosX(obj) {
		var curleft= 0;
		if (document.getElementById || document.all) {
			while (obj.offsetParent) {
				curleft+= obj.offsetLeft
				obj= obj.offsetParent;
			}
		}
		else if (document.layers)
			curleft+= obj.x;
		return curleft;
	}

	function findPosY(obj) {
		var curtop= 0;
		if (document.getElementById || document.all) {
			while (obj.offsetParent) {
				curtop+= obj.offsetTop
				obj= obj.offsetParent;
			}
		}
		else if (document.layers)
			curtop+= obj.y;
		return curtop;
	}

    function expandModels() {
    	elemExp.style.visibility= 'visible';
		elemExp.style.height= '70px';
		elemExp.style.top= '0px';
		elemExp.style.position= 'relative';
    }

    function packModels() {
    	elemExp.style.visibility= 'hidden';
		elemExp.style.height= '0px';
		elemExp.style.top= '-1000px';
		elemExp.style.position= 'absolute';
    }

    function init() {
		//ip= new ImagePreloader(aImg, onPreload);
	    boxtop= findPosY(document.getElementById("box1"));
    	boxleft= findPosX(document.getElementById("box1"));
		/*elemExp= document.getElementById("expanded");
    	packModels();
    	packDescription();*/
		
    }
    function fillDescription(nr) {
	    packDescription();
	    elemname= "box"+ nr;
	    elem= document.getElementById(elemname);
    	elem.style.display= 'inline';
    	elem.style.position= 'absolute';
    	//alert(elem.style);
    	if (26<nr)
    		elem.style.top= "2300px";	//elem.style.top+2200;
    	else if (22<nr)
    		elem.style.top= "1900px";	//elem.style.top+1800;
    	else if (18<nr)
    		elem.style.top= "1600px";	//elem.style.top+1500;
    	else if (14<nr)
    		elem.style.top= "1300px";	//elem.style.top+1200;
    	else if (8<nr)
    		elem.style.top= "900px";	//elem.style.top+800;
    }
    function packDescription() {
    	for (inx= 1; inx<=modelBoxes; inx++) {
	    	box= document.getElementById("box"+inx);
	    	if (box!=null) {
	    		box.style.display= 'none';
	    		//box.style.width= 300;
	    	}
    	}
    }
    //loadimages();
    
    /* create an XMLHttpRequest object (AJAX) */
	function createHttpRequestObject() {
		var request_o= null; //declare the variable to hold the object.
	
		if (window.XMLHttpRequest)
			request_o= new XMLHttpRequest();
		else if (window.ActiveXObject)
			request_o= new ActiveXObject("Microsoft.XMLHTTP");
		else {
			alert("Could not create XMLHttpRequest on this browser");
		}
		return request_o;
	}

	function hideShow(id, surrId) {
		var myEl= document.getElementById(id);
		var divEl= document.getElementById(surrId);
		if (myEl==null) {
			return;
		}
		//alert(divEl.className);
		if (myEl.style.display!="none" && myEl.style.display!="") {
			myEl.style.display= "none";
			divEl.style.height= "360px";
			//divEl.style.background= "transparent url(images/dialog2-dark-550x360-alpha.png) no-repeat top left";
			divEl.style.backgroundImage= "url(images/dialog2-dark-550x360-alpha.gif)";
		}
		else {
			myEl.style.display= "inline";
			divEl.style.height= "2200px";
			//divEl.style.background= "transparent url(images/dialog2-dark-550x2000-alpha.png) no-repeat top left";
			divEl.style.backgroundImage= "url(images/dialog2-dark-550x2000-alpha.gif)";
		}
	}
