// JQUERY START
$(document).ready( function() {

	// JQUERY LIGHTBOX
	$(function() {
		$('.jquery-lightbox').lightBox({fixedNavigation:false});
	});

	// FLOATING ACTION BAR
    var msie6 = $.browser == 'msie' && $.browser.version < 7;
    if (!msie6) {
	    $(window).scroll(function() {
	    	//console.log('test', $(window).scrollTop());
			if ($(window).scrollTop() > '205') {
				$('#floating-action-bar').css('display', 'block');	
			}
			if ($(window).scrollTop() < '205') {
				$('#floating-action-bar').css('display', 'none');	
			}
	    });    
    }
    
    // MAILING LISTS MODULE
    var text1 = 'Write or paste anything here and valid e-mail addresses will be automatically added to this mailing-list...';
   	var text2 = 'Write or paste anything here and valid e-mail addresses will be automatically removed from this mailing-list...';
    $('#emails-add').click(function() {
    	if ($('#emails').val() == '' || $('#emails').val() == text2) {
	    	$('#emails').val(text1);
	    }
    });
    $('#emails-remove').click(function() {
    	if ($('#emails').val() == '' || $('#emails').val() == text1) {
	    	$('#emails').val(text2);
	    } 
	});
    $('#emails').focus(function() {
    	if ($(this).val() == text1 || $(this).val() == text2) {
	    	$(this).val('');
	    }     	
    });
    $('#emails').blur(function() {
    	if ($(this).val() == '') {
    		if ($("#edit_form input[type='radio']:checked").val() == 'remove') {
	    		$('#emails').val(text2);
    		} else if ($("#edit_form input[type='radio']:checked").val() == 'add') {
	    		$('#emails').val(text1);
    		}
	    }     	
    });	
        	
});    



function ToggleThisElement(id) {
	if( document.getElementById(id).style.display == "block" ) {
	document.getElementById(id).style.display="none";
	} else {
	document.getElementById(id).style.display="block"; }	
}





function ShowThisElement(id) {
	if( document.getElementById(id).style.height == "auto" ) {
	document.getElementById(id).style.height="1px";
	} else {
	document.getElementById(id).style.height="auto"; }	
}
