
function launchsite() {
	w = screen.availWidth;
	h = screen.availHeight;
	//alert ("height = " + h);
	newwindow=window.open('flash/','flash','height=' + h + ',width=' + w + ',top=0,left=0,resizable=yes,scrollbars=no');
	//return false;
}
function launchsite2() {
	w = screen.availWidth;
	h = screen.availHeight;
	//alert ("height = " + h);
	newwindow=window.open('../flash/','flash','height=' + h + ',width=' + w + ',top=0,left=0,resizable=yes,scrollbars=no');
	//return false;
}


function initPage() {
	//positionSplash();
	//document.getElementById('container').style.visibility = 'visible';
	//document.getElementById('horizon').style.visibility = 'hidden';
	flashPlay();
}
function letsGo() {
	window.setTimeout("initPage()", 100);
}
// 3742 pixels is the bottom of my screen

function positionSplash() {
	splashWidth = 1500;
	vpWidth = returnWidth();
	splashX = parseInt((vpWidth/2) - (splashWidth/2));
	initscrollX = -splashX;
	document.getElementById('container').style.left = splashX + "px";
}

function pageTwo() {
	splashWidth = 4500;
	vpWidth = returnWidth();
	splashX = parseInt((vpWidth/2) - (splashWidth/2));
	clearup(); 
	moveto(splashX);
}

function pageOne() {
	splashWidth = 1500;
	vpWidth = returnWidth();
	splashX = parseInt((vpWidth/2) - (splashWidth/2));
	clearup(); 
	moveto(splashX);
}

function getScrollX() {
	var scrOfX = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfX = document.documentElement.scrollLeft;
	}
	return scrOfX;
}

function getScrollY() {
	var scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		scrOfY = document.documentElement.scrollTop;
	}
	return scrOfY;
}

function returnHeight() {
	var myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientHeight ) ) {
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && (document.body.clientHeight ) ) {
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}

function returnWidth() {
	var myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth ) ) {
		myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth ) ) {
		myWidth = document.body.clientWidth;
	}
	return myWidth;
}

started = false;

function moveto(x) {
	speedControl = 0.1;
	current_x = (document.getElementById('container').offsetLeft);
	//alert (current_x);

	if (current_x < x) {
		speedx = (Math.ceil((x - current_x )*speedControl)) //+ (speedx*0.9);
	} else {
		speedx = (Math.floor((x - current_x )*speedControl)) //+ (speedx*0.9);
	}
	
	

	new_x = current_x + speedx;
	document.getElementById('container').style.left = new_x + "px";
	
	if ((parseInt(current_x) != parseInt(x))) {
		timerStr = "looperID = self.setTimeout('moveto(" + x + ")',1);";
		eval(timerStr);
		started = true;
	} else {
		showallText();
		clearup();
	}
}


function clearup() {
	if (started == true) {
		clearTimeout(looperID);
		started = false;
	}
}

// - - - - - - - - - - - - - - - - - - - - - - - -  //
// - - - Javascript / Flash control functions - - - //
// - - - - - - - - - - - - - - - - - - - - - - - -  //
function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  	if (navigator.appName.indexOf ("Microsoft") !=-1) {
   		return window[movieName]
  	} else {
    	return document[movieName]
 	}
}
function flashPlay() {
	//alert("playFlash");
	window.setTimeout("thisMovie('movie').Play()", 700);
	//thisMovie('movie').Play();
	//this_screen = this_screen + 1;
	//alert(this_screen);
}


