var time_to_load = 0;
function time_load() {
	time_to_load++;
}
load_page=setInterval ( 'time_load()', 1000 );

var phponline = 0;
if (phponline.length>1) {phponline=0};
var path = location.pathname.substring(1,6);
if ((location.hostname != "babelfish.yahoo.com")&&(location.protocol == "http:")&&(path != "barry")&&(path != "babel")) {
	if (top.window.document.title != "Altered States *") {
		top.window.location.replace("http://altered-state.com/index2.htm?"+location.pathname);
	}
}
var loc_ok = 1;
/*var origin ="";
var nzadjust = 1;	  
var usadjust =.70407;*/
var usa =0.70569998;
var curcode="NZ $ ";
var WGdc=".";
function FormatMoney(A) {
/*if (origin !="nz") {adjust=usadjust;} else {adjust=nzadjust;}
	A=A*adjust;*/
  var N=Math.abs(Math.round(A*100));
  var S=((N<10)?"00":((N<100)?"0":""))+N;
  S=(S.substring(0,(S.length-2)))+WGdc+
    S.substring((S.length-2),S.length);
  return (S.length>14)?"over":S;
}
function convert(price) {
 amount = price;
  if ((location.hostname != "babelfish.yahoo.com")&&(location.protocol == "http:")&&(path != "barry")&&(path != "babel")) {
	parent.curconvt.amount = price;
	}
var currency = window.open('/currenc2.htm','convert','toolbar=no,scrollbars=yes,width=740,height=520');
      return;
}
function music_off() {
	self.parent.window.control.music_state = 1;
	self.parent.window.music.document.location = "/randmidi.htm";
}
document.writeln('<link rel="shortcut icon" href="/favicon.ico">');
document.writeln("<STYLE>  A:hover {color:red;background-color:#4bc4f1;}");
document.writeln(".button {font-size : 10px;color : yellow;font-weight : bold;background-color : #1A00FF; }");
document.writeln(".hilite {color: #FF0000; background-color:#FFFF00; }");
document.writeln("#loading {width: 100px;height: 100px;background-color: #FFFFFF;position: absolute;left: 100px;top: 100px;margin-top: -50px;margin-left: -50px;text-align: center; }");
document.writeln("</STYLE>");

/*document.write('<script language="JavaScript1.2" src= "http://www.altered-states.net/phplive/check.php"></script>');*/
  
document.write('<div id="loading"><img src="/anibcir.gif"></div>');

var on_page = null;
var imagnum = 0;
function stillthere(){
	if(document.all.time_image) {
		imagnum++; /* time equals imagnum *20 secs*/
		time_image.src='http://altered-states.net/php/pagetimer.php?timer='+imagnum+'&loadtime='+time_to_load+'&page=NZ_'+location.pathname;
	}
}
// on_page=setInterval ( 'stillthere()', 20000 );

// Created by: Simon Willison | http://simon.incutio.com/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(function() {
  document.getElementById("loading").style.display="none";
	clearInterval(load_page);
});
