
var pageStyle = '#f5f4f1';

//called for onmouseover and onmouseup, switches className
function lightup2(obj){
obj.className=(obj.className=='toplink'?'highlight':'topbar')
}  

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.display = iState ? "block" : "none";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.display = iState ? "block" : "none";
    }
}


function refreshObject(refreshType,urlPrefix,selectValue)	{
	location.href= urlPrefix + '/' + selectValue;
}

function checkActieForm()
{
	errorMessage = '';
	errorFound = false;

	if (document.ActieForm.group.value == '') 
	{
		errorMessage = errorMessage + '- Geen maat aangegeven.\n';
		errorFound = true;
	}

	if (errorFound) 
	{
		alert(errorMessage);
		return false;
	}


}	

function updateProductImage(imgsrc)	{
	document.productImage.src= imgsrc;
}
	
function showhide(id){
	if (document.getElementById){
		obj = document.getElementById(id);
		if (obj.style.display == "none"){
			obj.style.display = "";
		} else {
			obj.style.display = "none";
			}
		}
} 

function checkActionInput(newval,newurl){
	document.signupform.ActieCode.value = newval;
	document.signupform.okLink.value = newurl + '&result=ok';
	document.signupform.nokLink.value = newval + '&result=nok';
	toggleBox("actieinitform",0);
	toggleBox("actieform",1);
	return false;
}

function updateContent(div,desc) {
	var popobj=document.all? document.all[div] : document.getElementById? document.getElementById(div) : ""
	if (popobj)	popobj.innerHTML= desc;
}

function doSearch(what,where,form)	{
	if ((what == '') || (what == 'Zoek snel naar..') || what.match(/^ +$/)) return (false);
	// alert(where+what)
	myLightWindow.activateWindow(
		{
		href: where+escape(what),
		type: 'external', title: 'Libris Webshop', name: 'zoekformframe', id: 'zoekformframe', width: '850px'//, height: '460px'
		}
	); 
		// document.forms[form].submit();
		return false;
}


function checkResolution(thealtURL)	{
		var theheight=768;
		var thewidth=1024;
		var SiteLabel = 'Libris';
		var popMessage = "De " +SiteLabel+ " website kan het best worden bekeken met een schermresolutie van minimaal "+thewidth+"x"+theheight+".  Uw huidige resolutie is "+screen.width+"x"+screen.height+".\nKlik op \'OK\' om de " +SiteLabel+ " website alsnog te openen (wellicht kunt u uw resolutie aanpassen) of klik op \'Annuleren\' (Cancel) om naar de " +SiteLabel+ " Webshop te gaan waar u boeken kunt zoeken en bestellen.  Excuses voor het ongemak.";

		if (screen.width<thewidth||screen.height<theheight)	{
			if (!confirm(popMessage)) {
				location.href= thealtURL;
			} 
		}
	}	 
	
	
