$(document).ready(function() {
	
	if($('#slider').length) {
		$("#slider").show();
		$("#slider").easySlider({
			auto: true,
			continuous: true,
			nextId: "slider1next",
			prevId: "slider1prev",
			speed: 2000,
			pause: 3500
		});
	}
	
	$("button#link").each(function(){
		$(this).bind("click", function(){
			$(location).attr('href', $(this).attr('rel'));
		});
	});
	
	$('#colorhover-oilrig').bind('mouseenter', function() {
		swap($(this));
	});
	
	$('#colorhover-oilrig').bind('mouseleave', function() {
		swap($(this));
	});
	
	$('#colorhover-oilrig-ocean').bind('mouseenter', function() {
		swap($(this));
	});	
	
	$('#colorhover-oilrig-ocean').bind('mouseleave', function() {
		swap($(this));
	});	
	
	function swap(div) {
		var base = div.attr('rel');
		if (div.hasClass(base+'-color')) {
			div.removeClass(base+'-color');
		} else {
			div.addClass(base+'-color');
		}
	}
});

jQuery(document).bind("ready", function(event) {
    jQuery(".placeholder").each(function(i) {
        
        var item = jQuery(this);
        var text = item.attr('rel');
        var form = item.parents('form:first');

        if (item.val() === "" || item.val() === text) {
            item.val(text);
            item.css("color", "#888");
        }
        
        item.bind("focus.placeholder", function(event) {
            if (item.val() === text)
                item.val("");
            item.css('color', "");
        });
        
        item.bind("blur.placeholder", function(event) {
            if (item.val() === ""){
                item.val(text);
            	item.css("color", "#888");
            }
        });
        
        form.bind("submit.placeholder", function(event) {
          if (item.val() === text)
            item.val("");
        });     
        
    });
});	
