function clearDefault(that) {
	if (that.value == 'Enter keyword') {
		that.value = '';
	}
}

function fillDefault(that) {
	if (that.value == '') {
		that.value = 'Enter keyword';
	}
}

var NewWindow1;

function PopUp(Whatpage1) {
	ShowWindow1=window.open("","NewWindow1", "toolbar=1,menubar=1,location=0,directories=0,status=0,scrollbars=1,resizable=1,copyhistory=1,width=730,height=450");
	ShowWindow1.location.href = Whatpage1;
	self.NewWindow1 = ShowWindow1;
}

function redirRate(num) {
	window.location = num;	
}

//Pop-up window function
function openWin(answer){
  var win = window.open(answer, 'answer','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=760,height=500');

  if (! window.focus)return true;

  self.name="main"
}

//Pop-up window function
function openWinSmall(answer){
  var win = window.open(answer, 'answer','toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=yes,copyhistory=no,scrollbars=yes,width=400,height=350');

  if (! window.focus)return true;

  self.name="main"
}

function empty(field) {
	if (field.type == 'text' || field.type == 'textarea') {
		if (field.value.replace(/\s*/g,'').length == 0) {
			return true;
		}
	} else if (field.type == 'select-one') {
		if (field.selectedIndex == 0) {
			return true;
		}
	} else if (field[0].type == 'radio') {
		var checked = false;
		for (i=0; i < field.length; i++) {
			if (field[i].checked) {
				checked = true;
			}
		}
		if (!checked) {
			return true;
		}
	}
	return false;
}