// JavaScript Document
/*
function popup_2010maintenance_popupmessage(handler, width, height){
		height = !window.XMLHttpRequest ? height + 50 : height;
		//window.showModalDialog("/2010_maintenance_popupmessage/index.html", handler, 'dialogWidth:'+ width +'px; dialogHeight:'+ height +'px; dialogTop:'+ ((window.screen.availHeight-height)/2) +'px; dialogLeft:'+ ((window.screen.availWidth-width)/2) +'px; resizeable:no; help:no; scroll:no;');
		window.showModalDialog("index.html", handler, 'dialogWidth:'+ width +'px; dialogHeight:'+ height +'px; dialogTop:'+ ((window.screen.availHeight-height)/2) +'px; dialogLeft:'+ ((window.screen.availWidth-width)/2) +'px; resizeable:no; help:no; scroll:no;');
		
		//window.open("/2010_maintenance_popupmessage/index.html",'maintenancewindow','');
}
*/
//popup_2010maintenance_popupmessage(window, 640, 480);


var setCookie = function(c_name, value) {
	var expiredays = "";
	if (arguments[2] == null) {
		expiredays = null;
	} else {
		expiredays = arguments[2];
	}
	var exdate = new Date();
	exdate.setDate(exdate.getDate() + expiredays);
	document.cookie = c_name + "=" + encodeURIComponent(value)
			+ ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}

var getCookie = function(c_name) {
	if (document.cookie.length > 0) {
		c_start = document.cookie.indexOf(c_name + "=");
		if (c_start != -1) {
			c_start = c_start + c_name.length + 1;
			c_end = document.cookie.indexOf(";", c_start);
			if (c_end == -1) {
				c_end = document.cookie.length;
			}
			return decodeURIComponent(document.cookie.substring(c_start, c_end));
		}
	}
	return null;
}

var popup_maintenance_popupmessage = function(width, height) {
	var url = '/maintenance_popupmessage/index.html'
	if (getCookie("ISHASPOPUPMESSAGE") != 1) {
		setCookie("ISHASPOPUPMESSAGE", 1);
		var obj = window.open(
						url,
						"newmaintancewin",
						'width='
								+ width
								+ ', height='
								+ height
								+ ', top='
								+ ((window.screen.availHeight - height) / 2)
								+ ', left='
								+ ((window.screen.availWidth - width) / 2)
								+ ', toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no');
		obj.focus();
	}
}

popup_maintenance_popupmessage(640, 270);