function preloadImages() { //v3.0
	var d=document;
	if(d.images){ 
  		if(!d.p) 
			d.p=new Array();
		var i,j=d.p.length,a=preloadImages.arguments; 
		for(i=0;i<a.length;i++)
	    	if (a[i].indexOf("#")!=0){ 
				d.p[j]=new Image; 
				d.p[j++].src=a[i];
			}
	}
}

function imageChange(objName, img1, img2) {
	if (!img2)
		document.images[objName].src=img1;
	else {
		if (document.images[objName].src.indexOf(img1) > -1)
			document.images[objName].src=img2;
		else
			document.images[objName].src=img1;
	}
	
	return;
}
function hideEdit(objName){

	var obj=document.getElementById(objName);
	if (obj.style.display == "none"){
		obj.style.display = "block";
	}
	else{
		obj.style.display = "none";
	}
}
function disappear(objNumber) {
	var obj=document.getElementById("lvl"+objNumber);
	var imgObj=document.getElementById("img"+objNumber);
	
	if (obj.style.display == "none") {
		obj.style.display="block";
//		imgObj.src="img/contract_icon.gif";
	} else {
		obj.style.display="none";
//		imgObj.src="img/expand_icon.gif";
	}
	
	return;
}

function disappeartwo(objNumber) {
	var obj=document.getElementById("lvl"+objNumber);
	var imgObj=document.getElementById("img"+objNumber);

	if (obj.style.display == "none") {
		obj.style.display="block";
		imgObj.src="img/contract_icon.gif";
	} else {
		obj.style.display="none";
		imgObj.src="img/expand_icon.gif";
	}
	
	return;
}

function disappearthree(objNumber) {
	var obj=document.getElementById("lvl"+objNumber);
	var imgObj=document.getElementById("img"+objNumber);

	if (obj.style.display == "none") {
		obj.style.display="block";
		imgObj.src="img/folder_open_full.gif";
	} else {
		obj.style.display="none";
		imgObj.src="img/folder_closed_full.gif";
	}
	
	return;
}

var popWin=null;
function popup(winURL, scale, strWinName, intHeight) {
	if (isNaN(parseInt(intHeight)))
	{
		intHeight = 450;
	}
	if (!scale)
		scale=600;
		
	strWinName = (strWinName != "") ? strWinName : "popup";	//set window name

	if (popWin != null)
		if (!popWin.closed)
			popWin.close();

	popWin = window.open(winURL, strWinName, 'top=0, left=0, toolbars=no,scrollbars=yes,width='+scale+',height='+intHeight);

	return;
}

function popup2(winURL, scale, strWinName, intHeight) {
	if (isNaN(parseInt(intHeight)))
	{
		intHeight = 600;
	}
	if (!scale)
		scale=800;
		
	strWinName = (strWinName != "") ? strWinName : "popup";	//set window name

	if (popWin != null)
		if (!popWin.closed)
			popWin.close();

	popWin = window.open(winURL, strWinName, 'top=20, left=20, toolbars=no,scrollbars=yes,width='+scale+',height='+intHeight);

	return;
}
function popup3(winURL, scale, strWinName, intHeight) {
	if (isNaN(parseInt(intHeight)))
	{
		intHeight = 500;
	}
	if (!scale)
		scale=620;
		
	strWinName = (strWinName != "") ? strWinName : "popup";	//set window name

	if (popWin != null)
		if (!popWin.closed)
			popWin.close();

	popWin = window.open(winURL, strWinName, 'top=0, left=0, toolbars=no,scrollbars=yes,width='+scale+',height='+intHeight);

	return;
}
