$(document).ready(function(){  
	var pathname = location.pathname;

	//if (pathname == '/nada_project/guide.php') {
	

	if (pathname == '/guide.php') {
		$("#rightBan").css({
			'display': 'none'
		});
		$("#fitco").css({
			'float': 'left','display':'block'
		});
		$("#land").remove();
		$("#zeo").remove();
		$("#guide-left").remove();
		$("#lan").removeClass('land_img');
		$("#guide").css({
			'margin': '0px 0 0 70px','display':'block'
		});
		$("#add").css({
			'display': 'block','margin':'18px 0 0 20px','float':'right'
		});
		
	}
	if (pathname == '/projects.php') {
		$("#right").remove();
		$("#zeo").remove();
		$("#met").css({
			'display': 'block',
		});
		$("#cape").css({
			'display': 'block',
		});
	}
	if (pathname == '/index.php') {
		$("#zeo").remove();
		$("#hm").addClass("cars");
		$("#swfHome").css({
			'display': 'block',
		});
	}
	if (pathname == '/current-vacancies.php') {
		$("#zeo").remove();
		$("#swf").css({
			'display': 'block',
		});
	}
	if (pathname == '/index.php' || pathname=='/' ) {
		$("#met").remove();
		$("#land").css({'display':'block','float':'left','margin':'13px 0 0 20px'});
	}
	else {
		$("#land").remove();
	}
	if (pathname == '/show-articles.php') {
		$("#zeo").remove();
		$("#farm").css({
			'display': 'block',
		});
		$("#rightBan").css({
			'display': 'none',
		});
		$("#rightBan-art").css({
			'display': 'block',
		});
		
		$("#farm").addClass("cars");
	}
	if (pathname == '/exhebitions.php') {
		$("#zeo").remove();
		$("#exb").css({
			'display': 'block',
			'margin-left': '180px'
		});
		$("#exb").addClass("cars");
		$("#land").remove();
	}
		
	$("#send").click(function(){
		var name = sendValidate("input", "name", "Please enter your name");
		var company = sendValidate("input", "company", "Please enter your Company Name");
		var email = sendValidate("input", "email", "Please enter a valid email address");
		var phone = sendValidate("input", "phone", "Please enter your phone Number");
		var pobox = sendValidate("input", "pobox", "Please P.O.Box No.");
		var city = sendValidate("input", "city", "Please enter your City");
		var country = $("#country").val();
		if(name != "validation_error" && company != "validation_error" && email != "validation_error" && phone != "validation_error" && pobox != "validation_error" && city != "validation_error") {
				$.ajax({
				type: "GET",
				url: "subscribe-mail.php?name="+name+"&company="+company+"&email="+email+"&phone="+phone+"&pobox="+pobox+"&city="+city+"&country="+country,
				success: function(data) {
					if(data == "success") {
					$(".contactform_wrapper").css("visibility","hidden");
						$(".content_heading span").text("Thank you for Subscribing");
						$(".content_text").text("Thank you, we've received your message. We will Get back to you Soon.");
						$("#note").remove();
						
					}						
				}
			});
		}
	});
});
function sendValidate(input_type, input_name, error_text) {
	if ($(input_type + "[name=" + input_name + "]").val() == "") {
		$(input_type + "[name=" + input_name + "] + span").text(error_text).slideDown("slow");
		return "validation_error";
	}
	else if (input_name == "email") {
		if (/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test($(input_type + "[name=" + input_name + "]").val()) === false) {
			$(input_type + "[name=" + input_name + "] + span").text(error_text).slideDown("slow");
			return "validation_error";
		}
		else {
			$(input_type + "[name=" + input_name + "] + span").slideUp("slow");
			return $(input_type + "[name=" + input_name + "]").val();
		}	
	}
	else {
		$(input_type + "[name=" + input_name + "] + span").slideUp("slow");
		return $(input_type + "[name=" + input_name + "]").val();
	}
}
