/**
 * Channel Menu
 */
var imagePath = "/qcms/qCmsRepository/Portlets/largeBusiness/includes/channel-menu/";
var menuImages = new Array ("bmg_menuChannel.gif","bmg_menuChannel-over.gif","bmg_channelMenuItem.gif","bmg_channelMenuItem-active.gif","bmg_channelMenuItem-active-over.gif","bmg_channelMenuItem-over.gif");
var menuPreload = new Array ();
for (var i = 0; i < menuImages.length; i++ )
{
	menuPreload[ i ]= new Image();
	menuPreload[ i ].src = imagePath + menuImages[i];
} 

var channelMenu;
function ChannelMenu(channel, serverpath, imagepath){
	var channelMenu = this;
	this.activeChannel = channel;
	this.ID = "bmg_Channel_menuItem";
	// Create HTML for menu
					
	this.html = '<a><div class="channelTitle" onClick="javaScript:getChannelUrl(\''+serverpath+'\',\''+channel+'\')">'+channel+'</div><div id="showMenuChannel" class="thickbox channelBtn" onclick="(\'\',\'#TB_inline?height=360&amp;width=240&amp;inlineId=channelMenu_Modal&amp;modal=true\');"><!-- --></div></a>'+
				'<div id="channelMenu_Modal">'+
				'<div class="bmg_channelMenu" style="display:none;">'+
                '<div class="bmg_homeMenu_bgTop"><!-- --></div>'+
                '<div class="bmg_homeMenu_bgleft"><!-- --></div>'+
                '<div class="bmg_homeMenu_bgList">'+
                '  <div class="headingSelector">'+
                '    <div class="bmg_closeMenu" onclick="tb_remove()">'+
                '      <a href="javascript:;"><img src="'+ imagepath +'bmg_channelMenuClose.gif" width="18" height="18" alt="Close button" border="0">'+
                '      </a></div>'+
                '    <div class="bmg_clear0"></div>'+
                '  </div>'+
                '  <div class="seperator"><!-- --></div>'+
                '  <ul class="bmg_Channel_menuList" onclick="tb_remove()">'+
                '    <li id="ch_menuItem_0"><A tabIndex=21 href="'+serverpath+'/home/">Large Business</A></li>'+
                '    <li id="ch_menuItem_1"><A tabIndex=22 href="http://www.qwest.com/smallbusiness/index.html">Small Business</A></li>'+
                '    <li id="ch_menuItem_2"><A tabIndex=23 href="http://www.qwest.com/wholesale/">Wholesale</A></li>'+
                '    <li id="ch_menuItem_3"><A tabIndex=24 href="'+serverpath+'/federal-gov/">Federal Government</A></li>'+
                '    <li id="ch_menuItem_4"><A tabIndex=25 href="'+serverpath+'/state-and-local-gov/">State &amp; Local Government</A></li>'+
                '    <li id="ch_menuItem_5"><A tabIndex=26 href="'+serverpath+'/education/">Education</A></li>'+
                '    <li id="ch_menuItem_6"><A tabIndex=27 href="'+serverpath+'/partners/">Partners</A></li>'+
                '    <li id="ch_menuItem_7"><A tabIndex=28 href="'+serverpath+'/consultants/">Consultants</A></li>'+
                '    <li id="ch_menuItem_8"><A tabIndex=29 href="'+serverpath+'/systems-integrators/">Systems Integrators</A></li>'+
                '  </ul>'+
                '</div>'+
                '<div class="bmg_homeMenu_bgRight"><!-- --></div>'+
                '<div class="bmg_homeMenu_bgBottom"><!-- --></div>'+
                '</div>'+
				'</div>';
	
	$("#"+channelMenu.ID).html(channelMenu.html);
}

function getChannelUrl(serverpath, channel){
	if (channel=="Large Business"){
		location.href= serverpath + "/home/";
	}
	if (channel=="Federal Government"){
		location.href= serverpath + "/federal-gov/";
	}
	if (channel=="State & Local Government"){
		location.href= serverpath + "/state-and-local-gov/";
	}
	if (channel=="Education"){
		location.href= serverpath + "/education/";
	}
	if (channel=="Partners"){
		location.href= serverpath + "/partners/";
	}
	if (channel=="Consultants"){
		location.href= serverpath + "/consultants/";
	}
	if (channel=="Systems Integrators"){
		location.href= serverpath + "/systems-integrators/";
	}
	/** finish the code...*/
}
$(document).ready(function(){
	/* Mouse Over for IE6 */
	$("#bmg_Channel_menuItem a").mouseover(function(){
		$(this).addClass("activeTab");
	}).mouseout(function(){
		$(this).removeClass("activeTab");
	});
	/* End*/
	
	for (var j = 0; j < menuItems.length; j++ )
		{	
			$("#ch_menuItem_"+(j)).removeClass("activeItem");
			if(menuItems[j]==selChannel)
			{
				$("#ch_menuItem_"+(j)).addClass("activeItem");
			}
		}
	/* Channel Menu Show hide */
	$("div.bmg_closeMenu").click(
		function(){
			hideMenuChannel();
		}
	);
	$("ul.bmg_Channel_menuList li a").click(
		function(){
			hideMenuChannel();
		}
	);
	$("div#showMenuChannel").click(
		function(){
			showMenuChannel();
		}
	);
	/* channel Menu end */
});

/* Channel menu Starts */
function showMenuChannel(){
	$("div.bmg_channelMenu").show();		
}
function hideMenuChannel(){
	$("div.bmg_channelMenu").hide();
}
/* Channel menu End */

/* Tab active for Landing Page 
function activeTab(){
	if (landingPageSelected) {
		$("#bmg_Channel_menuItem a").addClass("activeTab");
	}
	else {
		$("#bmg_Channel_menuItem a").removeClass("activeTab");
	}
}
var landingPageSelected = false;
/* Tab active for Landing Page End*/

