window.defaultStatus = "Copyright Index4u.nl";

function confirmpopup(Message, url) 
{
    var is_confirmed = confirm(Message);
    if (is_confirmed) 
	{
	   location = url;
    }
	else return is_confirmed;
} 

function goTeletekst()
{
	if (document.teletekst_form.teletekstnr.value == "")
	{
		alert("Geen geldig teletekst nummer!");
	}
	else
	{
		window.open("http://teletekst.nos.nl/gif/" + document.teletekst_form.teletekstnr.value + "-01.html", "Teletekst");
	}
}

// na een klik..
function goURL(id)
{
	document.myform.urlid.value = id;
	document.myform.submit();
}
// top 10 pagina geklikt
function goSub(sub)
{
	location.href="http://" + sub + ".index4u.nl/";
}
// voor link/string weergave
function sl(string, object) // SetLocation
{
	window.status = string;
	if (object) 
	{	
		object.style.color  = "red";
		object.style.cursor = "hand";
		object.style.cursor = "pointer";
	}
}
// mouse out
function mo(object)
{
	if (object) 
	{
		object.style.color  = "black";
		object.style.cursor = "";
	}
	window.status = "";
}

// nodig om het plaatje in het zoek gedeelte te swappen
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// duidelijk
function addBookmark() 
{
  if (window.external)
    external.AddFavorite("http://www.index4u.nl","Index4u.nl Startpagina")
  else
    alert("Uw webbrowser ondersteund deze functie niet.");
}

// duidelijk
function openpopup(theURL,winName) 
{ 
    var w = 600;
	var h = 500;
	var scroll = "yes";
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',toolbars=0, location=0, statusbars=0, menubars=0, resizable=0, dependent=1';
	
	win = window.open(theURL, winName, winprops);
}

// gebruikt voor zoek functie
function doSearch(myForm)
{
	var val = myForm.engine.value;
	var s;

	if (myForm.q.value != "")
	{
		s = myForm.q.value;
		if (val=="subpage")
			window.open("http://overzicht.index4u.nl/?cat=all&ch=search&q="+s);
		else if (val=="google")
			window.open("http://www.google.nl/search?q="+s);
		else if (val=="vindex")
			window.open("http://www.vindex.nl/doorzocht/nederland?in="+s+"&resume=on&ord1=on");
		else if (val=="altavista")
			window.open("http://nl.altavista.com/web/results?q="+s);
		else if (val=="zoeknl")
			window.open("http://www2.zoek.nl/result/?query="+s);
	}
	else 
	{
		alert("Geef een geldige zoekterm!");
		myForm.q.focus();
	}
	return false;
}