function Init (pageID,parentID,siteID,homeURL,mode,level1ID,level2ID) {
	var menuheight = $('menu').getStyle('height');
	var menu_offset_left = $('menu').getCoordinates().left;
	
	$$(".menuitem").each(function(element,index){
								  
		//SELECTED?
		if(element.getProperty('id')=='li'+level1ID)
		{
			element.toggleClass('selected');
		}
		
		var children = element.getChildren();
		element.addEvent('mouseenter',function() {
			if(children.length>1)
			{
				var SubMenu = children[1];
				var SubMeuItems = SubMenu.getChildren();
				var SubMenuLength = 0;
				
				SubMeuItems.each(function(subelement,subindex){
					if(subelement.getCoordinates().width > SubMenuLength)
						SubMenuLength = subelement.getCoordinates().width;
				});
										
				if(element.getCoordinates().width>SubMenuLength)
				{
					SubMeuItems.each(function(subelement,subindex){
						if(subelement.getProperty('id')=='li'+level2ID){
							subelement.toggleClass('selected');
						}
						subelement.setStyle('width',element.getCoordinates().width);
						SubMenu.getElements('li').setStyle('width',element.getCoordinates().width);
					});
				} else {							
					SubMenu.setStyle('width',SubMenuLength);	
					SubMenu.getElements('li').setStyle('width','100%');
				}
				
				this.toggleClass('hover-dropdown');
				if(window.ie)
				{
					var margin_left = this.getCoordinates().left;						
					SubMenu.setStyle('margin','0 0 0 0');
					SubMenu.setStyle('left',margin_left+'px');
				}
			}
			else
				this.toggleClass('hover');
		
		});				
		element.addEvent('mouseleave', function() {
												
			var SubMenu = children;
			if(SubMenu.length>1)
			{
				this.toggleClass('hover-dropdown');			
				
				if(window.ie)
					children[1].setStyle("left","-999em");
			}
			else
				this.toggleClass('hover');				
		});
	});

		/* PATH 
		try {
		$('path_'+pageID).addClass('selected');
		} catch (exception) {
			//No path
		}
		*/
		
		/* FONT SIZE */ 
		$$("font").each(function(tag,i){		
			if(tag.size.toInt()>0 && tag.size.toInt()<8)
			{
				tag.toggleClass('size'+tag.size);	
				tag.removeProperty('size');				
			}
			else
			{
				tag.toggleClass('size3');	
				tag.removeProperty('size');				
			}
		});

		/* NET-BLAST LOGIN */
			$('login').adopt(new Element('img', {
			    'styles': {
					'cursor':'pointer'
				},
				'events': {
					'mouseenter': function(){
						this.src = this.src.replace(/.gif/, "-over.gif");        		
					},
					'mouseleave': function(){
						this.src = this.src.replace(/-over.gif/, ".gif");	
					},
					'click': function(){
						window.open('../../login?idWebside='+pageID+'','teleport','width=50,height=50, resizable');
					}
				},
				'src': '../../images/nbLayoutMaster/_Rainbow/net-blast.gif',
				'title': 'Net-blast'
			}));

		/* SITEMAP */
		$('sitemap').addEvent('click',function() {
			document.location.href='index.html?id='+pageID+'&template=9Sitemap::Rainbow';
		});
		

		/* PRINT */
		$('print').addEvent('click',function(printformat) {
			window.open("index.html?id="+pageID+"&template=8Plain::Default","_blank","toolbar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=yes, copyhistory=no, width=570, height=580"); return false; },this);

		/* BANNER 
		$('banner').addEvent('click',function() {
		location.href='alias.html?id='+siteID;
		});*/
}

function InsertImage(imageID,imageDescription) {
	if(imageID!='')
		document.write('<img src="../../images/'+imageID+'" alt="'+imageDescription+'" />');
	else
		document.write('');
}



//HELPBOX
document.addEvent('domready',function() {
	if($chk($('text-size-button-small'))){
		$('text-size-button-small').addEvent('click',function(){
			$(document.body).setStyle('font-size',$(document.body).getStyle('font-size').toInt()*0.9+'%');
		});
	}
	
	if($chk($('text-size-button-normal'))){
		$('text-size-button-normal').addEvent('click',function(){
			$(document.body).setStyle('font-size','100%');
		});
	}
	
	if($chk($('text-size-button-large'))){
		$('text-size-button-large').addEvent('click',function(){
			$(document.body).setStyle('font-size',$(document.body).getStyle('font-size').toInt()*1.1+'%');
		});
	}
	
	var contrast_style;
	if($chk($('contrast-button'))){
		$('contrast-button').addEvent('click',function(){
			if(!$chk($(contrast_style))){
				contrast_style = new Element('style', {'type':'text/css'}).inject(document.getElementsByTagName('head')[0]);
			}
			if($(contrast_style).innerHTML == ''){
				contrast_style.set('html', '#container * {background-color:#000 !important;color:#fff !important;}');
			} else {
				$(contrast_style).innerHTML = '';
			}
		});
	}
});
