/**
 * Javascript - jQuery enabled
 * 
 * @package WPFramework
 * @subpackage Media
 */

/* Example jQuery
jQuery(document).ready(function($) {
	alert('jQuery + screen.js is loaded and ready to go!');
});
*/

// Dropdown menu using superfish
jQuery(document).ready(function($) {
	
	
	$('.nav').supersubs({
		minWidth: 		9,						// requires em unit.
		maxWidth: 		25,						// requires em unit.
		extraWidth: 	0						// extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
    }).superfish({
		hoverClass:		'nav-hover',			// the class applied to hovered list items 
	//	pathClass:		'overideThisToUse',		// the class you have applied to list items that lead to the current page 
		pathLevels:		1,						// the number of levels of submenus that remain open or are restored using pathClass 
		delay:			400,					// the delay in milliseconds that the mouse can remain outside a submenu without it closing 
		animation:		{opacity:'show'},		// an object equivalent to first parameter of jQuery’s .animate() method 
		speed:			'normal',				// speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
		autoArrows:		false,					// if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
		disableHI:		false					// set to true to disable hoverIntent detection 
	});
	
	/* Font Replacement */
	Cufon.replace('.hentry h1', { fontFamily: 'Sansation' });
	Cufon.replace('h2', { fontFamily: 'Sansation', hover: true });
	Cufon.replace('h3', { fontFamily: 'Sansation' });
	Cufon.replace('h4', { fontFamily: 'Sansation' });
	Cufon.replace('h5', { fontFamily: 'Sansation' });
	Cufon.replace('h6', { fontFamily: 'Sansation' });
	Cufon.replace('.menu .nav li a', { fontFamily: 'Sansation', hover: true });
	Cufon.replace('.meta', { fontFamily: 'Sansation Light' });
	Cufon.now();
	
	/* Search Watermark */
	var watermark = "Suche...";
	if ($("#sub-header-search .search").val() == "") {
		$("#sub-header-search .search").val(watermark);
	}
	
	$("#sub-header-search .search")
		.focus(	function() {
			if (this.value == watermark) {
				this.value = "";
			}
		})
		.blur(function() {
			if (this.value == "") {
				this.value = watermark;
			}
		});
		
	/* PrettyPhoto */
	$("a[rel^='lightbox']").prettyPhoto({
		theme: 'light_square' /* light_rounded / dark_rounded / light_square / dark_square */		
	});

});
