function fOnLoad() {
    //setup feature button click and mouse over events(allow for bubble up/down)
    dojo.connect(dojo.byId('feature_background'),"onmouseover",featureEventHandler);
    dojo.connect(dojo.byId('feature_background'),"onmouseout",featureEventHandlerOff);
    dojo.connect(dojo.byId('feature_index_link'),"onclick",function(){document.location.href='index.html';});
}

function featureEventHandlerOff(evtObj) {
	try{
		var deviceDivId = globalCarrier + "_" + globalColor ;
		if(evtObj.target.id) {
			strObj = evtObj.target.id;
			switch(strObj.substring(0,12)) { //test for what div the mouse is over
				case "selector_loc":
					dojo.byId(strObj).style.backgroundImage = "none" ;
					break;
				default:
					break;
			}
		}
	}
	catch(err) {}
}

function featureEventHandler(evtObj) {
	try{
		var deviceDivId = globalCarrier + "_" + globalColor ;
		if(evtObj.target.id) {
			strObj = evtObj.target.id;
			switch(strObj.substring(0,12)) { //test for what div the mouse is over
				case "selector_loc":
					dojo.byId("feature_treo_" + deviceDivId + "_off").style.display = "none";  //turn off this background
					dojo.byId("feature_treo_" + deviceDivId + "_on").style.display = "block";  //turn off this background
					dojo.byId(strObj).style.backgroundImage = "url(images/selector/" + thisPage + "_" + strObj + "_on.jpg)" ;
					hideScreenShots();
					dojo.byId(strObj+"_screen_shot").style.display = "block";
					globalCurrentView = strObj;
					break;
				case "selector_are":
					if(globalCurrentView!="") {
						dojo.byId(globalCurrentView).style.backgroundImage = "none" ;
					}
					break;
				case "feature_back":
					showTreo();
					break;
				default:
					showTreo();
					break;
			}
		}
	}
	catch(err) {}
}
function hideScreenShots() {
    for(i=1; i<=orbCount;i++) {
        dojo.byId("selector_loc" + String(i) + "_screen_shot").style.display = "none"; //turn off screens
    }

}

function showTreo() {
    var deviceDivId = globalCarrier + "_" + globalColor ;
    hideScreenShots();
    //featured treo device
    dojo.byId("feature_treo_brazil_white_off").style.display = "none";  //turn off this background
    dojo.byId("feature_treo_brazil_black_off").style.display = "none";  //turn on this background
	//console.log("selected: " + "feature_treo_" + deviceDivId + "_off") ;
    dojo.byId("feature_treo_" + deviceDivId + "_off").style.display = "block";  //turn off this background
}

function fadeOneObject(targetFadeObject) {
    tFade = new dojo.fx.Toggler({ node: targetFadeObject, hideDuration:250, showDuration: 500}); 
    tFade.hide(10);									   
    tFade.show(200); 
}
function fadeTwoObjects(targetFadeOutObject, targetFadeInObject) {
    tFade1 = new dojo.fx.Toggler({ node: targetFadeOutObject, hideDuration:250}); 
    tFade1.hide(10);								   
    tFade2 = new dojo.fx.Toggler({ node: targetFadeInObject, showDuration:250}); 
    tFade2.show(10); 
}

