// JavaScript Document
function mainmenu(){
	$(" #nav ul ").css({display: "none"}); // Opera Fix
	$(" #nav li").hoverIntent(function(){
			$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideToggle('fast');
			},function(){
			$(this).find('ul:first').css({visibility: "visible",display:"block"}).slideToggle('fast');
			});
			
	$(" #nav li ul").not(':first').each(function(){
		var position = parseFloat($(this).parent().offset().left)- parseFloat($(this).parent().parent().offset().left);
		//var width = $(this).width();
    if ($.browser.msie && $.browser.version.substr(0,1)<7){ 		
		$(this).find('li:first').css('margin-left',0);
    }
    else {
        //alert($(this).eq());
        $(this).find('li:first').css('margin-left',position-50);  
     
    }

		
	});
    $("#menu_exc").css('margin-left',410);
}

$(document).ready(function() {
//linie dubla la titluri mari
    $("a#logo").css('cursor','pointer');
    


    if ($(".box_article .content h2").height()>60  ) {
        $(".box_article .content h2").css('background','transparent url(../images/title_bar_yellow_big.gif) no-repeat scroll right center');
        $("#inner_text").css('margin-top','70px');
    }
    
    if ($(".box_article .content h2").height()>68  ) {
        $(".box_article .content h2").css('background','transparent url(../images/title_bar_yellow_2big.gif) no-repeat scroll right center');
        $("#inner_text").css('margin-top','70px');
    }

    //scroll obiective
    $("div.scrollable").scrollable({size:1});
   
    //meniul principal
    mainmenu();
   
    //pretty photo pentru poze
    $("a[rel^='prettyPhoto']").prettyPhoto({padding:30, opacity:0.8, theme: 'custom', showTitle: true});

    //linkuri cu id la mai mult la obiective home page pt 8 obiective
    var i=1;
    $('div#youtube_events a.next').click(function(e){
        ++i;
        $('div#youtube_events a.more').attr('href','/amendament.html?id='+i);
    });
    $('div#youtube_events a.prev').click(function(e){
        --i;
        $('div#youtube_events a.more').attr('href','/amendament.html?id='+i);
    }); 
     $('div.scrollable').bind("mousewheel",function(e,delta){
        if (delta >0) {
            if(i>1) --i;
        }
        else {
            if(i<8) ++i;
        }
        $('div#youtube_events a.more').attr('href','/amendament.html?id='+i);
    }); 
    $('p.delimitator:last').hide();  
    
});
