(function($) {

$.ajaxSetup({cache: false});

$(document).ready(function() {

if ( location.href.match('http://wireandplastic.web7.hubspot.com/es/')) {
	$("#brighton_header #logo a").attr("href", "/es/");
}
if ( location.href.match('http://wireandplastic.web7.hubspot.com/cn/')) {
	$("#brighton_header #logo a").attr("href", "/cn/");
}
if ( location.href.match('http://wireandplastic.web7.hubspot.com/ru/')) {
	$("#brighton_header #logo a").attr("href", "/ru/");
}

//default field for inventory search
$("#invSearch").val("Inventory Search...");
$("#invSearch").click(function() {
	if($(this).val() == "Inventory Search...") $(this).val("");
});
$("#invSearch").blur(function() {
	if($(this).val() == "") $(this).val("Inventory Search...");
});

//add class to newsletter
$("div.block:has(.IngeniMailSubscribeContainer)").addClass("newsletter-block");
$("div.newsletter-block div.IngeniMailSubscribeContainer div:has(.IngeniMailSubscribeEmailInput)").addClass("form-container");
$(".newsletter-block .IngeniMailSubscribeContainer").prepend('<div class="newsletter-head">Subscribe to our FREE Wire & Plastic newsletter.</div>');
$(".newsletter-block .form-container .subhead").remove();
$(".newsletter-block .IngeniMailSubscribeButton").appendTo(".newsletter-block .form-container").val("");

//form defaults for newsletter form
$(".newsletter-block .IngeniMailSubscribeEmailInput").val("Email Address");
$(".newsletter-block .IngeniMailSubscribeEmailInput").live("click", function() {
	if($(this).val() == "Email Address") $(this).val("");
});
$(".newsletter-block .IngeniMailSubscribeEmailInput").live("blur", function() {
	if($(this).val() == "") $(this).val("Email Address");
});


//move footerStuff to footer
$.get('/Portals/75176/footerStuff1.html', function(data) {
	$('#footer').prepend(data);
});
//move footer to body
$("#footer").appendTo("form#Form");

});

})(jQuery);
