

jQuery(document).ready(function($) {
	$.preloadCssImages();
	
/***********************************
HORIZONTAL SITE SLIDER
JQUERY FRAMEWORK


//i should do this using a cookie
$('body').append('<div id="scroll_hack" style="display:none;"></div>').css({overflow: 'hidden'});

$(window).load(function(){
	var scrollItemWidth = "2900px";

	$('.scroll_item').width(scrollItemWidth);
	
	$('.scroll_container').width($('.scroll_item').width()*$('.scroll_item').size());

	$('.scroll_item, .scroll_item_wrapper, .content_wrapper').height($(window).height());

	$('.scroll_item_wrapper').width($(window).width());


	//any additional width/hight formatting
	$('#welcome').css({
		width: $(window).width()
	});
	
	
	//BIND DYNAMIC RESIZE
	$(window).bind('resize', function() {

		$('.scroll_item, .scroll_item_wrapper, .content_wrapper').height($(window).height());

		$('.scroll_item_wrapper').width($(window).width());

	    // to store it in a variable
		var scroll = $('#scroll_hack').text();
		$().scrollTo(scroll, 0, {axis:'xy', offset:{top: 0}});

	});
	
	
	//EASING
	$.easing.elasout = function(x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
					if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*2.2;
					if (a < Math.abs(c)) { a=c; var s=p/4; }
					else var s = p/(2*Math.PI) * Math.asin (c/a);
					return a*Math.pow(2,-20*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;

	};

	//SCROLL CLICK FUNCTION
	$('.scroll a').click(function(){
		var scroll = $(this).attr('href');
		$('#scroll_hack').empty().append(scroll);

		$().scrollTo(scroll, 1000, {easing:'elasout', axis:'xy', offset:{top: 0}});

		return false;	

	});
	

});


***********************************/	
jQuery.fn.dynamicPrice = function() {
	$(this).each(function(){
		var currentPrice = $(this).find('select.product-attr-custom option:first').attr('googlecart-set-product-price');
		$(this).find('input.product-price').val(currentPrice);
	});
}

$('.product').dynamicPrice();

$('.product-image img').addClass('product-image');


$('#greek input#wpcf_website').attr({value: 'Greek Inquiry'}).parent().hide();
$('#contact_container input#wpcf_website').attr({value: 'General Inquiry'}).parent().hide();
//$('#greek span.wpcf7-form-control-wrap.your-subject').find('input').attr({value: 'Greek Inquiry'}).parent().parent().hide();


if (jQuery.browser.msie) { 
//	$('html').css({overflow: 'hidden'});
  if(parseInt(jQuery.browser.version) == 6) { 
  } 
}





/*
$().scrollTo('#home', 0, {easing:'elasout', axis:'xy', offset:{top: 0}});
$('.social a').click(function(){
	var link = $(this).attr('href');
	$(link).slideToggle('fast', 'swing');
	return false;
});
*/





/*
Slide Show Tabs

	$(function() { 
	    // setup ul.tabs to work as tabs for each div directly under div.panes 
	    $("#slider ul.tabs").tabs("div.panes > div", { 

		        // enable "cross-fading" effect 
		        effect: 'fade', 
		        fadeOutSpeed: "slow", 

		        // start from the beginning after the last tab 
		        rotate: true 

		    // use the slideshow plugin. It accepts its own configuration 
		    }).slideshow({
				autoplay: true,
				autopause: false,
				clickable: false,
				interval: 4000
			}); 
	});


	$('#globalnav_container li.subnav').hover(function(){
		$(this).toggleClass('hover').find('ul').fadeIn('fast');
	}, function(){
		$(this).toggleClass('hover').find('ul').fadeOut('fast');
	});
	*/	
});
