
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//'                                                                '
//'   source       :   userprocs.js                                 '
//'   Description  :   included in sse.inc. user procedures        '
//'                                                                '
//'                                                                '
//'   Cerium content manager (based on the Sellenger site engine) 									 '
//'	(c) 1997-2007 Jos Verhoeff, cerium             '
//'   For more information http://www.cerium.nl              '
//'                                                                '
//'                                                                '
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

function flvpopup(map,mname,width,height) 
{
	var intIndexOfMatch = mname.indexOf( " " );
	while (intIndexOfMatch != -1){
		mname = mname.replace( " ", "%20" )
		intIndexOfMatch = mname.indexOf( " " );
	}
	var win1=window.open('/cerium/popup_flvalbum.asp?map='+ map + '&mov='+mname+'.flv&width='+width+'&height='+height,'movie','width='+ eval(width+20) + ',height='+ eval(height+40) + ',menubar=no,scrollbars=no,toolbar=no,resizable=no')
	win1.focus();
}

function popup(src,width,height) 
{
	var win1=window.open(src,'pop','width='+ eval(width) + ',height='+ eval(height) + ',status=no,titlebar=no,menubar=no,scrollbars=no,toolbar=no,resizable=no')
	win1.focus();
}
// these also exist in the vb component
function ssecreateCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function ssereadCookie(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 '';
}

function sseeraseCookie(name) {
	ssecreateCookie(name,"",-1);
}

function ssecookietest(bMsg) {
	var cookieVal = "Cerium Cookie test";
	ssecreateCookie("TestCookie",cookieVal)
	if (ssereadCookie("TestCookie") != cookieVal ) {
		if (bMsg) alert(msgNoCookies);
		return false;
	}
	sseeraseCookie("TestCookie");
	return true;
}
