/******************************************
YES ALERTBOX

author: mario aspeleiter <m.aspeleiter@yes-websolutions.de>
copyright: mario aspeleiter <m.aspeleiter@yes-websolutions.de>

******************************************/


function yes_alertbox(msg,w,h) {
  this.html_template = '';
  this.window_id = 'yes_alertbox';
  this.msg = msg;
  this.width = w;
  this.height = h;
  this.top = 200;
  this.left = 200;
  this.show = show;
  this.getHTML = getHTML;
  this.resizable = 'yes';
  this.scrollbars = 'yes';
  //This next line uses an alternative syntax
  this.retCirc = function () { return ( Math.PI * this.radius * 2 ); };
}

function show() {
	yabW = window.open(this.html_template,this.window_id,'width='+this.width+',height='+this.height+',resizable='+this.resizable+',scrollbars='+this.scrollbars+',top='+this.top+',left='+this.left);
	yabW.document.write( this.getHTML() );
	yabW.document.close();
}

function getHTML(){
	var HTML  = "<html>\r\n";
	HTML += "	<head>\r\n";
	HTML += "		<title>"+YES_JS_ALERTBOX_TITLE+"</title>\r\n";
	HTML += "		<link rel=\"stylesheet\" type=\"text/css\" href=\"includes/stylesheet.css\" />\r\n";
	HTML += "	</head>\r\n";
	HTML += "	<body style=\"background-color: #9999FF;margin:0px;padding:0px;\">\r\n";
	HTML += "	<div align=\"center\" class=\"yes_alertbox_title\">"+YES_JS_ALERTBOX_TITLE+"</div>\r\n";
	HTML += "	<div align=\"center\" class=\"yes_alertbox\">\r\n";
	HTML += "	"+this.msg+"\r\n";
	HTML += "	</div>\r\n";
	HTML += "	<div align=\"center\" style=\"padding:10px;\">\r\n";
	HTML += "	<a href=\"javascript:window.close();\"><img src=\"images/close_button.gif\" border=\"0\" alt=\""+YES_JS_WINDOW_CLOSE+"\" title=\""+YES_JS_WINDOW_CLOSE+"\" /></a>\r\n";
	HTML += "	</div>\r\n";
	HTML += "	</body>\r\n";
	HTML += "</html>";
	return HTML;
}

function show_yes_alertbox(msg,w,h){
	yab = new yes_alertbox(msg,w,h);
	yab.show();
}

