// function to put the focus on the first field
function putFocus(formInst, elementInst) {
	if (document.forms.length > 0) {
		document.forms[formInst].elements[elementInst].focus();
	}
}

function toon() {
	for (var i = 0; i < document.forms.length; i++) {
		alert('form: ' + document.forms[i].name);
		alert('aantal: ' + document.forms[i].elements.length);
		for (var j = 0; j < document.forms[i].elements.length; j++) {
			if (document.forms[i].elements[j].name == 'advt_rub') {
				alert('element: ' + document.forms[i].elements[j].name);
				alert('val: ' + document.forms[i].elements[j].options[0].value);
				document.forms[i].elements[j].options[0].focus();
			}
		}
	}
}

function hopeloos() {
	var i;
	URL=window.location.href ;
	//alert('tering');
}

//function breakOut() {
	//if (window != top) top.location.href = location.href;
	//if (parent.frames.length > 0) { parent.location.href = location.href; }
	//parent.location.href = top.frames['a6-14633'].location.href ('message.jsp');
	//alert(parent.peer.document.location)
	//top.frames['a6-14633'].location.href ('message.jsp');
//	if (parent.location != self.location && parent.location !=top.location) { top.frames['a6-14633'].location.href ('message.jsp'); }
//}


function DisablingBackFunctionality() {
	var URL;
	var i ;
	var QryStrValue;
	URL=window.location.href ;
	i=URL.indexOf("?");
	QryStrValue=URL.substring(i+1);
	if (QryStrValue!='X') {
		window.location=URL + "?X";
	}
}

function openWindowInParentFrame(url) {
	popupWin = parent.location.replace(url);
}

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
	}
	else {
		countfield.value = maxlimit - field.value.length;
	}
}
