$(document).ready(function() {
var buttons = document.getElementById("addThisWrapper");
var topText = document.getElementById("headerFrameHomeWrapper");
var bigSS = document.getElementById("bigSlideShow");
var textBelowBigSS = document.getElementById("headerFrameBelowHomeWrapper");
var leftVideo = document.getElementById("videoWrapperLeft");
var rightVideo = document.getElementById("videoWrapperRight");
var leftSmallSS = document.getElementById("smallSlideShowLeft");
var leftUpperCol = document.getElementById("leftUpperColumnHomeWrapper");
var rightSmallSS = document.getElementById("smallSlideShowRight");
var rightUpperCol = document.getElementById("rightUpperColumnHomeWrapper");
var isTextBelowSmallSS = document.getElementById("headerFrameBelowSmallHomeTempWrapper");
var textBelowSmallSS = document.getElementById("headerFrameBelowSmallHomeWrapper");
var theFlyerLeft = document.getElementById("flyerWrapperLeft");
var theFlyerRight = document.getElementById("flyerWrapperRight");
var leftLowerCol = document.getElementById("lowerLfColWrapper");
var rightLowerCol = document.getElementById("lowerRtColWrapper");
var bottomPageText = document.getElementById("footerHomeWrapper");
var theBottomPictures = document.getElementById("myPicturesHomeWrapper");
var sideBarCat = document.getElementById("sideBarFrame");
var seoBottomText = document.getElementById("seoTextBottom");

//==================================== SHOW HOME PAGE CONTENT WHEN JAVASCRIPT IS ENABLED
//show body content that is hidden in css and hide dummy nav bar
$('#navBarDivNoScript').css({ display:"none" });
$('#navBarDiv').css({ display:"block" });
$('#bodyContentArea').css({ display:"block" });
$('#rightSideBar').css({ display:"block" });
$('#footNavBar').css({ display:"block" });
$('#customHomeText2Wrapper').css({ display:"block" });

if(seoBottomText == null) {
$('.customHomeText2Link p').css({ display:"none" });
}

if(sideBarCat != null) {
$('#sideBarFrame').css({ display:"block" });
$('#brakeLineSidebar').css({ display:"block" });
}

//==================================== SIDE BAR
//side bar frame without buttons
if(buttons == null) {
$('#sideBarFrame').css({ marginTop:"14px" });
}

//==================================== BIG SLIDE SHOW
//move big slide show to page top
if(topText == null) {
$('#bigSlideShow').css({ marginTop:"30px" });
}
//move big slide show up to top text
if(topText != null) {
$('#bigSlideShow').css({ marginTop:"5px" });
}

//==================================== TEXT BELOW BIG SLIDE SHOW
//text below big slide show to page top
if(topText == null && bigSS == null) {
$('#headerFrameBelowHomeWrapper').css({ marginTop:"10px" });
}
//text below big slide show to top text
if(topText != null && bigSS == null) {
$('#headerFrameBelowHomeWrapper').css({ marginTop:"0px" });
}

//==================================== LEFT VIDEO
//left video to page top
if(topText == null && bigSS == null && textBelowBigSS == null) {
$('#videoWrapperLeft').css({ marginTop:"20px" });
}
//left video to big slide show
if(bigSS != null && textBelowBigSS == null) {
$('#videoWrapperLeft').css({ marginTop:"15px" });
}
//left video to page bottom
if(leftSmallSS == null && leftUpperCol == null && textBelowSmallSS == null && theFlyerLeft == null && leftLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#videoWrapperLeft').css({ marginBottom:"20px" });
}

//==================================== RIGHT VIDEO
//left video to page top
if(topText == null && bigSS == null && textBelowBigSS == null) {
$('#videoWrapperRight').css({ marginTop:"20px" });
}
//left video to big slide show
if(bigSS != null && textBelowBigSS == null) {
$('#videoWrapperRight').css({ marginTop:"15px" });
}
//left video to page bottom
if(rightSmallSS == null && rightUpperCol == null && textBelowSmallSS == null && theFlyerRight == null && rightLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#videoWrapperRight').css({ marginBottom:"20px" });
}

//==================================== LEFT SMALL SLIDE SHOW
//left small slide to page top
if(topText == null && bigSS == null && textBelowBigSS == null && leftVideo == null) {
$('#smallSlideShowLeft').css({ marginTop:"20px" });
}
//left small slide to top of page text
if(topText != null && bigSS == null && textBelowBigSS == null && leftVideo == null) {
//$('#smallSlideShowLeft').css({ marginTop:"100px" });
}
//left small slide to left video
if(leftVideo != null) {
$('#smallSlideShowLeft').css({ marginTop:"20px" });
}
//right small slide to bottom of page  clearRightSmallSS
if(rightUpperCol == null && textBelowSmallSS == null && theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#clearLeftSmallSS').css({ display:"block" });
}

//==================================== LEFT UPPER COL
//upper left col to page top
if(topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null) {
$('#leftUpperColumnHomeWrapper').css({ marginTop:"15px" });
}
//upper left col to left video
if(leftVideo != null && leftSmallSS == null) {
$('#leftUpperColumnHomeWrapper').css({ marginTop:"8px" });
}
//upper left col to small SS
if(leftSmallSS != null) {
$('#leftUpperColumnHomeWrapper').css({ marginTop:"8px" });
}
//upper left col to bottom of page
if(textBelowSmallSS == null && theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#leftUpperColumnHomeWrapper').css({ marginBottom:"20px" });
}

//==================================== RIGHT SMALL SLIDE SHOW
//right small slide to page top
if(topText == null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowRight').css({ marginTop:"20px" });
}
//right small slide to right video
if(rightVideo != null) {
$('#smallSlideShowRight').css({ marginTop:"20px" });
}
//right small slide to bottom of page  clearRightSmallSS
if(rightUpperCol == null && textBelowSmallSS == null && theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#clearRightSmallSS').css({ display:"block" });
}

//==================================== RIGHT UPPER COL
//right upper col to page top
if(topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null) {
$('#rightUpperColumnHomeWrapper').css({ marginTop:"15px" });
}
//upper left col to left video
if(rightVideo != null && rightSmallSS == null) {
$('#rightUpperColumnHomeWrapper').css({ marginTop:"8px" });
}
//upper right col to small SS
if(rightSmallSS != null) {
$('#rightUpperColumnHomeWrapper').css({ marginTop:"8px" });
}
//upper right col to bottom of page
if(textBelowSmallSS == null && theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#rightUpperColumnHomeWrapper').css({ marginBottom:"20px" });
}

//==================================== HEAD TEXT BELOW SMALL SLIDE SHOWS
//head text below small slide shows to page top
if(leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null) {
$('#headerFrameBelowSmallHomeWrapper').css({ marginTop:"5px" });
}
//head text below small slide shows to small slide shows
if((leftSmallSS != null && leftUpperCol == null) || (rightSmallSS != null && rightUpperCol == null)) {
$('#smallSlideShowRight').css({ marginBottom:"-5px" });
$('#smallSlideShowLeft').css({ marginBottom:"-5px" });
}
//head text below small slide shows to upper left and right cols text
if(leftUpperCol != null || rightUpperCol != null) {
$('#headerFrameBelowSmallHomeWrapper').css({ marginTop:"-10px" });
}
//head text below small slide shows to bottom of page
if(theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null && theBottomPictures == null) {
$('#headerFrameBelowSmallHomeWrapper').css({ marginBottom:"10px" });
}

//==================================== LOWER LEFT COL
//lower left col to page top
if(topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && isTextBelowSmallSS == null && theFlyerLeft == null) {
$('#lowerLfColWrapper').css({ marginTop:"15px" });
}
//lower left col for left flyer
if(theFlyerLeft != null) {
$('#lowerLfColWrapper').css({ marginTop:"-15px" });
}
//lower left col to bottom of page
if(bottomPageText == null && theBottomPictures == null) {
$('#lowerLfColWrapper').css({ marginBottom:"20px" });
}

//==================================== LOWER RIGHT COL
//lower right col to page top
if(topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null && isTextBelowSmallSS == null && theFlyerRight == null) {
$('#lowerRtColWrapper').css({ marginTop:"15px" });
}
//lower right col for right flyer
if(theFlyerRight != null) {
$('#lowerRtColWrapper').css({ marginTop:"-15px" });
}
//lower right col to bottom of page
if(bottomPageText == null && theBottomPictures == null) {
$('#lowerRtColWrapper').css({ marginBottom:"20px" });
}

//==================================== BOTTOM FOOTER TEXT
//bottom footer text to bottom of page
if(theBottomPictures == null) {
$('#footerHomeWrapper').css({ marginBottom:"20px" });
}

//==================================== BOTTOM ALBUM PICTURES
//move the bottom pictures to page top
if(topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null && isTextBelowSmallSS == null && theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null) {
$('#myPicturesHomeWrapper').css({ marginTop:"20px" });
}
//move the bottom pictures to small ss
if((leftSmallSS != null || rightSmallSS != null) && leftUpperCol == null && rightUpperCol == null && isTextBelowSmallSS == null && theFlyerLeft == null && theFlyerRight == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null) {
$('#myPicturesHomeWrapper').css({ marginTop:"20px" });
}
//move the bottom pictures for bottom footer text
if(bottomPageText != null) {
$('#myPicturesHomeWrapper').css({ marginTop:"10px" });
}


//==================================== 2 DIVISION PAGE LAYOUT ====================================
//THIS START THE IF FOR THE 2 DIVISION PAGE LAYOUT
//THIS USES #leftSideBarWrapper AND #rightSideBarWrapper
if(isTextBelowSmallSS == null) {

//==================================== FLYER LEFT - 2 DIVISION PAGE
//flyer left to top herader text
if(topText != null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null) {
$('#flyerWrapperLeft').css({ marginTop:"-3px" });
}
//flyer left to big slide show
if(bigSS != null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null) {
$('#flyerWrapperLeft').css({ marginTop:"-3px" });
}
//flyer left to text below big slide show
if(textBelowBigSS != null && leftSmallSS == null && leftUpperCol == null) {
$('#flyerWrapperLeft').css({ marginTop:"-3px" });
}

//==================================== LOWER LEFT COL - 2 DIVISION PAGE
//left lower col for small slide show
if(leftSmallSS != null && leftUpperCol == null && theFlyerLeft == null) {
$('#lowerLfColWrapper').css({ marginTop:"5px" });
}
//left lower col for upper left col text
if(leftUpperCol != null && theFlyerLeft == null) {
$('#lowerLfColWrapper').css({ marginTop:"5px" });
}

//==================================== FLYER RIGHT - 2 DIVISION PAGE
//flyer right to top herader text
if(topText != null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapperRight').css({ marginTop:"-3px" });
}
//flyer right to big slide show
if(bigSS != null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapperRight').css({ marginTop:"-3px" });
}
//flyer right to text below big slide show
if(textBelowBigSS != null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapperRight').css({ marginTop:"-3px" });
}

//==================================== LOWER RIGHT COL - 2 DIVISION PAGE
//lower right col top header text
if(topText != null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null && theFlyerRight == null) {
$('#lowerRtColWrapper').css({ marginTop:"12px" });
}
//lower right col to big slide show
if(bigSS != null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null && theFlyerRight == null) {
$('#lowerRtColWrapper').css({ marginTop:"10px" });
}
//lower right col to text big slide show
if(textBelowBigSS != null && rightSmallSS == null && rightUpperCol == null && theFlyerRight == null) {
$('#lowerRtColWrapper').css({ marginTop:"10px" });
}
//lower right col to small slide show
if(rightSmallSS != null && rightUpperCol == null && theFlyerRight == null) {
$('#lowerRtColWrapper').css({ marginTop:"5px" });
}
//lower right col to upper right col text
if(rightUpperCol != null && theFlyerRight == null) {
$('#lowerRtColWrapper').css({ marginTop:"5px" });
}

}//end of 2 DIVISION PAGE (if isTextBelowSmallSS is null)


});  //end of document.ready function
