    function mycarousel_initCallback(carousel)
    {
        // Disable autoscrolling if the user clicks the prev or next button.
        carousel.buttonNext.bind('click', function() {
            carousel.startAuto(0);
        });

        carousel.buttonPrev.bind('click', function() {
            carousel.startAuto(0);
        });

        // Pause autoscrolling if the user moves with the cursor over the clip.
        carousel.clip.hover(function() {
            carousel.stopAuto();
        }, function() {
            carousel.startAuto();
        });
    };
        
         jQuery(document).ready(function() {
            jQuery('#mycarousel').jcarousel({
                auto: 7,
                wrap: 'circular',
                initCallback: mycarousel_initCallback
            });
        });
        
        
        jQuery(document).ready(function() {
            jQuery('#mycarousel-promo').jcarousel({
                auto: 7,
                wrap: 'circular',
                initCallback: mycarousel_initCallback
            });
        });


    var htmlTab2;
	    $(document).ready(function() {
	        $("#jflow-controller").jFlow({
	            slides: "#jflow-slides",
	            controller: ".jflow-control", // must be class, use . sign
	            slideWrapper : "#jFlowSlide", // must be id, use # sign
	            selectedWrapper: "active",  // just pure text, no sign
	            width: "100%",
	            height: "229px",
	            duration: 400,
	            prev: ".jFlowPrev", // must be class, use . sign
	            next: ".jFlowNext" // must be class, use . sign
	        }); 
        htmlTab2 = $('#tab2').html();
        //Default Action
        $(".tab-left-content").hide(); //Hide all content
        $("ul.tabs-left li:first").addClass("active").show(); //Activate first tab
        $(".tab-left-content:first").show(); //Show first tab content
        //On Click Event
        $("ul.tabs-left li").click(function() {
            $("ul.tabs-left li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tab-left-content").hide(); //Hide all tab content
            var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
            $('#tab2').html(htmlTab2); 
            $(activeTab).fadeIn(); //Fade in the active content
          //  if ($(this).html().indexOf("بلمو") != -1)
         //   {
                $(".ideas").jCarouselLite({circular: false, scroll:1, visible: 2, btnNext: "#btnNext",
                    btnPrev: "#btnPrev"});
                function formatTitle(title, currentArray, currentIndex, currentOpts) {
                    return (currentIndex + 1) + ' وه ' + currentArray.length;
                }

                $("a.fancy-image-link").fancybox({
                	'titlePosition' 	: 'inside',
                	'titleFormat'		: formatTitle
                    
                });
                $(".fancy-image-link").mouseenter(function(obj){
                    $('.zoom-in',this).show();
                }).mouseleave(function(){
                    $('.zoom-in',this).hide();
                });
                
                $('.ideas-parent').css("width",$('.ideas').css("width"));
                $('.ideas-parent').css("height",$('.ideas').css("height"));
                $('#btnNext').css("margin-left",$('.ideas').css("width"));
                //$('.ideas').css("width","350px");
         //   }
            return false;
        });
 
    });

    $(document).ready(function() {

        //Default Action
        $(".tab-right-content").hide(); //Hide all content
        $("ul.tabs-right li:first").addClass("active").show(); //Activate first tab
        $(".tab-right-content:first").show(); //Show first tab content
        
        //On Click Event
        $("ul.tabs-right li").click(function() {
            $("ul.tabs-right li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tab-right-content").hide(); //Hide all tab content
            var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
            $(activeTab).fadeIn(); //Fade in the active content
            return false;
        });
        	$(".poly-en-inf").click(function(){
        		content = $(this).next(".poly-en-cont").children(".pol-content-text").html();
        		link = $(this).next(".poly-en-cont").children(".pol-content-link").html();
        		if (content != null) {
        			bigSubWin($(this).next(".poly-en-cont").children(".pol-content-link").text(),content,link);
        		}
        		return false;
        	});
        	$('.merker').click(function(){
        		$(this).next('.poly-en-inf').click();
        		if ($(this).children('span').get() != '') {
	        		return false;
        		}
        	});
        $("a[rel='fancy-uno-link']").fancybox({
		'titleShow'		: false
		});
    	$('.tabs_info div.tabs_info_content').not('.tabs_info div.tabs_info_content:first').hide();	
    	$('.tabs_menu a[rel]').click(function() {
    		var tDescr = $(this).attr('rel');
    			$('.tabs_menu li').removeClass('active');
    			$(this).parent().addClass('active');
    			$('.tabs_info_content').hide();
    			$('#'+tDescr).show();
    	});
        
        $(".show-hide").click(function (){
            $(".hide").slideToggle("medium");
            return false;
        });
    });
