var pix="null"; // object
var t;

function doMove() {
	if (parseInt(pix.style.left) < 750) {
  	pix.style.left = parseInt(pix.style.left)+20+'px';
 	t = setTimeout(doMove,40); // call doMove in 40msec
	}else{
	document.getElementById('mainwrap').style.visibility="visible";
	t=setTimeout(psycho, 3000);
	}
}

function init() {
  	pix = document.getElementById('pixObject'); // get the "pix" object
  	pix.style.left = '-120px'; // set its initial position to 0px
  	doMove(); // start animating
}

function unselecttab(){
	for (i=1;i<8;i++){
	document.getElementById('tabs'+i).style.backgroundImage="url(" + tabdown + ")";
	}
}

function showtab(tab, item){
	unselecttab();
	tab.style.backgroundImage="url(" + tabup + ")";
	showinfo(tab, item);
}

function showcontact(Menu, item){
	unselecttab();
	document.getElementById('tabs7').style.backgroundImage="url(" + tabup + ")";
	showinfo(Menu, 7);
}

function validate(){
	var i=0;
	while (document.eform1.Name.value.charAt(i) == " "){  ///remove leading spaces
	document.eform1.Name.value=document.eform1.Name.value.slice(i+1);
	i=0;         
}
	if (document.eform1.Name.value.length < 1) {
	alert("Please enter name");
	return false;
	}
  if ((document.eform1.email.value.length < 1) && (document.eform1.phone.value.length < 1)){ 
  alert("Please enter email and/or telephone number");
  return false;
  }
return true;
}

function validated(string) {
	var i=0;
	while (string.charAt(i) == " "){  ///remove leading spaces
	string=string.slice(i+1); 
	i=0;         }
	if (string.length > 250){
	alert("Maximum of 250 characters allowed");
	string=string.substring(0, 250);
	}
  if (string.length <1){
  alert("Please complete entry");
  return "";
  }
  for (var i=0, output='', valid="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_@./(), "; i<string.length; i++)
       if (valid.indexOf(string.charAt(i)) != -1)
          output += string.charAt(i)
       return output;
} 

var text=new Array;
text[1]="<span class='emph'>WEB PAGE</span><br><br>&diams; If you want to document activities, share pictures and communicate with an extended family you can do so very conveniently and inexpensively with a web site.<br><br>&diams; If you have a club, church group, hobby group to organize and promote, a web site is a great low cost communication medium.<br><br>&diams; if you have a non-profit agency you will want to advertise and solicit money and volunteer help with an online presence.<br><br>&diams; If you have any kind of business, service, sales, or professional, a well designed web site enhances your image and multiplies your ability to reach your target market.<br><br><span id='vision'>I can help create your vision. </span>";
text[2]="<span class='emph'>CAPABILITY</span><br><br>I can supply complete web page design solutions utilizing many web techniques as required for your web design project.<br><br><img src='franksmall.jpg' style='float:left; padding:10px 30px 20px 0px;' alt='Frank'/>&diams; Graphic processing.<br><br>&diams; Video and audio file setup.<br><br>&diams; HTML, CSS, and DHTML writing.<br><br>&diams; mySQL database setup and data retrieval.<br><br>&diams; Javascript and php scripting.<br><br>All web pages will be search engine optimized.";
text[3]="<span class='emph'>SERVICES</span><br><br>Optional support services for web page designs include:<br><br>&diams; Image editing, optimizing, graphic format conversions.<br><br>&diams; Video and audio file editing and conversion.<br><br>&diams; Animations and slide show displays.<br><br>&diams; Convert material to pdf files for potential download.<br><br>&diams; Databases created for use with e-commerce sites.<br><br>&diams; Site maintenance or updates to an existing site.<br><br>&diams; For your convenience I can provide domain registration and site hosting.";
text[4]="<span class='emph'>PRICING</span><br><br>&diams; First, or home, page design............$290<br><br>&diams; Additional pages, each ..................$ 75<br><br>This includes Client supplied graphics, Navigation, with single level menus, Email link if required, Headers, titles, client logos, Links to other sites, Optimization for search engines, Upload of the site to host.<br><br>OPTIONS:<br>&diams; Updates $ 45 per hour, or, $195 retainer per year.<br> &diams; Collect site visitor statistics $ 45 &diams; Shopping cart setup $ 80 &diams; Database creation, e-commerce $190 &diams; Customer forms, data retrieval $ 50 &diams; Animations/slide shows $ 40 &diams; Audio/video content. $ 35 &diams; Multilevel navigation menus $ 30 &diams; Web Hosting $8-$20 per month.";

text[5]="<span class='emph'>QUESTIONS? - SOME ANSWERS</span><br><span class='fq'>What is the site hosting cost? --</span> $8 /month for family/small business site. $20/month for e-commerce.<br><span class='fq'>What is the domain registration cost? --</span> Business use $20/year.<br><span class='fq'>How do I search for an available domain name? --</span> Most hosting services will search names and register them for you. If I host your site I will search for you.<br><span class='fq'>Who owns the site? --</span> You do. You can take the entire web page package that I provide and move it to another hosting service if desired.<br><span class='fq'>How do I update the site? --</span> You can do that yourself, or I am can provide that service.<br><span class='fq'>What if I need to make frequent content changes? --</span> I can set up a simple file upload facility that you can use if you just need to change text or images.<br><span class='fq'>Will the site work with all systems? --</span> The site will be set up to work with all common browsers, Firefox, Internet Explorer, Safari, Chrome, and Windows, Mac and Linux systems.<br><br><br><br><span class='fq' style='font-size:12px; font-weight:bold;'>Need a hosting service? Check out this low cost offer >>>> <a href='http://www.hostmonster.com/track/webpager/CODE58'>Hostmonster</a></span>";

text[6]="<span class='emph'>WEB PAGE<br>EXAMPLES</span><br><br>Click on image <br>quadrant to see <br>a larger display of<br>page fragment.<br><br><br><br>Click EXAMPLES tab<br>to close the larger<br>page display.";
text[7]="";//form replaced with html due to Safari javascript bug
//future expansion
text[8]="<span class='emph'>SOAP BOX</span>"+"<br><br>"+"open source propaganda here";
text[9]="<div style='background-color:#ddf; padding:20px;'><span class='emph'>STYLE-O-RAMA</span><br><br><br>&diams; Both style and content are important for a well targeted web site.<br><br>&diams; These 'styles' are a little extreme, but have fun playing with them.<br><br>&diams; This illustrates how you can make similar content look very different.<br><br><br>&diams; PS I can also provide more subtle designs!!</div>";
//
text[10]="<table width='220' border='0' cellspacing='5' style='background-color:#f2f2df; margin-left:100px;'><tr><td><span class='emph'>LINKS</span></td></tr><tr><td><a href='http://www.watsonville-band.org'>www.watsonville-band.org</a></td></tr><tr><td><a href='http://www.literacy-ink.com'>www.literacy-ink.com</a></td></tr><tr><td><a href='http://www.web-pager.com/final/final2.php'>Art by Frances</a></td></tr><tr><td><a href='http://www.ccsmusic.org'>CMEA Music</a></td></tr><tr><td><a href='http://www.santacruzpops.com'>Santa Cruz Pops</a></td></tr><tr><td><a href='http://www.scwdgroup.com'>Santa Cruz Web Developers</a></td></tr><tr><td><a href='www.fsf.com'>Free Software Foundation</a></td></tr></table>";

function showinfo(Menu,item){
if (Menu.style) {
  if (item==7){
  document.getElementById("eform1").style.visibility="visible";//
  document.getElementById("eform1").Name.focus();//focus on first entry
  }else{
  document.getElementById("eform1").style.visibility="hidden";
  }
var obj=document.getElementById('info');
  if (item==1) {
  t=setTimeout(psycho, 1000);
  }

  if (item==6) {
  document.getElementById('pixs').style.visibility="visible";
  document.images[3].src="websamples.jpg";//hot spots to images
  }else{
  document.getElementById('pixs').style.visibility="hidden";
  }

  obj.innerHTML=text[item];//write text into infodiv
	  }
}

function showweb(websample){
	document.images[3].src=websample;
}

function psycho(){//enlarging message
	t=setTimeout(update,150);
}

var h=-1;
var colr=new Array("#efefff","#cfcfff","#afafff","#4f4fff","#4444ff","#2222ff");

function update(){//run enlarging message
	target=document.getElementById('vision');
	if (target) {
	h++;
	target.style.fontSize="1."+h+"em";
	target.style.color=colr[h];
	t=setTimeout(update,150);
  if (h>6){
  clearTimeout(t);
  h=-1;
  }
}
}

printer = new Array("printericon.jpg", "ecoprinter.gif", "metalprinter.gif", "printer4.jpg");
Mail = new Array("email.jpg", "ecoemail.gif", "metalmail.gif", "email4.gif");
Sicon =new Array("sane.gif", "ecosymbol.gif", "metal.gif", "cartoons-einstein.gif");
webdes = new Array("webdes2.jpg", "webdes3.gif", "webdes4.jpg", "webdes4.gif");
tabs = new Array("tabdown2.gif", "tabup.gif", "tabdown3.gif", "tabup3.gif", "tabdown5.gif", "tabup4.gif");

var tabup=tabs[1];//initial value
var tabdown=tabs[0];//initial value

//remember IE6/7 bug gEbyId names must be unique in document
function styleselect(style){
  htarget=document.getElementById("web");
  target=document.getElementById("basic");
  ptarget=document.getElementById("Printer");
  etarget=document.getElementById("Emailicon");
  starget=document.getElementById("pageStyle");
  insanetarget=document.getElementById("pballs");

if (style.value=="sane"){
 target.href="index5h.css";
insanetarget.style.display="none";
htarget.src=webdes[0];
makechanges(0,0,0);
tabdown=tabs[0];
tabup=tabs[1];
}
  if (style.value=="eco"){
  target.href="index5h2.css";//OK IE6/7???
  insanetarget.style.display="none";//OK
  htarget.src=webdes[1];//OK
    makechanges(1,1,1);
  tabdown=tabs[2];//OK
  tabup=tabs[3];//OK
  }
	if (style.value=="metal"){
 	target.href="index5h3.css";
	insanetarget.style.display="none";
	htarget.src=webdes[2];
    	makechanges(2,2,2);
	tabdown=tabs[0];
	tabup=tabs[1];
	}
  if (style.value=="insane") {
  target.href="index5h4.css";
  htarget.src=webdes[3];
    makechanges(3,3,3);
  insanetarget.src="purpleballs.gif";
  insanetarget.style.display="inline";
  tabdown=tabs[4];
  tabup=tabs[5];
  }
init();//brush effect
tab=document.getElementById("tabs1");//refresh tabs
showtab(tab, 1);
}

function makechanges(pr, ml, si){
	ptarget.src=printer[pr];
	etarget.src=Mail[ml];
	starget.src=Sicon[si];
}
