// turn on what states have properties	- must be lowercase
var state_arr = ["mn", "ia", "mo", "mi", "wi", "il", "in", "oh", "fl", "nc", "sc", "ks"];

// flash checks for this function before initializing. 
function isReady() {
	return true;
}

// as soon as it initializes, Flash asks js what the states are
function activateStates() {
	return state_arr;
}


// when a state is clicked on map, Flash will tell JS which state was clicked through this function
function showLocation(state) {
	//alert(state);
	switch(state) {
		case 'mn':
			$('div.intro').hide();
			$('div.state').hide();
			$('.mn').show();	
			
			sIFR.replace(univers_thin_uc, {
			  selector: 'h6',
			  css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
			});
			sIFR.replace(univers_light_uc, {
			  selector: 'h3',
			  css: '.sIFR-root {color: #333333;}'
			});
			$('.map_col').css({'top':'425px'});
		break;

        case 'wi':
            $('div.intro').hide();
            $('div.state').hide();
            $('.wi').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;
            
		case 'ia':
			$('div.intro').hide();
			$('div.state').hide();
			$('.ia').show();
			sIFR.replace(univers_thin_uc, {
			  selector: 'h6',
			  css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
			});
			sIFR.replace(univers_light_uc, {
			  selector: 'h3',
			  css: '.sIFR-root {color: #333333;}'
			});
			$('.map_col').css({'top':'425px'});
		break;

        case 'mo':
            $('div.intro').hide();
            $('div.state').hide();
            $('.mo').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'mi':
            $('div.intro').hide();
            $('div.state').hide();
            $('.mi').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'il':
            $('div.intro').hide();
            $('div.state').hide();
            $('.il').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'in':
            $('div.intro').hide();
            $('div.state').hide();
            $('.in').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'oh':
            $('div.intro').hide();
            $('div.state').hide();
            $('.oh').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'fl':
            $('div.intro').hide();
            $('div.state').hide();
            $('.fl').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'nc':
            $('div.intro').hide();
            $('div.state').hide();
            $('.nc').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;

        case 'sc':
            $('div.intro').hide();
            $('div.state').hide();
            $('.sc').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;
			
        case 'ks':
            $('div.intro').hide();
            $('div.state').hide();
            $('.ks').show();

            sIFR.replace(univers_thin_uc, {
                selector: 'h6',
                css: '.sIFR-root {color: #fa7b13; font-size: 50px; font-weight: normal; padding: 0 0 0 0; margin: 0 0 0 0;}'
            });
            sIFR.replace(univers_light_uc, {
                selector: 'h3',
                css: '.sIFR-root {color: #333333;}'
            });
            $('.map_col').css({ 'top': '425px' });
            break;
	}	
}


$(document).ready(function(){
			$('div.state').hide();
		
		//MN Pager
		$('#mn_container').pajinate({
			items_per_page : 8,
			item_container_id : '.mn_content',
			nav_panel_id : '.mn_nav'

        });

        //WIPager
        $('#wi_container').pajinate({
            items_per_page: 3,
            item_container_id: '.wi_content',
            nav_panel_id: '.wi_nav'
        });
		
		//IA Pager
		$('#ia_container').pajinate({
			items_per_page : 8,
			item_container_id : '.ia_content',
			nav_panel_id : '.ia_nav'

        });

        //MO Pager
        $('#mo_container').pajinate({
            items_per_page: 3,
            item_container_id: '.mo_content',
            nav_panel_id: '.mo_nav'
        });

        //MI Pager
        $('#mi_container').pajinate({
            items_per_page: 8,
            item_container_id: '.mi_content',
            nav_panel_id: '.mi_nav'
        });

        //IL Pager
        $('#il_container').pajinate({
            items_per_page: 8,
            item_container_id: '.il_content',
            nav_panel_id: '.il_nav'
        });

        //IN Pager
        $('#in_container').pajinate({
            items_per_page: 8,
            item_container_id: '.in_content',
            nav_panel_id: '.in_nav'
        });

        //OH Pager
        $('#oh_container').pajinate({
            items_per_page: 8,
            item_container_id: '.oh_content',
            nav_panel_id: '.oh_nav'
        });

        //FL Pager
        $('#fl_container').pajinate({
            items_per_page: 8,
            item_container_id: '.fl_content',
            nav_panel_id: '.fl_nav'
        });

        //NC Pager
        $('#nc_container').pajinate({
            items_per_page: 8,
            item_container_id: '.nc_content',
            nav_panel_id: '.nc_nav'
        });

        //SC Pager
        $('#sc_container').pajinate({
            items_per_page: 8,
            item_container_id: '.sc_content',
            nav_panel_id: '.sc_nav'
        });
		
		//KS Pager
        $('#ks_container').pajinate({
            items_per_page: 8,
            item_container_id: '.ks_content',
            nav_panel_id: '.ks_nav'
        });
		

	    $(".previous_link").after('<div class="pipe"> | </div>');		
});	
