﻿function window_open(url, target, width, height) {
	window.open(url, target,
		'height='+height+',width='+width+',status=no,toolbar=no,menubar=no,location=no,scrollbars=no');
}	

function cookieTime(days) {
	var now = new Date();
	var exp = new Date();
	var x = Date.parse(now) + days*24*60*60*1000;
	exp.setTime(x);
	str = exp.toUTCString();
	
	re = '/(\d\d)\s(\w\w\w)\s\d\d(\d\d))/';
	
	return str.replace(re,"$1-$2-$3");
}

var StateCookie = {
	set: function ( id, value) {
		document.cookie = 'an:' + id + '='+value+';path=/;expires=' + cookieTime(365);
	},
	
	get: function( id, defaultState ) {
		var re = new RegExp('an:' + id + '=(.*)');
		var state = re.exec(document.cookie);
		return (state) ? state[1].split(';')[0] : defaultState;
	}
}

function msover(img, ref) {
	document.images[img].src = ref;
}



