<!-- ----------------------------------------------------------------------------------
//
// Description:	Home page routines.
//		  
// Maintenance:
//
// Date			Developer			Modification
// --------   	------------------	----------------------------------------------
// 10/01/06		Dan Carlson			Initial version created.
//
//--------------------------------------------------------------------------------- -->

//-------------------------------------------------------------------------------------
// Attach events.
//-------------------------------------------------------------------------------------
window.onload = InitPage;

//-------------------------------------------------------------------------------------
// Module level variables.
//-------------------------------------------------------------------------------------
var moMain = top.frames;

//-------------------------------------------------------------------------------------
// Link to specified content page.
//-------------------------------------------------------------------------------------
function DoLink() {

	var oSrc = event.srcElement;
    
    switch (oSrc.id) {
        case "ProdIdea1":
			moMain.ContentFrame.location = "Products.asp?#Prints";
            break;
        case "ProdIdea2":
			moMain.ContentFrame.location = "Products.asp?#NCards";
            break;
        case "ProdIdea3":
			moMain.ContentFrame.location = "Products.asp?#Prints";
            break;
        case "ProdIdea4":
			moMain.ContentFrame.location = "Products.asp?#Appt";
            break;
        case "ProdIdea5":
			moMain.ContentFrame.location = "Products.asp?#NCards";
            break;
        case "ProdIdea6":
			moMain.ContentFrame.location = "Products.asp?#PCards";
            break;
        case "ProdIdea7":
			moMain.ContentFrame.location = "Products.asp?#Cal";
            break;
        case "ProfileMore":
			moMain.ContentFrame.location = "Profile.asp";
            break;
        default:
			alert("Unknown link object: " + oSrc.id);
			break;
    }
}

//-------------------------------------------------------------------------------------
// Initializes the page, fires immediately after the browser loads page. 
//-------------------------------------------------------------------------------------
function InitPage() {

	var da = document.all;

	//Position footer.
	da.FooterFrame.style.top = parseInt(da.LeftSide.offsetTop) + parseInt(da.LeftSide.offsetHeight) + 5; 
	da.FooterFrame.style.width = parseInt(da.TopRight.offsetLeft) + parseInt(da.TopRight.offsetWidth); 

	//Do not display a left or right border on the content container.
	//moMain.SetContentBorders(false);

	//Attach events to Product Idea objects.
	ProdIdea1.attachEvent("onmouseover", SetLinkHilite);
	ProdIdea2.attachEvent("onmouseover", SetLinkHilite);
	ProdIdea3.attachEvent("onmouseover", SetLinkHilite);
	ProdIdea4.attachEvent("onmouseover", SetLinkHilite);
	ProdIdea5.attachEvent("onmouseover", SetLinkHilite);
	ProdIdea6.attachEvent("onmouseover", SetLinkHilite);
	//ProdIdea7.attachEvent("onmouseover", SetLinkHilite);
	
	ProdIdea1.attachEvent("onmouseout", SetLinkHilite);
	ProdIdea2.attachEvent("onmouseout", SetLinkHilite);
	ProdIdea3.attachEvent("onmouseout", SetLinkHilite);
	ProdIdea4.attachEvent("onmouseout", SetLinkHilite);
	ProdIdea5.attachEvent("onmouseout", SetLinkHilite);
	ProdIdea6.attachEvent("onmouseout", SetLinkHilite);
	//ProdIdea7.attachEvent("onmouseout", SetLinkHilite);
	
	ProdIdea1.attachEvent("onclick", DoLink);
	ProdIdea2.attachEvent("onclick", DoLink);
	ProdIdea3.attachEvent("onclick", DoLink);
	ProdIdea4.attachEvent("onclick", DoLink);
	ProdIdea5.attachEvent("onclick", DoLink);
	ProdIdea6.attachEvent("onclick", DoLink);
	//ProdIdea7.attachEvent("onclick", DoLink);
	
	//Attach events to Profile "More..." link.
	ProfileMore.attachEvent("onmouseover", SetLinkHilite);
	ProfileMore.attachEvent("onmouseout", SetLinkHilite);
	ProfileMore.attachEvent("onclick", DoLink);
	
}

//-------------------------------------------------------------------------------------
// Applies or removes hilite on a link object.
//-------------------------------------------------------------------------------------
function SetLinkHilite() {

	var oSrc = event.srcElement;
	
	if (oSrc.className == "ProdIdea") {
		var sName = oSrc.id;
		var iNum = parseInt(sName.substr(8));
		var sImageName = "ProdLink" + iNum;
	}
	
    if (event.type == "mouseover") {
		oSrc.style.color = "orange";
 		if (oSrc.className == "ProdIdea") document.all(sImageName).src = "images/LinkArrowOn.jpg";
    }
    else {
		oSrc.style.color = "rgb(0,140,130)";
 		if (oSrc.className == "ProdIdea") document.all(sImageName).src = "images/LinkArrowOff.jpg";
 	}
}

-->