<!--
ua=navigator.userAgent;
v=navigator.appVersion.substring(0,1);
if ((ua.lastIndexOf("MSIE")!=-1) && (v!='1') && (v!='2') && (v!='3')) {
	document.body.onmouseover=makeCool;
	document.body.onmouseout=makeNormal;
}
function makeCool() {
    src = event.toElement;
    if (src.tagName == "A") {
        src.oldcol = src.style.color;
        src.style.color = "red"; 
    }
}
function makeNormal() {
    src=event.fromElement;
    if (src.tagName == "A") {
        src.style.color = src.oldcol;
    }
}

function openNewWindow(url, wname, vert, vpercent, h, horz, hpercent, w, featuresArray) {
	if(vpercent > 100) vpercent = 100;
	if(hpercent > 100) hpercent = 100;
	if(vpercent < 0) vpercent = 0;
	if(hpercent < 0) hpercent = 0;
	var newWindowTop;
	var newWindowLeft;
	var features;
	
	if(h > window.availHeight) {
		newWindowTop = 0;
	} else if(vert.toUpperCase() == "BOTTOM") {
		newWindowTop = window.screen.availHeight - ((window.screen.availHeight * (vpercent/100)) + h);
		if(newWindowTop < 0) newWindowTop = 0;
	} else if(vert.toUpperCase() == "TOP") {
		newWindowTop = window.screen.availHeight * (vpercent/100);
		if(newWindowTop >= window.screen.availHeight) newWindowTop = window.screen.availHeight -30;
	} else {
		newWindowTop = 0;
	}
	
	if(w > window.availWidth) {
		newWindowLeft = 0;
	} else if(horz.toUpperCase() == "RIGHT") {
		newWindowLeft = window.screen.availWidth - ((window.screen.availWidth * (vpercent/100)) + w);
		if(newWindowLeft < 0) newWindowLeft = 0;
	} else if(horz.toUpperCase() == "LEFT") {
		newWindowLeft = window.screen.availWidth * (vpercent/100);
		if(newWindowLeft >= window.screen.availWidth) newWindowLeft = window.screen.availWidth -30;
	} else {
		newWindowLeft = 0;
	}

		leftString = new Number(newWindowLeft).toString();
		index = leftString.lastIndexOf(".");
		if(index == -1) index = leftString.length;
		leftString = leftString.substring(0,index);

		topString = new Number(newWindowTop).toString();
		index = topString.lastIndexOf(".");
		if(index == -1) index = topString.length;
		topString = topString.substring(0,index);

	if(ua.toUpperCase().lastIndexOf("MSIE") != -1) {
		features = "left=" + leftString + ",";
		features = features + "top=" + topString + ",";
	} else {
		features = "screenX=" + leftString + ",";
		features = features + "screenY=" + topString + ",";
	}
	
	features += "width=" + w + ",height=" + h + ",";
	
	for(var i=0; i < featuresArray.length; i++) {
		features = features + featuresArray[i] + ",";
	}
	
	features = features.substring(0,features.length-1);
	return window.open(url, wname, features);
}

function move(direction, theSelect) {
	if (theSelect.selectedIndex == -1) return;
	var holdText = theSelect.options[theSelect.selectedIndex].text;
	var holdValue = theSelect.options[theSelect.selectedIndex].value;
	switch (String(direction).toUpperCase()) {
		case 'DOWN':
			if (theSelect.selectedIndex < (theSelect.options.length - 1)) {
				theSelect.options[theSelect.selectedIndex].text = theSelect.options[theSelect.selectedIndex + 1].text;
				theSelect.options[theSelect.selectedIndex].value = theSelect.options[theSelect.selectedIndex + 1].value;
				theSelect.options[theSelect.selectedIndex + 1].text = holdText;
				theSelect.options[theSelect.selectedIndex + 1].value = holdValue;
				theSelect.selectedIndex = theSelect.selectedIndex + 1;
			}
			break;
			
		case 'UP':
			if (theSelect.selectedIndex > 0) {
				theSelect.options[theSelect.selectedIndex].text = theSelect.options[theSelect.selectedIndex - 1].text;
				theSelect.options[theSelect.selectedIndex].value = theSelect.options[theSelect.selectedIndex - 1].value;
				theSelect.options[theSelect.selectedIndex - 1].text = holdText;
				theSelect.options[theSelect.selectedIndex - 1].value = holdValue;
				theSelect.selectedIndex = theSelect.selectedIndex - 1;
			}
			break;
		case 'TOP':
			if (theSelect.selectedIndex > 0) {
				for(i = theSelect.selectedIndex; i > 0; i--) {
					theSelect.options[i].text = theSelect.options[i - 1].text;
					theSelect.options[i].value = theSelect.options[i - 1].value;
				}
				theSelect.options[0].text = holdText;
				theSelect.options[0].value = holdValue;
				theSelect.selectedIndex = 0;
			}
			break;
		case 'BOTTOM':
			if (theSelect.selectedIndex < (theSelect.options.length - 1)) {
				for(i = theSelect.selectedIndex; i < theSelect.options.length - 1; i++) {
					theSelect.options[i].text = theSelect.options[i + 1].text;
					theSelect.options[i].value = theSelect.options[i + 1].value;
				}
				theSelect.options[theSelect.options.length - 1].text = holdText;
				theSelect.options[theSelect.options.length - 1].value = holdValue;
				theSelect.selectedIndex = theSelect.options.length - 1;
			}
			break;
	}
}

function makeRequired(form, fields) {
	var field;
    for(var i = 0; i < fields.length; i++) {
		field = form.elements[fields[i]];
		switch(field.type) {
			case "select-multiple" :
				if(field.options.length == 0 || field.selectedIndex == -1) {
            		alert("This field is required");
            		field.focus();
            		return false;
				}
				break;
			case "select-one" :
				if(field.options[field.selectedIndex].value == "") {
            		alert("This field is required");
            		field.focus();
            		return false;
				}
				break;
			case "text" :
			case "textarea" :
	        	if(field.value == null || trim(field.value) == "") {
    	        	alert("This field is required");
        	    	field.focus();
            		return false;
        		}
				break;
			case "checkbox" :
			case "radio" :
				optionSelected = false;
				if(eval("form." + field.name + ".length")) {
					for(var j = 0; j < eval("form." + field.name + ".length"); j++) {
						optionSelected = eval("form." + field.name + "[" + j + "].checked");
						if(optionSelected) break;
        			}
				} else {
					optionSelected = field.checked;
				}
				if(!optionSelected) {
    	        	alert("This field is required");
        	    	field.focus();
            		return false;
        		}
				break;
		}
    }
    return true;
}

function removeHTML( strText ) {
	var regEx = /<[^>]*>/g;
	return strText.replace(regEx, "");
}

function ltrim (s) { 
	return s.replace( /^\s*/, "" ) 
} 

function rtrim (s) { 
	return s.replace( /\s*$/, "" ); 
} 
 
function trim (s) { 
	return rtrim(ltrim(s)); 
} 


function writeMailLink(sUser, sDomain) {
	var sFull = sUser + "@" + sDomain;
	var sURL = "mailto:" + sFull;
	document.write(sFull.link(sURL));
}

//-->
