
function loadPage(whichLayer) 
{

	$('foldText1').style.display = 'block';
	$('foldText1.1').style.display = 'block';
	$('foldText1.2').style.display = 'block';
	$('foldText1.3').style.display = 'block';
	$('foldText1.4').style.display = 'block';
	//$('foldText1.5').style.display = 'block';
	$('foldText1.6').style.display = 'block';
	//$('foldText1.7').style.display = 'block';
	//$('foldText1.8').style.display = 'block';
	
	switch(whichLayer)
	{
		case "styling":
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
			swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
			//swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			//swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			//swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');		
			break;
		case "integration":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');	
			new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
			swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');		
	        //new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
	        //swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			//swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			//swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');		
			break;
		case "importing":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
			swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');	
	        //new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
	        //swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			//swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			//swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');		
            break;
		case "livelinking":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');	
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');
	        //new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
	        //swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			//swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			//swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');		
            break;
            /*
		case "visualisation":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');	
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');
	        new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
	        swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');					
			break;
			*/
		case "interface":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');	
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');
	        new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
	        swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
			//swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			//swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');		
			//new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			//swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');					
			break;
			/*
		case "admin":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');	
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');
	        new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
	        swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
			swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.8', 'blind', { duration: 1 });
			swapImage('IMG1.8', 'images/unfoldedOK.png','images/foldedOK.png');					
			break;
		case "export":
			new Effect.toggle('foldText1.1', 'blind', { duration: 1 });
			swapImage('IMG1.1', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.2', 'blind', { duration: 1 });
			swapImage('IMG1.2', 'images/unfoldedOK.png','images/foldedOK.png');	
			new Effect.toggle('foldText1.3', 'blind', { duration: 1 });
			swapImage('IMG1.3', 'images/unfoldedOK.png','images/foldedOK.png');
	        new Effect.toggle('foldText1.4', 'blind', { duration: 1 });
	        swapImage('IMG1.4', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.5', 'blind', { duration: 1 });
			swapImage('IMG1.5', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.6', 'blind', { duration: 1 });
			swapImage('IMG1.6', 'images/unfoldedOK.png','images/foldedOK.png');		
			new Effect.toggle('foldText1.7', 'blind', { duration: 1 });
			swapImage('IMG1.7', 'images/unfoldedOK.png','images/foldedOK.png');					
			break;
			*/

	}
}
	
Effect.QueueThis = Class.create();
Object.extend( Object.extend( Effect.QueueThis.prototype, Effect.Base.prototype ), {
	initialize: function(element) {
		this.element = $(element);
		this.func = arguments[1];
		this.start(arguments[2]);
	},
	finish: function(position){
		this.func(this.element);
	}
});
	
function popup_window(winURL, winName)
{
    var props = 'scrollBars=yes,resizable=yes,toolbar=no,menubar=no,location=no,directories=no,width=1040,height=845';
    popupWindow = window.open(winURL, winName, props);
    popupWindow.focus();
}

var size = "small";
var ScaleIt = {
	timeout : null,
	scale : function(id_of_element){
		clearTimeout(this.timeout);
		switch (size) {
		case "small":
			this.timeout = setTimeout(function(){new Effect.Scale(id_of_element, 200,  {scaleMode: { originalHeight: 154, originalWidth: 250 }})},0);		 
			size = "large";
			$(id_of_element).title = 'Click to restore';
			break;
		case "large":
			var queue = Effect.Queues.get('global');
			queue.each(function(e) { e.cancel() });
			clearTimeout(this.timeout);
			this.timeout = setTimeout(function(){new Effect.Scale(id_of_element, 50,   {scaleMode: { originalHeight: 308, originalWidth: 500 }})},0);				 		    
			size = "small";
			$(id_of_element).title = 'Click to enlarge';
			break;
		}
	}
}
