function getElement(element) {
	if (document.getElementById) {
		return document.getElementById(element);
	}	
	else if (document.all) {
		return document.all(element);
	}
	else if (document.layers){
		return document.layers[element];
	}
	else {
		return null;
	}
}

function resizeLeftNav() {
	return;

	// 6/13/2011 - disabled since we changed the left nav now
	//var leftnavt_height = $('#leftnav-top').height();
	//var leftnavm_height = $('#leftnav-middle').height();
	//var leftnavb_height = $('#leftnav-bottom').height();
	//var leftnav_height = leftnavt_height + leftnavm_height + leftnavb_height;
	//var content_height = $('#content').height() - 8;
	////alert(content_height);
	//if(content_height > leftnav_height) {
	//	$('#leftnav-middle').css('height', (content_height-leftnavt_height-leftnavb_height) + 'px');
	//}
}

// initalize the autocomplete jquery functionality
function searchInit() {

	$( "#search" ).autocomplete({
		source: "/ajax/searchresults.php",
		select: function(event, ui) {
			if(ui.item.url != '') {
				//var urlext = ui.item.url.slice(-3);
				//if( urlext.toUpperCase() == 'PDF' ) {
				var urltext = ui.item.url.toUpperCase();
				if( urltext.lastIndexOf('PDF') != -1 ) {
					window.open(ui.item.url);
				} else {
					location.href = ui.item.url;
				}
			}
		}
	});
}

// preload images
$(document).ready(function() {

	var oimg = new Image(); 
	oimg.src = "/images/search-bg-active.png";

});



/* old function (netlink site) */
function gothere() {
	newwindow=window.open("")
	newwindow.location=document.dropdowns.part.options[document.dropdowns.part.selectedIndex].value
}
function gospecsheet() {
	newwindow=window.open("")
	newwindow.location=document.dropdowns.specsheet.options[document.dropdowns.specsheet.selectedIndex].value
}
function photoWindow(image) {window.open(image,'photo','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,width=525,height=525')}

