// JavaScript Document


details = new Array (
"You are on the quickest site for term paper delivery!",
"Read the most common questions asked!",
"Read what our customers are saying about us!",
"Search for your paper by subject selection!",
"Order your term paper RIGHT NOW!",
"Learn how to properly use our papers!");

ar = new Array (
"Welcome to TonsOfPapers.com!",
"Our customer care office is open 24 hours a day!",
"Order on-line or talk to a friendly representative who will take your order personally.",
"Customer care hotline 1-888-774-9994.",
"Thousands of papers on-file to choose from for same day delivery!",
"Pre-written papers only $8.95 a page.",
"Custom-written term papers only $ 18.95 a page.",
"Ordering a paper has never been easier!");
speed = 30;
pause = 2000;
timerID = null;
bannerRunning = false;
currentMessage = 0;
offset = 0;
emptyline = " ";

function show (j) {
	window.status = "";
	stopBanner ();
	document.infoform.infoarea.value = emptyline + details [j-1];
}
function stopBanner () {
	clearTimeout (timerID);
	offset = 0;
}
function startBanner () {
	stopBanner();
	showBanner();
}
function showBanner () {
	text = ar [currentMessage];
  if (offset < text.length) {
	if (text.charAt (offset) == " ") offset++;
	partialMessage = text.substring (0, offset + 1);
	document.infoform.infoarea.value = emptyline + partialMessage;
	offset++;
	timerID = setTimeout ("showBanner()", speed);
  } else {
	offset = 0;
	currentMessage++;
	if (currentMessage == ar.length) currentMessage = 0;
	timerID = setTimeout ("showBanner()", pause);
  }
}


function openPopUpWindow() {
  popupWin = window.open('./contact_us_form.php','mywindow','width=500,height=360');
  }

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



function popUp2(url) 
{
 var width  = 900;
 var height = 700;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 	 params += ', top='+top+', left='+left;
  	 params += ', directories=no';
  	 params += ', location=no';
  	 params += ', menubar=no';
 	 params += ', resizable=yes';
 	 params += ', scrollbars=yes';
  	 params += ', status=no';
  	 params += ', toolbar=no';
  	 newwin=window.open(url,'windowname', params);
 if (window.focus) {newwin.focus()}
 return false
}



function popUp3(url) 
{
 var width  = 550;
 var height = 600;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 	 params += ', top='+top+', left='+left;
  	 params += ', directories=no';
  	 params += ', location=no';
  	 params += ', menubar=no';
 	 params += ', resizable=yes';
 	 params += ', scrollbars=yes';
  	 params += ', status=no';
  	 params += ', toolbar=no';
  	 newwin=window.open(url,'windowname', params);
 if (window.focus) {newwin.focus()}
 return false
}




function popUp4(url) 
{
 var width  = 700;
 var height = 740;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 	 params += ', top='+top+', left='+left;
  	 params += ', directories=no';
  	 params += ', location=no';
  	 params += ', menubar=no';
 	 params += ', resizable=yes';
 	 params += ', scrollbars=yes';
  	 params += ', status=no';
  	 params += ', toolbar=no';
  	 newwin=window.open(url,'windowname', params);
 if (window.focus) {newwin.focus()}
 return false
}


function popUp5(url) 
{
 var width  = 900;
 var height = 900;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 	 params += ', top='+top+', left='+left;
  	 params += ', directories=no';
  	 params += ', location=no';
  	 params += ', menubar=no';
 	 params += ', resizable=yes';
 	 params += ', scrollbars=yes';
  	 params += ', status=no';
  	 params += ', toolbar=no';
  	 newwin=window.open(url,'windowname', params);
 if (window.focus) {newwin.focus()}
 return false
}

function launch(newURL, newName, newFeatures, orgName) {
  var remote = open(newURL, newName, newFeatures);
  if (remote.opener == null)
    remote.opener = window;
  remote.opener.name = orgName;
  return remote;
}
function showArticle(page) {
        var newsPage;
        newsPage = window.open(page,"login","location=no,menubar=no,toolbar=no,status=no,resizable=yes,width=750,height=650,scrollbars=no");
        newsPage.focus();
}
