
jQuery.noConflict();
jQuery(document).ready(function($){

 	
function label2value() {

	// CSS class names
	// put any class name you want
	// define this in external css (example provided)
	var inactive = "inactive";
	var active = "active";
	var focused = "focused";
	
	// function
	$("label").each(function(){		
		obj = document.getElementById($(this).attr("for"));
		if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){			
			$(obj).addClass(inactive);			
			var text = $(this).text();
			$(this).css("display","none");			
			$(obj).val(text);
			$(obj).focus(function(){	
				$(this).addClass(focused);
				$(this).removeClass(inactive);
				$(this).removeClass(active);								  
				if($(this).val() == text) $(this).val("");
			});	
			$(obj).blur(function(){	
				$(this).removeClass(focused);													 
				if($(this).val() == "") {
					$(this).val(text);
					$(this).addClass(inactive);
				} else {
					$(this).addClass(active);		
				};				
			});				
		};	
	});		
};
// on load

label2value();	
 });

 function newsletterSubscribe() {
    var email = jQuery('#newsletter_field').val();
    var data = 'email=' + email;
    jQuery.ajax({
        type: 'POST',
        url: 'http://www.ods2.com/subscribe.php',
        data: data,
        success: function(responseData) {
            if (responseData == 'ok') {
                alert('We have added you to our mailinglist. Thanks for subscribing.');
            } else {
                alert('Sorry.' + "\n" + 'We were unable to process your request.'+"\n"+'Maybe you filled a invalid emailaddress, or you are already on our mailinglist.');
            }
        }
    });
}
