<!--
// BROWSER CHECK
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror')){
	browser = "Konqueror";
	OS = "Linux";
}	
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);
if (!OS){
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string){
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

//NEW WINDOW
rwin=null;
function openWindow(Path,FrameName,windwidth,windheight,windleft,windtop,menubar,scrollbars,resizable){
	rwin =  window.open(Path,FrameName,"menubar="+menubar+",scrollbars="+scrollbars+",resizable="+resizable+",width="+windwidth+",height="+windheight+",status=no,left="+windleft+",top="+windtop);
		if (rwin!= null){
			setTimeout ("rwin.focus();",200);
		}
	return true;
}

// CHECKBOX/RADIO SELECT -- NAVIGATION
function radio_value(formfield) {
	var radio_choice = false;
	var radio_value = 0;
	if(formfield.length){
		for (i=0; i < formfield.length; i++) {
			if (formfield[i].checked) {
				radio_choice = true; 
				radio_value = formfield[i].value;
			}
		}
	} else radio_value = formfield.value;
	return (radio_value);
}

function checkbox_value(formfield) {
	var checkbox_value = "";
	var checkbox_choice	= 0;
	if(formfield.length){
		for (i=0; i < formfield.length; i++) {
			if (formfield[i].checked) {
				if(checkbox_choice){
					checkbox_value += ","+formfield[i].value;
				} else {
					checkbox_value += formfield[i].value;
				}
				checkbox_choice	= 1;
	    	}
		}
	}
	if (!checkbox_choice){
		checkbox_value = 0;
	}
	return checkbox_value;
}

function select_value(formfield) {
	var select_choice = false;
	var select_value = 0;
	for (i=0; i < formfield.length; i++) {
		if (formfield.options[i].selected) {
			select_choice = true; 
			select_value = formfield.options[i].value;
		}
	}
	return (select_value);
}

function showStatus(sMsg) {
    window.status = sMsg ;
  return true ;
}

function navigate(newlocation,fieldvalue,buttontype,confirmmessage,errormessage,multiples,nwindow){
	if(fieldvalue){
		if(buttontype == 'radio') var newvalue = radio_value(fieldvalue);
		if(buttontype == 'checkbox') var newvalue = checkbox_value(fieldvalue);
		if(buttontype == 'select') var newvalue = select_value(fieldvalue);
		var nwindow = nwindow ? nwindow : false;
		var multiples = multiples ? multiples : false;
		if(newvalue == 0 || (!multiples && newvalue.indexOf(',') > 0)) {
			alert(errormessage);
		} else {
			if(confirmmessage.length){
				if(confirm(confirmmessage)){
					window.location = newlocation + newvalue;
				}
			} else {
				if(!nwindow) window.location = newlocation + newvalue;
				else openWindow(newlocation + newvalue,'win',600,600,0,0,'no','yes','yes');
			}
		}
	} else {
		alert(errormessage);
	}	
}

// DIV SHOW HIDE
function ShowHide(div,openclose){
	thediv = document.getElementById(div);
	if(thediv.style.display == 'none' || openclose){
		thediv.style.display = 'inline';
	} else {
		thediv.style.display = 'none';
	}
	return true;
}

// FUNCTIONS
function left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}

// POP-UP CHECKER
function setEvents() {
	var objChild;                           // Window
	var reWork = new RegExp('object','gi');	// Regular expression

	try {
		objChild = window.open('','child','width=50,height=50,status=no,resizable=yes'); 
		objChild.close();
	}
	catch(e) { }

	if(!reWork.test(String(objChild)))
		alert('Warning: A pop-up blocker is enabled for this site!');
	else
		alert('No pop-up blocker or pop-up blocker is disabled!');
}

//PROCESSED FADE - message rec fade
function windowLoad(){
	var processMessage = document.getElementById("processMessage");
	if(processMessage){
		setTimeout('blinkBlink("processMessage")',500);
		fader = new Fadomatic(processMessage, 10, 100, 0);
		if(fader) setTimeout ("fader.fadeOut();",3000);
		if(fader) setTimeout ("processMessage.style.display='none';",4000);
	}
}

//FLICKER/BLINK A DIV AREA
function blinkExecute(target,color){
 // document.getElementById(target).style.backgroundColor = color;
 document.getElementById(target).style.display = color;
}
function blinkBlink (target){
  //color1 = document.getElementById(target).style.backgroundColor; // blinking color
 // color2 = "#ffffff"; // background color
 color1 = 'block';
 color2 = 'none';
  setTimeout('blinkExecute("'+target+'","'+color1+'")',0);
  setTimeout('blinkExecute("'+target+'","'+color2+'")',100);
  setTimeout('blinkExecute("'+target+'","'+color1+'")',200);
  setTimeout('blinkExecute("'+target+'","'+color2+'")',300);             
  setTimeout('blinkExecute("'+target+'","'+color1+'")',400);            
  document.getElementById(target).focus();
}

//SINGLE SELECT CHECKBOX - SHIFT FOR MULTIPLE
function singleselect(evt,frm){
	var formfield = document.displayform[frm.name];
	var snav = (window.event)? window.event.shiftKey : evt.shiftKey
	if(!snav) {
		for(i=0; i < formfield.length; i++) {
			if(formfield[i].value != frm.value) {
				formfield[i].checked = false;
			}
		}
	}
}

//-->
