function changeLetter(letter,cat) {
	window.location.href = "gids.php?letter="+letter+"&cat="+cat;
}

function removeStroph() {
	var tmp   = document.zoeken_top.query.value;
	var regex = "'";
	var replc = "";
	var qua   = tmp.replace(regex,replc);

	document.zoeken_top.query.value = qua;
	return true;
}

TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
TICKER_PAUSED = false;

function ticker_start() {
	TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
	var tickerSupported = false;
	TICKER_WIDTH = document.getElementById("TICKER").style.width;
	var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";

	// Firefox
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	}
	// IE
	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
		document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
		tickerSupported = true;
	}
	if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {
		document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
		document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
		document.getElementById("TICKER").style.display="block";
		TICKER_tick();
	}
}

function TICKER_tick() {
	TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
	if(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) document.getElementById("TICKER").scrollLeft = 0;
	window.setTimeout("TICKER_tick()", 30);
}

function changeField(newName,oldName) {
	document.discussie.elements[oldName].name = newName;
}

function getElement(aID) {
	var element = null;
	if (document.getElementById) {
		 element = document.getElementById(aID);
	} else if (document.layers) {
		element = document.layers[aID];
	} else if (document.all) {
		element = document.all[aID];
	}
	return element;
}

function moveElement(obj, x, y) {
	if (document.getElementById) {
		obj.style.top = y;
		obj.style.left = x;
	} else if (document.layers) {
		obj.top = y;
		obj.left = x;
	} else if (document.all) {
		obj.style.top = y;
		obj.style.left = x;
	}
}

var vMidLine;
var hMidLine;
var scrOfX = 0, scrOfY = 0;

function vH_init() {
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}

	vMidLine = Math.round(myWidth/2);
	hMidLine = Math.round(myHeight/2);

	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
}

function openPopup(lnk) {
	var pop = getElement("vH_popup");
	var ifr = getElement("popupIF");
	tX = (vMidLine - (458/2)+scrOfX);
	tY = (hMidLine - (351/2)+scrOfY);
	moveElement(pop, tX, tY);
	ifr.src = lnk;
	pop.style.display = 'block';
}

function spopenPopup() {
	var pop = getElement("vH_popup");
	tX = (vMidLine - (458/2)+scrOfX);
	tY = (hMidLine - (351/2)+scrOfY);
	moveElement(pop, tX, tY);
	pop.style.display = 'block';
}

function closePopup() {
	var pop = getElement("vH_popup");
	pop.style.display = 'none';
	var ifr = getElement("popupIF");
	ifr.src = "emptypopup.php";
}

