// JavaScript Document

$(document).ready(function() {
	
	 $('.mainmenu a').text(function() {
		text = $(this).text();
	    $(this).html('<div>'+text+'</div>');
		
	});
	$('.mainmenu a div').css('padding-top','6px');	
	$('.mainmenu a div').css('margin-left','10px');	
	
	
	
	$('.footer_links_left .footer_list_spacer').html('|');
	$('.footer_links_left .footer_list_spacer:last').html('');
	
	$('.mainmenu a:last').removeAttr('target');
	$('.mainmenu a:last').attr('target','_blank');
	
	
	
	var i = 0;
	
	
	$('#newsticker_scale').append('<div>+++</div>');
	
	
	browser = "MSIE 7.0"
	browser2 = "MSIE 8.0"
	agent = navigator.userAgent.toLowerCase();  
	multi = 2.5;
	if ( (agent.indexOf(browser.toLowerCase())>-1) || (agent.indexOf(browser2.toLowerCase())>-1) ) { 
		multi = 3.5;
	} 
	
	ntwidth = $('#newsticker_scale').html().length*multi;
	

	
	$('#newsticker_scale').css('width',ntwidth+'px');
	
	setInterval(function() {
		
		
		$('#newsticker_scale').css('margin-left',i+'px');
		
		if(i <= ntwidth*-1) {
			i = 280;
		}
		
		i--;
		
		
		
	}, 50);
  	
	
});


$(function(){
	
	$('#bestellform_button').click(function() {
		
		
		
		
		
			
	});
	
});



function check_bestellform () {
	
	check = new Array('email','firma','sachbearbeiter','name','strasse','plz_ort');
		
		checki = 0;
		for(i=0; i <= check.length-1; i++) {
			if( $('#'+check[i]+'').val() == "") {
				$('#'+check[i]+'').css('border','1px solid #ff0000');
				checki = checki + 1;
			} else {
				if(checki > 0) {
					checki = checki - 1;
				}
			}
			
		}
		
		if(checki == 0) {
			document.forms.bestellform.submit();
		}
		
		
}
