
	function msg_popup(msg_in) {
		alert(msg_in)
	} 
	
	
	function confirm_action(msg_in) {
		confirm(msg_in)
	} 
	function mkgcWindowp(url,n,w,h,l,t,m,st,sc,r,x,y)
	{
	alert("When the start sheet appears use the print icon on your toolbar to finalise margins before printing.");
	var myWin = window.open(url,n,
	'width=' + w + ', height=' + h + ',	left=' + x + ', top=' + y + ',location=' + l + ',menubar=' + m + ',status=' + st + ',toolbar=' + t + ',scrollbars=' + sc + ',resizable=' + r + '');
 	win.resizeTo(w, h);
	myWin.focus()
	}
	
	function mkgcWindow(url,w,h)
	{
	var myWin = window.open(url,
	name,
	'width=' + w + ', height=' + h + ',location=no,menubar=yes,status=yes,toolbar=yes,scrollbars=no,resizable=yes');
 	win.resizeTo(w, h);
	myWin.focus()
	}

	function writeCookie()
	{
	var today = new Date();
	var the_date = new Date("December 31, 2010");
	var the_cookie_date = the_date.toGMTString();
	var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
	var the_cookie = the_cookie + ";expires=" + the_cookie_date;
	document.cookie=the_cookie
	location = './includes/header.html';
	}

	function wopen(url, name, w, h)
	{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
	w += 32;
	h += 96;
	var win = window.open(url,
	  name, 
	  'width=' + w + ', height=' + h + ', ' +
	  'location=no, menubar=no, ' +
	  'status=no, toolbar=no, scrollbars=no, resizable=no');
	 win.resizeTo(w, h);
	 win.focus();
	}


function Cookie(document, name, hours, path, domain, secure)
{
    // All the predefined properties of this object begin with '$'
    // to distinguish them from other properties which are the values to
    // be stored in the cookie.
    this.$document = document;
    this.$name = name;
    if (hours)
        this.$expiration = new Date((new Date()).getTime() + hours*3600000);
    else this.$expiration = null;
    if (path) this.$path = path; else this.$path = null;
    if (domain) this.$domain = domain; else this.$domain = null;
    if (secure) this.$secure = true; else this.$secure = false;
}

// This function is the store() method of the Cookie object.
function _Cookie_store()
{
    var cookieval = "";
    for(var prop in this) {
        // Ignore properties with names that begin with '$' and also methods.
        if ((prop.charAt(0) == '$') || ((typeof this[prop]) == 'function')) 
            continue;
        if (cookieval != "") cookieval += '&';
        cookieval += prop + ':' + escape(this[prop]);
    }
    var cookie = this.$name + '=' + cookieval;
    if (this.$expiration)
        cookie += '; expires=' + this.$expiration.toGMTString();
    if (this.$path) cookie += '; path=' + this.$path;
    if (this.$domain) cookie += '; domain=' + this.$domain;
    if (this.$secure) cookie += '; secure';

    // Now store the cookie by setting the magic Document.cookie property.
    this.$document.cookie = cookie;
}
// This function is the load() method of the Cookie object.
function _Cookie_load()
{
    var allcookies = this.$document.cookie;
    if (allcookies == "") return false;
    // Now extract just the named cookie from that list.
    var start = allcookies.indexOf(this.$name + '=');
    if (start == -1) return false;   // Cookie not defined for this page.
    start += this.$name.length + 1;  // Skip name and equals sign.
    var end = allcookies.indexOf(';', start);
    if (end == -1) end = allcookies.length;
    var cookieval = allcookies.substring(start, end);
    var a = cookieval.split('&');    // Break it into array of name/value pairs.
    for(var i=0; i < a.length; i++)  // Break each pair into an array.
        a[i] = a[i].split(':');
    for(var i = 0; i < a.length; i++) {
        this[a[i][0]] = unescape(a[i][1]);
    }
    return true;
}

// This function is the remove() method of the Cookie object.
function _Cookie_remove()

{
    var cookie;
    cookie = this.$name + '=';
    if (this.$path) cookie += '; path=' + this.$path;



    if (this.$domain) cookie += '; domain=' + this.$domain;
    cookie += '; expires=Fri, 02-Jan-1970 00:00:00 GMT';
    this.$document.cookie = cookie;
}

