function slideSwitch() {
    var $active = $('.slideshow img.active');
    if ( $active.length == 0 ) $active = $('.slideshow img:last');
    var $next =  $active.next().length ? $active.next() : $('.slideshow img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0}).addClass('active').animate({opacity: 1.0}, 1000, function() {
        $active.removeClass('active last-active');
        });
	$active.animate({opacity: 0.0}, 990);
	
}

function closeerr()
{
 $('#errdiv').css({'display':'none'});
}

   function show() {
     var menu = $(this);
     menu.children(".submenu").fadeIn(150);
   }
  
   function hide() { 
     var menu = $(this);
     menu.children(".submenu").fadeOut(150);
   }


function changeMusic(value)
{
 $.post("index.php", { bgmusic: value } );
}

$(document).ready(function(){

$(function() {
    setInterval( "slideSwitch()", 3000 );
});

$(".hover-menu").hoverIntent({
     sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)
     interval: 50,   // number = milliseconds for onMouseOver polling interval
     over: show,     // function = onMouseOver callback (required)
     timeout: 300,   // number = milliseconds delay before onMouseOut
     out: hide       // function = onMouseOut callback (required)
   });
   
   $('.pajanlatkeres input').focus(function(){
    if($(this).val() == $(this).attr('rel') ) $(this).val('');
   });
   $('.pajanlatkeres textarea').focus(function(){
    if($(this).val() == $(this).attr('rel') ) $(this).val('');
   });
   $('.pajanlatkeres input').blur(function(){
    if($(this).val() == '' ) $(this).val($(this).attr('rel'));
   });
   $('.pajanlatkeres textarea').blur(function(){
    if($(this).val() == '' ) $(this).val($(this).attr('rel'));
   });

});
