WebFont.load({
	/*
	google: {
		//families: [ 'Jura:latin', 'Yanone+Kaffeesatz:200,400' ]
	},*/
	custom: { 
		families: ['Yanone+Kaffeesatz','Jura']
	}
});

jQuery.support.placeholder = (function(){ var i = document.createElement('input'); return 'placeholder' in i; })();
jQuery.browser.android = navigator.userAgent.match(/Android/);

$(function(){
	/* placeholder */
	if (!$.support.placeholder){
		$(':input[placeholder]').each(function(){
			var $this = $(this);
			var placeholder = $this.attr('placeholder');
			if($this.val() === '') { $this.val(placeholder); }
			$this.focus(function() { $this.addClass('focus'); if($this.val() === placeholder) { $this.val(''); } });
			$this.blur(function() { $this.removeClass('focus'); if($this.val() === '') { $this.val(placeholder); } });
		});
	}
	
	if ($.browser.msie && $.browser.version < 8.0){
		$('#header .navigation li').hover(function(){ $(this).addClass('sfhover'); }, function(){ $(this).removeClass('sfhover'); });
	}

	/* Accordion Nav */
	$('#header ul.navigation > li > a').click(function(){ return false; });
	var accordion = $('#header ul.navigation li.navigation_1113 li li:has(ul)').addClass('accordion');
	accordion.find('ul').hide();
	accordion.find('> a').click(function(){
		accordion.removeClass('open').find('ul').hide();
		var li = $(this).parent();
		var a = $(this);
		if (!li.hasClass('open')) {
			li.addClass('open').find('ul').show();
		}
		return false;
	});


	/* move the heading */
	$('#right h1:eq(0)').insertBefore('.breadcrumb').append('<a href="#" class="print" onclick="window.print(); return false;">Print</a>');
	$('#right .section_image').insertAfter('.breadcrumb');
	
	$.easing.custom = function (x, t, b, c, d) {
		var s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	}
	
	//$("#footer .oems ul").simplyScroll({ paseu:true, autoMode: 'loop' });
	$("#footer .oems .container").find('div:empty').remove().end().scrollable({speed: 600, easing: 'custom', circular:true});



	var overlayDiv = $('<div class="simple_overlay" id="imageoverlay"><div class="contentWrap"></div></div>').appendTo('#right .content');
	
	$('a[href^="/media/"][target="_blank"]:has(img)').attr('rel','#imageoverlay').overlay({
		mask: '#000000',
		efect: 'apple',
		fixed: false,
		onBeforeLoad: function() {
			var wrap = this.getOverlay().find(".contentWrap");
			var url = this.getTrigger().attr('href');
			var img = $('<img src="'+ url +'" />').load(function(){ overlayDiv.css({ width: img.width()+'px', height: img.height()+'px' }); });
			wrap.empty().append(img);
		}

	});


});
