window.onload=function(){

//Browser Check
var browserCheck = browserType();

/* Height Adjustment */


//TopLinkMenu height
var heightBox01 = document.getElementById('box01').offsetHeight;
var heightBox02 = document.getElementById('box02').offsetHeight;
//var heightBox03 = document.getElementById('box03').offsetHeight;
//var heightBox04 = document.getElementById('box04').offsetHeight;
//var heightBox05 = document.getElementById('box05').offsetHeight;
//var heightBox06 = document.getElementById('box06').offsetHeight;
//var heightBox07 = document.getElementById('box07').offsetHeight;
//var heightBox08 = document.getElementById('box08').offsetHeight;
//var heightBox09 = document.getElementById('box09').offsetHeight;


/*
//Submenu Height
//Submenu 01
var heightsubmenuBoxTextLeft = document.getElementById('submenuBoxTextLeft').offsetHeight;
var heightsubmenuBoxTextRight = document.getElementById('submenuBoxTextRight').offsetHeight;
var heightsubmenuBox01 = Math.max(heightsubmenuBoxTextLeft, heightsubmenuBoxTextRight);




//TEST    Delete this line
//document.getElementById('submenuBox01').style.marginTop = '10px';












//Submenu 02
var heightsubmenuBoxTextLeft02 = document.getElementById('submenuBoxTextLeft02').offsetHeight;
var heightsubmenuBoxTextRight02 = document.getElementById('submenuBoxTextRight02').offsetHeight;
var heightsubmenuBox02 = Math.max(heightsubmenuBoxTextLeft02, heightsubmenuBoxTextRight02);
//Submenu 03
var heightsubmenuBoxTextLeft03 = document.getElementById('submenuBoxTextLeft03').offsetHeight;
var heightsubmenuBoxTextRight03 = document.getElementById('submenuBoxTextRight03').offsetHeight;
var heightsubmenuBox03 = Math.max(heightsubmenuBoxTextLeft03, heightsubmenuBoxTextRight03);
//Submenu 04
var heightsubmenuBoxTextLeft04 = document.getElementById('submenuBoxTextLeft04').offsetHeight;
var heightsubmenuBoxTextRight04 = document.getElementById('submenuBoxTextRight04').offsetHeight;
var heightsubmenuBox04 = Math.max(heightsubmenuBoxTextLeft04, heightsubmenuBoxTextRight04);

//Submenu 05
var heightsubmenuBoxTextLeft05 = document.getElementById('submenuBoxTextLeft05').offsetHeight;
var heightsubmenuBoxTextRight05 = document.getElementById('submenuBoxTextRight05').offsetHeight;
var heightsubmenuBox05 = Math.max(heightsubmenuBoxTextLeft05, heightsubmenuBoxTextRight05);

//Submenu 06
var heightsubmenuBoxTextLeft06 = document.getElementById('submenuBoxTextLeft06').offsetHeight;
var heightsubmenuBoxTextRight06 = document.getElementById('submenuBoxTextRight06').offsetHeight;
var heightsubmenuBox06 = Math.max(heightsubmenuBoxTextLeft06, heightsubmenuBoxTextRight06);
*/


/* 
//Assign the height
//Submenu 01
document.getElementById('submenuBoxText').style.height = heightsubmenuBox01 +"px";

//Submenu 02
document.getElementById('submenuBoxText02').style.height = heightsubmenuBox02 +"px";

//Submenu 03
document.getElementById('submenuBoxText03').style.height = heightsubmenuBox03 +"px";

//Submenu 04
document.getElementById('submenuBoxText04').style.height = heightsubmenuBox04 +"px";

//Submenu 05
document.getElementById('submenuBoxText05').style.height = heightsubmenuBox05 +"px";


//Submenu 06
document.getElementById('submenuBoxText06').style.height = heightsubmenuBox06 +"px";
*/

//Assign submenuBox01 - submenuBox06 height to variables
/* 
heightsubmenuBox01 = document.getElementById('submenuBox01').offsetHeight;
heightsubmenuBox02 = document.getElementById('submenuBox02').offsetHeight;
heightsubmenuBox03 = document.getElementById('submenuBox03').offsetHeight;
heightsubmenuBox04 = document.getElementById('submenuBox04').offsetHeight;
heightsubmenuBox05 = document.getElementById('submenuBox05').offsetHeight;
heightsubmenuBox06 = document.getElementById('submenuBox06').offsetHeight;
*/


//TopLinkMenu calculation
var heightTopLinkMenu = heightBox01 * 9 + (10*9);

//heightsubmenuBox height + padding + margin
//Submenu 01 FF 783 IE 771
/*
//Submenu 01
heightTopLinkMenu += heightsubmenuBox01 + 10 + 10;

//Submenu 02 FF 450 IE 446
heightTopLinkMenu += heightsubmenuBox02 + 10 + 10;

//Submenu 03 FF 52 IE 52
heightTopLinkMenu += heightsubmenuBox03 + 10 + 10;

//Submenu 04 FF 756 IE 751
heightTopLinkMenu += heightsubmenuBox04 + 10 + 10;

//Submenu 05 FF 450 IE 446
heightTopLinkMenu += heightsubmenuBox05 + 10 + 10;

//Submenu 06 FF 180 IE 176
heightTopLinkMenu += heightsubmenuBox06 + 10 + 10;
*/


// topMainContentText + (max: ByVFDBox + paginationDIV + heightTopLinkMenu) + bottomContent = productContent
var topMainContentText = document.getElementById('topMainContentText').offsetHeight;
var ByVFDBox = document.getElementById('ByVFDBox').offsetHeight;
//var paginationDIV = document.getElementById('paginationDIV').offsetHeight;

var bottomContent = document.getElementById('bottomContent').offsetHeight + 10;


//ByVFDBox + paginationDIV
var ByVFDBoxpaginationDIV = ByVFDBox+40;
//Compare Height: ByVFDBox and heightTopLinkMenu
var mainContainer = Math.max(ByVFDBoxpaginationDIV, heightTopLinkMenu);

var productContent = topMainContentText + mainContainer + bottomContent;



document.getElementById('BytopMainContent').style.height = productContent +"px";
//document.getElementById('productContent').style.height = productContent +"px";





















/* Rounded Corner */
Nifty("div#header","all fixed-height");
Nifty("div#menu,div#genre","all fixed-height");
Nifty("div#productContent","bottom right fixed-height");
Nifty("div#productContent","bottom right fixed-height");
Nifty("div#box01,div#box02,div#box03,div#box04,div#box05,div#box06,div#box07,div#box08,div#box09,div#box10","all fixed-height");
Nifty("ul#nav a","transparent top");


}
