
// 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>');
}

// 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;
  window.open(theURL,"","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=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  var filter=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
  if (filter.test(emailstr)) {
    return true;
  } else {
    return false;
  }
}