/* This javascript file is build for www.hesje.com
 * @version 24-07-2010
 * @author Jeroen de Jong / deJong-IT
 * http://www.dejong-it.nl
 */

	// Add Google Analytics
	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-17694285-1']);
	_gaq.push(['_trackPageview']);

	(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
	})();


// Wait for the DOM to be ready
$(function(){

	// turn caching on
	jQuery.ajaxSetup({ cache: true });

	// Create round corners
	$('.inner').corner("round 8px").parent().css('padding', '4px').corner("round 10px")
	$('.inv').corner();
	$('.menu ul li a').corner();
	$('.order a').corner();

	// Need to hide something?
	if ($('.n').length > 0) {
		$('.n').hide();
		$('.n.nn').show();
	}

		// Create the SlideShow
	if ($('#slide').length > 0 || $('.imgslide').length > 0) {
		// Load the script
		$.getScript('/js/jquery.cycle.all.min.js', function() {
			// header scrolling
			$('#slide').cycle({
				fx: 'scrollLeft',
				speed: 1000, 
				timeout: 3000 ,
				random: 1 
			});

			// page scrolling
			$('.imgslide').cycle({
				fx: 'scrollLeft',
				speed: 1000, 
				timeout: 5000 ,
				random: 1 
			});
		});
	}

	// all PDF files should open in a new window
	$("a[href*=.pdf]").click(function(){
		window.open(this.href);
		return false;
	});
}); 

// Show one div and hide the rest
function HideAndShow(id) {
	// Hide all
	$('.n').hide();
	// Show one
	$(id).show();
	return true;
}

