// JavaScript Document
$(document).ready(function() {
//Hide navigation to being with
	$('ul.nav').hide();
//slide down navigation over a 3sec period
	$('ul.nav').slideDown(1000);
//Add hover soundeffect to navigation
   $('.nav a').hover(function() {
			$(this).css('paddingLeft','20px');
							   },function() {
							   $(this).css('paddingLeft','10px');
							   });
$('.close a').click(function(){
							 return false;
							 });
$('.close a').click(function() {
							 $('#SocialPlug').hide(1000);
							  });
	
	
//Add link hints
	$('#Content a[href$=pdf]').addClass('pdf');
	$('.rightcontainer a[href$=com]').addClass('com');
	$('.agencies a[href$=com]').addClass('com');
	$('.agencies a[href$=vc]').addClass('com');
//Add color to odd milestone listings
	$('.senic img').addClass('senicPic');					   
				   
						   
	
});
	/**
	 * render the flash embed for those crazy mp3 soundz ... yeah rock�n roll
	 *
	 */
	function insertPlayer(){

		var soundz = ['sound6.mp3']

	    var playerpath	= 'flash/singlemp3player.swf';
		var path		= 'sound/';
		var filename	= path + soundz.random();

		var mp3html = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
		mp3html += 'width="1" height="1" ';
		mp3html += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">';
		mp3html += '<param name="movie" value="'+playerpath+'?';
		mp3html += 'showDownload=false&file=' + filename + '&autoStart=true';
		mp3html += '&backColor=ffffff&frontColor=ffffff';
		mp3html += '&repeatPlay=false&songVolume=50" />';
		mp3html += '<param name="wmode" value="transparent" />';
		mp3html += '<embed wmode="transparent" width="1" height="1" ';
		mp3html += 'src="' + playerpath + '?'
		mp3html += 'showDownload=false&file=' + filename + '&autoStart=true';
		mp3html += '&backColor=ffffff&frontColor=ffffff';
		mp3html += '&repeatPlay=false&songVolume=50" ';
		mp3html += 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
		mp3html += '</object>';
		return mp3html;

	}
/* takes an array and returns a random element*/
Array.prototype.random = function( r )
{
	var i = 0, l = this.length;
	if( !r ) { r = this.length; }
	else if( r > 0 ) { r = r % l; }
	else { i = r; r = l + r % l; }
	return this[ Math.floor( r * Math.random() - i ) ];
};


