
$(document).ready(function()
	{
		 $('a.media').media({width:570, height:400})
	

   $('#slider_nav').dropmenu({
	effect	: 'slide',
	nbsp	: true,
	speed   : 250,
   timeout : 100
});
   $('.top_menu').dropmenu({
	effect	: 'slide',
	nbsp	: true,
	speed   : 250,
   timeout : 100
});
    $('.middle_nav').dropmenu({
	effect	: 'slide',
	nbsp	: true,
	speed   : 250,
   timeout : 100
});
   
      $('#proiect_slider').cycle({ 
	fx:     'cover', 
	timeout:0,
	
	pager:  '#proiect_slider_menu',
	pagerAnchorBuilder: pagerFactoryProiecte,
	after: onAfter
		});
	   var zIndexNumber = 1000;
                $('li').each(function() {
                $(this).css('zIndex', zIndexNumber);
				
                zIndexNumber -= 10;
                }); 
	  
});
function goto(url)
{
window.location=url;	
}

function onAfter(curr, next, opts, fwd) {
var index = opts.currSlide;

//get the height of the current slide
var $ht = $(this).height();
//set the container's height to that of the current slide
$(this).parent().animate({height: $ht});
}
function pagerFactoryP(idx, slide) {

		//if (idx==3) var d= '<li class="last"><a href="#" >' + jQuery(slide).children("h1").eq(0).html()+ '</a></li>';
		//else 
		var submenu=jQuery(slide).children("#submenu").eq(0).html();
		var linkk=jQuery(slide).children("#link").eq(0).html();
	
		if (submenu) var d= '<li><a href="#" onclick="goto('+linkk+')" >' + jQuery(slide).children("h1").eq(0).html()+ '</a>' + jQuery(slide).children("#submenu").eq(0).html()+ '</li>';
		else  var d= '<li><a href="#" onclick="goto('+linkk+')">' + jQuery(slide).children("h1").eq(0).html()+ '</a></li>';
   		 return d;
    };
	function goto(linkk)
	{
		window.location=linkk;
	}
	

function pagerFactoryProiecte(idx, slide) {

	var d= '<li ><a href="#" >' + jQuery(slide).children("h2").eq(0).html()+ '</a></li>';
	
   		 return d;
    };

 
