function checkIe6() {
	if(is_ie6) {
		alert("Uw browser wordt niet ondersteund.\n\nOm deze website goed weer te geven kunt u gebruik maken van bijvoorbeeld Mozilla Firefox, Microsoft Internet Explorer 7 of Apple Safari.");
	}
}

function bindMenu() {
	$(".menu-item").each(function(i) {
		if(this.id != "menu-home" && this.id != "menu-contact" && this.id != "menu-events" && this.id != "menu-conceptdevelopment") {
			$(this).bind("mouseover", function(e) {
				id = this.id;
				showSubmenu();
				$(this).attr("src", "static/img/"+this.id.replace("-", "/nl/")+"-on.gif");
			});
			$(this).bind("mouseout", function(e) {
				id = this.id;
				timeHideSubmenu();
				$(this).attr("src", "static/img/"+this.id.replace("-", "/nl/")+"-off.gif");
			});
		} else {
			$(this).bind("mouseover", function(e) {
				id = this.id;
				hideSubmenu();
				$(this).attr("src", "static/img/"+this.id.replace("-", "/nl/")+"-on.gif");
			});
			$(this).bind("mouseout", function(e) {
				$(this).attr("src", "static/img/"+this.id.replace("-", "/nl/")+"-off.gif");
			});
		}
	});
	$(".submenu").each(function(i) {
		$(this).bind("mouseover", function(e) {
			showSubmenu();
		});
		$(this).bind("mouseout", function(e) {
			timeHideSubmenu();
		});
	});
}


function sms() {
	$("#sms-response").html("<img src=\"static/img/loader.gif\" /> SMS verzenden...");
	$.get("application/ajax/sendSMS.php", { number:$("#sms").val() }, function(r) {
		if(r == "200") {
			$("#sms-response").html("SMS verzonden!");
		} else {
			$("#sms-response").html("Mislukt. Controleer nummer.<br /><a href=\"javascript:restoreSMS();\">Probeer opnniew</a>");
		}
	});
}

function restoreSMS() {
	$("#sms-response").html("<input type=\"button\" value=\"SMS mij\" onclick=\"sms();\" id=\"sms-button\" />");
}

function valContactForm() {
	if($("#contact-form-name").val() == "" || $("#contact-form-email").val() == "") {
		$("#contact-form-response").html("<input type=\"button\" value=\"Verzenden\" id=\"contact-button\" onclick=\"valContactForm();\" />&nbsp;&nbsp;Niet alle verplichte velden zijn ingevuld.");
	} else {
		$("#contact-form-response").html("<img src=\"static/img/loader2.gif\" /> Formulier verzenden...");
		var dCompany = $("#contact-form-company").val();
		var dName = $("#contact-form-name").val();
		var dEmail = $("#contact-form-email").val();
		var dPhone = $("#contact-form-phone").val();
		var dInfo = $("#contact-form-info").val();
		$.post("application/ajax/sendForm.php", { company:dCompany, name:dName, email:dEmail, phone:dPhone, info:dInfo }, function(r) {
			if(r == "") {
				$("#contact-form-response").html("Formulier verzonden! We nemen z.s.m. contact met u op.");
			} else {
				$("#contact-form-response").html("Mislukt.");
			}
		});
	}
}

function getRSS() {
	$("#rss-news").fadeOut(function() {
		$.get("application/ajax/getRSS.php", { i:rss, l:'nl' }, function(r) {
			$("#rss-news").html(r);
			$("#rss-news").fadeIn();
			if(rss == 9) {
				rss = 0;
			} else {
				rss++;
			}
			setTimeout("getRSS()", 5000);
		});
	});	
}
