$(document).ready(function($) {  
    // open a link in a new window, this is valid target="_blank" is not.
    $('a.blank').click(function(){ 
        window.open(this.href);
        return false;
    })
    
    // jquery flash plugin
    $('#jobmap').flash({    
        swf: '/swfs/map-jobs.swf', 
		height: 310,
		width: 440,
        wmode: 'transparent',   
        flashvars: {   name1: 'jQuery'   }   
    });
	
	$(".sf-menu a img, #slider li a img").hover(
		function(){
			orig_img = $(this).attr("src");
			over_img = $(this).attr("rel");
			$(this).attr('src',over_img);
		},
		function(){
			$(this).attr('src',orig_img);}
	);

	$(".sf-menu a img, #slider li a img").click(
		function(e){

			$(this).attr('src',orig_img);
		}
	);
    
    $('form .clearme').focus(function(){
    	var orig_text = $(this).attr('rel');
    	var value = $(this).val();
    	if(orig_text == value){
    		$(this).val("");
    	}
    });
    $('form .clearme').blur(function(){
    	var orig_text = $(this).attr('rel');
    	var value = $(this).val();
    	if(value == ""){
    		$(this).val(orig_text);
    	}
    });
    
    
    $(".employee_link").toggle(
    	function(){
    		$("#login_box").show();
    		$(".employee_login").addClass('active');
    	},
    	function(){
    		$("#login_box").hide();
    		$(".employee_login").removeClass('active');
    	}
    		
    );
    
    $('img[data-hover]').hover(function() {
        $(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
    }).each(function() {
        $('<img />').attr('src', $(this).attr('data-hover'));
        
    });;
}); // end ready
