// JavaScript Document

function change_style(obj, css)
{
	obj.id = css;
}

function change_calss(obj, css)
{
	obj.setAttribute("class", css); 
	obj.setAttribute("className", css); 
}

function showNews(id)
{
	//document.getElementById().style.display = "none";	
	$("#event_" + currnetDisplay).hide("slow", callback);
	currnetDisplay = id;
	
	
}

function callback()
{
	$("#event_" + currnetDisplay).slideDown("slow");
}

function fade()
{
	$("#content_body:hidden:first").fadeIn("slow");
}

$(document).ready(	function()
{
	if($("#content_body").fadeIn(500))
	{
		
	}
	else
	{

		document.getElementById("content_body").style.display = "";
	}

});

function search_album(page_string)
{
	var sid = document.getElementById("singer").value;
	var year = document.getElementById("year").value;
	//var pid = document.getElementById("pop").value;
	var lid = document.getElementById("language").value;
	
	location.href = "products.php?" + "year=" + year + "&sid=" + sid + "&lid=" + lid + page_string;
}

function checkForm()
{
	var error = false;
	
	if (document.getElementById("fname").value == "")
	{
		error = true;
		document.getElementById("name_field").style.backgroundColor  = "#ff0000";
	}
	else
	{
		document.getElementById("name_field").style.backgroundColor  = "#def6ff";	
	}
	if (document.getElementById("email").value == "")
	{
		error = true;
		document.getElementById("email_field").style.backgroundColor  = "#ff0000";
	}
	else
	{
		document.getElementById("email_field").style.backgroundColor  = "#def6ff";	
	}
	if (error == false)
	{
		document.submitForm.action = "/Connections/submit.php";
		document.submitForm.submit();
	}
}

function clearForm()
{
	document.forms[0].reset();
}