// Cufón font replacement
Cufon.replace('.bodoni', { hover: true, fontFamily: 'bodoni' });
Cufon.replace('.arial', { fontFamily: 'arial' });
Cufon.replace('.progressBar div', { fontFamily: 'arial' });
Cufon.replace('.footer a', { fontFamily: 'arial', hover: true });
Cufon.replace('.printActions a', { fontFamily: 'arial', hover: true });
Cufon.replace('.trebuchet', { fontFamily: 'trebuchet' });

// activate biggerLink, so that entire li becomes a link
$(document).ready(function() {
	$('.bLink li').biggerlink();
});


$(document).ready(function(){	
	$("#pass1").jpassword({
		flat: false,
		type: 0
//		onShow: function(jInput, jTooltip){ jTooltip.slideUp(); },  
//		onHide: function(jInput, jTooltip){ jTooltip.slideDown(); },  
//		onComplete: function(jInput, jTooltip){ jTooltip.slideDown(); }  
	});  
});

// accordion function on documentFinder block
$(document).ready(function(){
	
	$('.accordion').accordion({
		header: '.head',
		active: false,
		collapsible: true,
		autoheight: false,
		selectedClass: 'fix'		
	});
	
	$('.head').hover(function() {
		$(this).addClass('hover');
			}, function() {
		$(this).removeClass('hover');
	});
	
	
});



// ToolTip
$(document).ready(function(){
	$('.toolTip').tooltip({
		fixPNG: true, 
		showURL: false 					  
	});
});

// HoverTip
$(document).ready(function(){
	$('.hoverTip').tooltip({
		fixPNG: true, 
		showURL: false 					  
	});
});

/* popup
$(function(){
	$.superbox({	
		boxWidth: "586", // Default width of the box
		boxHeight: "402" // Default height of the box		   
	});
}); */


// change textcolor and value of selected input fields
function blurfocus(elm, text, newval)
{
    if ($(elm).val() == text)
    {
        $(elm).val(newval);
    }
}

$(document).ready(function() {  
     $('input[type="text"]').addClass("idleField");  
     $('input[type="text"]').focus(function() {  
         $(this).removeClass("idleField").addClass("focusField");  
     });    
     $('input[type="password"]').addClass("idleField");  
     $('input[type="password"]').focus(function() {  
         $(this).removeClass("idleField").addClass("focusField");  
     });  
	$('textarea').addClass("idleField");  
	$('textarea').focus(function() {  
         $(this).removeClass("idleField").addClass("focusField");  
     }); 
	$('input[type="text"]').blur(function() {  
		$(this).removeClass("focusField").addClass("idleField"); 
	}); 
	$('input[type="password"]').blur(function() {  
		$(this).removeClass("focusField").addClass("idleField"); 
	}); 
	$('textarea').blur(function() {  
		$(this).removeClass("focusField").addClass("idleField");
	});  
 });  

$(document).ready(function()  {
	$(".navBarUl").treeview({
	//	persist: "cookie",
		animated: false,
		collapsed: true,
		unique: true
		
	});
	
	$('.hitarea').hover(function() {
		$(this).addClass('hover');
			}, function() {
		$(this).removeClass('hover');
	});
});

function CorrectOverlay()
{
	var body_height =$('body').height();
	
	var height = $(window).height();
	
	if(body_height > height) height = body_height;
  
    $('.popupBackground').height(height); 
}