// fixes $ / mrm.$ jQuery conflict call between site and gmds app
var mrm = mrm || {}; mrm.$ = mrm.$ || jQuery;

$(document).ready( function(){
	$( 'div#primaryNavigation > ul' ).fill({
		elements : 'li',
		fill     : 'li#blackFill'
	});

	$( 'li#vehicles, li#vision, li#company' ).primaryNavigationSlideDown();

	$( 'li#GMLogo' ).click( function(){
		location.href = "http://www.gm.com/";
	});

	$( 'li#contactUs, li#allGMSites' ).each( function(){
		if( typeof( Cufon ) == 'function' && Cufon.replace ){
			Cufon.replace( $( this ).children( 'h2' ).children( 'a' ), { fontFamily: 'gotham-bold', hover: true });
		}
	});

	$( 'li#search > form input' ).focus( function(){
		if( $( this ).attr( 'value' ) == 'SEARCH' )
			$( this ).attr( 'value', '' )
	}).blur( function(){
		if( $( this ).attr( 'value' ).length <= 0 )
			$( this ).attr( 'value', 'SEARCH' );
	});
});
