	   $(function(){
        $('.slide-out-div').tabSlideOut({
            tabHandle: '.handle',                     //class of the element that will become your tab
            pathToTabImage: '/Elements_Design.nsf/images/contact_tab.png', //path to the image for the tab //Optionally can be set using css
            imageHeight: '122px',                     //height of tab image           //Optionally can be set using css
            imageWidth: '40px',                       //width of tab image            //Optionally can be set using css
            tabLocation: 'left',                      //side of screen where tab lives, top, right, bottom, or left
            speed: 300,                               //speed of animation
            action: 'click',                          //options: 'click' or 'hover', action to trigger animation
            topPos: '250px',                          //position from the top/ use if tabLocation is left or right
            leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
            fixedPosition: false                      //options: true makes it stick(fixed position) on scroll
        });         
    });

// Set up the image files to be used.
var theImages = new Array() 
theImages[0] = 'website1.png'
theImages[1] = 'website2.png'
theImages[2] = 'website3.png'
theImages[3] = 'website4.png'
theImages[4] = 'website5.png'
theImages[5] = 'website6.png'

var p = theImages.length;
var whichImage = Math.round(Math.random()*(p-1));

function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}








function trim(value) {
  value = value.replace(/^\s+/,'');
  value = value.replace(/\s+$/,'');
  return value;
}
	
	// write credentials to cookie
	function writeCredentials(){
		// get toplevel domain
		var toplevelDomain = window.location.hostname;
		toplevelDomain = toplevelDomain.split(".");
		 toplevelDomain  = toplevelDomain[toplevelDomain .length - 2] + "." + toplevelDomain[toplevelDomain .length - 1] ;
		if($("#rememberme")[0].checked == true)
		var username = $("#username")[0].value;
		$.cookie("username", username, { expires: 30 , path : "/" , domain: toplevelDomain});
		var password= $("#password")[0].value;
		$.cookie("password", password, { expires: 30 , path : "/" , domain: toplevelDomain });
		$.cookie("bestelbox_new", "1", { expires: 30 , path : "/" , domain: toplevelDomain });
		return true;
	}

	// read credentials from cookie
	function readCredentials(){
		if($.cookie('username')!=null){	
			var username = $.cookie('username');
			$("#username")[0].value = username;
			var password = $.cookie('password');
			$("#password")[0].value = password;
		}
	}

