

var defWidth = 420;
var defHeight = 400;

function openWindow(page,w,h,scroll,resize) {
	if (w == 0) {
		w = defWidth;
	}
	if (h == 0) {
		h = defHeight;
	}

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize;
	win = window.open(page, 'popup', winprops)
	//if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	return;
}


function confirmDelete(link, name) {
	if( confirm( 'Wilt u pagina "' + name + '" verwijderen?' ) ) {
		window.location = link;
	
		return 1;
	} else {
		window.location = window.location;
		return 0;
	}
}

function showImage(image,w,h,scroll,resize) {
	if (w == 0) {
		w = defWidth;
	}
	if (h == 0) {
		h = defHeight;
	}

	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize;
	win = window.open('', 'popup', winprops);
	
	output = '<html><body bgcolor="#ffffff">';
	output += '<title>Bella Vita Kennels</title>';
	output += '<img src="' + image + '">';
	output += '</body></html>';
	
	win.document.write(output);
	win.document.close();
	win.focus();

}

function setSessionID() {
	var sesID = new String;
	var langID = new String;
	
	var cookie = document.cookie;
	var p = cookie.indexOf('session_id');

	if (p > -1) {
		cookie = cookie.substring(p);
		sesID = cookie.substring(cookie.indexOf('=')+1);
		
		p = sesID.indexOf(';');
		if (p > -1) {
			sesID = sesID.substring(0, p);
		}
	}
	
	if (sesID == '') {
		var sesNUM = new Number(Math.random());
		sesID = new String(sesNUM.toString(16));
		sesID = sesID.substring(2);

		document.cookie = 'session_id=' + sesID +';path=/';
	}
	
}

