<!--

function OpenWindow(strURL,width,height,sroll){
	var objWnd = window.open(strURL,"Detail","scrollbars=" + sroll + ",resizable=yes,height=" + height + ",width=" + width + ",left=0,top=0");
	objWnd.focus();
}

function NewWindow(strURL){
	var objWnd = window.open(strURL);
	objWnd.focus();
}

function Trim(s){
	while(s.substring(0,1) == ' '){
		s = s.substring(1,s.length);
	}
	while(s.substring(s.length-1,s.length) == ' '){
		s = s.substring(0,s.length-1);
	}
	return s;
}


function CheckEmptyField(sField){
	var sMsg = '';
	var oLabel = document.getElementById('lb' + sField);
	if(Trim(document.getElementById(sField).value) == ""){
		document.getElementById(sField).focus();
		if(oLabel){
			sMsg = oLabel.firstChild.data;
			if(sMsg.substring(sMsg.length - 1, sMsg.length) == ':') sMsg = sMsg.substring(0, sMsg.length-1)
			oLabel.style.color = 'red';
		}
		else sMsg = '';
		alert(sCheckEmptyField + sMsg + ".");
		return false;
	}
	else{
		if(oLabel) oLabel.style.color = '';
		return true;
	}
}


function ContactFormValidate(){
	if(!CheckEmptyField('description1')) return false;
	if(!CheckEmptyField('email')) return false;
	if(!CheckEmptyField('control_string')) return false;
	return true;
}


function ReferenceCategory(){
	document.getElementById('reference-f').submit();
}
//-->
