window.onload = Load;
window.onresize = Resize;

function Load() {
	is.afterLoad(1000,600);
	defineLayerObjs();
	registerEvents();
	MainContent();
}

function Resize() {
	Load();
	if (is.browser=='Netscape' && is.domQuirk) window.location.reload(false);
	Load();
}

function defineLayerObjs() {
	dContent = new LayerObj('divContent');
	dL = new LayerObj('divL');
	dR = new LayerObj('divR');
	dLb = new LayerObj('divLb');
	dLc = new LayerObj('divLc');
	dLd = new LayerObj('divLd');
	dRa = new LayerObj('divRa');
	dRb = new LayerObj('divRb');
	dRc = new LayerObj('divRc');
	dRe = new LayerObj('divRe');
	dLb1 = new LayerObj('divLb1');
	dLb2 = new LayerObj('divLb2');
	dLb3 = new LayerObj('divLb3');
	dLd1a = new LayerObj('divLd1a');
	dLd2a = new LayerObj('divLd2a');
	dRa1 = new LayerObj('divRa1');
	dPic01 = new LayerObj('pic01');
	dTextLb2x1 = new LayerObj('textLb2x1');
	dTextLb2x3 = new LayerObj('textLb2x3');
	dTextRa1 = new LayerObj('textRa1');
	dTextRb1 = new LayerObj('textRb1');
	dTextRe1 = new LayerObj('textRe1');
	dPicLc3 = new LayerObj('picLc3');
	dRc.initResizeContainer(538,331);
	defineOtherLayers();
}

function registerEvents() {
	dPicLc3.obj.onclick = promolink;
	dPicLc3.obj.onmouseover = promostatusover;
	dPicLc3.obj.onmouseout = promostatusout;
	dLd1a.obj.onclick = promolink;
	dLd1a.obj.onmouseover = promostatusover;
	dLd1a.obj.onmouseout = promostatusout;
	dLd2a.obj.onclick = promolink;
	dLd2a.obj.onmouseover = promostatusover;
	dLd2a.obj.onmouseout = promostatusout;
	registerOtherEvents();
}

function MainContent() {
	dContent.setSize(is.clientWidth, is.clientHeight);
	dL.setHeight(dContent.height);
	dR.setSize(dContent.width-dL.width, dContent.height);
	dRa.setWidth(dR.width);
	dRb.setWidth(dR.width);
	dRc.setWidth(dR.width);
	dRe.setWidth(dR.width);
	var h = dContent.height-dRa.height-dRb.height-dRe.height;
	dLb.setHeight(h+dRb.height-dLc.height);
	dLb2.setHeight(dLb.height-dLb1.height);
	dLb3.setHeight(dLb.height);
	dLc.setTop(dLb.bottom);
	dLd.setTop(dLc.bottom);
	dPic01.setLeft(dRa.width-dPic01.width);
	dRa1.setWidth(dPic01.left);
	dTextRa1.setLeft((dRa.width-dTextRa1.width)/3);
	dRc.setHeight(h);
	dRe.setTop(dRc.bottom);
	dTextRe1.setCenterH(dRe);
	dTextLb2x3.setBottom(dLb2.height-10);
	otherMainContent();
}

function promolink(e) {
	var trg = getEventObj(e);
	promoAction(trg, 'link');
}

function promostatusover(e) {
	var trg = getEventObj(e);
	promoAction(trg, 'over');
}

function promostatusout(e) {
	window.status = "";
}

function promoAction(trg, action) {
	switch(trg.id) {
	case 'picLc3':
		switch(action) {
		case 'link':
			window.location.href = 'ContactUs.htm';
			break;
		case 'over':
			window.status = 'Contact Us';
			break;
		}
		break;
	case 'divLd1a':
		switch(action) {
		case 'link':
			window.location.href = 'MemberServices.php';
			break;
		case 'over':
			window.status = 'Member Services Login';
			break;
		}
		break;
	case 'divLd2a':
		switch(action) {
		case 'link':
			window.location.href = 'Purchase.htm';
			break;
		case 'over':
			window.status = 'Products and Downloads';
			break;
		}
		break;
	default:
		promoOtherAction(trg, action);
	}
}