// JavaScript Document

function load_next_wizard_step(divout,divin){$("."+divout).hide();$("."+divin).fadeIn("slow");}

function set_default_button_div(divId, defaultButtonId)
{
    $('#' + divId + ' input, #' + divId + ' select, #' + divId + 'textarea').bind("keydown", function(event) {
        if(event.keyCode == 13)
        { 
            $('#' + defaultButtonId).click();
        }
    });
}
        
function open_details_details(url, name, title, targetDiv, width, height)
{
    if(!$('#dialog-' + name + '-details').length)
	{
	    $(targetDiv).append('<div id="dialog-' + name + '-details" title="' + title + '"><img src="./images/ajax-loader.gif" border="0" /></div>');
	    
	    $('#dialog-' + name + '-details').dialog({
	                        autoOpen: false,
                    		resizable: false,
	                        width:width,
                    		height:height,
                    		modal: true
                    	});    			
	}
                    	
    $.ajax({
       type: "POST",
       url: url,
       success: function(data) 
       {
          $('#dialog-' + name + '-details').html(data);
       }
     });
     
    $('#dialog-' + name + '-details').dialog('open');
}









function NavigateMenuItem(url)
{
	window.location = url;
}

function ToggleMenuItemHover(menuItem, hover)
{
	menuItem.className = "MenuItem" + (hover ? 'Hover' : '');
}

function printDiv(printpage)
{
	var headstr = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
	headstr += '<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Rapport</title><link rel="stylesheet" type="text/css" href="./CSS/StyleSheet.css" /><link rel="stylesheet" type="text/css" href="./CSS/Print.css" />';			
	headstr += ' </head><body><div class="page">';			
	var footstr = "</div></body></html>";
	
	var a = window.open('','','width=800,height=600,scrollbars=yes');
	a.document.open("text/html");
	
	a.document.write(headstr + document.getElementById(printpage).innerHTML + footstr);
	a.document.close();
	a.print();
	a.close();
}
