$.ajaxSetup({cache: false});

function readmore(){
	$("#readmorelink").hide();
	$("#readmoretext").show();
	$("#brighton_three-column").css("margin-top","0px");
}
function readless(){
	$("#readmoretext").hide();
	$("#readmorelink").show();
	$("#brighton_three-column").css("margin-top","-90px");
}

$(document).ready(function() {


//$("#brighton_body").wrapInner("<div class='bodywrapper'></div>");
//$("#brighton_container").wrap("<div class='containerwrapper'></div>");


//move footerStuff to footer
$.get('/Portals/77655/footerStuff.html', function(data) {
	$('#footer').prepend(data);
});
//move footer to body
$("#footer").appendTo("form#Form");


//google search box
$("#googlesearchbox").prependTo("#topnav");

// replace <!--zipcode--> with zip code request form html
$.get('/Portals/77655/zipCodeRequestForm.html', function(data) {
 	$('.zipcode').replaceWith(data);
});

// zip request input field
$(".ziprequest").live("keyup", function() {
	var theZip = $(this).val();
	$(".ziprequest").val(theZip);
});

// zip code request form submit
$(".zipsubmit").live("click", function() {
window.location.href='/schedule-service/?zip=' + $(this).prev("input").val();
return false;
});

// populate Online Service Request Form with zip from url
if(location.href.match('schedule-service')) {
var theUrl = location.href.split("=");
var theZip = theUrl[1];
$("label").each(function() {
if ($(this).text() == "Zip") {
$(this).next("input").val(theZip);
}
});
}

//form defaults for zip code form
$("div.zipform .ziprequest").val("enter zip code");
$(".ziprequest").live("click", function() {
	if($(this).val() == "enter zip code") $(this).val("");
});
$(".ziprequest").live("blur", function() {
	if($(this).val() == "") $(this).val("enter zip code");
});

//coupon subscribe block
$(".IngeniMailSubscribeContainer").closest(".block").addClass("couponsub");
$("div.couponsub .IngeniMailSubscribeButton").val("");
$("div.couponsub .IngeniMailSubscribeEmailInput").val("e-mail address");
$("div.couponsub .IngeniMailSubscribeEmailInput").click(function() {
	if($(this).val() == "e-mail address") $(this).val("");
});
$("div.couponsub .IngeniMailSubscribeEmailInput").blur(function() {
	if($(this).val() == "") $(this).val("e-mail address");
});

//blog feed block for homepage
$(".feedreader_box").closest(".block").addClass("maintenance");
$(".maintenance .pad").append('<a href="/blog/" class="readmore">READ MORE</a>');


// jquery for blog feed icons for different inner pages
if(location.href.match('a-c-heating')) {
$(".maintenance h3").css("background-image", "url(hello.png)");
}


//move map to right of address on contact page. only moves if not logged in
if( $("div.location-map").length && !$("#hsnav").length) {
	$("#map").prependTo("div.location-map");
}

});