$(document).ready(function(){
	//begin salesman js for all sales pages
	$('.openSalesmen').click(function(){
		$('.salesmen').fadeIn("slow");
		$('.openSalesmen').hide();
		$('.closeSalesmen').show();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.closeSalesmen').click(function(){
		$('.salesmen').hide();
		$('.closeSalesmen').hide();
		$('.openSalesmen').show();
	});
	$('.salesmen a').click(function(){
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	//end salesman js for sales pages
	//begin leasing js for leasing pages
	$('.hidePics').hide();
	$('#pics').hide();
	$('.showPics').click(function(){
		$('#pics').show();
		$('.hidePics').show();
		$(this).hide();
	});
	$('.hidePics').click(function(){
		$('#pics').hide();
		$('.showPics').show();
		$(this).hide();
	});
	//end leasing js for leasing pages
	//begin console js for console page
	$('.return').click(function(){
		window.location.reload()
	});
	$('.form').hide();
	$('.form2').hide();
	$('.form3').hide();
	$('.form4').hide();
	$('.form5').hide();
	$('.form6').hide();
	$('.empremove').hide();
	$('.addemp').hide();
	$('.addformform').hide();
	$('.historya').hide();
	$('.historyu').hide();
	$('.specialsa').hide();
	$('.specialsd').hide();
	$('.formupdate').hide();
	$('.formremove').hide();
	$('.inventorya').hide();
	$('.inventoryr').hide();
	$('.inventoryu').hide();
	$('.newslet').show();
	$('.addform').show();
	$('.addform').css({ color: "#2d486c", background: "transparent"});
	$('.remform').show();
	$('.remform').css({ color: "#2d486c", background: "transparent"});
	$('.add').show();
	$('.add').css({ color: "#2d486c", background: "transparent"});
	$('.rem').show();
	$('.rem').css({ color: "#2d486c", background: "transparent"});
	$('#man').hide();
	$('.close').css({ color: "#2d486c", background: "transparent"});
	$('.close2').css({ color: "#2d486c", background: "transparent"});
	$('.close3').css({ color: "#2d486c", background: "transparent"});
	$('.close4').css({ color: "#2d486c", background: "transparent"});
	$('.close5').css({ color: "#2d486c", background: "transparent"});
	jQuery.easing.def = 'easeInQuart';
	$('#addRemoveFORMS').hover(function(){
		$(this).css({background: "#B0C4DE"});
		$('.form2').css({background: "#E7EDF5"});
	},function(){
		$(this).css({background: "#E7EDF5"});
	});
	$('#companyInfo').hover(function(){
		$(this).css({background: "#B0C4DE"});
		$('.form5').css({background: "#E7EDF5"});
	},function(){
		$(this).css({background: "#E7EDF5"});
	});
	$('#updateInventory').hover(function(){
		$(this).css({background: "#B0C4DE"});
		$('.form4').css({background: "#E7EDF5"});
	},function(){
		$(this).css({background: "#E7EDF5"});
	});
	$('#addNewsletters').hover(function(){
		$(this).css({background: "#B0C4DE"});
		$('.form3').css({background: "#E7EDF5"});
	},function(){
		$(this).css({background: "#E7EDF5"});
	});
	$('#addRemoveEMPLOYEES').hover(function(){
		$(this).css({background: "#B0C4DE"});
		$('.form').css({background: "#E7EDF5"});
	},function(){
		$(this).css({background: "#E7EDF5"});
	});
	$('#specials').hover(function(){
		$(this).css({background: "#B0C4DE"});
		$('.form6').css({background: "#E7EDF5"});
	},function(){
		$(this).css({background: "#E7EDF5"});
	});
	$('.addSpecials').click(function(){
		$('.close6').show();
		$('.form3').slideUp(1000);
		$('.form2').slideUp(1000);
		$('.form').slideUp(1000);
		$('.form4').slideUp(1000);
		$('.form5').slideUp(1000);
		$('.form6').show(1000);
	});
	$('.news').click(function(){
		$('.close3').show();
		$('.form3').show(1000);
		$('.form2').slideUp(1000);
		$('.form').slideUp(1000);
		$('.form4').slideUp(1000);
		$('.form5').slideUp(1000);
		$('.form6').slideUp(1000);
	});
	$('.inv').click(function(){
		$('.close4').show();
		$('.form4').show(1000);
		$('.form2').slideUp(1000);
		$('.form3').slideUp(1000);
		$('.form').slideUp(1000);
		$('.form6').slideUp(1000);
		$('.form5').slideUp(1000);
	});
	$('.company').click(function(){
		$('.close5').show();
		$('.form5').show(1000);
		$('.form4').slideUp(1000);
		$('.form2').slideUp(1000);
		$('.form3').slideUp(1000);
		$('.form').slideUp(1000);
		$('.form6').slideUp(1000);
	});
	$('.employee').click(function(){
		$('.close').show();
		$('.form5').slideUp(1000);
		$('.form').slideDown(1000);
		$('.form2').slideUp(1000);
		$('.form3').slideUp(1000);
		$('.form4').slideUp(1000);
		$('.form6').slideUp(1000);
	});
	$('.forms').click(function(){
		$('.close2').show();
		$('.form2').slideDown(1000);
		$('.form').slideUp(1000);
		$('.form3').slideUp(1000);
		$('.form4').slideUp(1000);
		$('.form5').slideUp(1000);
		$('.form6').slideUp(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
		
	});
	$('.addspc').click(function(){
		$('.addspc').hide();
		$('.remspc').show();
		$('.specialsd').slideUp(1000);
		$('.specialsa').show(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.remspc').click(function(){
		$('.remspc').hide();
		$('.addspc').show();
		$('.specialsd').show(1000);
		$('.specialsa').slideUp(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
	})
	$('.addhis').click(function(){
		$('.addhis').hide();
		$('.updhis').show();
		$('.historyu').slideUp(1000);
		$('.historya').show(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.updhis').click(function(){
		$('.updhis').hide();
		$('.addhis').show();
		$('.historya').slideUp(1000);
		$('.historyu').show(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.addform').click(function(){
		$('.addformform').slideDown('slow');
		$('.addform').hide();
		$('.formremove').slideUp('slow');
		$('.formupdate').slideUp('slow');
		$('.remform').show();
		$('.updform').show();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.remform').click(function(){
		$('.formremove').slideDown('slow');
		$('.addformform').slideUp('slow');
		$('.formupdate').slideUp('slow');
		$('.remform').hide();
		$('.addform').show();
		$('.updform').show();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.updform').click(function(){
		$('.formupdate').slideDown('slow');
		$('.formremove').slideUp('slow');
		$('.addformform').slideUp('slow');
		$('.remform').show();
		$('.addform').show();
		$('.updform').hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.addinv').click(function(){
		$('.reminv').show();
		$('.updinv').show();
		$('.inventorya').slideDown('slow');
		$('.inventoryr').slideUp('slow');
		$('.inventoryu').slideUp('slow');
		$(this).hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.reminv').click(function(){
		$('.addinv').show();
		$('.updinv').show();
		$('.inventorya').slideUp('slow');
		$('.inventoryr').slideDown('slow');
		$('.inventoryu').slideUp('slow');
		$(this).hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.updinv').click(function(){
		$('.reminv').show();
		$('.addinv').show();
		$('.inventorya').slideUp('slow');
		$('.inventoryr').slideUp('slow');
		$('.inventoryu').slideDown('slow');
		$(this).hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.add').click(function(){
		$('.empremove').slideUp('slow');
		$('.addemp').slideDown('slow');
		$('.rem').show();
		$('.add').hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.rem').click(function(){
		$('.rem').hide();
		$('.add').show();
		$('.empremove').slideDown('slow');
		$('.addemp').slideUp('slow');
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.checkremove').click(function(){
		if (confirm('Are you sure you want to delete this entry?  Click OK to continue...')) {
			return true;
		}
		else {
			return false;
		}
		$(this).css({ color: "#2d486c", background: "transparent"});
    });
	$('.checkupdate').click(function(){
		if (confirm('Are you sure you want to update this entry?  Click OK to continue...')) {
			return true;
		}
		else {
			return false;
		}
		$(this).css({ color: "#2d486c", background: "transparent"});
    });
	$('.checkadd').click(function(){
		if (confirm('Are you sure you want to add this newsletter?  It will replace the current one on the front page!  Click OK to continue...')) {
			return true;
		}
		else {
			return false;
		}
		$(this).css({ color: "#2d486c", background: "transparent"});
    });
	$('.close').click(function(){
		$('.form').slideUp('slow');
		$('.close').hide();
		$('.add').show();
		$('.rem').show();
		$('.addemp').hide();
		$('.empremove').hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});

	$('.close2').click(function(){
		$('.form2').slideUp('slow');
		$('.close2').hide();
		$('.addformform').hide();
		$('.formremove').hide();
		$('.addform').show();
		$('.remform').show();
		$('.updform').show();
		$('.formupdate').hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.close3').click(function(){
		$('.form3').slideUp('slow');
		$('.close3').hide();
		$('.addNewsletters').hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
	});
	$('.close5').click(function(){
		$('.form5').slideUp(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
		$('.close5').hide();
		$('.historya').hide();
		$('.historyu').hide();
		$('.addhis').show();
		$('.updhis').show();
	});
	$('.close6').click(function(){
		$('.form6').slideUp(1000);
		$(this).css({ color: "#2d486c", background: "transparent"});
		$('.close6').hide();
		$('.specialsa').hide();
	});
	$('.close4').click(function(){
		$('.form4').slideUp('slow');
		$('.close4').hide();
		$(this).css({ color: "#2d486c", background: "transparent"});
		$('.inventorya').hide();
		$('.inventoryr').hide();
		$('.inventoryu').hide();
		$('.addinv').show();
		$('.reminv').show();
		$('.updinv').show();
	});
	$('.emp').val("Name");
	$('.title').val("Title");
	$('.area').val("803");
	$('.number').val("771");
	$('#number2').val("0176")
	$('.ext').val("Ext");
	$('.mail').val("Email@shealytruck.com");
	$('.title2').val("Form Title");
	$('.path').val("Form File Name");
	$('.pic').val("Picture File Name");
	$('.cell').val("Cell");
	$('.man').val("none2");
	$('.tit').val("Title");
	$('.pat').val("Path");
	$('.type').val("Truck Type");
	$('.daily').val("Cost Per Day");
	$('.weekly').val("Cost Per Week");
	$('.mile').val("Cost Per Mile");
	$('.year').val("Year");
	$('.information').val("Information Goes Here...");
	$('.exp').val("Expiration");
	$('.exp').focus(function(){
		$(this).val("");
	});
	$('.year').focus(function(){
		$(this).val("");
	});
	$('.information').focus(function(){
		$(this).val("");
	});
	var test = "Columbia";
	$('#location').change(function(){
	if ($('#location').val()==test){
		$('#area').val("803");
		$('#number').val("771");
		$('#number2').val("0176");
	}
	else {
		$('#area').val("864");
		$('#number').val("968");
		$('#number2').val("1177");
	}
	});
	$('#man2').hide();
	$('#dept').val("Management");
	$('#dept').change(function(){
	if ($('#dept').val()=="Sales"){
		$('#man2').show();
	}
	else {
		$('#man2').hide();
	}
	});
	if ($('.mile').value = 'Cost Per Mile'){
		$('.mile').focus(function(){
			$(this).val("");
		});
	}
	else {
		$('.mile').value = $('.mile').value
	};
	if ($('.weekly').value = 'Cost Per Week'){
		$('.weekly').focus(function(){
			$(this).val("");
		});
	}
	else {
		$('.weekly').value = $('.weekly').value
	};
	if ($('.daily').value = 'Cost Per Day'){
		$('.daily').focus(function(){
			$(this).val("");
		});
	}
	else {
		$('.daily').value = $('.daily').value
	};
	if ($('.type').value = 'Truck Type'){
		$('.type').focus(function(){
			$(this).val("");
		});
	}
	else {
		$('.type').value = $('.type').value
	};
	if ($('.tit').value = 'Title'){
		$('.tit').focus(function(){
		$(this).val("");
	});
	}
	else {
		$('.tit').value = $('.tit').value
	}
	if (('.pat').value = 'Path'){
		$('.pat').focus(function(){
		$(this).val("");
	});
	}
	else {
		$('.pat').value = $('.pat').value
	}
	if (('.emp').value = 'Name'){
		$('.emp').focus(function(){
		$(this).val("");
	});
	}
	else {
		$('.emp').value = $('.emp').value
	}
	$('.area').focus(function(){
		$(this).val("");
	});
	$('.cell').focus(function(){
		$(this).val("");
	});
	$('.pic').focus(function(){
		$(this).val("");
	});
	$('.title2').focus(function(){
		$(this).val("");
	});
	$('.path').focus(function(){
		$(this).val("");
	});
	$('.title').focus(function(){
		$(this).val("");
	});
	$('.number').focus(function(){
		$(this).val("");
	});
	$('.ext').focus(function(){
		$(this).val("");
	});
	$('.mail').focus(function(){
	if ($('.mail').val()=="Email@shealytruck.com") {
			$(this).val("@shealytruck.com");
		}
	else {
		$('.mail').val();
	}
	});
	$('#employee').autotab({ target: 'title', format: 'text'});
	$('#title').autotab({ target: 'area', format: 'text', previous: 'employee'});
	$('#area').autotab({ target: 'number', format: 'numeric', previous: 'title'});
	$('#number').autotab({ target: 'number2', format: 'numeric', previous: 'area'});
	$('#number2').autotab({ target: 'ext', format: 'numeric', previous: 'number'});
	$('#ext').autotab({ target: 'cellac', format: 'numeric', previous: 'number2'});
	$('#cellac').autotab({ target: 'cell', format: 'numeric', previous: 'ext'});
	$('#cell').autotab({ target: 'cell2', format: 'numeric', previous: 'cellac'});
	$('#cell2').autotab({ target: 'email', format: 'numeric', previous: 'cell'});
	$('#email').autotab({ target: 'pic', format: 'all', previous: 'cell2'});
	$('#pic').autotab({ target: 'dept', format: 'all', previous: 'email'});
	//end salesman js for console page
	//begin contactLists js for contact pages
	$('#contactsList li:nth-child(odd)').addClass('alternate');
	//end contactLists js for contact pages
	//begin slide out contact info for front page and forms pages
	$('#rightContentCONTACT').hide();
		$('.clickToOPEN').click(function(){
			$(this).fadeOut('slow');
			$('#rightContentCONTACT').animate({right: 76, opacity: 'show'}, 2000);
	});
	$('.clickToCLOSE').click(function(){
		$('#rightContentCONTACT').animate({right: -82, opacity: 'hide'}, 2000);
		$('.clickToOPEN').fadeIn('slow');
		$(this).css({ color: "#2d486c", background: "transparent"});
		})
	//end slide out contact info for front page and forms pages
	//begin js for divs on parts page
	$('#columbia').hide();
	$('#duncan').hide();
	$('.nada').hide();
		$('.cola').click(function(){
			$('#duncan').hide();
			$('#columbia').show();
			$('.loc').val("Columbia");
			$('.nada').show();
		});
		$('.dunc').click(function(){
			$('#columbia').hide();
			$('#duncan').show();
			$('.loc').val("Duncan");
			$('.nada').show();
		});
		$('.nada').click(function(){
			$('#columbia').hide();
			$('#duncan').hide();
			$(this).hide();
		});
	//end js for divs on parts page
});

