function togglePage(page){
	var obj = $("#"+page);
	$('.pageHolder').each(function(){$(this).hide();});
	$(obj).show();
	if (page == "techContainer") {
		$('#techContainer').trigger('select');
	}
	var target = thisMovie('FlashID');
	target.changeActive(page);
}

function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
	   return window[movieName];
    } else {
	   return document[movieName];
    }
}


function toggleCategory(target,section) {
	if($('#'+section).css('display') != 'none') {
		
		$('#'+section).slideUp('fast');
		
		i = $(target).find("img:eq(0)");
		newp = $(i).attr('src').replace('_minus','_plus');
		$(i).attr('src',newp);
	
	} else {
	
		$('#'+section).slideDown('fast');
		
		i = $(target).find("img:eq(0)");
		newp = $(i).attr('src').replace('_plus','_minus');
		$(i).attr('src',newp);
	
	}
}

function showVideo() {
	var vid = $.fn.colorbox({innerWidth:770,innerHeight:520,href:"/video.html",iframe:true});
}

$(document).ready(function(){
	$('#techContainer').select(function() {
		if ($('.categoryContainer').length > 0) {
			$('.categoryContainer').not(':first').each(function(){
				var target = $(this).children().eq(0);
				var section = $(this).children().eq(1).attr('id');
				$('#'+section).slideUp('fast');
		
				i = $(target).find("img:eq(0)");
				newp = $(i).attr('src').replace('_minus','_plus');
				$(i).attr('src',newp);
			});
		}
	});
});
