/*
File:  		JsUtilities.js
Description: All the JavaScript Utilities
*/
var winW, oldDiv, banner, contentH = 0, col = 3, force3 = 0, siteRes = 1280, conWidth = 667, conWidthBig = 870, outerWidth = 1079;
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
var check;
if ((browser=='Netscape'||browser=='Microsoft Internet Explorer')
&& (version>=4))
{
	check = 'ok';
}


// Pops up a child window with the given window name and dimensions.
// Takes the optional arguments to set the menubar, resize, and scrollbars attributes of Window.
function popupWindow(winname,  w, h, menu, resize, scroll) {
	if (winname == null) winname = "newWindow";
	if (w == null) w = 600;
	if (h == null) h = 600;
	if (resize == null) resize = 1;
	
	menutype   = "nomenubar";
	resizetype = "noresizable";
	scrolltype = "noscrollbars";
	if (menu) menutype = "menubar";
	if (resize) resizetype = "resizable";
	if (scroll) scrolltype = "scrollbars";
	
	cwin=window.open('', winname,
		"status," + menutype + "," + scrolltype + "," + resizetype + ",width=" + w + ",height=" + h);
return true;
}

function popupSign(winname,  w, h, menu, resize, scroll) {
	if (winname == null) winname = "newWindow";
	if (w == null) w = 600;
	if (h == null) h = 600;
	if (resize == null) resize = 1;
	
	menutype   = "nomenubar";
	resizetype = "noresizable";
	scrolltype = "noscrollbars";
	if (menu) menutype = "menubar";
	if (resize) resizetype = "resizable";
	if (scroll) scrolltype = "scrollbars";
	
	cwin=window.open('','newWindow','height=200,width=400,status=yes,toolbar=no,menubar=no,location=no');
return true;
}


function trim(string) {
   while (string.charAt(0) == " ")
      string = string.substring(1,string.length);

   while (string.charAt(string.length-1) == " ") 
      string = string.substring(0,string.length-1);

   return string;
}

function checkNumeric(element, whole, fractional) {

   if (fractional == 0) {
	 var value = parseInt(element.value);
   } else {
	 var value = parseFloat(element.value);
   }
//   if (trim(element.value) == "") return true;

   if (isNaN(value)) {
      alert("Please enter a number");
      element.focus();
      return false;
   }

   element.value = value;

   if (whole != null) {
      if (value >= Math.pow(10,whole)) {
         element.value = value;
         alert("Please enter a number less than " + Math.pow(10,whole));
         element.focus();
         return false;
      }

      if (fractional != null && fractional != 0) {
         temp = Math.floor((value-Math.floor(value)) * Math.pow(10,fractional)) 
         temp += Math.pow(10,fractional)
         temp += ""
         element.value = Math.floor(value) + "." + temp.substring(1,temp.length);
	  }
   }

   return true;
}

// A function to validate the E-mail
 function validEmail(email) {
    invalidChars = " /:,;"

  if (email == "") {      // cannot be empty
   return false
  }
  for (i=0; i<invalidChars.length; i++) { // does it contain any invalid characters?
   badChar = invalidChars.charAt(i)
   if (email.indexOf(badChar,0) > -1) {
    return false
   }
  }
  atPos = email.indexOf("@",1)   // there must be one "@" symbol
  if (atPos == -1) {
   return false
  }
  if (email.indexOf("@",atPos+1) != -1) { // and only one "@" symbol
   return false
  }
  periodPos = email.indexOf(".",atPos)
  if (periodPos == -1) {     // and at least one "." after the "@"
   return false
  }
  if (periodPos+3 > email.length) {  // must be at least 2 characters after the "."
   return false
  }
  return true
}

// Check form field content.
function checkField (thisform, fieldvalue) {
	if (thisform.BookmarkName.value == "") {
	   alert ('Please enter ' +  fieldvalue);
	   return false;
	}
	return true;
}

// Check form for E-mail addresses
 function checkForm (emailform) {
 	  if (emailform.email_target_email.value == "") {
	      alert ('Please enter "Send to" address.');
		  return false
	  }
	  else {  
		   if (!validEmail(emailform.email_target_email.value)) {
		    alert('Invalid "Send to" email address')
		    emailform.email_target_email.focus()
		    emailform.email_target_email.select()
		    return false
		   }
	  }
	  
	   if (emailform.email_from.value == "") {
	      alert ('Please enter "Your email" address.');
		  return false
	   }
	   else {
	   	   if (!validEmail(emailform.email_from.value)) {
		    alert('Invalid email address')
		    emailform.email_from.focus()
		    emailform.email_from.select()
		    return false
		   }
	   }

	  return true
 }

// Check thisform's multiple select list and give an error if selected 
// items count is more than maxcount.
function checkSelectionCount (thisform, selname, maxcount) {
   var j = 0;
   for (var i=0; i<thisform.elements[selname].options.length; i++) {
   	   if(thisform.elements[selname].options[i].selected) j++;
   }

   if (j > maxcount) {
	   alert("Please select " + maxcount + " or fewer items.\nCurrently selected items: " + j);
       return false;
   }
   else {
       return true;
   }

}

// Pops up a child window with the given window name and dimensions
/*
function popupWindow(winname,w,h) {
	if (winname == null) winname = "newWindow";
	if (w == null) w = 600;
	if (h == null) h = 600;
	cwin=window.open("", winname,
	"nomenubar,status,scrollbars,noresizable,width=" + w + ",height=" + h);
return true;
}
*/

// Submits the form associated with "thiswin" window and displays the results in 
// "popupname" window of dimensions 'w' and 'h'.  Uses popupWindow function. 
function submitClose(thiswin, popupname, w, h, menu, resize, scroll) {
	if (popupname == null) popupname = "resultswindow";
	if (w == null) w = 600;
	if (h == null) h = 600;
	popupWindow(popupname, w, h, menu, resize, scroll);
	
	thiswin.document.forms[0].submit();
	
	thiswin.close();
}

// Checks(status true) or unchecks(status false) all the checkboxes associated with the form.
function CheckUncheck(status) {
   for (i = 0; i < document.forms[0].length; i++) {
      document.forms[0].elements[i].checked = status
   }
}

// Handles switching on and off of the Design, Proof, and Order Online vid
function showHideFlash(fmDivSwitch) {
		var fmDiv = window.document.getElementById('plasma');
		
			if (fmDivSwitch == "on") {
				var wcenter = window.document.body.clientWidth / 2;
				var flashcode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="900" height="700" id="FlashID" tabindex="27" title="Design, Proof & Order Online">';
                flashcode += '<param name="movie" value="http://www.deesign.com/flash/Plasma-TV.swf" />';
    			flashcode += '<param name="quality" value="high" />';
    			flashcode += '<param name="wmode" value="transparent" />';
    			flashcode += '<param name="swfversion" value="6.0.65.0" />';
				flashcode += '<param name="allowScriptAccess" value="always" />';
    			flashcode += '<param name="expressinstall" value="http://www.deesign.com/Scripts/expressInstall.swf" />';
    			flashcode += '<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->';
    			flashcode += '<!--[if !IE]>-->';
    			flashcode += '<object type="application/x-shockwave-flash" data="http://www.deesign.com/flash/Plasma-TV.swf" width="661" height="563">';
    			flashcode += '  <!--<![endif]-->';
    			flashcode += '  <param name="quality" value="high" />';
    			flashcode += '  <param name="wmode" value="transparent" />';
				flashcode += '<param name="allowScriptAccess" value="always" />';
    			flashcode += '  <param name="swfversion" value="6.0.65.0" />';
    			flashcode += '  <param name="expressinstall" value="http://www.deesign.com/Scripts/expressInstall.swf" />';
    			flashcode += '  <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->';
    			flashcode += '  <div>';
    			flashcode += '    <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>';
    			flashcode += '    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>';
    			flashcode += ' </div>';
    			flashcode += ' <!--[if !IE]>-->';
    			flashcode += ' </object>';
    			flashcode += '<!--<![endif]-->';
    			flashcode += '</object>';
				//alert(flashcode);
				
				
				fmDiv.innerHTML = '<div id="plasmaXY" style="position:relative; z-index:99; left:-250px; top: 0px; ">'+ flashcode +' </div>';
				
				//expressinstall_url = false; 
				//flashvars = { oldTitle: window.document.title };  
        		//params = { title: 'DeeSign', quality: 'high', wmode: 'transparent', allowScriptAccess: 'always', menu: 'false' }; 
		        //attributes = { id: 'plasmaXY' }; 
				//swfobject.embedSWF('flash/Plasma-TV.swf', 'plasmaXY', '900', '700', '8.0.0', expressinstall_url, flashvars, params, attributes);  //1200x900
			    
			} else {
				fmDiv.innerHTML = "";
				
			}
	}
	


	function blank2(d) {
		if (d == "Banner") document.getElementById("Dee_Banner").innerHTML = '<img src="Index_images2/'+banner+'" alt="The Sign that Shows You Made a Dream Come True" width="667" height="203" />'; 
		if (d == "Main") document.getElementById("Franchise_Content").innerHTML = '<br />'; 
		if (d == "Sub") document.getElementById("Franchise_Content").innerHTML = '<br />'; 
	}

	function insertflash2() {
		expressinstall_url = false; 
		params = { title: 'DeeSign', quality: 'high', wmode: 'transparent', allowScriptAccess: 'always', menu: 'false' };
		flashvars = { oldTitle: window.document.title };  
        attributes = { id: 'riderDemo' }; 
		swfobject.embedSWF('flash/riderDemo.swf', 'customriders', '400', '232', '8.0.0', expressinstall_url, flashvars, params, attributes);
		matchHeight();
	}
	
	function insertSubImg(d, img) {
		document.getElementById(d).innerHTML = '<img id="ContentImage" name="ContentImage" src="http://www.deesign.com/images/layout/'+img+'"  /><br/>';
		matchSize();
	}

	function insertSubPage(d, c) {
		document.getElementById(d).innerHTML = document.getElementById(c).innerHTML + '<br/>';
		matchSize();
	}
	
function matchWidth(){
	if (parseInt(navigator.appVersion)>3) {
 		if (navigator.appName=="Netscape") {
		  winW = window.innerWidth;
		  //winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  //winH = document.body.offsetHeight;
	 }
	}
	//alert(winW);	
		//document.getElementById('MainBody').style.width = 1000;
		if (document.getElementById('rightNav')) {
			document.getElementById('rightNav').style.width = 201;
			document.getElementById('Franchise_Content').style.width = 586;
		} else {
			document.getElementById('Franchise_Content').style.width = 793;
		}
		
	
	
}

function fit2screen(forceme) {	
	//alert('Site Upgrade in progress... no problems detected');
	if (parseInt(navigator.appVersion)>3) {
 		if (navigator.appName=="Netscape") {
		  winW = window.innerWidth;
		  bser = 'net';
		  //winH = window.innerHeight;
	 }
	 if (navigator.appName.indexOf("Microsoft")!=-1) {
	  winW = document.body.offsetWidth;
	  bser = 'ms';
	  //winH = document.body.offsetHeight;
	 }
	}
	if (document.getElementById('force3C') && force3 < 1) col = 2;
	if (forceme == 1024 || winW < 1025) siteRes = 1024;
		//alert('running fit2screen. Your window size is :'+winW+'. Running in '+siteRes);

	if (siteRes != 1280) {
	if (siteRes == 1024) { conWidth = 586; conWidthBig = 790; outerWidth = 1000; }
	if (forceme == 1400) { conWidth = 986; conWidthBig = 1190; outerWidth = 1400; }				
		//alert('making adjustments for'+ siteRes);
		if (document.getElementById('Franchise_Content') && col == 3) document.getElementById('Franchise_Content').style.width = conWidth+"px";
		if (document.getElementById('Franchise_Content') && col == 2) document.getElementById('Franchise_Content').style.width = conWidthBig+"px";
			//if (document.getElementById('Franchise_Content').style.width == '870px') document.getElementById('Franchise_Content').style.width = conWidthBig;
			//if (document.getElementById('Franchise_Content').style.width == '667px') 
			//alert ('inner:'+conWidth+'    outer:'+outerWidth);
		if (document.getElementById('DeeSign')) document.getElementById('DeeSign').style.width = outerWidth+"px";
		if (document.getElementById('topDiv')) document.getElementById('topDiv').style.width = outerWidth+"px";
		if (document.getElementById('Dee_topMenu')) document.getElementById('Dee_topMenu').style.width = outerWidth+"px";
		if (document.getElementById('MainBody')) document.getElementById('MainBody').style.width = outerWidth+"px";
		if (document.getElementById('Dee_Header')) document.getElementById('Dee_Header').style.width = outerWidth+"px";
		if (document.getElementById('Dee_Layout')) document.getElementById('Dee_Layout').style.width = outerWidth+"px";
		if (document.getElementById('Dee_Footer')) document.getElementById('Dee_Footer').style.width = outerWidth+"px";
		if (document.getElementById('Dee_Footer2')) document.getElementById('Dee_Footer2').style.width = outerWidth+"px";
		if (document.getElementById('Dee_Banner')) document.getElementById('Dee_Banner').style.width = conWidth+"px";
		if (document.getElementById('Franchise_Footer')) document.getElementById('Franchise_Footer').style.width = outerWidth+"px";
				
	}
	

	matchSize(siteRes);
	//if (document.getElementById('Big'))	document.getElementById('Big').innerHTML = document.getElementById('small');
}


function force3column() {
	var f3Ccontent;
	force3 += 1;
	if (document.getElementById('force3C')) {
	f3Ccontent = '<div id="rSep" style="width:4px;float:left; height:auto; background-color:#fff"><img src="/Index_images2/spacer.gif" width="4" height="4" alt="" /></div>';
 	f3Ccontent +='<div id="rightNav" align="center" style="float:left; background-color:#fbf6e3; width: 203px; overflow:hidden; vertical-align:top; clear:right;">';
	f3Ccontent += document.getElementById('rightNav').innerHTML;
	f3Ccontent +='</div>';
	document.getElementById('FCresize').innerHTML = '<div id="Franchise_Content" style="min-height:100px; height:auto; float:left; margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom: 0px; width:'+conWidth+'px; min-width:'+conWidth+'px;max-width:'+conWidth+'px;vertical-align:top; background-color:#fbf6e3; "><div></div></div>';
	document.getElementById('force3C').innerHTML = f3Ccontent;
	} 	
}

function matchSize(siteRes){	
 	var contentDiv = document.getElementById('Franchise_Content').offsetHeight;
	var leftDiv =  document.getElementById('leftNav').offsetHeight;
	var rightDiv = document.getElementById('rightNav').offsetHeight;	
	var maxH, scH, sdH, col = 3, injectFlag;
	if (document.getElementById('force3C') && force3 < 1) col = 2;
	if (col == 2 && force3 == 0) rightDiv = 0; //rightDiv is hidden
	if (document.getElementById('Big') && siteRes == 1024)	{
		document.getElementById('Big').innerHTML = document.getElementById('small').innerHTML;
	}
	if (siteRes != 1280 && document.images["ContentImage"]) {
		//alert('attempting image resize');
		document.images["ContentImage"].width = conWidth;
		document.images["ContentImage"].style.width = conWidth+"px";	
	}
        if (col == 3) {	
			if (document.getElementById('signCalculator')) document.getElementById('signCalculator').style.width = (conWidth - 136) + "px";
			if (document.getElementById('signDesigner')) document.getElementById('signDesigner').style.width = (conWidth - 236) + "px"; 
			if (document.getElementById('ContentBorder')) document.getElementById('ContentBorder').style.width = (outerWidth - 210) + "px";
			if (document.getElementById('checkOutBorder')) document.getElementById('checkOutBorder').style.width = (conWidth - 100) + "px";
			document.getElementById('Franchise_Content').style.width = conWidth+"px";
			if (document.getElementById('force3C')) document.getElementById('force3C').style.width = 205;
			if (!document.getElementById('force3C')) document.getElementById('rightNav').style.width = 201;
		} else {
			if (document.getElementById('signCheckout')) document.getElementById('signCheckout').style.width = (conWidthBig - 50) + "px";
			if (document.getElementById('signCalculator')) document.getElementById('signCalculator').style.width = (conWidth - 136) + "px";
			if (document.getElementById('signDesigner')) document.getElementById('signDesigner').style.width = (conWidth - 136) + "px"; 
			//alert('Debug report: 2 Column');
			//document.getElementById('Franchise_Content').style.width = 798; //793
			//if (document.getElementById('ContentBorder')) alert('content border div present');
			//document.getElementById('Franchise_Content').style.width = conWidthBig+"px";
			document.getElementById('force3C').style.width = 0;
			document.getElementById('rightNav').style.width = 0;
			
		}
	//alert('ContentDiv:'+contentDiv);
	//alert('leftDiv: (offset): '+leftDiv);
	//alert('rightDiv (offset): '+rightDiv);
	// Get most recent hieght

	if (document.getElementById('signDesigner')) {
		sdH = document.getElementById('signDesigner').offsetHeight
		if (sdH > contentDiv) contentDiv = sdH + 130;
	}
	if (document.getElementById('signCalculator')) {
		scH = document.getElementById('signCalculator').offsetHeight
		if (scH > contentDiv) contentDiv = scH + 130;
		if (document.getElementById('prodvid')) {
			injectFlag = '<br /><br /><p></p><font #application.LargeStandardFontFace#><b>INSTALLATION INSTRUCTIONS</b></font>';
			injectFlag += '<font #application.SmallStandardFontFace#><br>Follow these easy steps to install your feather flag.</font>';
			injectFlag += '<object width="450" height="355"><param name="movie" value="http://www.youtube.com/v/H1U0wCwHg0E?fs=1&amp;hl=en_US"></param><param name="allowFullScreen"';
			injectFlag += 'value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/H1U0wCwHg0E?fs=1&amp;hl=en_US"';
			injectFlag += 'type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="450" height="355"></embed></object>';
			document.getElementById('signCalculator').innerHTML += injectFlag;
			contentDiv += 150;
		} else if (document.getElementById('fflink')) {
			injectFlag = '<br /><br /><p></p><font #application.LargeStandardFontFace#><b>INSTALLATION INSTRUCTIONS</b></font>';
			injectFlag += '<a href="http://www.youtube.com/watch?v=H1U0wCwHg0E&feature=player_embedded">';
			injectFlag += '<font #application.SmallStandardFontFace#><br>Follow these easy steps to install your feather flag.</font></a>';
			document.getElementById('signCalculator').innerHTML += injectFlag;
		} else if (document.getElementById('ffvidlink')) {
			injectFlag = '<br /><br /><p></p><font #application.LargeStandardFontFace#><b>INSTALLATION INSTRUCTIONS</b></font>';
			injectFlag += '<a href="http://www.youtube.com/watch?v=H1U0wCwHg0E&feature=player_embedded">';
			injectFlag += '<font #application.SmallStandardFontFace#><br>Follow these easy steps to install your feather flag.</font></a>';
			injectFlag += '<object width="450" height="355"><param name="movie" value="http://www.youtube.com/v/H1U0wCwHg0E?fs=1&amp;hl=en_US"></param><param name="allowFullScreen"';
			injectFlag += 'value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/H1U0wCwHg0E?fs=1&amp;hl=en_US"';
			injectFlag += 'type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="450" height="355"></embed></object>';
			contentDiv += 350;
			document.getElementById('signCalculator').innerHTML += injectFlag;
		}
	}		
	if (document.getElementById('signCheckout')) {
		scH = document.getElementById('signCheckout').offsetHeight
		if (scH > contentDiv) contentDiv = scH + 130;
	}	

	contentDiv += 100;
	if (contentH == 0 || force3 == 1) {
		if (col == 2) {
			if (contentDiv > leftDiv + 75) maxH = contentDiv;
			if (leftDiv > contentDiv - 75) maxH = leftDiv + 75;	
			} else {
			if (contentDiv > leftDiv + 75 && contentDiv > rightDiv + 20) maxH = contentDiv;
			if (leftDiv > contentDiv - 75 && leftDiv > rightDiv - 55) maxH = leftDiv + 75;
			if (rightDiv > contentDiv - 20 && rightDiv > leftDiv + 55) maxH = rightDiv + 50;								
		}
	} else {	
		if (col == 2) {
			if (contentDiv > leftDiv) maxH = contentDiv;
			if (leftDiv > contentDiv) maxH = leftDiv;
		} else {
			if (contentDiv > leftDiv && contentDiv > rightDiv) maxH = contentDiv;
			if (leftDiv > contentDiv && leftDiv > rightDiv) maxH = leftDiv;
			if (rightDiv > contentDiv && rightDiv > leftDiv) maxH = rightDiv;
		}
		
	}
	//
	 //if (force3 > 0) document.getElementById('force3C').style.width = 207;
	//alert('stored content height is '+contentH);
	//if (contentH > maxH) alert(' the page is already large enough to hold the content ');	
	//alert('New content height is: '+ maxH);
	if (col == 3) {
		if (document.getElementById('force3C')) document.getElementById('force3C').style.height = maxH;
		document.getElementById('rSep').style.height = maxH;
		if (document.getElementById('force3C')) { 
			document.getElementById('rightNav').style.height = maxH-10 
		} else { 
			document.getElementById('rightNav').style.height = maxH;
		}
		document.getElementById('rightNav').style.width = 200;
	}
	if (col == 2) document.getElementById('rightNav').style.height = 1;
		document.getElementById('lSep').style.height = maxH;
		document.getElementById('leftNav').style.height = maxH;
		document.getElementById('Franchise_Content').style.height = maxH;
		document.getElementById('MainBody').style.height = maxH;
	contentH = maxH;
	
	//alert('H of Franchise Content: '+document.getElementById('Franchise_Content').style.height)
	//alert('H of MainBody: '+document.getElementById('MainBody').style.height)
	//document.getElementById('Dee_Footer2').style.top = maxH;
	

}

function matchHeight2(){
 	var contentDiv =  document.getElementById('Franchise_Content').offsetHeight;
	var leftDiv =  document.getElementById('leftNav').offsetHeight;
	document.getElementById('Franchise_Content').style.width = 870;
	alert('mH2');
	if (contentDiv > leftDiv + 75) {
		document.getElementById('MainBody').style.height = contentDiv;
		document.getElementById('lSep').style.height = contentDiv;
		document.getElementById('leftNav').style.height = contentDiv;
	
	}
	if (leftDiv > contentDiv - 75) {
		document.getElementById('MainBody').style.height = leftDiv + 75;
		document.getElementById('Franchise_Content').style.height = leftDiv + 75;
		document.getElementById('leftNav').style.height = leftDiv + 75;
		document.getElementById('lSep').style.height = leftDiv + 75;
	}
	
	
}

function matchHeightImg(s){
	alert('mHI');
 	var contentDiv = s;
	var leftDiv =  document.getElementById('leftNav').offsetHeight;
	var rightDiv =  document.getElementById('rightNav').offsetHeight;

	if (contentDiv > leftDiv && contentDiv > rightDiv) maxH = contentDiv;
	if (leftDiv > contentDiv && leftDiv > rightDiv) maxH = leftDiv;
	if (rightDiv > contentDiv && rightDiv > leftDiv) maxH = rightDiv;
	
	alert('New content height is: '+ maxH);
	document.getElementById('Franchise_Content').style.height = maxH;
	document.getElementById('MainBody').style.height = maxH;
	document.getElementById('lSep').style.height = maxH;
	document.getElementById('leftNav').style.height = maxH;
	document.getElementById('rightNav').style.height = maxH;
	document.getElementById('rSep').style.height = maxH;
	contentH = maxH;	
}

function report(obj, fvar) {
	// the text function updateText() 
	 if (check == 'ok' && obj != '') {
	     document.DeeMaster.updateText(obj, fvar); 
		
         }
}

function AcceptReport(p) {
	var paramz = p.split(";");
	var theForm = document.Calculator;
	// the text function updateText() 
       // alert('obj:'+paramz[0]+"  fvar:"+paramz[1]);
	//alert(paramz);
	with (theForm) {
	  if (paramz[0] == 'agentname') agentname.value = paramz[1]; 
	  if (paramz[0] == 'dba') dba.value = paramz[1];
	  if (paramz[0] == 'aphn') agentphn.value = paramz[1]; 
	  if (paramz[0] == 'coPh') coPh.value = paramz[1]; 
	  if (paramz[0] == 'phone') phone.value = paramz[1]; 
	  if (paramz[0] == 'phone_ac') phone_ac.value = paramz[1]; 
	  if (paramz[0] == 'phone_phone') phone_phone.value = paramz[1]; 
	  if (paramz[0] == 'web') web.value = paramz[1];
	  if (paramz[0] == 'forsale') forsale.value = paramz[1];
	}
}

// Dreamweaver Rollover/Image pre-load code
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];}
}
// end dreamweaver code
