
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// start javascript scripts file with php enabled

    // Company: 	Reactive Development LLC
    // Author:		Jeremy Selph 
    // Website:		http://www.reactivedevelopment.net

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// javascript constant variables we may uses in the following classes
		
		var testDir					= "ojoee/";
        var homeUrl                 = "http://" + window.location.host + "/" + testDir;
        var templateDir             = homeUrl + "wp-content/themes/turnAround/";
        var templateimagesDir       = templateDir + "img/";
        var uploadsDir              = homeUrl + "assets/";
		
		var j 						= jQuery.noConflict(); // because of wp-ecommerce plugin conflicts

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// jquery onload

        j(document).ready(function() {

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /// menu fix

                j("ul.sf-menu li").removeClass("isParent");
                j("ul.sf-menu li > ul").parent().addClass("isParent");

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /// main nav superfish menu

                j("ul.sf-menu").supersubs({ 

                    minWidth:    20,   	// minimum width of sub-menus in em units 
                    maxWidth:    30,   	// 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({ 

                    autoArrows:  false,	// disable generation of arrow mark-up 
                    delay:       200   // the delay in milliseconds that the mouse can remain outside a submenu without it closing 

                });

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /// lightbox

                j(".lightbox").fancybox({

                    "transitionIn"	:	"elastic",
                    "transitionOut"	:	"elastic",
                    "speedIn"		:	600, 
                    "speedOut"		:	200, 
                    "overlayShow"	:	true,
                    "overlayColor"	:	"#000"

                });

            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /// jquery cycle				

                j("#slideCont").cycle({ fx: "scrollHorz", speed: 1500, easing: "easeOutQuad", delay: 2500, prev: '#prev', next: '#next' });
                j("#footerBlog").cycle({ fx: "scrollUp", speed: 1500, easing: "easeOutQuad", delay: 2500 });
                j("#homeSlider").cycle({ fx: "scrollLeft", speed: 1500, easing: "easeOutQuad", delay: 2500 });
                j("#homeDishCycle").cycle({ fx: "fade", speed: 1500, easing: "easeOutQuad", delay: 2500 });
				
			////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            /// quick sidebar

                /*j(".eventPrev").click(function() {
                    
                    var curPos = j("#eventSlide").position();
                    var curTop = parseInt( curPos.top ) + 100;

                    if( curTop <= 0 ){ 

                        // j("#eventSlide").css( "top", curTop );
                        j("#eventSlide").animate({
                            
                            top: '-'+curTop
                            }, 400, function() {  }

                        );

                    }

                });

                j(".eventNext").click(function() {
                    
                    var curPos = j("#eventSlide").position();
                    var curTop = parseInt( curPos.top ) - 100;

                    var tempHeight = parseInt( j("#eventSlide").height() );
                        tempHeight = tempHeight - ( tempHeight * 2 )

                    if( curTop >= tempHeight ){ 

                        // j("#eventSlide").css( "top", curTop ); 
                        j("#eventSlide").animate({
                            
                            top: '+='+curTop
                            }, 400, function() { }

                        );

                    }

                });*/

                if (j('#eventSlide').height() > j('#eventSlider').height()) {
                    
                    j(".eventNext").click(function () {

                        animateContent("up");

                    });

                    j(".eventPrev").click(function () {

                        animateContent("down");

                    });

                }

                j(".viewMenu").click(function() {
                    
                    window.location = "http://184.173.198.29/~jsreact/dev/tuscan/menu/";

                });
							
			/// end jquery
            ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        });

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    /// javascript functions	

        var animationOffset = 0;
        var inc             = 100;
        function animateContent(direction) {  
            
            var tempH = -(j('#eventSlide').height());

            var move  = false;

            if ( direction == 'down' && animationOffset < 0 ){ animationOffset = animationOffset + inc; move = true; }
            else if( direction == 'up' && animationOffset > tempH ){ animationOffset = animationOffset - inc; move = true; }

            console.log( "container-content: " + j('#eventSlide').height() + " | " + tempH );
            console.log( "animationOffset: " + animationOffset );
            console.log( "direction: " + direction );

            if( move == true ){
                
                j('#eventSlide').stop().animate({ "marginTop": animationOffset + "px" }, 500);

            }

        }

    /// end javascript
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

