// JavaScript Document

var $dc = jQuery.noConflict();
var dc_animateSpeed = 100;

$dc(document).ready(dc_READY);

function dc_READY(){
	dc_bind_events();
	var $dc_getVars = docked_get_variables();
	
	if( $dc_getVars['hideWidget'] != 'true' )
		$dc("#docked_controller").show();
}

function dc_bind_events(){
	$dc("#docked_controller a").hover(docked_controller_a_MOUSE_OVER, docked_controller_a_MOUSE_OUT);
}

function docked_controller_a_MOUSE_OVER(){
	$dc("#docked_controller_message span").hide();
	$dc(this).css({color: "#931702"});
	$dc(".docked_controller_icon", this).hide();
	$dc(".docked_controller_icon_on", this).show();
	$dc(this).not("animated").animate({marginTop: -17, paddingBottom: 17}, {queue: false, duration: dc_animateSpeed});
}

function docked_controller_a_MOUSE_OUT(){
	$dc(this).css({color: "#3f3f3f"});
	$dc(".docked_controller_icon", this).show();
	$dc(".docked_controller_icon_on", this).hide();
	$dc(this).not("animated").animate({marginTop: 0, paddingBottom: 0}, {queue: false, duration: dc_animateSpeed});
	$dc("#docked_controller_message span").show();
}

function docked_get_variables(){
	var getVars = [];
	var partitions;
	var variableStrings = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
		
	for( var i = 0; i < variableStrings.length; i++ ){
		partitions = variableStrings[i].split('=');
		getVars.push( partitions[0] );
		getVars[ partitions[0] ] = partitions[1];
	}
	
	return getVars;
}

jQuery.noConflict();
