//<script language=javascript>



var popupsready = false;
var lastpopelem = '';

lastpopelem = '';
if (document.layers) {
  visible = 'show';
  hidden = 'hide';
  origWidth = innerWidth;
  origHeight = innerHeight;
  window.onresize = redo;
} else if (document.all) {
  visible = 'visible';
  hidden = 'hidden';
}


function initpops() {
  return true;
}


function activatepopups() {
  popupsready = true;
  return true;
}

function redo() {
  if (innerWidth != origWidth || innerHeight != origHeight) location.reload();
  return true;
}

function showpopup(popelem,placenearthis) {
  if (!popupsready) return false;
  if (document.layers) {
    popelemstyle = document.layers[popelem];
    if (lastpopelem) { popelem2hidestyle = document.layers[lastpopelem]; }
    popelemstyle.top = placenearthis.y + 300;
	popelemstyle.left = placenearthis.x + 300;
  } else if (document.all) {
    popelemstyle = document.all(popelem).style;
    if (lastpopelem) { popelem2hidestyle = document.all(lastpopelem).style; }
    popelemstyle.top = placenearthis.offsetTop + 300;
    popelemstyle.left = placenearthis.offsetLeft + 300;
  } else {
    return false;
  }
  popelemstyle.visibility = visible;
  if ((lastpopelem) && (lastpopelem != popelem)) {
    popelem2hidestyle.visibility = hidden;
  }
  lastpopelem = popelem;
  return true;
}

function hidepopup(popelem) {
  if (!popupsready) return false;
  if (document.layers) {
    popelemstyle = document.layers[popelem];
  } else if (document.all) {
    popelemstyle = document.all(popelem).style;
  } else {
    return false;
  }
  popelemstyle.visibility = hidden;
  return true;
}

function goback(){
	window.history.back();
}



// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie 
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
	  
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" + 
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

 var x=getCookie("iesubcode");
 thestr = "";
  
 if (x == "" ){
 
  	if ( 1 ==0){
		location='index.php3';
	thestr = "Information Has been accepted!";
	thestr += '<a href="" target=""> Click Here </a> to Enter';;
	}else{
	 alert("Please Check Your Entry!!!");
	window.history.back();
	}
}else{	
	
	thestr += '<P><TABLE border=0 cellPadding=2 cellSpacing=0 width="50%"><TBODY><TR>';

	thestr += '<TD align=left class=Content colSpan=4 vAlign=center><P>To access the Online Edition of Investment Executive, first, you must enter your subscription code located on the top right of your address label of your Investment Executive newspaper. Then enter your last name.</P><BR></TD></TR></FONT><TR>';
	
  thestr += '<td><TABLE align=center bgColor=#ffcc00 border=0 cellPadding=2 cellSpacing=0 width="100%"><TBODY><TR><TD>';
  thestr += '<TABLE bgColor=#000000 border=0 cellPadding=4 cellSpacing=0 width="100%"><TBODY><TR><TD>';
  thestr += '<TABLE border=0 cellPadding=5 cellSpacing=0 width="100%"><TBODY><TR>';
  thestr += '<TD align=middle bgColor=#ffffff class=CONTENT vAlign=center>';
  thestr += '<TABLE border=0 cellPadding=2 cellSpacing=0 width="100%"><TBODY><TR><TD>&nbsp;</TD>';
  thestr += '<TD class=FORMCONTENTB vAlign=center width="40%">Subscription Number:</TD>';
  thestr += '<TD class=FORMCONTENTB vAlign=center width="40%"><INPUT name=subcode size=12 value=></TD><TD>&nbsp;</TD></TR>';
  thestr += '<TR><TD>&nbsp;</TD><TD class=FORMCONTENTB vAlign=center width="40%">Last Name:</TD>';
  thestr += '<TD class=FORMCONTENTB vAlign=center width="40%"><INPUT name=lastname></TD><TD>&nbsp;</TD></TR>';
  thestr += '<TR><TD>&nbsp;</TD></TR><TR>';
  thestr += '<TD align=middle colSpan=4 vAlign=center><INPUT border=0 type=submit value=Login></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></td></TR>';
  thestr += '<TR><TD align=middle class=FORMCONTENTB><BR><FONT color=#ff0000>**You must complete all fields</FONT></TD></TR><TR><TD align=middle><BR><BR>';
  thestr += '<DIV class=Content>If you are having problems logging on to our Subscriber services, please contact us by email.</DIV><P><A class=LinkToMore href="mailto:support@investmentexecutive.com">[ click here ]</A></P></TD></TR></TBODY></TABLE></center></div>';
 
} 


var now = new Date();
now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
var iesubcode = getCookie("iesubcode");

var m
function MM_openBrWindow(theURL,winName,features) { 
  m = window.open(theURL,winName,features);
}

function searching(){
var advanced;
document.forms[0].advanced.value = 0;
topword = document.forms[0].submit();
}

function advsearching(){
var advanced;
document.forms[0].advanced.value = 1;
topword = document.forms[0].submit();

}



var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}



