
function popitup(url, w, h) {
	var p_args = 'height='+h+',width='+w+',scrollbars=1';
	newwindow=window.open(url,'name',p_args);
	if (window.focus) {newwindow.focus()}
	return false;
}


function showMovingForm(id) {
		
		if (document.getElementById) { 
			document.getElementById(id).style.display = 'block';
		}
			else {
				
				if (document.layers) { 
					document.id.display = 'block';
				}
				
				else {
					document.all.id.style.display = 'block';
				}
		}
		
}

function hideMovingForm(id) {
		
		if (document.getElementById) { 
			document.getElementById(id).style.display = 'none';
		}
			else {
				
				if (document.layers) { 
					document.id.display = 'none';
				}
				
				else {
					document.all.id.style.display = 'none';
				}
		}
		
}


    /////////////////////////////////////////////////////////
    //// SHOW / HIDE SUB MENUS //////////////////////////////
    /////////////////////////////////////////////////////////
	var rows = new Array('row1', 'row2', 'row4');
	var switched = false;
	
	function collapseRow(id)
	{
		if (document.getElementById)
		{ // DOM3 = IE5, NS6
			
			document.getElementById(id).style.display = 'none';
						
		}
		else {
				if (document.layers)
				{ // Netscape 4
					document.id.display = 'none';
				}
				else
				{ // IE 4
					document.all.id.style.display = 'none';
				}
		}
		
	}
	
	///////////////////////////
	function collapseRows()
	{
		for(var i=0; i<rows.length; i++)
		{
			collapseRow(rows[i]);
		}
	}
	
	function switchRow(rowid) {
	

		var rowid;
		if(row = document.getElementById(rowid))
		{
			if(row.style.display == 'block') {
				row.style.display = 'none';
			}
			else {
				collapseRows();
				row.style.display = 'block';
			}
		}

	}
	
	
	//////////////////////////////
	//switch main navigation tab//
	//////////////////////////////
	jQuery.noConflict();
	jQuery(document).ready(function() {
		
		jQuery("#navigation ul li").hover(
			function(){ jQuery(this).children(".nav_link").toggleClass("dHover"); jQuery(this).children(".menu_drop").show(); },
			function(){ jQuery(this).children(".nav_link").toggleClass("dHover"); jQuery(this).children(".menu_drop").hide(); }
		);
		
	
	    jQuery("#navigation ul li").removeClass("current");
	    
	    if(location.href.indexOf("whyenergia/") != -1 )
	    {
	       jQuery("#navigation ul li#why").addClass("current");
	    }
	    
	    if(location.href.indexOf("supply/") != -1 )
	    {
	       jQuery("#navigation ul li#electricity").addClass("current");
	    }
	    
	    if(location.href.indexOf("gas/") != -1 )
	    {
	       jQuery("#navigation ul li#gas").addClass("current");
	    }
	    
	    if(location.href.indexOf("energyefficiency/") != -1 )
	    {
	       jQuery("#navigation ul li#efficiency").addClass("current");
	    }
	    
	    if(location.href.indexOf("customerservice/") != -1 )
	    {
	       jQuery("#navigation ul li#customer").addClass("current");
	    }
	    
	    if(location.href.indexOf("news/") != -1 )
	    {
	       jQuery("#navigation ul li#news").addClass("current");
	    }
		
	});
