//*******************************************************************************************
//*******************************************************************************************
function fl_changeVis(strArgs){ 
	for(var i=0;i<fl_changeVis.arguments.length; i+=2){
		node = null;
		var node = document.getElementById(fl_changeVis.arguments[i]);
		if(node != null){
			node.style.visibility = fl_changeVis.arguments[i+1];
		}
	}
}

//*******************************************************************************************
// function fl_changeSrcs(arg1,arg1-1 [,arg2,arg2-1,arg3,arg3-1,...])
// DOM1 compliant
// changes the attribute "src"  of element argX to argX-1
// multiple argument pairs may be passed
//*******************************************************************************************
function fl_changeSrc(strArgs){ 
	for(var i=0;i<fl_changeSrc.arguments.length; i+=2){
		var node = document.getElementById(fl_changeSrc.arguments[i]);
		node.setAttribute("src", fl_changeSrc.arguments[i+1]); 
	}
}

//*******************************************************************************************
// function fl_changeLoc(arg1)
// jumps to a new page
//*******************************************************************************************
function fl_changeLoc(strDst){
	window.location = strDst;
}

//*******************************************************************************************
// function fl_changeClass(arg1,arg1-1 [,arg2,arg2-1,arg3,arg3-1,...])
// changes the class of element argX to class argX-1
// multiple argument pairs may be passed
//*******************************************************************************************
function fl_changeClass(strID, strClassName){
	for(var i=0;i<fl_changeClass.arguments.length; i+=2){
		var node = document.getElementById(fl_changeClass.arguments[i]);
		node.className = fl_changeClass.arguments[i+1];
		/*
		Using setAttribute for "class" in Explorer does not seem to update the page correctly.
		node.setAttribute("class", fl_changeClass.arguments[i+1]); 
		*/
	}
}

//*******************************************************************************************
// function fl_toggleClass(element, classname1, classname2)
// changes the element to classname1 if it's classname2 and visa-versa
//*******************************************************************************************
function fl_toggleClass(objElement, strClassName1, strClassName2){
	var node;
	node = objElement;
	if ( node.className == strClassName1 ){
		node.className = strClassName2;
	} else {
		node.className = strClassName1;
	}
}

//*******************************************************************************************
// function fl_toggleDisplay(element1, element2, ...)
// changes the CSS attribute "display" to "none" and back to default
//*******************************************************************************************
function toggleDisplay(strArgs){ 
	for(var i=0;i<toggleDisplay.arguments.length; i++){
		var node = document.getElementById(toggleDisplay.arguments[i]);
		if ( node.style.display == "" ){
			node.style.display = "none";
		}else{
			node.style.display = "";
		}
	}
}


//*******************************************************************************************
// function cancelEvent()
// assigning this function to an elements onmouseover prevents the event from propigating 
// to parent objects.
//*******************************************************************************************
function cancelEvent(myEvent){
	// blocks the enter key value from being processed when assigned to an objects event
	// Mozilla sends the event as the first parameter while IE does not
	if (myEvent == null){
		//IE
		myEvent = window.event;
		myEvent.cancelBubble = true;
		//alert(myEvent.srcElement.name);
	} else {
		//DOM2
		myEvent.stopPropagation();
		//alert(myEvent.target);
	}

	return false;
};


//*******************************************************************************************
// function togglePointer()
// toggles the image used for the cursor from default to pointer on each call
//*******************************************************************************************
function fl_togglePointer(){
	// DOM CSS2 required
	if (document.body.style.cursor=='pointer'){
		document.body.style.cursor='';
	}else{
		document.body.style.cursor='pointer';
	}
}

function fl_openWindow(strURL,strWinName,strFeatures){
	window.open(strURL,strWinName,strFeatures);
}

function fl_openWindowCentered(strURL,strWinName,intWidth,intHeight,strFeatures){
	//alert('left='+ (screen.width - intWidth) / 2 +',top='+(screen.height - intHeight ) / 2 +',width='+intWidth+',height='+intHeight+','+strFeatures);
	window.open(strURL,strWinName,'left='+ (screen.width - intWidth) / 2 +',top='+(screen.height - intHeight ) / 2 +',width='+intWidth+',height='+intHeight+','+strFeatures);
}


// MacroMedia function newImage()
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

// MacroMedia function changeImages()
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

// Hiermenus function
if(window.event + "" == "undefined") event = null;
function HM_f_PopUp(){return false};
function HM_f_PopDown(){return false};
popUp = HM_f_PopUp;
popDown = HM_f_PopDown;



function checkDOM()
{
	if (document.getElementById && document.createElement)
		return true;
	else return false;
}




// IE fix for activating controls without requiring user input.
// Inline javascript cannot perform this function 
// reference: http://activecontent.blogspot.com/
var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}