

//addLoadEvent( function(){ Tabs.start( $('product-detail') ) } );
//addLoadEvent( function(){ Tabs.start( $('partners') ) } );

// Top Nav
function set_nav(){
	var nav = document.getElementById('topnav');
	var lis = nav.getElementsByTagName('li');
	for(var i=0; i<lis.length; i++){
		var li = lis[i];
				
		li.onmouseover = function(){
		this.className += ' sfhover';
	}
	li.onmouseout = function(){
		this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
	}
						
	if (li.getElementsByTagName('ul').length > 0){
		li.className += ' hasChildren';
	}else{
		li.className += ' hasNoChildren';
		}
	}
					
}

function add_load_event(func) {
	var oldhandler = window.onload;
	window.onload = (typeof window.onload != 'function') ? func: function(){oldhandler();func();};
}

add_load_event(set_nav);


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/*
	Standards Compliant Script
	Alternates Table Columns
	Author : Kevin Cannon
	http://www.multiblah.com
	Last Edited: 12.12.2004
	Version 1.0
	
	Search through the document for tables with the "alternateRows" class,
	and set the class of even rows to "even" to appropriate rows <tr>
	
	Changes:
	4/10/2004 - Added in AddLoadEvent function which piggybacks code onto window.onLoad 
	
*/

// Main function, called when the page loads
function alternateRows() {
	var i, j;
	
	if (!document.getElementById) return
	
		var tables = document.getElementsByTagName("table");	  
		//search through tables in document
		for (i=0; i<tables.length; i++) {
			// If table has the right classname
			if (tables[i].className == "data-table alternateRows") {
				rows = tables[i].getElementsByTagName("tr");
				applyClasstoRows(rows);
			}
		}
}

// Function, which is passed a table reference, applies the class 'even' to each even row, <tr> tag
function applyClasstoRows(myRows) {
	// search through rows
	for (j=0; j<rows.length; j++) {
	
	   // Set class for even rows (odd doesn't need to be set)
	   if (j%2 == 0) { 
		  rows[j].setAttribute("className", "shaded");
		  rows[j].setAttribute("class", "shaded");
	   } 
	}
}


// Piggy-back fucntion onto onLoad event ............................................
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(alternateRows);
function fnredirect(strUrl)
{
	window.location=strUrl;
}

function fnSearch(strValue)
{
	var strLocation = "http://www.qlogic.com/_layouts/OSSSearchResults.aspx?k="+strValue;
	
	window.location=strLocation;
}