




/*

Correctly handle PNG transparency in Win IE 5.5 and 6.
http://homepage.ntlworld.com/bobosola. Updated 18-Jan-2005.

Use in <HEAD> section with DEFER keyword
wrapped in conditional comments thus: 

    <!--[if lt IE 7]>
    <script defer type="text/javascript" src="pngfix.js"></script>
    <![endif]-->

This extended version includes imagemap and input image functionality.
It also requires a 1px transparent GIF.
 
*/


var strGif = "$domain/controls/transparentpixel.gif"
var strFilter = "progid:DXImageTransform.Microsoft.AlphaImageLoader"
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

if ((version >= 5.5) && (document.body.filters)) 
{
	for(var i=0; i<document.images.length; i++)
	{
	   var img = document.images[i]
	   var imgName = img.src.toUpperCase()
	   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	   {
		  var imgID = (img.id) ? "id='" + img.id + "' " : ""
		  var imgClass = (img.className) ? "class='" + img.className + "' " : ""
		  var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
		  var imgStyle = "display:inline-block;" + img.style.cssText 
		  if (img.align == "left") imgStyle = "float:left;" + imgStyle
		  if (img.align == "right") imgStyle = "float:right;" + imgStyle
		  if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
		  if (img.useMap)
		  {  
			 strAddMap = "<img style=\"position:relative; left:-" + img.width + "px;"
			 + "height:" + img.height + "px;width:" + img.width +"\" "
			 + "src=\"" + strGif + "\" usemap=\"" + img.useMap 
			 + "\" border=\"" + img.border + "\">"
		  }
		  var strNewHTML = "<span " + imgID + imgClass + imgTitle
		  + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
		  + "filter:" + strFilter
		  + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
		  if (img.useMap) strNewHTML += strAddMap
		  img.outerHTML = strNewHTML
		  i = i-1
	   }
	}

   for(i=0; i < document.forms.length; i++) findImgInputs(document.forms(i))
}

function findImgInputs(oParent)
{
   var oChildren = oParent.children
   if (oChildren)
   {
      for (var i=0; i < oChildren.length; i++ )
      {
         var oChild = oChildren(i)
         if ((oChild.type == 'image') && (oChild.src))
         {
             var origSrc = oChild.src
             oChild.src = strGif
             oChild.style.filter = strFilter + "(src='" + origSrc + "')"
         }
         findImgInputs(oChild)
      }
   }
}





/* 
   Ajax Form Box, JavaScript handler
   Version 1.0
   May 5, 2010

   This script custom generated May 15, 2010 at
   http://www.willmaster.com/software/WebSitesSecret/AjaxFormBox/generator.php

   Will Bontrager
   http://www.willmaster.com/
   Copyright 2010 Bontrager Connection, LLC

   Bontrager Connection, LLC grants you 
   a royalty free license to use or modify 
   this software provided this notice appears 
   on all copies. This software is provided 
   "AS IS," without a warranty of any kind.
*/

// One customization place.

// Specify the URI to the PHP contact box processor.
//    The URI is the URL minus the domain name.
//    Example: URL http://example.com/ProcessAjaxContactBox.php 
//         is: URI /ProcessAjaxContactBox.php 

var PHPhandlerURI = "/ajax.php";

//
// No further customization required.

var fm = '<div align="center" style="font-size:10px; font-weight:bold; letter-spacing:2px; text-align:center;"><a href="javascript:acb_HideContactBox()">[Hide Contact Form]</a></div>';
fm += '<table width="100%" align=center border="0" cellspacing="20" cellpadding="20">';
fm += '<tr>';
fm += '<td bgcolor="#ffffff">';
fm += '<table align=center border="2" cellspacing="12" cellpadding="12">';
fm += '<tr>';
fm += '<td background = "http://webmaster-engine.com/images/metal.gif">';
fm += '<table width="90%" align=center  cellspacing="0" cellpadding="0">';
fm += '<tr>';
fm += '<td align=center background = "http://webmaster-engine.com/images/metal.gif">';
fm += '<div align="center" style="font-size:80%">Have a question or suggestion?  Please let us know!<br><br></div>';
fm += '<f'+'o'+'rm id="acb_f'+'o'+'rmtag" style="margin:0;" on'+'su'+'bmit="return false;">';
fm += '<in'+'pu'+'t t'+'y'+'pe=hi'+'dd'+'en name="name" value="" id="acb_name">';
fm += '<div style="font-size:80%;color:#4a4a4a;">Your Em'+'ai'+'l:</div>';
fm += '<in'+'pu'+'t t'+'y'+'pe=t'+'e'+'xt name="em'+'ai'+'l" value="" id="acb_em'+'ai'+'l"><br><br>';
fm += '<div style="font-size:80%;color:#4a4a4a;">Your Comments:</div>';
fm += '<te'+'xt'+'area name="comments" rows="8" cols="20" wrap="soft" id="acb_comments"></te'+'xt'+'area>';
fm += '</f'+'o'+'rm>';
fm += '</td>';
fm += '</tr>';
fm += '<tr>';
fm += '<td align=center bgcolor="#999999">';
fm += '<in'+'pu'+'t t'+'y'+'pe="bu'+'tt'+'on" style="width:300px; margin-top:3px;" onclick="acb_ProcessAjaxContactBox()" value="Contact Us"> ';
fm += '</td>';
fm += '</tr>';
fm += '</table>';
fm += '</td>';
fm += '</tr>';
fm += '</table><br>';
fm += '<div align="center" style="font-size:80%"><a href = "http://willmaster.com/library/tools/ajax-form-box-generator.php" target=window>Get This<br>Contact Form<br> For Your Site</a></div>';
fm += '</td>';
fm += '</tr>';
fm += '</table>';

document.write('<div align="center" id="acb_box" style="display:none; position:absolute; top:-422; left:-422; z-index:9999; background-color:#ffffff; width:550px; margin:0;">');
document.write('<div align="center" style="border:1px solid #ffffff; margin:10px;">');
document.write('<div align="center" id="acb_messageBox" style="margin:0px 10px 140px 0px;">');
document.write('&nbsp;');
document.write('</div>');
document.write('</div>');
document.write('</div>');


function acb_BoxMessage(message,closeafter)
{
   var s = '<div align="center" style="font-size:10px; font-weight:bold; letter-spacing:2px; font-family:verdana,sans-serif; text-align:center;"><a href="javascript:acb_HideContactBox()">[HIDE MESSAGE]</a></div>';
   s += '<p style="text-align:center; margin-top:25px; font-weight:bold;">'+message+'</div>';
   document.getElementById("acb_messageBox").innerHTML = s;
   if(closeafter) { setTimeout("acb_HideContactBox()",3000); }
   return false;
}

function acb_findPosX(obj)
{
   var leftedge = 0;
   if(obj.offsetParent)
   {
      while(true) 
      {
         leftedge += obj.offsetLeft;
         if( ! obj.offsetParent ) { break; }
         obj = obj.offsetParent;
      }
   }
   else
   {
      if(obj.x) { leftedge += obj.x; }
   }
   return leftedge;
}

function acb_findPosY(obj)
{
   var topedge = 0;
   if(obj.offsetParent)
   {
      while(true)
      {
         topedge += obj.offsetTop;
         if( ! obj.offsetParent ) { break; }
         obj = obj.offsetParent;
      }
   }
   else
   {
      if(obj.y) { topedge += obj.y; }
   }
   return topedge;
}

function acb_GetResponse(http)
{
   if(http.readyState == 4)
   {
      if(http.status == 200) { acb_BoxMessage(http.responseText,true); }
      else { acb_BoxMessage('Content request error, status code: '+content.status+' '+content.statusText,true); }
   }
}

function acb_GetHTTP()
{
   var xhttp;
   try { xhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
   catch (e) {
      try { xhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
      catch (e2) {
         try { xhttp = new XMLHttpRequest(); }
         catch (e3) { xhttp = false; }
         }
      }
   return xhttp;
}

function acb_ProcessAjaxContactBox()
{
   var addy = document.getElementById("acb_email").value;
   var name = document.getElementById("acb_name").value;;
   if( (addy.indexOf("@") < 1) && (name.indexOf("@") > 0) )
   {
      var ts = name;
      name = addy;
      addy = ts;
   }
   if( addy.indexOf("@") < 1 )
   {
      alert("An ema"+"il address is required.");
      return ;
   }
   var http = acb_GetHTTP();
   if(! http) { return acb_BoxMessage("Sorry, unable to open a connection to the server.",true); }
   var tid;
   var params = "acb_field_list_bca=name%09email%09comments";
   params += "&acb_email_field_bca="+encodeURIComponent("email");
   params += "&acb_name_field_bca="+encodeURIComponent("name");
   params += "&name="+encodeURIComponent(document.getElementById("acb_name").value);
   params += "&email="+encodeURIComponent(document.getElementById("acb_email").value);
   params += "&comments="+encodeURIComponent(document.getElementById("acb_comments").value);
   params += "&url="+encodeURIComponent(document.URL);
   acb_BoxMessage("Sending ema"+"il.<br><br>A moment, please ...",false);
   http.open("POST",PHPhandlerURI,true);
   http.onreadystatechange = function() { acb_GetResponse(http); }
   http.setRequestHeader("Content-type", "application/x-www-fo"+"rm-urlencoded");
   http.setRequestHeader("Content-length", params.length);
   http.setRequestHeader("Connection", "close");
   http.send(params);
}

function acb_DisplayContactBox()
{
   var addyspot = document.getElementById("acb_pubaddy");
   var x = acb_findPosX(addyspot);
   var y = acb_findPosY(addyspot);
   if( x < 50 ) { x = 50; }
   if( y < 50 ) { y = 50; }
   document.getElementById("acb_messageBox").innerHTML = fm;
   var ff = document.getElementById("acb_box");
   ff.style.left = (x-200)+"px";
   ff.style.top = (y-150)+"px";
   ff.style.display = "";
}

function acb_HideContactBox()
{
   var ff = document.getElementById("acb_box");
   ff.style.display = "none";
   ff.style.left = "-422px";
   ff.style.top = "-422px";
}







// function SetCookie() {
// if(arguments.length < 2) { return; }
// var n = arguments[0];
// var v = arguments[1];
// var d = 0;
// if(arguments.length > 2) { d = parseInt(arguments[2]); }
// var exp = '';
// if(d > 0) {
// 	var now = new Date();
// 	then = now.getTime() + (d * 24 * 60 * 60 * 1000);
// 	now.setTime(then);
// 	exp = '; expires=' + now.toGMTString();
// 	}
// document.cookie = n + "=" + escape(String(v)) + '; path=/' + exp;
// } // function SetCookie()





// 
// 
// function ReadCookie(n) {
// var cookiecontent = new String();
// if(document.cookie.length > 0) {
// 	var cookiename = n+ '=';
// 	var cookiebegin = document.cookie.indexOf(cookiename);
// 	var cookieend = 0;
// 	if(cookiebegin > -1) {
// 		cookiebegin += cookiename.length;
// 		cookieend = document.cookie.indexOf(";",cookiebegin);
// 		if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
// 		cookiecontent = document.cookie.substring(cookiebegin,cookieend);
// 		}
// 	}
// return unescape(cookiecontent);
// } // function ReadCookie()





	
