// JavaScript Document

// Pretty Photo
	$(document).ready(function(){
    $("a[rel^='prettyPhoto']").prettyPhoto();
  	});

// Slider
$(window).load(function() {
         $('#slider').orbit();
     });
	 
// Featured slider boxes with bounce effects
jQuery.easing['BounceEaseOut'] = function(p, t, b, c, d) {
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        easing: 'BounceEaseOut',
        animation: 1000
    });
});

// Image opacity eefects
$(function() {
            $('.imageopacity').each(function() {
                $(this).hover(
                    function() {
                        $(this).stop().animate({ opacity: 0.6 }, 400);
                    },
                   function() {
                       $(this).stop().animate({ opacity: 1.0 }, 400);
                   })
                });
});

// Featured overlay effect
$(function() {
	$(".roll").css("opacity","0");
	$(".roll").hover(function () {
	$(this).stop().animate({
	opacity: 1
	}, "fast");
},

function () {

	$(this).stop().animate({
	opacity: 0
	}, "fast");
});
});

// Main content shop product overlay effects
$(function() {
	$(".over").css("opacity","0");
	$(".over").hover(function () {
	$(this).stop().animate({
	opacity: 1
	}, "fast");
},

function () {

	$(this).stop().animate({
	opacity: 0
	}, "fast");
});
});

// Images overlay effect
$(function() {
	$(".link").css("opacity","0");
	$(".link").hover(function () {
	$(this).stop().animate({
	opacity: 1
	}, "fast");
},

function () {

	$(this).stop().animate({
	opacity: 0
	}, "fast");
});
});

// Sign in box
$(document).ready(function() {

            $(".signin").click(function(e) {
                e.preventDefault();
                $("fieldset#signin_menu").toggle();
                $(".signin").toggleClass("menu-open");
            });

            $("fieldset#signin_menu").mouseup(function() {
                return false
            });
            $(document).mouseup(function(e) {
                if($(e.target).parent("a.signin").length==0) {
                    $(".signin").removeClass("menu-open");
                    $("fieldset#signin_menu").hide();
                }
            });            

        });
				
		
// Superfish menu (main navigation)
$(document).ready(function(){ 
        $("ul.sf-menu").supersubs({ 
            minWidth:    10,   // minimum width of sub-menus in em units 
            maxWidth:    47,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 
    });

$(document).ready(function() { 
        $('ul.sf-menu').superfish(); 
    });

// Menu accordion
ddaccordion.init({
	headerclass: "submenuheader", //Shared CSS class name of headers group
	contentclass: "submenu", //Shared CSS class name of contents group
	revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
	mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
	collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
	defaultexpanded: [], //index of content(s) open by default [index1, index2, etc] [] denotes no content
	onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed)
	animatedefault: false, //Should contents open by default be animated into view?
	persiststate: true, //persist state of opened contents within browser session?
	toggleclass: ["", ""], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
	togglehtml: ["suffix", "<img src='images/style-1/accordion/plus.png' class='statusicon' />", "<img src='images/style-1/accordion/minus.png' class='statusicon' />"], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
	animatespeed: "normal", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
	oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
		//do nothing
	},
	onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
		//do nothing
	}
})
	

// jQuery Zoom Gallery
$(document).ready(function(){
	var options = {
            zoomType: 'standard',
            lens:true,
			title: false,
			showEffect : 'fadein',
			hideEffect: 'fadeout',
            preloadImages: true,
            alwaysOn:false,
            zoomWidth: 225,
            zoomHeight: 250,
            xOffset:16,
            yOffset:0,
            position:'right'
            //...MORE OPTIONS
	};
	$('.MYCLASS').jqzoom(options);
});


