// JavaScript Document
$(document).ready(function() {
	$(".menuLink").hover(
		function () {
			idCurent=$(this).attr("id");
			$(this).attr('src','/style/menu/' + idCurent + '-on.png');
		}, 
		function () {
			idCurent=$(this).attr("id");
			$(this).attr('src','/style/menu/' +idCurent + '.png');
		}
	);
	$('.articleListing img').css('float','left');
	$('.articleListing img').css('margin-right','10px');
	$('.articleListing img').css('margin-bottom','10px');
});

function showHideContent(id)
{
	if(id)
	{
		if($('#chapter_'+id).css('display')=='none')
		{
			$('.chapterContent').hide('slow');
			$('.imgBullets').attr('src','/style/images/plus.png') ;
			$('.imgBullets').attr('title','Expand') ;
			$('#chapter_'+id).show('slow');
			$('#bullet_'+id).attr('src','/style/images/minus.png') ;
			$('#bullet_'+id).attr('title','Colapse');
		}
		else
		{
			$('.chapterContent').hide('slow');
			$('.imgBullets').attr('src','/style/images/plus.png') ;
			$('.imgBullets').attr('title','Expand') ;
		}
	}
}

function validateFields()
{
	var ok=1;
	$('.error').hide();
	if($('#Name').val()=='')
	{
		$('#nameError').show();	
		ok = 0;
	}
	if($('#Message').val()=='')
	{
		$('#messageError').show();	
		ok = 0;
	}
	if(ok) 
		document.frmContact.submit();
	else
		return;
}

function emailCheckNewsLetter()
{
	message="";
	if( $('[name=txtEmail]').val().search(/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,4}$/)==-1)
	{
		message = 'Invalid email address';
		alert(message);
		return;
	}
	document.frmSignup.submit();
}

function showRegister()
{
	$('#register').animate({'top':'-27px'}, 500);
	$('#register a').attr('href','javascript:hideRegister()');
}

function hideRegister()
{
	$('#register').animate({'top':'-208px'}, 500);
	$('#register a').attr('href','javascript:showRegister()');
}


