// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this header

// =======================================
// Place this script in the head of your
// page and set the following variables.
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'images/spelt2.jpg';
Pic[1] = 'images/spelt13.jpg';
Pic[2] = 'images/spelt3.jpg';
Pic[3] = 'images/spelt4.jpg';
Pic[4] = 'images/spelt7.jpg';
Pic[5] = 'images/spelt10.jpg';
Pic[6] = 'images/spelt5.jpg';
Pic[7] = 'images/spelt11.jpg';
Pic[8] = 'images/spelt6.jpg';
Pic[9] = 'images/spelt10.jpg';

// =======================================
// do not edit anything below this line
// =======================================

isIE=document.all;
isNN=!document.all&&document.getElementById;
isN4=document.layers;
isHot=false;

function ddInit(e){
  topDog=isIE ? "BODY" : "HTML";
  whichDog=isIE ? document.all.theLayer : document.getElementById("theLayer");  
  hotDog=isIE ? event.srcElement : e.target;  
  while (hotDog.id!="titleBar"&&hotDog.tagName!=topDog){
    hotDog=isIE ? hotDog.parentElement : hotDog.parentNode;
  }  
  if (hotDog.id=="titleBar"){
    offsetx=isIE ? event.clientX : e.clientX;
    offsety=isIE ? event.clientY : e.clientY;
    nowX=parseInt(whichDog.style.left);
    nowY=parseInt(whichDog.style.top);
    ddEnabled=true;
    document.onmousemove=dd;
  }
}

function dd(e){
  if (!ddEnabled) return;
  whichDog.style.left=isIE ? nowX+event.clientX-offsetx : nowX+e.clientX-offsetx; 
  whichDog.style.top=isIE ? nowY+event.clientY-offsety : nowY+e.clientY-offsety;
  return false;  
}

function ddN4(whatDog){
  if (!isN4) return;
  N4=eval(whatDog);
  N4.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
  N4.onmousedown=function(e){
    N4.captureEvents(Event.MOUSEMOVE);
    N4x=e.x;
    N4y=e.y;
  }
  N4.onmousemove=function(e){
    if (isHot){
      N4.moveBy(e.x-N4x,e.y-N4y);
      return false;
    }
  }
  N4.onmouseup=function(){
    N4.releaseEvents(Event.MOUSEMOVE);
  }
}

function hideMe(){
  if (isIE||isNN) whichDog.style.visibility="hidden";
  else if (isN4) document.theLayer.visibility="hide";
}

function showMe(){
  if (isIE||isNN) whichDog.style.visibility="visible";
  else if (isN4) document.theLayer.visibility="show";
}

document.onmousedown=ddInit;
document.onmouseup=Function("ddEnabled=false");

var t;
var j = 0;
var p = Pic.length;

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)";
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
      document.images.SlideShow.filters.blendTrans.Apply();      
   }
   if (!isN4) document.images.SlideShow.src = preLoad[j].src;
   if (isN4) document.layers['theLayer'].document.images['SlideShow'].src = preLoad[j].src;
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play();
   }
   j = j + 1;
   if (j > (p-1)) j=0;
   t = setTimeout('runSlideShow()', slideShowSpeed);
}


///MENU MENU MENU MENU  ////

function writemenu()
{
	document.write("<ul id='navlist'>");
	document.write("<li><a href='index.asp'>home</a></li>");
	document.write("<li><a href='wiezijnwij.html'>algemeen</a></li>");
	document.write("<li><a href='watisspelt.html'>wat is spelt</a></li>");
	//document.write("<li><a href='wieishildegard.html'>wie is hildegard</a></li>");
	//document.write("<li><a href='kruiden.asp'>kruid van de maand</a></li>");
	//document.write("<li><a href='recepten.asp'>recept van de maand</a></li>");
	document.write("<li><a href='producten.asp'>producten</a></li>");
	document.write("<li><a href='bestellen.html'>bestellen</a></li>");
	document.write("<li><a href='links.asp'>links</a></li>");
	document.write("<li><a href='route.html'>route</a></li>");
	document.write("<li><a href='speltkorrelvoorwaarden.html'>voorwaarden</a></li>");
	document.write("<li><a href='disclaimer.php'>disclaimer</a></li>");
	document.write("</ul>");
}

function writeadminmenulogin()
{
	document.write("<ul id='navlist'>");
	document.write("<li><a href='index.asp?page=editproducten'>producten</a></li>");
	document.write("<li><a href='index.asp?page=overzichtkruiden'>kruiden</a></li>");
	document.write("<li><a href='index.asp?page=overzichtrecepten'>recepten</a></li>");
	document.write("<li><a href='index.asp?page=voegkruidtoe'>kruid toevoegen</a></li>");
	document.write("<li><a href='index.asp?page=voegrecepttoe'>recept toevoegen</a></li>");
	document.write("<li><a href='index.asp?page=kruidenreceptenfiguren'>figuur kruiden</a></li>");
	//document.write("<li><a href='index.asp?page=kruidvandemaand'>kruid van de maand</a></li>");
	//document.write("<li><a href='index.asp?page=receptvandemaand'>recept van de maand</a></li>");
	document.write("<li><a href='index.asp?page=editinfo'>Startpagina info</a></li>");
	document.write("<li><a href='index.asp?page=editlinks'>links</a></li>");
	document.write("<li><a href='index.asp?page=editgebruikers'>gebruikers</a></li>");
	document.write("<li><a href='disclaimer.php'>disclaimer</a></li>");
	document.write("<li><hr></li>");
	document.write("<li><a href='login.asp?action=uitloggen'>uitloggen</a></li>");
	document.write("</ul>");
}
function writeadminmenu()
{
	document.write("<ul id='navlist'>");
	document.write("<li>producten</li>");
	document.write("<li>kruiden</li>");
	document.write("<li>recepten</li>");
	document.write("<li>kruid toevoegen</li>");
	document.write("<li>recept toevoegen</li>");
	document.write("<li>figuur kruiden</li>");
	//document.write("<li>kruid van de maand</li>");
	//document.write("<li>recept van de maand</li>");
	document.write("<li>links</li>");
	document.write("<li>disclaimer</li>");
	document.write("</ul>");
}

// POPUP POPUP POPUP ///
//popUpWindow('newproduct.asp',100,100, 550, 500)
function popUpWindow(url,xx,yy,ww,hh)
{
	s = 'width=' + ww + ',height=' + hh + ',top=' + yy + ',left=' + xx;
	//alert(s);
	window.open(url,'speltkorrel','"'+s+'"');
}

function janeevraag(vraag)
{
	answer = confirm(vraag);
	return answer;
}

 function encodeMyHtml(s) {
     s = escape(s);
     //s = s.replace(/\//g,"%2F");
     //s = s.replace(/\?/g,"%3F");
     //s = s.replace(/=/g,"%3D");
     //s = s.replace(/&/g,"%26");
     //s = s.replace(/@/g,"%40");
     return s;
   } 
 
function setnieuwenaam()
{
	var selectedItem = document.frmcategory.category.selectedIndex;
	var selectedText = document.frmcategory.category.options[selectedItem].text;
	var tst = "-->";
	if (selectedText.substring(0,4).value == tst.value)
	{
		selectedText = selectedText.substring(4);
	}
	document.frmcategory.naam.value = selectedText;
}

