$(function(){
  $('.dropdown').each(function(){
    var pwidth=$(this).width();
	$(this).find('a').each(function(){
		$(this).css('width',pwidth+'px');
		$(this).find('.dropdown').each(function(){
			var mywidth=$(this).width();
			$(this).find('a').each(function(){
				$(this).css('width',mywidth+'px');
			});
		});
	});
  });
  
	$("#right_contact").validate({
		rules:{
			name:{
				required:true
			},
			email:{
				required:true,
				email: true
			},
			validation:{
				required:true
			}
		},
		submitHandler: function(form) {
			$.post("contact.php", $("#right_contact").serialize(), function(data){
				switch(data){
					case '1':
						alert('Your Message has been sent.');
						$("#right_contact").resetForm();
						$('#validation_image').attr('src','img/server.php?'+Math.random());
					break;
					default: 
						alert('Incorrect Validation Code');
					break;
				}
			});
			return false;
		}
	});
});
function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function check_phone(value, input, len){
	if(value.length==len){
		document.getElementById(input).focus();
	}
}