// JavaScript Document
function fHandleTelephone(field, blur, e) 
{if (e) {var key, keyChar;if (window.event) {key = window.event.keyCode;} else if (e) {key = e.which;} else {return true;};if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27)) return true;keyChar = String.fromCharCode(key);if ((("0123456789").indexOf(keyChar) < 0)) return false;};var sTemp = "";for (var iChar = 0; iChar < field.value.length; iChar++) {var iTemp = field.value.substring(iChar, iChar + 1);if (iTemp == parseInt(iTemp)) sTemp += iTemp.toString();};if (sTemp.length >= 10+blur) {sTemp = "(" + sTemp.substring(0, 3) + ") " + sTemp.substring(3, 6) + "-" + sTemp.substring(6, 10) + " x" + sTemp.substring(10);} else if (sTemp.length >= 6+blur) {sTemp = "(" + sTemp.substring(0, 3) + ") " + sTemp.substring(3, 6) + "-" + sTemp.substring(6);} else if (sTemp.length >= 3+blur) {sTemp = "(" + sTemp.substring(0, 3) + ") " + sTemp.substring(3);} else if (sTemp.length >= 0+blur) {sTemp = "(" + sTemp;};field.value = sTemp;return true;};
																																																																																																																																																																																																																																									   function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
																																																																																																																																																																																																																																									
function showDiv(divid)
{
	document.getElementById(divid).style.display="inline";
}

function hideDiv(divid)
{
	document.getElementById(divid).style.display="none";
}

function CheckName(of)
{
	var txt_name = document.form1.name.value;
	if (txt_name.length == 0)
	{
		showDiv('NameDiv');
		return false;
	} else {
		hideDiv('NameDiv')
		return true;
	}	
}
function CheckContactInfo()
{
	var txt_phone = document.form1.phone.value;
	if ((txt_phone.length == 0))
	{
		showDiv('PhoneDiv');
		return false;
	} else {
		hideDiv('PhoneDiv');
		return true;
	}
	
}
function CheckInputs()
{
	var n = CheckName();
	var c = CheckContactInfo();
	if ((n==true))
	{
		return true;
	} else {
		return false;
	}
	
}
function NewWindowOpenScroll (url,name,width,height,resiz)
  {
  var options = '';
  var winl = (screen.width - width) / 2;
  var wint = (screen.height - height) / 2;

  options = 'scrollbars=yes,';
  options = options + 'width=' + width + ',';
  options = options + 'height=' + height + ',';
  options = options + 'top=' + wint + ',';
  options = options + 'left=' + winl + ',';
  options = options + 'resizable=' + resiz;

  popupWin = window.open (url, name, options);
  popupWin.opener.top.name = "opener";
  }
  
  function DisplayTest()
  {
	  
	var r_text = new Array ();
	///////////////////////////////////////////////////////
	// Example:
	// r_text[0] ="\"QUOTEQUOTEQUOTE\"<br /><br /><strong>-NAME,LOCATION</strong>";
	///////////////////////////////////////////////////////
	
	r_text[0] = "\"Got our pool up and running with no problems.  Very pleasant to work with.\"<br /><br /><strong>-Wendy, Northridge</strong>";
	
	r_text[1] = "\"Quick to respond to my call, very nice and professional. So far service has been great!\"<br /> <br /><strong>-Cindy, Valley Village</strong>";
	
	r_text[2] = "\"Spectrum gives me confidence in terms of their knowledge and willingness to explain and follow up with me.\"<br /> <br /><strong>-Brenda, Santa Monica</strong>";
	
	r_text[3] = "\"Spectrum is fantastic.  They arrived on time and finished the work quickly with no mess.\"<br /> <br /><strong>-Ken, Encino</strong>";
	
	r_text[4] = "\"They are extremely prompt and predictable.\"<br /> <br /><strong>-Liz, Sherman Oaks</strong>";
	
	r_text[5] = "\"Spectrum is clearly driven by a committment to excellence.\"<br /> <br /><strong>-Lee & Jill, Tarzana</strong>";
	
	r_text[6] = "\"Mark was very punctual and reliable, and left the premises clean after installing the heater.\"<br /> <br /><strong>-Gabe, Calabasas</strong>";
	
	r_text[7] = "\"Our poolman does a beautiful job keeping our pool water clear and chemicals well balanced.\"<br /> <br /><strong>-Barbara, Van Nuys</strong>";
	
	r_text[8] = "\"The office staff is pleasant and efficient.\"<br /> <br /><strong>-Sharon, Granada Hills</strong>";
	
	r_text[9] = "\"Larry was pleasant to deal with and effective at communicating services and options.\"<br /> <br /><strong>-Crystal, West Hollywood</strong>";
	
	r_text[10] = "\"They're very knowledgeable about pools... we trust them.\"<br /> <br /><strong>-Robert, Studio City</strong>";
	
	r_text[11] = "\"Unusually good responsiveness.\"<br /> <br /><strong>-Ted, Bel Air</strong>";
		
		
	
	var i = Math.round((r_text.length-1)*Math.random());
	return r_text[i];
	  
  }