var fNetscape = navigator.appName == "Netscape";

function splitself(s, delim)
{ // JavaScript 1.0
  var ss = s;
  var as = new Array();
  var i;
  var j = ss.indexOf(delim);
  for (i=0 ;j >=0; i++) {
    as[i] = ss.substring(0, j);
    ss = ss.substring(j+1, ss.length);
    j = ss.indexOf(delim);
  }
  as[i] = ss;
  return as;
}


function inframe()
{
  if (top == self) 
     self.location.href = "index.html?"+ self.location.pathname;
}

function showimage(image,width)
{
  var docwidth = 1024;
	var docheight = 768;
	if (fNetscape) {
			docwidth = window.innerWidth;
			docheight = window.innerHeight;
	}
	else if (document.all) {
			docwidth = document.body.clientWidth;
			docheight = document.body.clientHeight;
	}
  if (!width) {
		var width = 300;
		var width2 = 100;
		if (docwidth <= 1024) {
			if (docwidth  <= 800) {
				width = 150;
				width2 = 5;
			}
			else {
				width = 200;
				width2 = 50;
			}
		}
	}
	else
	  width2=10;
	document.writeln("<table align=right cellpadding=10><tr>");
	document.writeln("<td><img src='"+image+"' width="+width+"><td width="+width2+">&nbsp;</td>");
	document.writeln("</tr></table>");
}
/*
function showboek(boek,id,width)
{
  if (!width) width=90;
  document.writeln("<a href=index.php?page=bestel.php?id="+id+" target=_parent onclick=\"document.location.href='index.php?page=\'bestel.php?id="+id+"\''\" onmouseover=\"this.T_WIDTH=60;return escape('Bestel dit boek door hier te klikken');\" class='boek' style='width:"+width+"'><img src='boeken/afbeeldingen/"+ boek + "' width="+width+" /></a>");
}
*/
function showboek2(boek,objid,width,titel,auteur,prijs)
{
  if (!width || width<=0) 
    width=70;
  document.write("<div style='float:right; right:20px;left:10px; width:"+width+"px'><a href=\"index.php?page=bestel.php&objid="+objid);
if (titel)
    document.write("&titel="+escape(titel))
  if (auteur)
    document.write("&auteur="+escape(auteur))
    if (prijs)
    document.write("&prijs="+prijs)
  document.write("\" target=_parent");/* onclick=\"document.location.href='index.php?page='bestel.php?id="+id);
  if (titel)
    document.write(";titel="+titel)
  if (auteur)
    document.write(";auteur="+auteur)
  if (prijs)
    document.write(";prijs="+prijs)
  document.writeln("'\" onmouseover=\"this.T_WIDTH=80;return escape('Bestel dit boek door hier te klikken');\" class='boek'><img src= */  
  document.writeln(" onmouseover=\"this.T_WIDTH=80;return escape('Bestel dit boek door hier te klikken');\" class='boek'><img src='boeken/afbeeldingen/"+ boek + "' width="+width+"px /></a></div>");
}

function showboekplaatje(boek)
{
  document.write("<div style='float:right;margin-left:0.8em;border: black 1px solid; width:100px'>");
  document.writeln(" <img src='boeken/afbeeldingen/"+ boek + "' width=100px /></div>");
}


function showboek3(boek,width)
{
 if (boek.length == 0)
  boek = "leeg.jpg";
 // if (boek == "leeg.jpg")
//    return;
	
  if (!width || width<=0) width=40;
  document.write("<div style='width:"+width+"px'><img src='boeken/afbeeldingen/"+ boek + "' width="+width+"px /></div>");
}
/*
function showboekimage(boek,id,width)
{
	var docwidth = 1024;
	var docheight = 768;
	if (fNetscape) {
			docwidth = window.innerWidth;
			docheight = window.innerHeight;
	}
	else if (document.all) {
			docwidth = document.body.clientWidth;
			docheight = document.body.clientHeight;
	}

//	var width = 300;
	var width2 = 40;
	if (docwidth <= 1024) {
		if (docwidth  <= 800) {
//			width = 150;
			width2 = 5;
		}
		else {
//			width = 200;
			width2 = 50;
		}
	}
	document.writeln("<table align=right cellpadding=10><tr>");
	document.writeln("<td>");
	showboek(boek,id,width);
	document.writeln("<td width="+width2+">&nbsp;</td>");
	document.writeln("</tr></table>");
}
*/
function docwidth()
{
	if (fNetscape) {
			return window.innerWidth;
	}
	else if (document.all) {
			return document.body.clientWidth;
	}
	return 1024;
}

function docheight()
{
	if (fNetscape) {
			return window.innerheight;
	}
	else if (document.all) {
			return document.body.clientheight;
	}
	return 768;
}


function setCookie(name, value, expires, path) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "");
  document.cookie = curCookie;
}


function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function toCookie(obj, record)
{
  setCookie(form+obj.name + "-" + record, obj.value);
}

function getid(id)
{
	return (
		(document.layers && typeof document.classes != "undefined") ? (document.layers[id] || null)
		: (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && document.all && ((document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body? document.body : null) && !(!!(window.opera && document.getElementById))) ? (document.all[id] || null)
		: (document.getElementById(id) || null)
	);
}
/*
var base64s =
 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

function base64_decode(encStr) {
  var bits, decOut = '', i = 0;
  for(; i<encStr.length; i += 4){
    bits =
     (base64s.indexOf(encStr.charAt(i))    & 0xff) <<18 |
     (base64s.indexOf(encStr.charAt(i +1)) & 0xff) <<12 | 
     (base64s.indexOf(encStr.charAt(i +2)) & 0xff) << 6 |
      base64s.indexOf(encStr.charAt(i +3)) & 0xff;
      decOut += String.fromCharCode((bits & 0xff0000) >>16, (bits & 0xff00) >> 8, bits & 0xff);
  }
  if(encStr.charCodeAt(i -2) == 61)
    undecOut=decOut.substring(0, decOut.length -2);
  else if(encStr.charCodeAt(i -1) == 61)
    undecOut=decOut.substring(0, decOut.length -1);
  else undecOut=decOut;
  
  return undecOut;
}


function floatdiv(html)
{
  html = base64_decode(html); 
  
}
*/

