var $j=jQuery.noConflict();
var subscriptionErrors = false;
$j(document).ready(function(){
// Contact us Portion Starts
	$j(".text_box1").focus(function(){
			$j(this).next('span').attr('style','display:inline');
	});
	$j(".text_box1").blur(function(){
		$j(this).next('span').attr('style','display:none');
		if($j("#txtName").val() == '')
		{   
			$j("#txtName").attr('style','border:1px solid #FF0000');
			$j("#txtName").next('span').attr('style','display:inline');
			$j("#txtName").next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j("#txtName").addClass('denied');
		}
		else{
			$j("#txtName").attr('style','border:1px solid #347C17');
			$j("#txtName").next('span').attr('style','display:inline');
			$j("#txtName").next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j("#txtName").removeClass('denied');
		}
		if($j(this).isEmpty())
		{	
			$j(this).attr('style','border:1px solid #FF0000');
			$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).attr('style','border:1px solid #FF0000');
			$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') == 'registerwithus_email')
		{   
			$j('#registerwithus_email').attr('style','border:1px solid #FF0000');
			$j('#registerwithus_email').next('span').attr('style','display:inline');
			$j('#registerwithus_email').next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j('#registerwithus_email').addClass('denied');
		}
		else
		{
			$j(this).attr('style','border:1px solid #347C17');
			$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(".text_box1").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:'registor_mail_send.php?contactus_email='+$j("#contactus_email").val()+"&txtName="+$j("#contactus_email").val()+"&txtTelephone="+$j("#txtTelephone").val()+"&txtcomments="+$j("#txtcomments").val(),
				data: data,
				dataType:'json',
				success:function(jData){
					if(jData.flag == 1)
					{
						//alert(jData.html);
						$j('#hide_div').html(jData.html);
						$j('#hide_div').addClass("contact-form");
						//$j('.innerpage-con p').hide();
						//$j('#thankyouDiv').slideDown();
						//$j('#thankyouDiv').show();
						//$j("#thankyouDiv").html(jData.msg);
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					$j(".contactus-block").html("Some server error occoured. Please report to system administrator.</div>");
				}
		});
	}
	else{		
		$j("#ErrMsgDisplay").html("<span style='color:red;'><strong>Please fill * marked field(s).</strong></span>");
			window.location.href='#top';
	}
}
$j(document).ready(function(){

$j(".text_box2").focus(function(){
			$j(this).next('span').attr('style','display:inline');
	});
	$j(".text_box2").blur(function(){
		$j(this).next('span').attr('style','display:none');
		if($j(this).isEmpty())
		{	
			$j(this).attr('style','border:1px solid #FF0000');
			$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).attr('style','border:1px solid #FF0000');
			$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') == 'registerwithus_email')
		{   
			$j('#registerwithus_email').attr('style','border:1px solid #FF0000');
			$j('#registerwithus_email').next('span').attr('style','display:inline');
			$j('#registerwithus_email').next('span').css('background','#F8E48B url(images/bg-span-hint-kindagood.gif) no-repeat 0px 0px');
			$j('#registerwithus_email').addClass('denied');
		}
		else
		{
			$j(this).attr('style','border:1px solid #347C17');
			$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');
		}
		
	});
});
function registerwithus(formID)
{
	/*alert("a");*/
	$j(".text_box2").blur();
	if($j(".denied").length == 0){	
		var data=$j('#'+formID).serializeArray();
		$j(".registerwithus-block").css('height','100px');
		$j(".registerwithus-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:'contact_mail_send.php',
				data: data,
				dataType:'json',
				success:function(jData){
					if(jData.flag == 1)
					{
						//alert(jData.html);
						$j('#inner-content1').html(jData.html);
						$j('.innerpage-con p').hide();
						//$j('#thankyouDiv').slideDown();
						//$j('#thankyouDiv').show();
						//$j("#thankyouDiv").html(jData.msg);
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					$j(".registerwithus-block").html("Some server error occoured. Please report to system administrator.</div>");
				}
		});
	}
	else
{		$j("#ErrMsgDisplay1").html("<span style='color:red;'><strong>Please fill * marked field(s).</strong></span>");
		window.location.href='#top';
}
}
//Contact us Portion Ends
