// JavaScript Document
$(document).ready(function(){
	$("a[class=load_page]").click(function(){
				     var cur=	window.location ;
					var cur=$('#url').val();
					$("#loading").show('100');
					var location=$(this).attr('id');
					$("#ourTeamImgTxtCntnr").load(location);
					$("#loading").fadeOut();
					$(".load_page").css("color","#514F42");
					$(this).css("color",'#949B50');
					
				});
	$('#loginUser').click(function() {
							 var path = $('#path').val();
							var user_info;
    							user_info= jQuery.ajax({ type: "GET", url:path+"/themefunction.php/?username="+document.getElementById('log').value+"&pass="+document.getElementById('pwd').value, async: false }).responseText;
						    if(user_info == 'Invalid UserName'){
							 jQuery('label.userNameLabelError').empty();
							 jQuery('label.userPassLabelError').empty();
							  jQuery('label.userNameLabelError').show().append("Invalid UserName");
							 return false;
						    }
						    else  if(user_info == 'Invalid Password'){
							 jQuery('label.userPassLabelError').empty();
							 jQuery('label.userNameLabelError').empty();
							 jQuery('label.userPassLabelError').show().append("Invalid Password");
							 return false;
						    }
						    else {
						document.getElementById("loginform").submit();
						return true;
						    }
			  });
	
	$('#reqInfoSubmit').live('click',function(){
		$("#loading").show();
		var path=$('#reqInfo').attr('action');
		$.ajax({
			url:path+'/saveRequestInfo.php',
			type:"POST",
			data:$('#reqInfo').serialize(),
			success:function(html)
			{
				
				if($.trim(html)=="ok")
				{
					document.getElementById('reqInfo').reset()
					$("#errorDiv").html("Thanks for your interest");
				}
				else
				{
					$("#errorDiv").html(html);
				}
				$("#loading").fadeOut();
			}
		});
		return false;
	});
	
			});


