
function op(url) {
  self.location = url;
}

// NoSpam
function sm(n, d) {
  window.location.href = "mailto:" + n + "@" + d;
  return false;
}

function nospam(n, d, t) {
  eml=(n + '@' + d);
  if (t == null) t = eml
  document.write('<a href="mailto:' + eml + '">' + t + '</a>');
}

function get_selected(rad) {
  var theone;
  for (i=0;i<rad.length;i++){
    if (rad[i].checked==true){
      theone=i;
      break;
    }
  } return theone;
}

// Misc
function showimage(url)
{

  var aw = screen.availWidth;
  var ah = screen.availHeight;
  awaa = window.open("images/shots/" + url, null, "resizable=yes,scrollbars=yes");
  awaa

//  imag = new Image;
//  imag.src = "images/shots/" + url;
//  awaa = window.open(imag.src, null, "resizable=yes,scrollbars=no");
//  imag.onResize = awaa.resizeTo(imag.width + 30, imag.height + 55);

}

function openWin(theURL,w,h) {
  if (w==null) w = screen.availWidth - 10;
  if (h==null) h = screen.availHeight - 30;
  x = (screen.availWidth - w) / 2;
  y = (screen.availHeight - h) / 2;
  window.open(theURL,"","left="+x+",top="+y+"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+w+",height="+h+"");
}

function getLayerRef(id, document) {
    if(!document)
        document = window.document;
    if (document.all) {
        return document.all[id];
    } else if (document.getElementById) {
        return document.getElementById(id);
    }
}

function toggleDiv(linkObj,div){
   divObj = getLayerRef(div)
   if(divObj){
      if(divObj.style.display=='none'){
	      linkObj.className='brandheader';
	      divObj.style.display='block';
	  }else{
	      linkObj.className='brandlink';
	      divObj.style.display='none';
	  }
   }
}

function Checkemail(emailstr){
  var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
  if (filter.test(emailstr)) {
    return true;
  } else {
    return false;
  }
}