$(document).ready(function()
{
	
	$('#nav li').bind('mouseover', function(){ $(this).addClass('hover'); });
	$('#nav li').bind('mouseout', function(){ $(this).removeClass('hover'); });
	$('#nav li').bind('click', function(){ location.href = $(this).children('a').attr('href') });
	
	$('#sidebar_left li').bind('mouseover', function(){ $(this).addClass('hover'); });
	$('#sidebar_left li').bind('mouseout', function(){ $(this).removeClass('hover'); });
	//$('#sidebar_left li').bind('click', function(){ alert($(this).children('a').attr('href')) });
	$('#sidebar_left li').bind('click', function(){ location.href = $(this).children('a').attr('href') });
	
	$('#sidebar_right li').bind('mouseover', function(){ $(this).addClass('hover'); });
	$('#sidebar_right li').bind('mouseout', function(){ $(this).removeClass('hover'); });
	$('#sidebar_right li').bind('click', function(){ location.href = $(this).children('a').attr('href') });
	
	$('#searchbox').bind('click', function(){ $(this).val('') });
	$('#searchbox').bind('blur', function(){ if ($(this).val() == '') { $(this).val('Suchbegriff') }  });
	
	// change border color
	
		$('#sidebar_left li.active').prev().addClass('almostactive'); 
	
});

function ComaAjaxUpload(fieldname, style)
{
	if ( $('#' + fieldname + '_container').length > 0 )
	{
		new AjaxUpload('#' + fieldname + '_upload',
		{
			action: c_home + 'ajax/upload.php?style=' + style,
			name: 'ajax',
			onSubmit : function(file, ext){
				$('#' + fieldname + '_container').html('Uploading file... please wait.');
			},
			onComplete : function(file, response)
			{
				if (response != '')
				{
					$('#' + fieldname + '_container').html('<img src="' + c_home + '__/?' + response + '" alt="" border="" />');
					items = response.split('.');
					$('#' + fieldname + '').val(items[0]);
				}
				else
				{
					$('#' + fieldname + '_container').html('Error uploading file.');
				}
			}
		});
	}
}



