/*Written by D.H.Tucker - Copywrite 2011 This is to controll css for the default.html CMS home page*/
$(document).ready(function() {
var buttons = document.getElementById("addThisWrapper");
var topText = document.getElementById("headerFrameHomeWrapper");
var bigSS = document.getElementById("bigSlideShow");
var textBelowBigSS = document.getElementById("headerFrameBelowHomeWrapper");
var leftUpperCol = document.getElementById("leftUpperColumnHomeWrapper");
var rightUpperCol = document.getElementById("rightUpperColumnHomeWrapper");
var leftSmallSS = document.getElementById("smallSlideShowLeft");
var rightSmallSS = document.getElementById("smallSlideShowRight");
var isTextBelowSmallSS = document.getElementById("headerFrameBelowSmallHomeTempWrapper");
var textBelowSmallSS = document.getElementById("headerFrameBelowSmallHomeWrapper");
var theFlyer = document.getElementById("flyerWrapper");
var leftLowerCol = document.getElementById("lowerLfColWrapper");
var rightLowerCol = document.getElementById("lowerRtColWrapper");
var bottomPageText = document.getElementById("footerHomeWrapper");
var theBottomPictures = document.getElementById("myPicturesHomeWrapper");

//==================================== SHOW BODY CONTENT
//show body content that is hidden in css and hide dummy nav bar
$('#navBarDivNoScript').css({ display:"none" });
$('#navBarDiv').css({ display:"block" });
$('#bodyContentScriptArea').css({ display:"block" });
$('#footNavBar').css({ display:"block" });

//==================================== HEADER TOP TEXT
//top header text to buttons
if(buttons != null) {
$('#headerFrameHomeWrapper').css({ marginTop:"18px" });
}
//top header text to menu
if(buttons == null) {
$('#headerFrameHomeWrapper').css({ marginTop:"8px" });
}

//==================================== BIG SLIDE SHOW
//move big slide show down for buttons
if(buttons != null && topText == null) {
$('#bigSlideShow').css({ marginTop:"30px" });
}
//move big slide show down from nav bar
if(buttons == null && topText == null) {
$('#bigSlideShow').css({ marginTop:"18px" });
}
//move big slide show up for top of page text
if(topText != null) {
$('#bigSlideShow').css({ marginTop:"5px" });
}

//==================================== TEXT BELOW BIG SLIDE SHOW
//text below big slide show to buttons
if(buttons != null && topText == null && bigSS == null) {
$('#headerFrameBelowHomeWrapper').css({ marginTop:"17px" });
}
//text below big slide show to menu
if(buttons == null && topText == null && bigSS == null) {
$('#headerFrameBelowHomeWrapper').css({ marginTop:"7px" });
}
//text below big slide show to top text
if(topText != null && bigSS == null) {
$('#headerFrameBelowHomeWrapper').css({ marginTop:"0px" });
}

//==================================== LEFT SMALL SLIDE SHOW
//left small slide to menu
if(topText == null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowLeft').css({ marginTop:"19px" });
}
//left small slide to top text
if(topText != null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowLeft').css({ marginTop:"10px" });
}
//left small slide to big slide show
if(bigSS != null && textBelowBigSS == null) {
$('#smallSlideShowLeft').css({ marginTop:"10px" });
}
//left small slide to text below big slide show
if(textBelowBigSS != null) {
$('#smallSlideShowLeft').css({ marginTop:"11px" });
}

//==================================== BOTH SMALL SLIDE SHOWS
//both small slide shows to buttons
if(buttons != null && leftSmallSS != null && rightSmallSS != null && topText == null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowLeft').css({ marginTop:"31px" });
$('#smallSlideShowRight').css({ marginTop:"31px" });
}
//both small slide shows to menu
if(buttons == null && leftSmallSS != null && rightSmallSS != null && topText == null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowLeft').css({ marginTop:"19px" });
$('#smallSlideShowRight').css({ marginTop:"19px" });
}


//==================================== RIGHT SMALL SLIDE SHOW
//right small slide show to buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null) {
$('#smallSlideShowRight').css({ marginTop:"30px" });
}
//right small slide show to menu
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowRight').css({ marginTop:"19px" });
}
//right small slide show to top text
if(topText != null && bigSS == null && textBelowBigSS == null) {
$('#smallSlideShowRight').css({ marginTop:"10px" });
}
//right small slide show to big slide show
if(bigSS != null && textBelowBigSS == null) {
$('#smallSlideShowRight').css({ marginTop:"10px" });
}
//right small slide show to text below big slide show
if(textBelowBigSS != null) {
$('#smallSlideShowRight').css({ marginTop:"11px" });
}

//==================================== LEFT UPPER COL
//upper left col to menu
if(topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null) {
$('#leftUpperColumnHomeWrapper').css({ marginTop:"10px" });
}

//==================== LEFT  AND RIGHT UPPER COLS ONLY AND ALINGED FOR BUTTONS
//upper cols to buttons
if(buttons != null && leftUpperCol != null && rightUpperCol != null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && rightSmallSS == null) {
$('#leftUpperColumnHomeWrapper').css({ marginTop:"22px" });
}

//==================================== RIGHT UPPER COL
//right upper col to buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null) {
$('#rightUpperColumnHomeWrapper').css({ marginTop:"22px" });
}
//right upper col to menu
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null) {
$('#rightUpperColumnHomeWrapper').css({ marginTop:"10px" });
}

//==================================== HEAD TEXT BELOW SMALL SLIDE SHOWS
//head text below small slide shows to buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null) {
$('#headerFrameBelowSmallHomeWrapper').css({ marginTop:"13px" });
}
//head text below small slide shows to menu
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null && 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
if(leftUpperCol != null || rightUpperCol != null) {
$('#headerFrameBelowSmallHomeWrapper').css({ marginTop:"-10px" });
}

//==================================== BOTTOM FOOTER TEXT
//bottom text to buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null&& theFlyer == null && leftLowerCol == null && rightLowerCol == null) {
$('#footerHomeWrapper').css({ marginTop:"16px" });
}
//bottom text to menu
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null&& theFlyer == null && leftLowerCol == null && rightLowerCol == null) {
$('#footerHomeWrapper').css({ marginTop:"5px" });
}

//==================================== BOTTOM ALBUM PICTURES
//move the bottom pictures for buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null && theFlyer == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null) {
$('#myPicturesHomeWrapper').css({ marginTop:"28px" });
}
//move the bottom pictures for menu
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null && theFlyer == null && leftLowerCol == null && rightLowerCol == null && bottomPageText == null) {
$('#myPicturesHomeWrapper').css({ marginTop:"16px" });
}
//move the bottom pictures for bottom footer text
if(bottomPageText != null) {
$('#myPicturesHomeWrapper').css({ marginTop:"10px" });
}


//================================= TEXT BELOW SS 4 COLUMN PAGE LAYOUT ================================
//THIS DOES NOT USE #leftSideBarWrapper AND #rightSideBarWrapper

//THIS START THE IF FOR THE DIFFERENT LAYOUTS
//switch the page layout for text below small slide show
if(isTextBelowSmallSS != null) {
$('#sideBarTopHomeLeft').css({ marginLeft:"50px" , marginBottom:"0px" , marginRight:"20px" });
$('#sideBarTopHomeRight').css({ marginBottom:"0px" , marginRight:"35px" });
$('#lowerRtColWrapper').css({ marginRight:"35px" });
	if(leftLowerCol == null) {
	$('#flyerWrapper').css({ float:"none" , marginLeft: "45px" });
	$('#lowerRtColWrapper').css({ float:"none" , marginLeft: "45px" });
	}
}
//============================== NO TEXT BELOW SS 2 COLUMN PAGE LAYOUT ================================
else {
//THIS USES #leftSideBarWrapper AND #rightSideBarWrapper

//right side when nothing is on left side and no text below small slide show
if(leftSmallSS == null && leftUpperCol == null && leftLowerCol == null) {
$('#rightSideBarWrapper').css({ marginLeft:"45px" });
}

//==================================== FLYER - 2 COLUMN PAGE
//flyer to menu with no buttons
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapper').css({ marginTop:"3px" });
}
//flyer to menu with buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapper').css({ marginTop:"13px" });
}
//flyer to top herader text
if(topText != null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapper').css({ marginTop:"-3px" });
}
//flyer to big slide show
if(bigSS != null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapper').css({ marginTop:"-3px" });
}
//flyer to text below big slide show
if(textBelowBigSS != null && rightSmallSS == null && rightUpperCol == null) {
$('#flyerWrapper').css({ marginTop:"-3px" });
}

//==================================== LOWER LEFT COL - 2 COLUMN PAGE
//left lower col to menu without flyer
if(topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && theFlyer == null) {
$('#lowerLfColWrapper').css({ marginTop:"10px" });
}
//left lower col to menu with flyer
if(topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && theFlyer != null) {
$('#lowerLfColWrapper').css({ marginTop:"10px" });
}
//left lower col for small slide show
if(leftSmallSS != null && leftUpperCol == null && theFlyer == null) {
$('#lowerLfColWrapper').css({ marginTop:"5px" });
}
//left lower col for upper left col text
if(leftUpperCol != null && theFlyer == null) {
$('#lowerLfColWrapper').css({ marginTop:"5px" });
}

//==================================== LOWER LEFT COL WITH LOWER RIGHT COL - 2 COLUMN PAGE
//left and right col to buttons
if(buttons != null && leftLowerCol != null && rightLowerCol != null && topText == null && bigSS == null && textBelowBigSS == null && leftSmallSS == null && leftUpperCol == null && rightSmallSS == null && rightUpperCol == null && theFlyer == null) {
$('#lowerLfColWrapper').css({ marginTop:"21px" });
$('#lowerRtColWrapper').css({ marginTop:"21px" });
}

//==================================== LOWER RIGHT COL - 2 COLUMN PAGE
//lower right col to buttons
if(buttons != null && topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#lowerRtColWrapper').css({ marginTop:"21px" });
}
//lower right col to menu
if(buttons == null && topText == null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#lowerRtColWrapper').css({ marginTop:"10px" });
}
//lower right col to big slide show
if(bigSS != null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#lowerRtColWrapper').css({ marginTop:"10px" });
}
//lower right col top header text
if(topText != null && bigSS == null && textBelowBigSS == null && rightSmallSS == null && rightUpperCol == null) {
$('#lowerRtColWrapper').css({ marginTop:"12px" });
}
//lower right col to text big slide show
if(textBelowBigSS != null && rightSmallSS == null && rightUpperCol == null) {
$('#lowerRtColWrapper').css({ marginTop:"10px" });
}
//lower right col to small slide show
if(rightSmallSS != null && rightUpperCol == null) {
$('#lowerRtColWrapper').css({ marginTop:"5px" });
}
//lower right col to upper right col text
if(rightUpperCol != null) {
$('#lowerRtColWrapper').css({ marginTop:"5px" });
}

}//end else - 2 COLUMN PAGE

});
