// JavaScript Document

$(function() {

    /*
    =====================================================================						
    //jquery media plugin for playing files like flv,mov and etc
    =====================================================================
    */


    /*
    =====================================================================						
    //Script for gallery effect
    =====================================================================
    */
    $(".projectItemWrapper").hover(function() {

        ///$("div.projectinfo", $(this)).addClass("show").slideUp(0).slideDown("slow"); 
        $("div.projectinfo", $(this)).css("top", "-137px");
        $("div.projectinfo", $(this)).animate({ top: '0px' }, { queue: false, duration: 500 });
    }, function() {
        //$("div.projectinfo",$(this)).removeClass("show").slideUp("slow");
        $("div.projectinfo", $(this)).animate({ top: '274px' }, { queue: false, duration: 500 });

    });


    /*
    =====================================================================						
    //Navigation show hide on mouse over on main list items
    =====================================================================
    */

    $("#MainNavigation>li").hover(function() {
        //

        var childlist = $("ul.child", $(this));
        $("div#childNav").empty();
        $(childlist).clone().prependTo("div#childNav"); // check prepend() examples
        $("div#childNav ul.child").css("display", "block");

    });

    $("#childNav").mouseenter(function() {
        // $("p:first",this).text("mouse enter");
    }).mouseleave(function() {

        $("#childNav").animate({ background: "black" }, 5000, function() {
            $("div#childNav").empty();
            //alert("hey");
        });
    }
		);


    /*
    ==============================================						
    //Featured Projects
    ==============================================
    */
    $(".projectLinkPic").hover(function() {
        //$($(this) span).css({'display','none'}).html("oye");									
        $(this).nextAll("span").addClass("highlight");
        //console.log("shit");
    }, function() {
        $(this).nextAll("span.highlight").removeClass();
    });


    /*=============================================
	Primary navigation submenu openning script
	==============================================*/
	$("#pNav li").click(function(){
	var child = $(this).find("ul");
		if($(child).hasClass("show"))
		{
			$(child).css("display","none").removeClass("show");
			//$(child).slideUp({duration:1000,easing:"jswing"}).removeClass("show");				
		}
		else
		{
			$(child).css("display","block").addClass("show");
			//$(child).slideDown({duration:1000,easing:"jswing"}).addClass("show");				
		}			
	});



});
