// JavaScript Document

//var _AB_template = 'templates/'+_LANG_+'/modules/countdown.html';
var _AB_template = 'templates/'+_LANG_+'/modules/coming_soon.html';
var _AB_template = _HTMLPATH_+'prelaunch_contact.php';

var _AB_mute		= 2; //minutes
var _AB_delay		= 500; // 0.6s
var _AB_width		= ""; //"620px";
var _AB_height	= ""; //"620px";
var _AB_top			= "164px";
var _AB_left		= "25%";
var _AB_zIndex	= 2;

var _AB_style		= "cursor:pointer; position:absolute; z-index:"+_AB_zIndex+";";

if (typeof _LANG_ == 'undefined') _LANG_ = "";

var AB_object,x,da,ex,new_alert;

//loadobjs('css/signup.css');

new_alert = (navigator.cookieEnabled && !document.cookie.match(/alert_seen/));
//new_alert = true;

function AB_open(AB_url) {
	AB_object = document.getElementById('main').appendChild(document.createElement('DIV'));
	if (_AB_width) _AB_style += "width:"+_AB_width+";";
	if (_AB_height) _AB_style += "height:"+_AB_height+";";
	if (_AB_left) _AB_style += "left:"+_AB_left+";";
	if (_AB_top) _AB_style += "top:"+_AB_top+";";
	AB_object.setAttribute("style",_AB_style);
	with(AB_object.style) {
		cursor='pointer';
		position = 'absolute';
		zIndex=_AB_zIndex;
		if (_AB_width) width=_AB_width;
		if (_AB_height) height=_AB_height;
		if (_AB_left) left=_AB_left;
		if (_AB_top) top=_AB_top;
	}

	AB_object.onmousedown = AB_close;

	ajaxpage(AB_url, AB_object);
}

function AB_close() {
	AB_object.parentNode.removeChild(AB_object);
	if (new_alert) {
		ex = new Date();
		ex = new Date(ex.getTime() +1000*60*_AB_mute);
		document.cookie = 'alert_seen=1; expires='+ex.toGMTString()+';';
	}
}

if (new_alert) {
	//window.setTimeout("AB_open(_AB_template)", _AB_delay);
	window.setTimeout("_SP_top='55px';SP_open_panel(_AB_template);", _AB_delay);
}
