$(document).ready(function() 
{
	if($("#gallery a").length){ $('#gallery a').lightBox({fixedNavigation:true}); }
	
	$('input,textarea,select').addClass("field-nml");
	$('input,textarea,select').focus
	(
		function()
		{
			$(this).removeClass("field-nml").addClass("field-hgl");
		}
	);
	$('input,textarea,select').blur
	(
		function()
		{
			$(this).removeClass("field-hgl").addClass("field-nml");
		}
	);
	
	$("#frm-cnt").submit
	(
		function()
		{
			$("#msg-status").html('');
			$("#msg-status").html('<p><span class="msg-stat">Sending Message, Please wait.</span></p>');
			var str = $(this).serialize();
			$.ajax(
			{
				type: "POST",
				url: "sendmail.php",
				data: str,
				success: 
				function(msgStatus)
				{
					$("#msg-status").ajaxComplete(function(event, request, settings)
					{
						$(this).html(msgStatus);
					});
				}
			});
			$("#securecode").attr("src", "securecode.php?" +  Math.floor(Math.random()*100));
			return false;
		}
	);
	
});


function loadgallery(strDir)
{
	arrPath = strDir.split("/");
	if(arrPath[1])
		strID = arrPath[1];
	else
		strID = arrPath[0];
	$('#'+strID).addClass('nbclr');
	$('#'+strID).addClass('bimg');
	$.ajax(
	{
		type: "GET",
		url: "gallery.php",
		data: "dir="+strDir,
		success: 
		function(strHTML)
		{
			$('#'+strID).ajaxComplete(function(event, request, settings)
			{
				$(this).html(strHTML);
				strIDA = '#'+strID+' a';
				$(strIDA).lightBox({fixedNavigation:true});
			});
		}
	});
}
