

//ubacuje captcha kod
function codeChange () {

	$.post(urlAkcija, {page: 'codeChange'},
		function(data) {
			
			if (data) {
				$('.codeChange').html(data);
			} 
			
		}
	);
	
}


//ispis obavestenja
function info (text) {
	
	if ($('.obavesetenje_info').length) {
		
		$('.obavesetenje_info').append('<br /><hr>'+text+' <a onclick="infoClose();"><img src="/js/close.png" /></a>');
		
	} else {
		
		$('body').prepend('<div class="obavesetenje_info">'+text+' <a onclick="infoClose();"><img src="/js/close.png" /></a></div>');
		$('body').prepend('<div class="loader_obavesetenje"></div>');
		
	}
	
	$('.loader_obavesetenje').fadeIn('slow',function(){
		$('.obavesetenje_info').animate({'top':'20px'},500);
	});
	
}



//rucno zatvaranje info
function infoClose () {

	$(".obavesetenje_info").remove();
	$(".obavesetenje_info").fadeOut("slow");
	$(".loader_obavesetenje").remove();
	$(".loader_obavesetenje").fadeOut('slow');
	
}




//funkcija za jumpmenu
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}




function selectChange () {

	var ID_select = document.getElementById('select_votre').value;
	
    $('.box1').hide();
		$('.box2').hide();
		$('.box3').hide();
		$('.box4').hide();
	
	if (ID_select == "Stockage en box") {
		
		//$('.radio3').addClass('required');
		$('.box1').show();
		$('.box2').hide();
		$('.box3').hide();
		$('.box4').hide();
		$('.box2 select').attr("disabled", true);
		$('.box3 input').attr("disabled", true);
		$('.box3 select').attr("disabled", true);
		$('.box4 input').attr("disabled", true);
		$('.box1 input').removeAttr("disabled");
			
		
	}
	
	if (ID_select == "Stockage en vrac") {
		
		//$('.radio3').removeClass('required');
		$('.box2').show();
		$('.box1').hide();
		$('.box3').show();
		$('.box4').hide();
		$('.box1 input').attr("disabled", true);
		$('.box4 input').attr("disabled", true);
		$('.box2 select').removeAttr("disabled");
		$('.box3 input').removeAttr("disabled");
		$('.box3 select').removeAttr("disabled");
			
		
	}
	
	
	
}


function selectForm () {

	var ID_select = document.getElementById('select_gardiennage').value;
	
	if (ID_select == "Palette") {
		
		//$('.radio3').addClass('required');
		$('.box3').show();
		$('.box4').hide();
		$('.box4 input').attr("disabled", true);
		$('.box3 input').removeAttr("disabled");
		$('.box3 select').removeAttr("disabled");
			
		
	}
	
	if (ID_select == "Gardiennage de véhicule") {
		
		//$('.radio3').removeClass('required');
		$('.box4').show();
		$('.box3').hide();
		$('.box3 input').attr("disabled", true);
		$('.box3 select').attr("disabled", true);
		$('.box4 input').removeAttr("disabled");
			
		
	}
	
	
	
}





$(document).ready(function() {
	
	$('.box2 select').attr("disabled", true);
	
	//provera forme
	$("#form_chk").validate();
	
	
	//galerija
	$(".galerijaPhoto").fancybox({
	   'titleShow'		: false
	});
	
	
	selectChange ();


});


//$('#heder').html(x_poz +', '+ y_poz);
//window.alert(slikaW);
