/******************************************************

MARCREA JavaScript functions and settings

http://marcrea.de/en/

********************************************************/

/*  enclose in CDATA to allow reliable code validation
//<![CDATA[

/* init everything when document is ready */
$(document).ready(function(){

	/* initialize SUPERFISH */
	$('ul.sf-menu').superfish( {
			delay:       200,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: false                            // disable drop shadows  
		});

	
	/* fancyBox image viewer */
	$("a.fancybox").fancybox({
		titlePosition: 'over',
		titleFormat: formatTitle,
		overlayColor: '#fff',
		overlayOpacity: 0.6,
		padding: 15
	});
	function formatTitle(title, currentArray, currentIndex, currentOpts) {
		return '<div id="fb_dadalogo"></div><div id="fb_title_line"><div id="fb_title">' + (title && title.length ? title : '' ) + '</div></div>';
	}
	
	/* fancyBox iframe viewer */
	$("a.iframe").fancybox({
		titleShow: false,
		overlayColor: '#fff',
		overlayOpacity: 0.6,
		padding: 30,
		width: 900,
		height: 600
	});
	
	/* fancyBox iframe viewer */
	$("a.wp-oembed").fancybox({
		titleShow: false,
		overlayColor: '#fff',
		overlayOpacity: 0.6,
		padding: 30,
		width: 900,
		height: 600
	});
});
 
 /* clear input fields when clicked */
function doClear(theText) {
	if (theText.value == theText.defaultValue) {
		theText.value = ""
	}
}

/* hide facebook share-bar */
if (top.location != location) { top.location.href = document.location.href; } 
 
 //]]
