/* 

Bootup Script
v. 2.0

last mod: 7-29-09
by: Mark

jQuery calls.

*/


/*################################################################################## */

// index keys used with list item classes
var $programs = new Array('idb', 'logtech', 'daelp', 'cser', 'log21', 'mxclp', 'lcelp', 'mlcse');				

$(document).ready(function() {	
	
	if ($('#index-content').length > 0) {
		$('#program-nav li').eq(0).addClass('on');
		$('#graphics ul').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '340px' });
	
		var $graphicsList = $.preloadGraphics();
		
		$('#program-nav li a').hover( function() {
			
			/*if ($(this).parent().attr('id') == 'pn-logtech' || $(this).parent().attr('id') == 'pn-daelp') {
				return true;
			}*/
			
			this.hideFocus = true; // hide nasty dotted border on link
			var $program = $(this).attr('rel');
			
			if ($program) {
				$('#program-nav li').removeClass('on');
				$(this).parent().addClass('on');
				$('#graphics ul').replaceWith($graphicsList[$.inArray($program, $programs)]);
				// reload innerfade
				$('#graphics ul').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '340px' });
			}
			
			return false;
		});
	}
	
	if ($('body#logtech').length > 0) {
		var element = $('#main-area').prepend('<div class="solo-headers"><ul><li><img src="/img/logtech_inn-shoulders.jpg" alt="" /></li><li><img src="/img/logtech_inn-classroom.jpg" alt="" /></li></ul></div>');
		element.ready(function() {
			$('.solo-headers ul').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '356px' });
		});
	}
	
	/*if ( ($('body.logtech').length > 0) && ($('body#logtech').length < 1) ) {
		var element = $('#main-area').prepend('<div class="solo-headers"><ul><li><img src="/img/inn_logtech-classroom.jpg" alt="" /></li><li><img src="/img/inn_logtech-shoulders.jpg" alt="" /></li></ul></div>');
		element.ready(function() {
			$('.solo-headers ul').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '356px' });
		});
	}*/
	
	
	if ($('body#daelp').length > 0) {
		var element = $('#main-area').prepend('<div class="solo-headers"><ul><li><img src="/img/daelp_inn-tour.jpg" alt="" /></li><li><img src="/img/daelp_inn-pentagon.jpg" alt="" /></li></ul></div>');
		element.ready(function() {
			$('.solo-headers ul').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '356px' });
		});
	}
	/*
	if ( ($('body.daelp').length > 0) && ($('body#daelp').length < 1) ) {
		var element = $('#main-area').prepend('<div class="solo-headers"><ul><li><img src="/img/inn_daelp-tour.jpg" alt="" /></li><li><img src="/img/inn_daelp-pentagon.jpg" alt="" /></li></ul></div>');
		element.ready(function() {
			$('.solo-headers ul').innerfade({ speed: 'slow', timeout: 10000, type: 'sequence', containerheight: '356px' });
		});
	}*/
	
	
	if ($('form li.radio').length >0 ) {
		
		$('li.radio > fieldset > legend').each(function() {
			$legend = $(this).text();
			$(this).hide();
			$(this).parent().addClass('legend-replaced').prepend('<h2>' + $legend + '</h2>');
		});		
		
	}
	
	
},function(){
	//GUnload();
});