dojo.addOnLoad(function() {
	new fadeshow(fadeimages, overlayimg, 587, 266, 0, 4000, 1);
	dojo.style(dojo.byId("bodyRow"),  "visibility", "visible");
	
	dojo.parser.parse();	
	
	var totalH = 270;
	var contentH = 196;	
	var topStrip = dojo.query(".dijitTabContainerTop-tabs.dijitTabContainerTopStrip.dijitAlignTop")[0];
	var topStripHeight = dojo.coords(topStrip).h;
	//console.debug(topStripHeight);
	var nestedStripHeight = 0;
	dojo.query('[id^=\"dijit_layout_TabContainer\"]:.dijitTabContainerTabListNested').forEach(function(node, index, array){
		nestedStripHeight = dojo.coords(node).h;
		var t = null;
		var subtitle = "";		
		var n = node.nextSibling;        
        while (n) {
			var cname = dojo.attr(n, "class");
			if (cname && cname.indexOf("dijitTabPaneWrapperNested") > -1) {
				t = n;
				break;
			}		
			n = n.nextSibling;
		}		
		//console.debug(t);		
		if (t && t.childNodes) {
			for (var j in t.childNodes) {
				var k = t.childNodes[j];
				var cname = dojo.attr(k, "class");
				if (cname && cname == "subTitleHidden") {
					subtitle = k.innerHTML;
					break;
				}
			}
		}		
		//console.debug(subtitle);		
		if (t && subtitle.length > 0) {
			var s = dojo.doc.createElement("div");
			dojo.attr(s, "class", "innerTabListPrefix");
			var t = dojo.doc.createTextNode(subtitle);
			dojo.place(t, s, "first");
			dojo.place(s, node, "first");
		}
	}); 	
	//console.debug(nestedStripHeight);
	var singleOffest = totalH - topStripHeight - 46 - contentH;
	if (nestedStripHeight  <= 0) {
		if (topStripHeight == 27) {
			nestedStripHeight = 44;
		} else {
			nestedStripHeight = 45;
		}
	}	
	var nestOffest = totalH - topStripHeight - nestedStripHeight - contentH;
	//console.debug(singleOffest);
	//console.debug(nestOffest);
	dojo.query(".singleTabImg").forEach(function(node, index, array) {
		if (singleOffest > 0) {
			dojo.attr(node, "height", singleOffest);
		} else {
			dojo.query(".srow").forEach(function(node, index, array) {						
				var parent = node.parentNode;
				parent.removeChild(node);
			});
		}
	});
		
	dojo.query(".nestedTabImg").forEach(function(node, index, array) {
		if (nestOffest > 0) {
			dojo.attr(node, "height", nestOffest);
		} else {
			dojo.query(".nrow").forEach(function(node, index, array) {
				var parent = node.parentNode;
				parent.removeChild(node);
			});
		}
	});

	dojo.style(dojo.byId("lftTab"),   "visibility", "visible");	
	
   	dojo.query("#fpCtl").onclick(function(e){
		var node = e.currentTarget;		
   		//dojo.style(node, "backgroundColor", "#EDECE6");
		dojo.attr(node, "class", "home_pf_tab_selected");
   		dojo.style(dojo.byId("ffDiv"), "visibility", "hidden");
     	//dojo.style(dojo.byId("ffCtl"), "backgroundColor", "white");
		dojo.attr(dojo.byId("ffCtl"), "class", "home_pf_tab_unselected");
		dojo.style(dojo.byId("fpDiv"), "visibility", "visible");
   	});
        	
	dojo.query("#ffCtl").onclick(function(e){
		var node = e.currentTarget;
        //dojo.style(node, "backgroundColor", "#EDECE6");
		dojo.attr(node, "class", "home_pf_tab_selected");
        dojo.style(dojo.byId("fpDiv"), "visibility", "hidden");
        //dojo.style(dojo.byId("fpCtl"), "backgroundColor", "white");
		dojo.attr(dojo.byId("fpCtl"), "class", "home_pf_tab_unselected");
    	dojo.style(dojo.byId("ffDiv"), "visibility", "visible");
   	});
	
	dojo.style(dojo.byId("rhtTab"),  "visibility", "visible");
	
 });
 
  function featurePostForward() {
	dijit.byId('featurepost').forward();	
 }
 
 function featurePostBackward() {
	dijit.byId('featurepost').back();
 }
