
function pop (loc) {
	
}

function gotoLoc (select) {
	//alert(select.options[select.selectedIndex].value);
	if (select.options[select.selectedIndex].value != "" && select.options[select.selectedIndex].value != "Choose...")
	{	
		window.location = select.options[select.selectedIndex].value; 
	}
}

function showhide (id, img) {
	var elem = document.getElementById(id);
	var str = elem.className;
	var img_elem = document.getElementById(id + '_arrow');
	// alert(img_elem.src);
	if (str.indexOf('hide') > -1)
	{
		elem.className = str.replace('hide', 'show');
		img_elem.src = "data/fonts/_da_"+img; // "./font_h2.php?text=_da_ "+id;
	} else {
		elem.className = str.replace('show', 'hide');
		img_elem.src = "data/fonts/_ra_"+img;
	}
}  

function showhide2 (id) {
	var elem = document.getElementById(id);
	var str = elem.className;
	if (str.indexOf('hide') > -1)
	{
		elem.className = str.replace('hide', 'show');
	} else {
		elem.className = str.replace('show', 'hide');
	}
}

   function oNav(my_id)
  { 
   var elem = document.getElementById(my_id);
   var str = elem.className;
   
   if (str.indexOf('Closed') > -1)
	{
		elem.className = str.replace('Closed', 'Opened');
	}
	else
	{
		elem.className = str.replace('Opened', 'Closed');
   }
  }

// AJAX STUFF cheers to Rasumus :) 

function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
        ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
        ro = new XMLHttpRequest();
    }
    return ro;
}

var http = createRequestObject();
var resultDIV = "";

function sndReq(url, responseFunction) {
    http.open('get', url);
    http.onreadystatechange = responseFunction;
    http.send(null);
}

function searchResponse() {
    if (http.readyState == 4) {
        var response = http.responseText;
        document.getElementById(resultDIV).innerHTML = response;
    }
}

function AJAXsearch(q,divID,url) {
	alert(q);
	resultDIV = divID;
	document.getElementById(resultDIV).innerHTML = "searching...";
	sendReq(url+'?q='+q, searchResponse);
}



/*
function XMLsearch() {	// receives the keyup events from the browser
	document.getElementById('searchResults').innerHTML = '<p>Searching for '+query+'</p>';
	sndReq('downloads.php?sort=xmlsearch&query='+this.value, searchResponse);
}

// this sets the search to be handled via AJAX
function activateForm (element) {
	element.onkeyup = XMLsearch;
}
*/

