function mainmenu(){
$('#mainMenu ul').css({'display' : 'none'}); // Opera Fix
$('#mainMenu li').hover(function(){
	
	$(this).siblings().find('ul').stop(true,true).css({ 'display' : 'none' });
	$(this).find('ul:first:hidden').css({ 'visibility' : 'visible', 'display' : 'none' }).slideDown(200);
	},function(){
	$(this).find('ul:first').stop(true,true).css({ 'display' : 'none' });
	
	
	/*
	$(this).find('ul:first:hidden').css({ 'visibility' : 'visible' , 'display' : 'none' }).slideDown(400);
	},function(){
	$(this).find('ul:first').css({visibility: 'hidden'});
	*/
	
	});

}

function mollifyIE6(){ 
$('#mainMenu li a, #secondaryMenu li a, #mainMenu li div.extra').each(function () {
	tempReplacement = $(this).css("background-image").replace('.png','.gif');
	$(this).css('background-image', tempReplacement);
	});
}

function languagesSideClickee(){ 
$('#languagesSideClickee').click(function () {
	$('#languagesSideBlob').slideToggle(400);
	});
}

function filetypesPlusClickee(){ 
$('#filetypesPlusClickee').click(function () {
	$('#filetypesPlusBlob').slideToggle(900);
	});
}

 $(document).ready(function(){
	mainmenu();
	languagesSideClickee();
	filetypesPlusClickee();
});



/*** bios ****/
var containertoopen;
$(function() {
	$('img.more').click(function() {
		if ( containertoopen == $(this).attr('hover') ) {
			$('div#' + containertoopen).slideUp();
			containertoopen = '';
		}
		else {
			containertoopen = $(this).attr('hover');
			$('div#' + containertoopen).slideDown();
		}
		
	});
});

/*** language box ***/
var languageopen = 0;
$(function() {
	$('span#language_openbox').click(function() {
		if ( languageopen == 1 ) {
			$('div.language_container').slideUp();
			languageopen = 0;
		}
		else {
			languageopen = 1;
			$('div.language_container').slideDown();
		}
		
	});
});


/************************	Tube Actions	***********************/
var currentbar;
$(function() {
	$('.rollover').hover(function() {

		var currentImg = $('img#' + currentbar).attr('src');
		$('img#' + currentbar).attr('src', $('img#' + currentbar).attr('hover'));
		$('img#' + currentbar).attr('hover', currentImg);

		currentbar = $(this).attr('id');
		currentImg = $(this).attr('src');
		$(this).attr('src', $(this).attr('hover'));
		$(this).attr('hover', currentImg);

		/* show copy */
		var tmp = 'copy' + currentbar;
		$('div.copyholder').html( $('div#' + tmp).html() );

		/* move icon sprite */
		/* binder builder */
		if (currentbar == 'bar9' || currentbar == 'barr10')
			$('div.iconpositioner').css( 'background-position', '0px -106px');
		/* discovery set*/
		else if (currentbar == 'bar2')
			$('div.iconpositioner').css( 'background-position', '0px -110px');
		/* witness */
		else if (currentbar == 'bar11')
			$('div.iconpositioner').css( 'background-position', '0px -216px');
		/* advances security */
		else if (currentbar == 'bar12')
			$('div.iconpositioner').css( 'background-position', '0px -323px');
		/* search */
		else if (currentbar == 'bar7')
			$('div.iconpositioner').css( 'background-position', '0px -428px');
		/* concept search */
		else if (currentbar == 'bar3')
			$('div.iconpositioner').css( 'background-position', '0px -537px');
		/* review predictor */
		else if (currentbar == 'barr9')
			$('div.iconpositioner').css( 'background-position', '0px -638px');
		/* no icon */
		else
			$('div.iconpositioner').css( 'background-position', '0px -752px');

	}, function() {	});
});





















