/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-menutip-and-image-preview-using-jquery
 *
 */
 
this.menutip = function(){
        /* CONFIG */
                xOffset1 = -30;
                yOffset1 = -10;				
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result
        /* END CONFIG */
        $("a.menutip").hover(function(e){
                this.t = this.title;
                this.title = "";
                $("body").append("<p id='menutip'>"+ this.t +"</p>");
                $("#menutip")
                        .css("top",(e.pageY - xOffset1) + "px")
                        .css("left",(e.pageX + yOffset1) + "px")
						.delay(300)
                        .fadeIn(200);
    },
        function(){
                this.title = this.t;
                $("#menutip").remove();
    });
        $("a.menutip").mousemove(function(e){
                $("#menutip")
                        .css("top",(e.pageY - xOffset1) + "px")
                        .css("left",(e.pageX + yOffset1) + "px");
        });
};

this.menulinkstip = function(){
        /* CONFIG */
                xOffset2 = -30;
                yOffset2 = 0;
				var block_width2=100;
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result
        /* END CONFIG */
        $("a.menulinkstip").hover(function(e){
                this.t = this.title;
                this.title = "";				
                $("body").append("<p id='menulinkstip'>"+ this.t +"</p>");
				block_width2=$("#menulinkstip").width();
                $("#menulinkstip")
                        .css("top",(e.pageY - xOffset2) + "px")
                        .css("left",(e.pageX + yOffset2 - block_width2) + "px")
						.delay(1200)
                        .fadeIn(2);					
    },
        function(){
                this.title = this.t;
                $("#menulinkstip").remove();
    });
        $("a.menulinkstip").mousemove(function(e){
                $("#menulinkstip")
                        .css("top",(e.pageY - xOffset2) + "px")
                        .css("left",(e.pageX + yOffset2 - block_width2) + "px");
        });		
	
};


this.menulantip = function(){
        /* CONFIG */
                xOffset3 = 40;
                yOffset3 = 0;
				var block_width3=100;
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result
        /* END CONFIG */
        $("img.menulantip").hover(function(e){
				
                this.t = this.alt;
				//alert(this.t);
                this.alt = "";						
                $("body").append("<p id='menulantip'>"+ this.t +"</p>");
				block_width3=$("#menulantip").width();
                $("#menulantip")
                        .css("top",(e.pageY - xOffset3) + "px")
                        .css("left",(e.pageX + yOffset3 - block_width3) + "px")
						.delay(3)
                        .fadeIn(2);					
    },
        function(){
                this.alt = this.t;
                $("#menulantip").remove();
    });
        $("img.menulantip").mousemove(function(e){
                $("#menulantip")
                        .css("top",(e.pageY - xOffset3) + "px")
                        .css("left",(e.pageX + yOffset3 - block_width3) + "px");
        });
};

this.lessmenutip = function(){
        /* CONFIG */
            
			
				
                // these 2 variable determine popup's distance from the cursor
                // you might want to adjust to get the right result
        /* END CONFIG */
        $("a.lessmenutip").hover(function(e){
		
			//RESET MENU POSITION
				$('#less_dropdown')
					.css("width","100px")
					.css("height","50px")
					.css("position","absolute")
					.css("display","block")
					.css("margin-left","289px")
					.css("left","50%")
					.css("top","290px");
	
				$('#less_dropdown_top')
					.css("width","100%")
					.css("height","1px");		
		
				//$("#less_dropdown").				
				$('#less_dropdown').animate({opacity: "0.8", height: "80px"}, 400);
				$('#less_dropdown_top').animate({opacity: "0.8", height: "15px"}, 400);   		
    },
        function(){	
			
              
    });
        $("a.lessmenutip").mousemove(function(e){
             
        });
};

this.lessmenutip_hide = function(){ 

        $("div.lessmenutip_hide").hover(function(e){
	
    },
        function(){ /*alert(this.t);
                this.alt = this.t;
                $("#menulantip2").remove();*/
				$('#less_dropdown').animate({opacity: "0", height: "61px"}, 1000);
				$('#less_dropdown_top').animate({opacity: "0", height: "1px"}, 1000);
    });
        $("a.menulantip").mousemove(function(e){
                /*$("#menulantip2")
                        .css("top",(e.pageY - xOffset3) + "px")
                        .css("left",(e.pageX + yOffset3 - block_width3) + "px");*/
        });
};
