//
// @author [Cassette]
// @copyright [2011]
// Software on this site is copyright 2011
// Cassette Pty Ltd.
// All Rights Reserved. Copying, Editing or
// Distributing this software is strictly
// forbidden without permission from
// Cassette Pty Ltd.
// for more information please contact
// Cassette www.cassette.cc 
//

$(document).ready(function(){
	setup_jscroll();
	setup_window_resize();
	setup_gallery_slider();
}); 


function setup_window_resize() {
	$(window).resize(window_resize);
	window_resize();
}

function window_resize() {
	var height = $(window).height();
	var width = $(window).width();
	
	if(height < 750) {
		$("#wrapper-center").css({marginTop: "0px", top: "0px"});
	} else {
		$("#wrapper-center").css({marginTop: "-375px", top: "50%"});
	}
}
function setup_gallery_slider() {
	$("#pr-gallery").each(function() {
		$(this).bxSlider({
			infiniteLoop: true,
			hideControlOnEnd: false,
			displaySlideQty: 7,
			moveSlideQty: 7,
			speed: 2000,
			easing: 'easeOutQuint',
			prevImage: site_url + '/images/gui/arrow_left.png',
			nextImage: site_url + '/images/gui/arrow_right.png'
		});
		
		$(this).find("img").css({opacity: 0.5});
		$(this).find("img").hover(function() {$(this).css({opacity: 1});},function() {$(this).css({opacity: 0.5});});
		$("a.grouped_elements").fancybox();
	});
	
	$("#prive-gallery, #goldwell-gallery").each(function() {
		$(this).find("img").css({opacity: 0.5});
		$(this).find("img").hover(function() {$(this).css({opacity: 1});},function() {$(this).css({opacity: 0.5});});
		$("a.grouped_elements").fancybox();
	});
}

function setup_jscroll() {
	$('.scroll-pane').jScrollPane();
	// hack for font problem
	setTimeout(function() {
		$('.scroll-pane').jScrollPane();
	},2000);	
}
