function setFontSize( txt_size ) { // set the font size.
	var contentDiv = document.getElementById("content"); 
	contentDiv.style.fontSize = txt_size;
	setCookie( 'iwbTxtSize', txt_size,10 ); 
}

function setImage() { // set the background-image.
            var imageDiv1 = document.getElementById("small"); 
            var imageDiv2 = document.getElementById("big"); 
            //imageDiv1.style.background = "../gfx/small.png";
            //imageDiv2.style.background = "../gfx/big0.png";
			imageDiv1.style.display = "show";
            imageDiv2.style.display = "block";
            setCookie( 'iwbImageSelect', 'image_select', 1 ); 
}

function setImage2() { // set the background-image.
            var imageDiv1 = document.getElementById("small"); 
            var imageDiv2 = document.getElementById("big");
			imageDiv1.style.display = "block";
            imageDiv2.style.display = "show";
            //imageDiv1.style.background = "background-image: url('../gfx/small0.png') no-repeat ";
            //imageDiv2.style.background = "background-image: url('../gfx/big.png‘) no-repeat ";
            setCookie( 'iwbImageSelect', 'image_select', 2 ); 
}



function loadUserPrefs() { 
	var userTxtSize = getCookie( 'iwbTxtSize' ); 
	if ( userTxtSize != null ) { 				
		setFontSize( userTxtSize,10 ); 
	}
} 	

function setCookie(name, value,hours) { 
	var seconds = 3600*hours;
	var date = new Date(); 
	date.setTime(date.getTime() + seconds); 
	document.cookie = name + "=" + value + ";expires=" + date.toGMTString() + "; path=/"; 
}

function getCookie(name) { 
	var nameEQ = name + "="; 
	var ca = document.cookie.split(';'); 
	for(var i=0;i < ca.length;i++) { 
		var c = ca[i]; 
		while (c.charAt(0)==' ') c = c.substring(1,c.length); 
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 
	} 
	return null;
} 

window.onload = loadUserPrefs();
