/* ENABLE SEARCHING */
function sendSearchHelper(searchURL,formId,searchDropDownId) { 
	sendSearchRedirect2('http://www.cnet.com', 'http://www.search.com/redirect', formId, 'target', '2001-1_1-0', '1');
};

function trapSearchKey(e, keyToCheck, enterFunction){
	if (!e) e = window.event;
	if (e.keyCode == keyToCheck){
		enterFunction();
		return false;
	} else {
		return true;
	}
};

/* Pop up BIOS */
function showHide(elementid){
	if ($(elementid).style.display == 'none'){
		$(elementid).style.display = '';
		$(elementid).style.border = '1px solid gray';
		$(elementid).style.position = 'absolute';
		$(elementid).style.top = '70px';
		$(elementid).style.left = '0px';
		$(elementid).style.background = '#FFF';
		$(elementid).style.padding = '10px';
		$(elementid).style.width = '300px';
		$(elementid).getParent().style.zIndex = '2';
		$('rb_content').style.zIndex = '5999';
	} else {
		$(elementid).style.display = 'none';
		$(elementid).getParent().style.zIndex = '1';
		$('rb_content').style.zIndex = '0';
	}
}

/* EXPANDING BIOS */
function expandCollapse(elementid){
	if ($(elementid).style.display == 'none'){
		$(elementid).style.display = '';
	} else {
		$(elementid).style.display = 'none';
	}
}

//function to draw out breadcrumb text

function drawAboutBreadcrumbText(contentID){
		if(contentID == "undefined" || contentID == "" || contentID == null){
			{contentID = '6722448';}
		}else{
			var about_navID = about_navObj[contentID].nav;	
			document.write('<li>' + aboutTabNavigation[about_navID][0] + '</li>');
		}	
}

//function to draw out the navugational tabs
function drawAboutTabNavigation(contentID) {
	
	if(contentID == "undefined" || contentID == "" || contentID == null)
		{contentID = '6722448';}
	var about_navID = about_navObj[contentID].nav;	
	for (var i=0;i<7;i++) {
		if (i == about_navID) {
			document.write ('<li class=\"active\"><a href=\"' + aboutTabNavigation[i][1] + '?tag=top_nav\">' + aboutTabNavigation[i][0] + '</a></li>');
		} else {
			document.write ('<li><a href=\"' + aboutTabNavigation[i][1] + '?tag=top_nav\">' + aboutTabNavigation[i][0] + '</a></li>');
		}
	}
}

//function to draw out the left navs for each tab
function drawAboutLeftNavigation(contentID, pageNum) {
	if(contentID == "undefined" || contentID == "" || contentID == null)
		{contentID = '6722448';}
	if(pageNum == "undefined" || pageNum == "" || pageNum == null)
		{pageNum = '1';}	
	var page_num = pageNum;
	var contentId = contentID;
	var about_navID = about_navObj[contentID].nav;
	var about_leftNavID = about_navObj[contentID].leftnav;
	var about_subNavID = about_navObj[contentID].subnav;
	var hasSubNav = false;
	if (about_subNavID != null){
		hasSubNav = true;
	}
	for(var j=0; j < aboutLeftNavigation[about_navID].length; j++) {
		if(j == 0){
			document.write('<dt><a href=\"' + aboutLeftNavigation[about_navID][j][1] + '\">' + aboutLeftNavigation[about_navID][j][0] + '</a></dt>');
		}
		else if(j == about_leftNavID) {
			if(hasSubNav == true){
				document.write('<dd class=\"youAreHere\"><dl><dd><a href=\"' + aboutLeftNavigation[about_navID][j][1] + '\">' + aboutLeftNavigation[about_navID][j][0] + '</a></dd>');
				drawAboutSubNavigation(contentId,pageNum);
				document.write('</dl></dd>');
			}
			else{
				document.write('<dd class=\"youAreHere\"><a href=\"' + aboutLeftNavigation[about_navID][j][1] + '\">' + aboutLeftNavigation[about_navID][j][0] + '</a></dd>');
			}
		} else {
			document.write('<dd><a href=\"' + aboutLeftNavigation[about_navID][j][1] + '\">' + aboutLeftNavigation[about_navID][j][0] + '</a></dd>');
		}
	}
}
//function to draw out the sub navs
function drawAboutSubNavigation(contentID,pageNum) {
	if(contentID == "undefined" || contentID == "" || contentID == null)
		{contentID = '6722448';}
	if(pageNum == "undefined" || pageNum == "" || pageNum == null)
		{pageNum = '1';}	
	var page_num = pageNum;
	var about_navID = about_navObj[contentID].nav;
	var about_subNavID = about_navObj[contentID].subnav;
	for(var n=1; n < aboutSubNavigation[about_subNavID].length; n++) {
		if(aboutSubNavigation[about_subNavID][n][0] != null && aboutSubNavigation[about_subNavID][n][0] != "" && aboutSubNavigation[about_subNavID][n][0] != "undefined"){
			if(n == page_num) {
				document.write('<dd class=\"subNav current\">' + aboutSubNavigation[about_subNavID][n][0] + '</dd>');
			} else {
				document.write('<dd class=\"subNav\"><a href=\"' + aboutSubNavigation[about_subNavID][n][1] + '\">' + aboutSubNavigation[about_subNavID][n][0] + '</a></dd>');
			}	
		}
	}
}

