$(document).ready(function(){
	$('#hd-homeSearch').watermark({html:"Search College by Name", cls:"wmark-homeSearch"});
	$('#hd-Search').watermark({html:"Search College by Name", cls:"wmark-search"});
	
	$(document).find('#searchCollege').watermark({html:"Search College by Name", cls:"wmark-sr"});
		
		var wt = $('.btn_normal').width();
		var ht = $('.btn_normal').height();
		$('.btnsubmit').css({width:wt+25})
		$('.showmore').css({width:wt+25})
		$('.showmore2').css({width:wt+35})
		
		var wt2 = $('.btn_login').width();
		
		$('.btnLogin').css({width:wt2+15, height:ht+7})
})


function regForm(){
	$('#txtconfirmEmail').watermark({html:"Confirm Email", cls:"wmark-17"});
	$('#txtConfirmPassword').watermark({html:"Confirm Password", cls:"wmark-17"});
	$('#loginemail').watermark({html:"Your Username", cls:"wmark-3"});
	$('#userpass').watermark({html:"Your Password", cls:"wmark-3"});
	
	
		$('input[type="text"], input[type="password"], select').bind('focus blur', function () {
			$('.form-section').removeClass('up');
				if($(this).attr("name")=="hd-Search")
				$(this).parent().parent().toggleClass('up-No');
				else
				$(this).parent().parent().toggleClass('up');
		});
	//form validation
		$('#postRegistration').validate({
			groups: {
				email: "txtemail txtconfirmEmail",
				pass: "txtpassword txtConfirmPassword"
			},
			errorPlacement: function(error, element) {
				if(element.attr("name")=="txtGender")
				error.insertAfter( element.parent());
				else
				error.insertAfter( element.parent().parent().find('h2'));
			},
			highlight: function(element, error, valid) {
				 $(element).addClass('highlight');
				 $(element).parent().parent().addClass('redBlock');
				 $(element).parent().parent().find('label').fadeOut(function() {
							   $(element).parent().parent().find('label').fadeIn();
							 });
	
			},
			unhighlight: function(element, error, valid) {
				 $(element).removeClass('highlight');
				 $(element).parent().parent().removeClass('redBlock');
			},
			rules:{
				 txtconfirmEmail: {
					equalTo: "#txtemail"
				 },
				 txtConfirmPassword: {
					equalTo: "#txtpassword"
				 }
			}
		});
		
		
		$('#userlogin').validate({
			errorPlacement: function(error, element) {
				error.insertBefore( element.parent());
			},
			highlight: function(element, error, valid) {
				 $(element).parent().addClass('highlight');
				 $(element).parent().parent().addClass('redBlock');
				 $(element).parent().parent().find('label').fadeOut(function() {
							   $(element).parent().parent().find('label').fadeIn();
							 });
	
			},
			unhighlight: function(element, error, valid) {
				 $(element).parent().removeClass('highlight');
				 $(element).parent().parent().removeClass('redBlock');
			}
		});
		
}