var launchColorbox = false;
$(document).ready(function() {
	//* SCROLLING TICKER ON SIDEBAR */
	$('#news-ticker').vTicker({ 
		speed: 1500,
		pause: 6000,
		showItems: 1
	});
	$('#projects-ticker').vTicker({ 
		speed: 1500,
		pause: 4000,
		showItems: 3
	});	
	$('#exhibits-ticker').vTicker({ 
		speed: 1500,
		pause: 8000,
		showItems: 1
	});	
	/* JOINING MAILING LIST */	
    $(".black-field").focus(function() {
		var e = $(this);
        if (e.val() == e.attr('title')) {
            e.val("");
        }
    });
    
    $(".black-field").blur(function() {
		var e = $(this);									
        if (e.val() == "") {
            e.val(e.attr('title'));
        }
    });
    
    $(".black-field").blur();	
	/* SUBMITTING FORM */
	$('#mailing-list').submit(function() {
		$('#mailing-list-button').hide();
		$('#mailing-list-loading').show();
		$.ajax({
			type: "POST",
			url: "/php/join-mailing-list.php",
			data: 	"fullname=" + document.getElementById("fullname").value + 
					"&email=" + document.getElementById("email").value + 
					"&phone=" + document.getElementById("phone").value,
			success: function(html){
				$('#mailing-list-button').show();
				$('#mailing-list-loading').hide();
				$('#join-mailing-list-form').hide();
				$('#join-mailing-list-response').show();
				$("#join-mailing-list-response").html(html);
			}
		});		  
	  return false;
	});
	/* EXTERNAL LINKS OPEN NEW WINDOW */
	$('a[href^="http://"]').attr('target', '_blank');
	/* MEGA MENU DROP DOWN */
	$(".megamenu").megamenu();
});
/* SHOW FORM AGAIN ON ERROR */
function showform() {
	$('#join-mailing-list-form').show();
	$('#join-mailing-list-response').hide();
}
