$(function(){
//-------------> News slider
	$("#news-slider").loopedSlider({
				container: ".slider-container",
				containerClick: false,
				autoStart: 8000,
				slidespeed: 2000,
				fadespeed: 1000,
				restart: 8000,
				addPagination: true,
				pagination: "pagination"
	});

	/* Super Box */
	$.superbox.settings = {
        boxId: "superbox", // Id attribute of the "superbox" element
        boxClasses: "", // Class of the "superbox" element
        overlayOpacity: .8, // Background opaqueness
        boxWidth: "600", // Default width of the box
        boxHeight: "400", // Default height of the box
        loadTxt: "جاري التحميل...", // Loading text
        closeTxt: "اغلاق", // "Close" button text
        prevTxt: "السابق", // "Previous" button text
        nextTxt: "اللاحق" // "Next" button text
    };
    $.superbox();
	$.superbox();
	
	$('#sponsoredSlides').crossSlide({
  sleep: 7,
  fade: 1
	}, [
	  { src: '../Uploads/sponsors-first-row.gif' },
	  { src: '../Uploads/sponsors-scnd-row.gif' }
	
	]);

	
	 /* slider News Paging */
    //$("ul.pagination:first").css({ float: 'right' }).before(("<span class='alignRight'>4/</span>"));
    $("ul.pagination:first li a").addClass("disableLink").css({ 'border': '0 solid #fff' });

    $("ul.pagination:last").css({ 'display': 'block', 'margin-top': '0', 'padding-top': '0' });
    $("ul.pagination:last li").addClass("imgPaging");
    $("ul.pagination:last li:first").addClass("active");
    $("ul.pagination:last li a").html("");


    $("ul.paginate:first").css({ float: 'right' }).before(("<span class='alignRight'>4/</span>"));
    $("ul.paginate:first li a").addClass("disableLink").css({ 'border': '0 solid #fff' });




    /*var nwscount = $("imgPaging").size();*/
    /*$(".slides div img").each(function(){$(this).clone().appendTo(".imgPaging a")});*/

    /*for(i=0;i<3;i++){}*/
    $(".slides div img").each(function(index) {
        $(this).clone().appendTo(".imgPaging a:eq(" + index + ")");
    });

    $("imgPaging img").removeClass("alignRight, push-left-2");

	
	

//-------------> Mega menu
var megaConfig = {sensitivity: 4,over: addMega, timeout: 100,	out: removeMega};
	$("li.mega, .hClinic").hoverIntent(megaConfig);
	function addMega(){
  		$(this).find('.sub').show()
	}
	function removeMega(){
		$(this).find('.sub').hide();
	}

	
//-------------> Calendar Effect
	$('.calendar-post').each(function(){
		$(this).bind({
			mouseover: function(){
				$(this).stop().addClass('current');
				$('.calendar-post')
					.stop()
					.animate({opacity:.2}, 'fast')
					.parent()
					.find('.current')
					.stop()
					.animate({opacity:1, paddingRight:4}, 'fast');
			},
			mouseleave: function(){
				$(this).removeClass('current');
				$('.calendar-post').animate({opacity:1, paddingRight:0}, 'fast');
			}
		});
	});
});
