var $j=jQuery.noConflict();
$j(document).ready(function(){
// Contact us Portion Starts
	$j(".con-req").focus(function(){
		$j(this).attr('style','border:1px solid #DDDDDD');						  
	});
	$j(".con-req").blur(function(){
		$j(this).next('span').attr('style','display:none');
		if($j(this).isEmpty())
		{	
			$j(this).attr('style','border:1px solid #FF0000');
			$j(this).addClass('denied');
			
		}
		else if(!$j(this).emailCheck() && $j(this).attr('id') == 'email')
		{   
			$j(this).attr('style','border:1px solid #FF0000');
			$j(this).addClass('denied');
		}

	
		else
		{
			$j(this).attr('style','border:1px solid #347C17');
			$j(this).removeClass('denied');
		}
	});
//Contact us Portion Ends

							});


// Contact us Portion Starts
function contactus(formID)
{
	$j(".con-req").blur();
	$j(".con-notreq").blur();
	if($j(".denied").length == 0){	
		var data=$j('#'+formID).serializeArray();
		$j(".contact-form").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:'feedback_mail_send.php',
				data: data,
				dataType:'json',
				success:function(jData){
					if(jData.flag == 1)
					{
						$j('#feedbackbg').html(jData.html);
						$j('#top-msg').hide();
					}
				},
				error: function(XMLHttpRequest, textStatus, errorThrown){
					$j("#feedbackbg").html("Some server error occoured. Please report to system administrator.</div>");
					$j('#top-msg').hide();
				}
		});
	}
}
//Contact us Portion Ends

function removeValidationImg(elem)
{
	jQuery(elem).next('img[@alt="wrong"]').remove();
	jQuery(elem).removeClass('denied');
	jQuery(elem).next('img[@alt="correct"]').remove();
	jQuery(elem).removeClass('denied');
}


function checkPhone(elem)
{
var phoneRegExp =/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,13})(-| )?(\d{1})(( x| ext)\d{1,5}){0,1}$/; 
if (elem.match(phoneRegExp)) 
return true;
}

