var imgarraycount = 0;
var arrayofimages = new Array(10);

function showhide(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
if (obj.style.display == "none"){ 
obj.style.display = ""; 
} else { 
obj.style.display = "none"; 
} 
} 
} 

function showhide(id){ 
if (document.getElementById){ 
obj = document.getElementById(id); 
if (obj.style.display == "none"){ 
obj.style.display = ""; 
} else { 
obj.style.display = "none"; 
} 
} 
} 


function add_rollover(inimageroll){
	arrayofimages[imgarraycount] = new Image();
	arrayofimages[imgarraycount].src = inimageroll;
	imgarraycount++;
}

function show_rollover(inid){document.getElementById(inid).style.backgroundUrl = arrayofimages[inpos][1].src;}

function hide_rollover(inid){document.getElementById(inid).style.backgroundUrl = '';}

function linkokcancel(inlink, inmsg) { 
	if(confirm(inmsg)){
		if (inlink != '') window.location.href = inlink;
		return true;
	}
	return false;
} 

function ftextcounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
	else countfield.value = maxlimit - field.value.length;
}

function fgeta(lhost,lil,lact){
	if (lact=='')lact = lil + "@" + lhost;
	document.write("<a href=" + "mail" + "to:" + lil + "@" + lhost+ ">" + lact + "</a>");
}

function swap_box(inid, inboxid){
	document.getElementById(inboxid).innerHTML = document.getElementById(inid).innerHTML;
}

function frm_unwipe(obj, txt) {
	if (document.getElementById(obj).value == ''){
		document.getElementById(obj).value = txt;
	}
}
function frm_wipe(obj, txt) {
	if (document.getElementById(obj).value == txt){
		document.getElementById(obj).value = '';
	}
}
function frm_submit(obj, txt, error){
	if(document.getElementById(obj).value == txt){
		alert(error);
		return false;
	}
}

function fshowselect(indiv, inselect){
	
	alert(indiv+" "+inselect);
	selObj = document.getElementById(inselect);
	seltext = '';
	for (i=0; i<selObj.options.length; i++) {
		if (selObj.options[i].selected) {
			seltext = seltext+'<li>'+selObj.options[i].text+'</li>';
		}
	}
	if (seltext != '') document.getElementById(indiv).innerHTML = '<ul>'+seltext+'</ul>';
}

function startupload() {
	document.getElementById("uploading").innerHTML = '<img src=\"/images/uploading.gif\">';
	setTimeout("document.uploader.submit();", 800);
	return true;
}

//initial checkCount of zero 
var checkCount=0 
//maximum number of allowed checked boxes 
var maxChecks=3 

function setChecks(obj){ 
//increment/decrement checkCount 
if(obj.checked){ 
checkCount=checkCount+1 
}else{ 
checkCount=checkCount-1 
} 
//if they checked a 4th box, uncheck the box, then decrement checkcount and pop alert 
if (checkCount>maxChecks){ 
obj.checked=false 
checkCount=checkCount-1 
alert('you may only choose up to '+maxChecks+' options') 
} 
} 

function joblookup(inputString) {
		if(inputString.length < 2) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
	
	
			$.post("/findjob.php", {queryString: ""+inputString+""}, function(data){
					
					
				if(data.length >0) {
				
					$('#suggestions').show();
				
			
				
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
function lookup(inputString) {
		if(inputString.length < 2) {
			// Hide the suggestion box.
			$('#suggestions').hide();
		} else {
			$.post("findarea.php", {queryString: ""+inputString+""}, function(data){
				if(data.length >0) {
					$('#suggestions').show();
					$('#autoSuggestionsList').html(data);
				}
			});
		}
	} // lookup
	
	
	function jobfill(thisValue) {
		$('#frmsearchtitle').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
	function fill(thisValue) {
		$('#inputString').val(thisValue);
		setTimeout("$('#suggestions').hide();", 200);
	}
