var $ukw = jQuery.noConflict();
$ukw(function(){
    $ukw('#navi .page a').removeAttr('title');
    $ukw('#header-meta-box li').hover(
		function(){
			$ukw('div', $ukw(this)).slideDown('fast');
    },
		function(){
			$ukw('div', $ukw(this)).fadeOut('fast');
    });
});

//----------- Lightbox ------------------------------------------------------------------
function ukw_dim() {
	if($ukw("#ukw_dim").css("display")=="none") {
		var filter="Alpha(opacity=70)";
		var perc=0.7;
		var el=document.getElementById("ukw_dim").style;
		el.filter=filter; el.MozOpacity=perc; el.KhtmlOpacity=perc; el.opacity=perc;
		$ukw('#ukw_dim').fadeIn(100,function(){ $ukw("#lightbox-radio-pos, #lightbox-content").css('top',($ukw(window).scrollTop()+100)+'px').show(); }).click(function(){ ukw_dim(); });
		$ukw('#ukw_send_bet').unbind().click(function(){ dim(id, 1, url); });
	}
	else {
		$ukw("div[id$='-pos']").hide();
		$ukw('#confirmation').hide();
		$ukw('#lightbox-content').hide();
		$ukw('#ukw_dim').unbind().fadeOut(100);
	}
}

function ukw_change(step) {
	if(step==0) {
		$ukw('#lightbox-radio-pos').css('display','block');
		$ukw('#lightbox-input-pos').css('display','none');
		$ukw('#lightbox-content').css('height','800px');
	}
	if(step == 1) {
		$ukw('#lightbox-radio-pos').css('display','none');
		$ukw('#lightbox-input-pos').css('display','block');
		$ukw('#lightbox-content').css('height','800px');
	}
	if(step==2) {
		$ukw('#lightbox-input-pos').css('display','none');
		$ukw('#confirmation').css('display','block');
		$ukw('#lightbox-content').css('height','800px');
	}
}

function send() {
	
	$ukw('input').css('borderColor', '#542e08');
	$ukw('#error_msg').html('');
	
	if($ukw('input[name="mitarbeiter"]').val() == '') {
		$ukw('input[name="mitarbeiter"]').css('borderColor', '#ff0000');
		$ukw('#error_msg').html('Bitte geben Sie die Anzahl Ihrer Mitarbeiter an!');
		return false;
	}
	if($ukw('input[name="vorname"]').val() == '') {
		$ukw('input[name="vorname"]').css('borderColor', '#ff0000');
		$ukw('#error_msg').html('Bitte geben Sie ihren Vornamen an!');
		return false;
	}
	if($ukw('input[name="nachname"]').val() == '') {
		$ukw('input[name="nachname"]').css('borderColor', '#ff0000');
		$ukw('#error_msg').html('Bitte geben Sie ihren Nachnamen an!');
		return false;
	}
	if($ukw('input[name="email"]').val() == '') {
		$ukw('input[name="email"]').css('borderColor', '#ff0000');
		$ukw('#error_msg').html('Bitte geben Sie ihre Emailadresse an!');
		return false;
	}

	var dat = $ukw('form#lightbox-input-form').serialize();
	$ukw.post('../mail/ukw_mail.php',dat, function(data){
		ukw_change(2);
	});
}

