// JavaScript Document

function rgbConvert(str) {
   str = str.replace(/rgb\(|\)/g, "").split(",");
   str[0] = parseInt(str[0], 10).toString(16).toLowerCase();
   str[1] = parseInt(str[1], 10).toString(16).toLowerCase();
   str[2] = parseInt(str[2], 10).toString(16).toLowerCase();
   str[0] = (str[0].length == 1) ? '0' + str[0] : str[0];
   str[1] = (str[1].length == 1) ? '0' + str[1] : str[1];
   str[2] = (str[2].length == 1) ? '0' + str[2] : str[2];
   return ('#' + str.join(""));
}

function linkOut(id)	
{
	var colorCheck = document.getElementById(id).style.color;
	var check = document.getElementById(id).style.color.indexOf('rgb')
	if (check != -1)
	{
		colorCheck = rgbConvert(document.getElementById(id).style.color);
	}

	moveLeft(id);
	if (colorCheck != '#ed5458')
	{	
		document.getElementById(id).style.color ='#c0c0c0';
	}
}

function linkOver(id)
{
	var colorCheck = document.getElementById(id).style.color;
	var check = document.getElementById(id).style.color.indexOf('rgb');
	if (check != -1)
	{
		colorCheck = rgbConvert(document.getElementById(id).style.color);
	}
	
	moveRight(id);
	if (colorCheck != '#ed5458')
	{
		document.getElementById(id).style.color ='red';
	}
}


function linkClicked(id, hash)
{
	clearTimeout(bannerRullaFramTimer);
	clearTimeout(bannerTonaTimer);
		
	window.location.hash='#'+hash+'';
	
	deleteActiveLinks();
	document.getElementById(id).style.color = '#ed5458';
	document.getElementById(id).style.fontStyle='italic';	
}

function moveRight(id)
{
	var atPad = {paddingLeft: { to: 50 }};
	var anPad = new YAHOO.util.Anim(id,atPad, 0.3, YAHOO.util.Easing.easeOut);	
	anPad.animate();
}
function moveLeft(id)
{
	var atPad = {paddingLeft: { to: 40 }};
	var anPad = new YAHOO.util.Anim(id,atPad, 0.3, YAHOO.util.Easing.easeOut);	
	anPad.animate();
}
