var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
function getClock(){
    var mydate=new Date()
    var year=mydate.getYear()
    if (year < 1000)
    year+=1900
    var month=mydate.getMonth()
    var daym=mydate.getDate()
    if (daym<10)
    daym="0"+daym
    var hours=mydate.getHours()
    var minutes=mydate.getMinutes()
    var dn="AM"
    if (hours>=12)
    dn="PM"
    if (hours>12){
    hours=hours-12
    }

    if (hours==0)
    hours=12
    if (minutes<=9)
    minutes="0"+minutes

    var cdate= montharray[month] + " " + daym + ", " + year + " " + hours + ":" + minutes + " " + dn
    document.getElementById("clock").innerHTML=cdate
}

var xmlhttp=false;

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}

@else
	xmlhttp = false;
@end @*/

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
}



function getComps() {
	var q = escape(document.getElementById('name').value);
	if(q.length > 5) {
		var sURL = "quicksearch.php?q=" + q;
		if (xmlhttp) {
		xmlhttp.open("GET", sURL, true);
			xmlhttp.onreadystatechange=function() {
				if (xmlhttp.readyState==4) {
					var response = xmlhttp.responseText;
					if(response == "NORES") {
						document.getElementById('res').innerHTML = 'Sorry, no results...';
					} else {
						document.getElementById('res').innerHTML = response;
					}
				}
			}
			xmlhttp.send(null)
		}
	}
}

function moveOn(id) {
	var sURL = "enhance-select.php?id=" + id;
	location.href = sURL;
}


function addStateSelection(val) {
	document.getElementById('state').value = val;
	document.form1.submit();
}

function showDetail() {
	document.getElementById('details').style.display = 'inline';
}

function closeDetail() {
	document.getElementById('details').style.display = 'none';
}

function updateAd() {
	if(document.selections.highlights.checked) {
		document.getElementById('highlight').style.background = '#FFFFAA';
		document.getElementById('highlight').style.border = '1px solid #CCCCCC';
	} else {
		document.getElementById('highlight').style.background = '#FFFFFF';
		document.getElementById('highlight').style.border = 'none';
	}
	
	if(document.selections.font.checked) {
		document.getElementById('namecol').style.color = '#FF0000';
	} else {
		document.getElementById('namecol').style.color = '#000000';
	}
	
	if(document.selections.logo.checked) {
		document.getElementById('logo').style.display = 'inline';
		document.getElementById('logoimg').style.display = 'inline';
	} else {
		document.getElementById('logo').style.display = 'none';
		document.getElementById('logoimg').style.display = 'none';
	}

	if(document.selections.caption.checked) {
		document.getElementById('caption').style.display = 'inline';
		document.getElementById('capt').style.display = 'inline';
		document.getElementById('capt').innerHTML = '&nbsp;&nbsp;&nbsp;' + document.selections.captiontxt.value + '<br />';
	} else {
		document.getElementById('caption').style.display = 'none';
		document.getElementById('capt').style.display = 'none';
		document.selections.captiontxt.value = '';
	}
}

function checkfl() {
	if(document.getElementById('serv').value == 'FL') {
		document.getElementById('flreg').style.display = 'inline';
	} else {
		document.getElementById('flreg').style.display = 'none';
	}
}