$(function(){
		/* ############### NAVIGATION ############### */
		/*
		$("#nav ul li a",this).hover(function(){
			$(this).parent().css("background","url(img/nav_bg.png) left -27px repeat-x");								
		},function(){
			$(this).parent().css("background","url(img/nav_bg.png) left top repeat-x");
		});
		*/
		/* ############### SCROLL TO TOP ############### */
		$("#totop").click(function(){
			$.scrollTo("#head",800);
			return false;
		});
		setInterval( "slideSwitch()", 5000 );
		/* ############### IE8 FIXES ############### */
		if($.browser.msie  && parseInt($.browser.version) == 8) {
  			$("#nav ul li:last").css("width","140px");
		} else if($.browser.msie  && parseInt($.browser.version) == 7){
			$("#nav ul li:last").css("width","140px");
			$("#nav ul li:last").css("border-right","#e4ef83 1px solid");
		}
});

function slideSwitch() {
    var $active = $('.slide img.active');
    if ( $active.length == 0 ) $active = $('.slide img:last');
    var $next =  $active.next().length ? $active.next()
        : $('.slide img:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
    });
}

function refreshSchnellsuche(laender, veranstalter, reisedauer, preiswahl)
{
    $.ajax({
      url: 'ajax/schnellsuche.ax.php?laender='+laender+'&veranstalter='+veranstalter+'&reisedauer='+reisedauer+'&preiswahl='+preiswahl,
      success: function(data) {
        $("#divSchnellsuche").fadeOut(175);
        $('#divSchnellsuche').html(data);    
        $("#divSchnellsuche").fadeIn(175);
      }
    });
}


function STResizeIFrame(STHeight){
	var STIFrameID  = 'STIFrame'; 
	var STJQuery 	= '0';								//use JQuery
	var STHeightMin  = 1000; 
	if(STHeight < STHeightMin) STHeight = STHeightMin;                
    if(STJQuery == '1'){
		if($("#"+STIFrameID).height() != STHeight){ $("#"+STIFrameID).animate({height: parseInt(STHeight)+60+'px'}, "slow");}
	} else {
		document.getElementById(STIFrameID).height = parseInt(STHeight)+60;
	}
    return false;
}

