/***********************************************
* A ugly hack for the aout selector for forms
* 2009-02-22
***********************************************/

function chrChange(sel, chrs, sign_role)
{
	var role;
	role = document.getElementById("signup_role"+sign_role);
	
	for(var i = 0; i< role.options.length; i++)
	{
		if( chrs[sel.selectedIndex] == role.options[i].text )
		{
			role.selectedIndex = i;
			break;
		}
	}							
}
$(document).ready(function(){

	$("#icon_name").change(function(){ 
		/*$("#icon_image").hide();
		$("#icon_image").attr("src", 'games/lotro/images/raids/'+$(this).val());
		$("#icon_image").show();*/
		
		/*var img = new Image();
		$(img).load(function () {
			$("#div_image").html($(this))
		}).attr( {"id":"icon_image", "name":"icon_image"} ).attr("src", 'games/lotro/images/raids/'+$(this).val() );//$("#icon_name :selected"));*/
		ChangeEventImage();
	});
	
	function ChangeEventImage()
	{
		$("#icon_image").hide();
		var img = new Image();
		$(img).load(function () {
			$("#div_image").html($(this))
		}).attr( {"id":"icon_image", "name":"icon_image"} ).attr("src", 'games/lotro/images/raids/'+$("#icon_name").val() );
	}
	ChangeEventImage();
});
