// Show News 
mhgoz$(document).ready(function() {
	mhgoz$(".latest-adds-button").click(function(){
		setTimeout(function(){$("html,body").animate({scrollTop:200},"2000");
        },2000)
		mhgoz$("#blog-contact").animate({
			height: "430px"
		},{
		//	duration: 1500,
		//	specialEasing: {
		//		height: 'easeOutBounce'
		//	}
		});

	   mhgoz$(".blog-contact").fadeIn(1000);
		mhgoz$(".latest-adds-button-up").toggle();
		mhgoz$("html,body").animate({scrollTop:1550},"2500");
	});	
	
   mhgoz$("#hide_button").click(function(){
	   mhgoz$(".blog-contact").fadeOut(1000);
		mhgoz$("#blog-contact").animate({
			height: "0px"
		},{
			duration: 1500,
			specialEasing: {
				height: 'easeOutBounce'
			}
		});
	  mhgoz$(".latest-adds-button-up").toggle();
		
	
   });	
	
});

//scroll 

$(window).load(function() {
	mCustomScrollbars();
});

function mCustomScrollbars(){
	/* 
	malihu custom scrollbar function parameters: 
	1) scroll type (values: "vertical" or "horizontal")
	2) scroll easing amount (0 for no easing) 
	3) scroll easing type 
	4) extra bottom scrolling space for vertical scroll type only (minimum value: 1)
	5) scrollbar height/width adjustment (values: "auto" or "fixed")
	6) mouse-wheel support (values: "yes" or "no")
	7) scrolling via buttons support (values: "yes" or "no")
	8) buttons scrolling speed (values: 1-20, 1 being the slowest)
	*/
	$("#mcs_container").mCustomScrollbar("vertical",400,"easeOutCirc",1.05,"auto","yes","yes",10); 
	$("#mcs2_container").mCustomScrollbar("vertical",0,"easeOutCirc",1.05,"auto","yes","no",0); 
	$("#mcs3_container").mCustomScrollbar("vertical",900,"easeOutCirc",1.05,"auto","no","no",0); 
	$("#mcs4_container").mCustomScrollbar("vertical",200,"easeOutCirc",1.25,"fixed","yes","no",0); 
	$("#mcs5_container").mCustomScrollbar("horizontal",500,"easeOutCirc",1,"fixed","yes","yes",20); 
}

/* function to fix the -10000 pixel limit of jquery.animate */
$.fx.prototype.cur = function(){
    if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
      return this.elem[ this.prop ];
    }
    var r = parseFloat( jQuery.css( this.elem, this.prop ) );
    return typeof r == 'undefined' ? 0 : r;
}

/* function to load new content dynamically */
function LoadNewContent(id,file){
	$("#"+id+" .customScrollBox .content").load(file,function(){
		mCustomScrollbars();
	});
}
/*/ Button Hover Effect /*/
$(document).ready(function(){
	$(".gallery img").fadeTo("slow", 1.0); // This sets the opacity of the thumbs to fade down to 60% when the page loads

	$(".gallery img").hover(function(){
		$(this).fadeTo("slow", 0.4); // This should set the opacity to 100% on hover
	},function(){
   		$(this).fadeTo("slow", 1.0); // This should set the opacity back to 60% on mouseout
	});
});

/*/ nav edite /*/ 
mhgoz$(document).ready(function(){
  $(".main-menu li:last").css("background-image","none");
});
/*/ custome light box /*/ 
  jQuery(document).ready(function($){
    $("a[href$='.jpg'], a[href$='.jpeg'], a[href$='.gif'], a[href$='.png'], .lightbox").lightbox();
	
  });

// social hover effect 
    $(document).ready(function () {
    $("#social-icons li").each(function () {
    $("a strong", this).css("opacity", "0");
    });
    $("#social-icons li").hover(function () {
    $(this).stop().fadeTo(500, 1).siblings().stop().fadeTo(500, 0.2);
    $("a strong", this).stop().animate({
    opacity: 1,
    top: "-10px"
    }, 300);
    }, function () {
    $(this).stop().fadeTo(500, 1).siblings().stop().fadeTo(500, 1);
    $("a strong", this).stop().animate({
    opacity: 0,
    top: "-1px"
    }, 300);
    });
    });
// Gallery Show 2 // 
$(document).ready(function(){
	var ctrl = true;
    $(".showcomment").click(function(){
		$(".all").animate( { height: "show" },{
			duration: 2000,
			specialEasing: {
				height: 'easeOutBounce'
			}
		});
	});
	$(".close").click(function(){
		$(".all").animate( { height: "hide" },{
				duration: 700,
				specialEasing: {
				height: 'easeInExpo'
					}
			});

		
	});
});


// Slider in frontpage
			$(function() {
				$('#va-accordion').vaccordion({
					expandedHeight	: 450,
					animSpeed		: 500,
					animEasing		: 'easeInOutBack',
					animOpacity		: 0.4
				});
			});
//copy
// MHGOZ.com.eg
if(document.location.protocol=='http:'){var Tynt=Tynt||[];Tynt.push('drSLxOvaCr4lpUadbi-bpO');Tynt.i={"ap":"المصدر:"};(function(){var s=document.createElement('script');s.async="async";s.type="text/javascript";s.src='http://tcr.tynt.com/ti.js';var h=document.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);})();}
// tooltip 
$(function(){
$("a").tipTip({maxWidth: "auto", edgeOffset: 10});
}); 