$(document).ready(function() {

    switch ( page ) {
        case 'index' :
        case '' :
            $('#frontpageImage').show('slide',{},1000);
            $('#frontpage_introText').fadeIn(6000);
            break;
        case 'mixitup' :
            $('#imagefade').fadeIn(6000); 
            $('#textfade').fadeIn(6000); 
            $('#textfade2').fadeIn(6000); 
            $('#textfade3').fadeIn(6000);
            $('#slide').show('slide',{},1000); 
            break;
        case 'abouttown' :
            $('#fold1').show('fold',{},1000);
            $('#fold2').show('fold',{},1000);
            $('#aboutText').fadeIn(6000);
            $('#scale1').show('scale',{},1000);
            $('#scale2').show('scale',{},1000);
            $('#scale3').show('scale',{},1000);
            $('#scale4').show('scale',{},1000);
            $('#imagefade').fadeIn(6000);
            $('#textfade1').fadeIn(6000);
            break;
        case 'startwithcollisons' :
            $('#imagefade').fadeIn(6000); 
            $('#startWithCollisonsText').fadeIn(6000); 
            $('#textfade1').fadeIn(6000);
            $('#textfade2').fadeIn(6000); 
            $('#textfade3').fadeIn(6000);
            $('#slide').show('slide',{},1000); 
            break;
        case 'about' :
            $('#introText').fadeIn(6000);
            $('#textfade1').fadeIn(6000); 
            $('#textfade2').fadeIn(6000);
            $('#slide').show('slide',{},1000); 
            break;
        case 'join' :
			if (window.location.hash.substr(1) == 'blkcofe')
				$('#textfade2').fadeIn(6000);
			else
            	$('#textfade1').fadeIn(6000);
				 
            break;
        case 'contact' :
            $('#slide1').show('slide',{},1000); 
            $('#slide2').show('slide',{},1000); 
            $('#slide3').show('slide',{},1000); 
            break;
 	case 'press_releases' :
            $('#imagefade').fadeIn(6000); 
            $('#startWithCollisonsText').fadeIn(6000); 
            $('#textfade1').fadeIn(6000);
            $('#textfade2').fadeIn(6000); 
			//$('#textfade3').fadeIn(6000);
	    	$('#textfade4').fadeIn(6000);
			$('#textfade5').fadeIn(6000);
	    	$('#textfade6').fadeIn(6000);
            $('#slide').show('slide',{},1000); 
            break;
	case 'articles' :
            $('#imagefade').fadeIn(6000); 
            $('#startWithCollisonsText').fadeIn(6000); 
            $('#textfade1').fadeIn(6000);
            $('#textfade2').fadeIn(6000); 
            $('#textfade3').fadeIn(6000);
			$('#textfade4').fadeIn(6000);
            $('#slide').show('slide',{},1000); 
            break;
	case 'articleone' :
            $('#imagefade').fadeIn(6000); 
            $('#articlesText').fadeIn(6000); 
            $('#textfade1').fadeIn(6000);
            $('#textfade2').fadeIn(6000); 
            $('#textfade3').fadeIn(6000);
            $('#slide').show('slide',{},1000); 
            break;

	case 'tellusmore' :
            $('#textfade1').fadeIn(6000);
     
            break;

	case 'pr1' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr1_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr2' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr2_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr2_cont_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr3' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr3_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr4' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr4_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr5' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'pr5_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break;
			
	case 'pr6' :
            $('#articlesText').fadeIn(6000); 
         
            break;
			
	case 'pr7' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'article1' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'article1' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'article1_cont' :
            $('#articlesText').fadeIn(6000);  
         
            break;

	case 'article2' :
            $('#articlesText').fadeIn(6000); 
         
            break;

	case 'article2_cont' :
            $('#articlesText').fadeIn(6000);  
         
            break;


	case 'article2_cont_cont' :
            $('#articlesText').fadeIn(6000);  
         
            break;

	case 'article3' :
            $('#articlesText').fadeIn(6000); 
         
            break


	case 'article3_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break

	case 'article4' :
            $('#articlesText').fadeIn(6000); 
         
            break


	case 'article4_cont' :
            $('#articlesText').fadeIn(6000); 
         
            break

    case 'article7' :
            $('#articlesText').fadeIn(6000); 
         
            break

    }

    $('#nav_' + page).css({
                             'color' : '#a4a4a4'
                            ,'text-decoration' : 'underline'
                        });

    $('a').each(function(){
        if ( $(this).attr('rel') == 'external' ) {
            var url = $(this).attr('href');
            if ( '' != url ) {
                $(this).click(function(){
                    window.open(url,'gallery','');
                    return false;
                });
            }
        }
    });

});

