var $j=jQuery.noConflict();
var subscriptionErrors = false;
$j(document).ready(function(){
// Contact us Portion Starts
	$j(".con-req").focus(function(){
			$j(this).next('span').attr('style','display:inline');
	});
	$j(".con-req").blur(function(){
		$j(this).next('span').attr('style','display:none');
		if($j(this).isEmpty())
		{
			$j(this).next('span').attr('style','display:inline');
			$j(this).next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j(this).addClass('denied');
			
		}
		else if(!$j(this).emailCheck() && $j(this).attr('id') == 'contactus_email')
		{
			$j(this).next('span').attr('style','display:inline');
			$j(this).next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j(this).addClass('denied');
		}
		else if($j(this).isEmpty() && $j(this).attr('id') == 'subject')
		{
			$j(this).next('span').attr('style','display:inline');
			$j(this).next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j(this).addClass('denied');
		}
		else
		{
			$j(this).next('span').attr('style','display:inline');
			$j(this).next('span').css('background','#9fd680 url(images/bg-span-hint-welldone.gif) no-repeat 0px 0px');
			$j(this).removeClass('denied');
		}
	});
//Contact us Portion Ends

});
// Contact us Portion Starts
function contactus(formID)
{
	$j(".con-req").blur();
	if($j(".denied").length == 0){
		
		var data=$j('#'+formID).serializeArray();
		$j(".contactus-block").css('height','100px');
		$j(".contactus-block").html('<div style="width:400px; margin-top:20px; text-align:center;"><img src="images/ajax-loader.gif" border="0"></div>');
		$j.ajax({
				type:'POST',
				url:'requests.php',
				data: data,
				dataType:'json',
				success:function(jData){
					if(jData.flag == 1)
					{
						
						$j("#con-area").html('<h6 style="margin:150px 0 140px 0; font-weight:bold;">'+jData.msg+'</h6>');
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					$j(".contactus-block").html("Some server error occoured. Please report to system administrator.</div>");
				}
		});
	}
}
//Contact us Portion Ends
