function getURL(url) {
	window.open(url, '_self');
}

function selectState(id, over) {
	if(over) {
		document.getElementById(id).style.backgroundColor = '#337a9d';
		document.getElementById(id).style.color = '#FFFFFF';
	}
	else {
		document.getElementById(id).style.backgroundColor = '#FFFFFF';
		document.getElementById(id).style.color = '#000000';
	}
}

//ANTISPAM EMAIL LINKfunction antiSpam(id,domain) {
function antiSpam(id,domain) {
	document.write("<a href='mailto:" + id + "@" + domain + "'>" + id + "@" + domain + "</a>");
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function show_drop_down_menu(menu_id, link_id)
{
    if (document.getElementById(menu_id)) {
				var left = (getOffsetLeft(link_id) + 1) + 'px';
        var top = getOffsetTop(link_id) + (document.getElementById(link_id).offsetHeight + 3) + 'px';
        document.getElementById(menu_id).style.left = left;
        document.getElementById(menu_id).style.top = top;
        document.getElementById(link_id).style.backgroundColor = '';
        document.getElementById(menu_id).style.visibility = 'visible';
				document.getElementById(menu_id).style.zindex = 100;
    }
}

function hide_drop_down_menu(menu_id, link_id)
{
    if (document.getElementById(menu_id)) {
        document.getElementById(menu_id).style.visibility = 'hidden';
        document.getElementById(link_id).style.backgroundColor = '';
    }
}

function getOffsetTop(element)
{
    el = document.getElementById(element);
    xPos = el.offsetTop;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function getOffsetLeft(element)
{
    el = document.getElementById(element);
    xPos = el.offsetLeft;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function replaceHeight(h){
	var browser_type=navigator.appName
	
	setHeight = 'auto';
	a = navigator.appVersion.split(';');
	browser_version = parseInt(a[1].replace('MSIE ', ''));
	if (browser_type=="Microsoft Internet Explorer"&&browser_version<7)
		setHeight = h + 'px';
		
	return setHeight;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function getPage() {
	url = window.location.toString();
	setPage = '/popup.php?gp=' + url.substr(url.lastIndexOf('/')+1, url.length);
	MM_openBrWindow(setPage,'popup','menubar=yes,scrollbars=yes,width=500,height=600');
}