

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}


// Kindler Chase  n3_showHide ver1.3
// www.ncubed.com
function n3_showHide(theID) {
	if(!document.getElementById){return};
	var theElement = document.getElementById(theID);
	if (theElement.style.display == 'block') {
		theElement.style.display = 'none';
	} else {
		theElement.style.display = 'block';
	}
}

// Kindler Chase  n3_ToggleThis ver1.0
// Based off Dan Pastrana - www.fourlevel.com
// www.ncubed.com
function n3_ToggleThis(theID,imgID,img1,img2,alt1,alt2) {
	if(!document.getElementById){return};
	var theElement = document.getElementById(theID);
	var theImage = document.getElementById(imgID);
	var theImageAlt

	if(theImage.src.indexOf(img1)!=-1){
		theImage.src=img2;
		theImageAlt=alt1
	}
	else{
		theImage.src=img1;
		theImageAlt=alt2;
	}
	theImage.setAttribute("alt",theImageAlt);
	
	if (theElement.style.display == 'block') {
		theElement.style.display = 'none';
	} else {
		theElement.style.display = 'block';
	}
}


// Dan Pastrana - www.fourlevel.com
// If you haven't been to Dan's site - go there... he is a mad-flow JS coder!
function n3_ToggleMe(ImgID, First, Second, Alt1, Alt2){
	if(!document.getElementById){return};
	var theImageAlt,arr=document.getElementsByTagName("DIV");
	var theImage=document.getElementById(ImgID);
	if(theImage.src.indexOf(First)!=-1){
		theImage.src=Second;
		theImageAlt=Alt1
	}
	else{
		theImage.src=First;
		theImageAlt=Alt2;
	}
	theImage.setAttribute("alt",theImageAlt);

	for(var i=0;i<arr.length;i++){
		var thisDiv=arr[i];
		if (thisDiv.getAttribute("lang") == "en"){
			var allDivs=arr[i].style.display;
			arr[i].style.display=(allDivs=="none")?allDivs="block":allDivs="none";
		}
	}
}


function n3_confirm(msg) {
	document.MM_returnValue = confirm(msg);
}

function Lvl_openWin(u,n,w,h,l,t,c,f) { //v1.0 4LevelWebs
  var ww=((screen.width-w)/2);if(c==1){l=ww;t=(screen.height-h)/2;}if(c==2){l=ww}
	f+=',top='+t+',left='+l;LvlWin = window.open(u,n,f);LvlWin.focus();
}

// Kindler Chase  n3_swapClass ver1.2
// www.ncubed.com
function n3_swapClass(theID,cssStyle,cssStyleOther) {
	if(!document.getElementById){return};
	var theElement = document.getElementById(theID);
	if (theElement.className == cssStyle) {
		theElement.className = cssStyleOther;
	} else {
		theElement.className = cssStyle;
	}
}


// n3_checker written by Mick White of www.mickweb.com
// check out the old toad when you get a chance.
function n3_checker(checkboxGroup){
	if(!checkboxGroup){return false;} // no checkboxes
	if(!checkboxGroup.length ){// it is not an Array
		return checkboxGroup.type=="checkbox"?checkboxGroup.checked:false
	}
	for(f=0;f<checkboxGroup.length;f++){
		if(checkboxGroup[f].checked){
			return true;
		}
	}
	return false;
}


function n3_xhtmlExternalLinks() { 
	if (!document.getElementsByTagName) return; 
	var anchors = document.getElementsByTagName("a")
	var anchorsMap = document.getElementsByTagName("area"); 
	var i
	var j
	var theLinks
	for (i=0; i<anchors.length; i++) { 
		theLinks = anchors[i]; 
		if (theLinks.getAttribute("href") && theLinks.getAttribute("rel") == "external") theLinks.target = "_blank"; 
	} 
	for (j=0; j<anchorsMap.length; j++) { 
		theLinks = anchorsMap[j]; 
		if (theLinks.getAttribute("href") && theLinks.getAttribute("title") == "external") theLinks.target = "_blank"; 
	} 
}


// submit the select links form with a link and
// send in the id of the category
function n3_getLinks(categoryID) {
  document.frmAdmin.id.value = categoryID ;
  document.frmAdmin.submit() ;
}


//heisted from: http://www.atgconsulting.com/oodynlistbox.asp
function comboItemSelected(oList1,oList2){
	if (oList2!=null){
		clearComboOrList(oList2);
		if (oList1.selectedIndex == -1){
			oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
		} else {
			fillCombobox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
		}
	}
}

function listboxItemSelected(oList1,oList2){
	if (oList2!=null){
		clearComboOrList(oList2);
		if (oList1.selectedIndex == -1){
			oList2.options[oList2.options.length] = new Option('Please make a selection from the list', '');
		} else {
			fillListbox(oList2, oList1.name + '=' + oList1.options[oList1.selectedIndex].value);
		}
	}
}
function clearComboOrList(oList){
	for (var i = oList.options.length - 1; i >= 0; i--){
		oList.options[i] = null;
	}
	oList.selectedIndex = -1;
	if (oList.onchange)	oList.onchange();
}
function fillCombobox(oList, vValue){
	if (vValue != '') {
		if (assocArray[vValue]){
			oList.options[0] = new Option('Please make a selection', '');
			var arrX = assocArray[vValue];
			for (var i = 0; i < arrX.length; i = i + 2){
				if (arrX[i] != 'EOF') oList.options[oList.options.length] = new Option(arrX[i + 1], arrX[i]);
			}
			if (oList.options.length == 1){
				oList.selectedIndex=0;
				if (oList.onchange) oList.onchange();
			}
		} else {
			oList.options[0] = new Option('None found', '');
		}
	}
}
function fillListbox(oList, vValue){
	if (vValue != '') {
		if (assocArray[vValue]){
			var arrX = assocArray[vValue];
			for (var i = 0; i < arrX.length; i = i + 2){
				if (arrX[i] != 'EOF') oList.options[oList.options.length] = new Option(arrX[i + 1], arrX[i]);
			}
			if (oList.options.length == 1){
				oList.selectedIndex=0;
				if (oList.onchange)	oList.onchange();
			}
		} else {
			oList.options[0] = new Option('None found', '');
		}
	}
}



