// jQuery Code
$(document).ready(function(){  
   $("a.lien").hover(function() {
     $(this).addClass("menuHighlight");
   },function(){
     $(this).removeClass("menuHighlight");
   });
   
   $("a.footer_href").hover(function() {
     $(this).addClass("menuHighlight");
   },function(){
     $(this).removeClass("menuHighlight");
   });
   
   // Hide onLoad Div Id Note
   $("#note").css({display:'none', cursor:'pointer'});
   
   // Show/Hide
   $("#note").click(function(){
      if($("#note").is(":visible") == true){
   		 $("#note").slideUp('slow');
	  }
   });
      
   $("span.note").css({cursor:'pointer'}).click(function() {
     if($("#note2").is(":visible") == true){
	     $("#note2").hide();
	  }
     if($("#note").is(":visible") == true){
       $("#note").slideUp('slow');
	 }
	 else {
	   $("#note").slideDown('slow');
	 }
   });
   
   // Hide onLoad Div Id Note 2
   $("#note2").css({display:'none', cursor:'pointer'});
   
   // Show/Hide
   $("#note2").click(function(){
      if($("#note2").is(":visible") == true){
   		 $("#note2").slideUp('slow');
	  }
   });
      
   $("span.note2").css({cursor:'pointer'}).click(function() {
     if($("#note").is(":visible") == true){
	     $("#note").hide();
	 }
     if($("#note2").is(":visible") == true){
       $("#note2").slideUp('slow');
	 }
	 else {
	   $("#note2").slideDown('slow');
	 }
   });
   
   // Hide onLoad Div Id PictureForm
   $("#PictureForm").css({display:'none'});
   
   // Show/Hide 
   $("span.pictureForm").css({cursor:'pointer'}).click(function() {
     if($("#PictureForm").is(":visible") == true){
       $("#PictureForm").slideUp('fast');
	 }
	 else {
	   $("#PictureForm").slideDown('fast');
	 }
   });
   
   // loadForm Check
   $("#frmloadForm-save").click(function(){
   
   		if($("#frmloadForm-file").val() != ''){
			
			$(this).attr('disabled', 'disabled');
			
			var mess = '<span style="font-size: 10pt; color:red; background-color:lightyellow"><b>Čakajte na nahratie súboru. Može to trvať niekoľko minút...</b></span>';
			
			var messCont = $(document.createElement('div')).css({display:'block'});
			
			messCont.append(mess);
			
			$("#PictureForm").append(messCont);
			
		}
   
   		
   
   });
   
   
   // Delete confirmation
   $(".actions a").click(function(){
   
        var title = $(this).attr('title');
		
		if(title == 'Zmazať'){
			var del = confirm('Naozaj chcete vymazať túto položku?');
			if(del==true){
				$.get($(this).attr('href'));
			}
			return false;
		} else {
			return true;
		}
   
   });
   
   
});



// Delete confirming function
function confirmDelete(presenter)
{
var del=confirm('Naozaj chcete vymazať túto položku?');
  if (del==true)
  {
	 //self.location=url+'delete';
	 window.location='http://www.mbmartworks.sk/';
  }
  else
  {
  	 alert(presenter);
	 self.location='index.php';
  }
}