// JavaScript Document
//var ewwsetp;
var xspublished; // not in use?
var dopid;

var nouserc;
if (window.userc === undefined){ nouserc = "no_user" }; // see if there is a userc variable set (e.g. a user has logged in)

//alert ("sName = " + sName + " - myuid = " + myuid + " - ewwsetp = " + ewwsetp + " - nouserc = " + nouserc);
	
//test for value in variable - redirect if not "y"
if (sName != myuid) { 
	//if (ewwsetp != "y" ) {
	if (ewwsetp != "y" && nouserc == "no_user") { //page NOT public && NO userc variable set so no login has ocurred [1/11/08 LOW security workaround to login failures due to errors in evaluating the sName != myuid ]
	//alert ("sName = " + sName + " - myuid = " + myuid);
	window.location="../../ewwalert/index.php?alert=np1.inc&user=x&test=y";
	}
} else {
   	if (xspublished == "y") { 
		dopid = "a";
	} 
	if (ewwsetp != "y") {
		dopid = "b";
	} 
	if (dopid == "b" && xspublished == "y") {
		dopid = "c";
	} 
	
	switch (dopid) {
		case "a":
			if (sName == myuid) {
				document.write("<div id=\"notlive\" style=\"top: 0px; right: 0px; width: 180px; position: absolute; border: solid #bbb; border-width: 1px; padding: 2px; background-color: #ccc; filter: alpha(opacity=40); z-index=20\" align=\"center\" class=\"smblk\">Page live on external server</div>");
			}
		break;
		case "b":
			document.write("<div id=\"notlive\" style=\"top: 0px; right: 0px; width: 180px; position: absolute; border: solid #bbb; border-width: 1px; padding: 2px; background-color: #ccc; filter: alpha(opacity=40); z-index=20\" align=\"center\" class=\"smblk\">Page not live on Easywebwriter</div>");
		break;
		case "c":
			document.write("<div id=\"notlive\" style=\"top: 0px; right: 0px; width: 180px; position: absolute; border: solid #bbb; border-width: 1px; padding: 2px; background-color: #ccc; filter: alpha(opacity=40); z-index=20\" align=\"center\" class=\"smblk\">Page not live on Easywebwriter<br>Page live on external server</div>");
		break;
	}
	
}