function ShowHide(divID) {
  var item = document.getElementById(divID);
  if (item) {
    item.className=(item.className=='hide')?'show':'hide';
  }
}

function ShowIf(select,trigger,divID) {
	var menu = document.getElementById(select);
  	var item = document.getElementById(divID);
  	if (menu.value==trigger) 
  	{
   		item.style.display='block';
 	} else {
 		item.style.display='none';
 	}
}

function showimage(answer) {
	var mediabank = document.getElementById('attachimage');
	if (answer == 1) { mediabank.show(); }
	if (answer == 0) { mediabank.hide(); }
}


var shown;
function toggleDiv(show) 
{
	// if one is displayed, close it.
	if(shown) {
		new Effect.BlindUp(shown);
	}

	// if we're clicking the title of a just shown item, exit here so we don't expand again
	if(shown == show) {
		shown = false;
		return;
	}

        new Effect.BlindDown(show);
        shown = show;
}



// ajax set up
function getHTTPObject() 
{
	if (typeof XMLHttpRequest != 'undefined') 
	{ 
		return new XMLHttpRequest(); 
	} 
	try 
	{ 
		return new ActiveXObject("Msxml2.XMLHTTP"); 
	} 
	catch (e) 
	{ 
		try 
		{ 
			return new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch (e) 
		{} 
	} 
	return false; 
}

// ajax email application
function apply(jobid) {
  var myurl = "http://www.sourcethatjob.com/apply_ping.php";
  var http = getHTTPObject();
  http.open("GET", myurl + "?id=" + escape(jobid), true);
  http.onreadystatechange = useHttpResponse;
  http.send(null);
}
function useHttpResponse() {
  if (http.readyState == 4) {
    var textout = http.responseText;
   // document.write.textout;
  }
}