/*
	This website is powered by indual
	Copyright (c) 2010 indual GmbH (www.indual.ch)                        
*/

function startpage_portletzone_mouseover() {
	var current_node_id;
	var current_node_height;
	
	// set 'onmouseover'
	$$('#startpage_portlets h1').each(function(h1, index) {
		h1.onmouseover = function() {
			$$('#' + $(h1.parentNode).id + ' .portlet-content').each(function(portletcontent) {
				// set display to block
				portletcontent.style.display = 'block';
				
				// set margin-top of all other elements but current
				current_node_id = $(h1.parentNode).id;
				current_node_height = $(h1.parentNode).offsetHeight;
				$$('#startpage_portlets div.portlet').each(function(portlet, index) {
					if ($(portlet).id != current_node_id) {
						$(portlet).style.marginTop = (current_node_height) + 'px';
					}
				});
				
			});
			
			// set current title arrow
			$(h1).style.background = '#a90f1a url(templates/loetschental/img/portlet_heading_arrow_down.png) no-repeat top right';
			$(h1).style.cursor = 'pointer';
		};
	});
	
	// set 'onmouseout'
	$$('#startpage_portlets h1').each(function(h1) {
		h1.onclick = function() {
			$$('#' + $(h1.parentNode).id + ' .portlet-content').each(function(portletcontent, index) {
				// set display to none
				portletcontent.style.display = 'none';
				
				// set margin-top of all other elements but current
				current_node_id = $(h1.parentNode).id;
				current_node_height = $(h1.parentNode).offsetHeight;
				$$('#startpage_portlets div.portlet').each(function(portlet, index) {
					if ($(portlet).id != current_node_id) {
						$(portlet).style.marginTop = (current_node_height) + 'px';
					}
				});
				
				// set title arrows
				$$('#' + $(portletcontent.parentNode).id + ' h1').each(function(h1) {
					$(h1).style.background = '#a90f1a url(templates/loetschental/img/portlet_heading_arrow_up.png) no-repeat top right';
					$(h1).style.cursor = 'auto';
				});
			});
		}; 
	});

}


