var bookmarkurl="http://www.livera.nl";
var bookmarktitle="Livera";


//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";
       document.layers[szDivID].display = iState ? "block" : "none";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
        obj.style.display = iState ? "block" : "none";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
        document.all[szDivID].style.display = iState ? "block" : "none";
				
    }
}


function addbookmark(title,url){
    
    if (window.sidebar) window.sidebar.addPanel(title, url,"");

    else if( window.opera && window.print )
    {
    var mbm = document.createElement('a');
    mbm.setAttribute('rel','sidebar');
    mbm.setAttribute('href',url);
    mbm.setAttribute('title',title);
    mbm.click();
    }

    else if( document.all ) window.external.AddFavorite( url, title);

}


function popupform(myform, windowname)
{
if (! window.focus)return true;
window.open('', windowname, 'height=580,width=640,scrollbars=yes');
myform.target=windowname;
return true;
}


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


var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable=yes'
	win = window.open(mypage,myname,settings)
}
	
function openShop()	{
	NewWindow('http://www.albus.nl/shop/enter.html','LiveraShop',770,500,'auto')
}


function changed(what) {
    selectedOptionValue = what.options[what.selectedIndex].value;
	document.ecardform.message.value=selectedOptionValue;
}


function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}

var splitIndex = 0;
var splitArray = new Array();

function splits(string,text) {
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return;
    if (i == -1) {
        splitArray[splitIndex++] = string;
        return;
    }

    splitArray[splitIndex++] = string.substring(0,i);
     
    if (i+txtLength < strLength)
        splits(string.substring(i+txtLength,strLength),text);

    return;
}

function split(string,text) {
    splitIndex = 0;
    splits(string,text);
}

function validate() {
    split(document.ecardform.message.value,'\n');
    if (splitIndex > 6) {
        alert('Maximaal 6 regels')
        return false;
    }
    for (var i=0;i<splitIndex;i++) {
        if (splitArray[i].length > 150) {
            alert('Maximaal 150 alfnummerieke karakters');
            return false;
        }
    }
    return true;
}

function split(string,text) {
    splitArray = string.split(text);
    splitIndex = splitArray.length;
}

var selectedOptionValue = null;

function changed(what) {
    selectedOptionValue = what.options[what.selectedIndex].value;
	document.ecardform.message.value=selectedOptionValue;
}

