//function maximizescreen(){ 
//function randominteger(x){
//function thedate(){
// function instring(little,big)  is little found in big?


function dr(x){
 document.write(x);
}

function initArrs (){
//  this.size = length;
  for(var i=0; i < initArrs.arguments.length; i++){
    this[i] = initArrs.arguments[i];
  }
}




function maximizescreen(){ 
 if (window.screen) {
  var aw = screen.availWidth; var ah = screen.availHeight;    window.moveTo(0, 0);    window.resizeTo(aw, ah); 
 }
}; 


function randominteger(x){
 return Math.floor(Math.random()*(x));
}



//////////////////// DATE stuff //////////////////////////////////
function thedate(){
  var Today = new Date();

  year = (Today.getYear().toString());
  year = year.substring(1,3);

  daze = new initArrs('Sun','Mon','Tue','Wed','Thur','Fri','Sat');
  month = new initArrs('01','02','03','04','05','06','07','08','09','10','11','12');
  daynum = new initArrs('00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31');

  return daze[Today.getDay()] + '.' + month[Today.getMonth()] + '.' + daynum[Today.getDate()] + '.' + year;
}




var msg=0;
var msgindex=0;
var maxmsg=0;
var messages=new Array();
messages[maxmsg++]="Welcome to KC Websites              ";
messages[maxmsg++]="Affordable rates for any individual or business             ";
messages[maxmsg++]="Quality Web Design and E-commerce.             ";
messages[maxmsg++]="Get professional e-mail:             ";
messages[maxmsg++]="YOURNAME@YOUR-COMPANY.COM ...             ";
messages[maxmsg++]="Websites start as little as $100             ";

function type(){
 msgindex++;
 if(msgindex>messages[msg].length){msg++;msgindex=0;}
 if(msg>maxmsg-1){msgindex=0;msg=0;}
 x=messages[msg].substr(0,msgindex);
 window.status=x;
 setTimeout("type()", 100);
}




function instring(little,big){
 if(big.indexOf(little)!=-1) return true; else return false;
}

function getLocationSearch(){
 return String(location.search.substr(1,1000));
}

function inLocationSearch(x){
 if(getLocationSearch().indexOf(x)!=-1)return true; else return false;
}

function getLocationOnly(){
 loc=getLocationSearch();
 if(loc=="") return String(this.window.location);
 //otherwise
 loc=String(this.window.location);
 i=loc.indexOf("?");
 return loc.substr(0,i);
}


function parse(x,j){  //return the j'th item in the list x
/// parse the "|" separator 
var b=new Array();
var count=-1;
var s=""
if(x.charAt(x.length-1)!="|")x+="|"; ///add the | to the end if it ain't there 
 for(var i=0; i<x.length; i++){
  ch=x.substring(i,i+1);
  if(ch=="|"){ 
    count++;  b[count]=s; s="";
   } else  {
    s+=ch;
  }
 } 
 if(j>count)return ""; else return b[j]; 
}

