// JavaScript Document
$(function() {
////create top slider
var imgArr= new Array();	
$('.header_c p').each(function(i){
	imgArr.push($(this).html());
	//alert($(this).html());
	})


//alert(screen.width);
$('.header_c').html('<div class="jCarouselLite"><div class="leftShape"></div><div class="rightShape"></div><ul class="thumbwrap" ></ul></div>');
for(var i=0;i<imgArr.length;i++){
	$(".jCarouselLite ul.thumbwrap").append('<li>'+imgArr[i]+'</li>');
	//alert(imgArr[i]);
	}
if(screen.width<=1024){
$(".jCarouselLite ul.thumbwrap img").css({'width':'550px','height':'149px'});	
	}
$('.header_c').show();
$(".jCarouselLite").jCarouselLite({
    auto: 2000,
    speed: 2000,
	visible:1,
	btnNext: ".next",
	btnPrev: ".prev"
});


///////////////


if(!$.browser.msie){
  $('.premii a').css('opacity', 0.5);
}
$(".premii a").mouseover(function() {
       if(!$.browser.msie){
        $(this).animate({opacity: 1}, 500);
        }
  }).mouseout(function(){
        if(!$.browser.msie){
    $(this).animate({opacity: 0.5}, 500);
        }
  });
  
if ($.browser.msie ) {
 if($.browser.version >8){
	 
$('.premii a').css('opacity', 0.5);
 
 $(".premii a").mouseover(function() {
 $(this).animate({opacity: 1}, 500);
  }).mouseout(function(){   
    $(this).animate({opacity: 0.5}, 500);
  });
  }
}

$(".staffCont").mouseover(function() {
 $(this).addClass('sur');
  }).mouseout(function(){   
   $(this).removeClass('sur');
  });
	
$(".firstLevel").click(function(e){
	if($(this).hasClass("activNow")){
	
	if($(this).next().hasClass('hidden')){
		$(".firstLevel").next().addClass('hidden');
		$(".firstLevel").find('span').removeClass("minus");
		$(".firstLevel").removeClass("activNow");
		$(this).addClass("activNow");
		$(this).next().removeClass('hidden');
		$(this).find('.plus').addClass("minus");
		//$(span).html("hello");
		}else{
		$(this).next().addClass('hidden');
		$(this).find('span').removeClass("minus");
		$(this).removeClass("activNow");
			}
	e.preventDefault();	
		}
	
	})

$("#nav li").hover(
  function () {
	  if($(this).hasClass("activ")){
		 $(this).css("background","url(../img/site/menuGradA.png) repeat-x center"); 
		  } }, function () { }
);	
$(".menu_l a").hover(
  function () {
	  if($(this).hasClass("activNow")){
		 $(this).css({"border":"none","padding-left":"10px"}); 
		  } }, function () { }
);

$("div.bookCont").hover(
  function () {
	  
		 $('.book').addClass('bookA'); 
		 
		  }, function () {$('.book').removeClass('bookA');  }
		  
);		
	

	$("div.searchRow").mouseover(function() {
    $(this).addClass('grey');
	
  }).mouseout(function(){
    $(this).removeClass('grey');
  });
	
	var col2=$('.col2').height();
	var col3=$('.col3').height();
	var col1=$('.col1').height();
	if(col1>=col2 && col1>=col3){
	$('.col2,.col1,.col3').css("min-height",col1+"px");	
		}else if(col2>=col1 && col2>=col3){
		$('.col2,.col1,.col3').css("min-height",col2+"px");		
			}else{
				 $('.col2,.col1,.col3').css("min-height",col3+"px");
				}


$('.titlu').click(function(e){
	e.preventDefault();
	//alert('hello');
	
	if($(this).next().hasClass('newsH')){
		$('.newsContainter a span').removeClass('titleA');
	$('.newsContainter .newsA').removeClass('newsA').addClass('newsH');
	$(this).next().removeClass('newsH').addClass('newsA');
	$(this).children().addClass('titleA');
	}else{
		$(this).next().removeClass('newsA').addClass('newsH');
	$(this).children().removeClass('titleA');
			}
	
	
	
	})
	
	
$("#arhiv").click(function(e){
		e.preventDefault();
		$(".yearC").toggle();
		})
})

function toggle5(showHideDiv, switchImgTag) {
        var ele = document.getElementById(showHideDiv);
        var imageEle = document.getElementById(switchImgTag);
        if(ele.style.display == "block") {
                ele.style.display = "none";
		imageEle.innerHTML = '<img src="img/plus.gif">';
        }
        else {
                ele.style.display = "block";
                imageEle.innerHTML = '<img src="img/minus.gif">';
        }
}
function toggleNews(showHideDiv, switchImgTag) {
        var ele = document.getElementById(showHideDiv);
        var imageEle = document.getElementById(switchImgTag);
        if(ele.style.display == "block") {
                ele.style.display = "none";
		imageEle.style.cssText="font-weight:bold;color:#F93; text-decoration:none;";
        }
        else {
                ele.style.display = "block";
                imageEle.style.cssText="font-weight:bold; color:#F93; text-decoration:underline;";
        }
}
function alfaB(showHideDiv, switchImgTag) {
        var ele = document.getElementById(showHideDiv);
        var imageEle = document.getElementById(switchImgTag);
        if(ele) {
                ele.style.cssText = "font-weight:;color:#ccc; text-decoration:none;font-size:12px;";
		        imageEle.style.cssText="color:#333; font-size:14px;text-decoration:none; font-weight:;";
        }
        
}
function numbers(showHideDiv, switchImgTag) {
        var ele = document.getElementById(showHideDiv);
        var imageEle = document.getElementById(switchImgTag);
        if(imageEle) {
                ele.style.cssText = "color:#333; text-decoration:none; font-weight:;font-size:14px;";
		        imageEle.style.cssText="font-weight:;color:#ccc; text-decoration:none;font-size:12px;";
        }
        
}



