function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=300,height=400,scrollbars=yes');
return false;
}

function popupphoto(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=800,height=600,scrollbars=yes');
return false;
}


function checkCheckBox() {
  var frm = document.forms['register'];

  var ok = true;
  var msg = "";
  
  if (frm['terms'].checked==false)
  {
    msg += "You must check the box to agree to our terms.\n";
    ok = false;
  } // if

  if (!ok)
  {
    alert(msg);
  }

  return ok;
}


function checkForm()
{
  var frm = document.forms['placeorder'];

  var ok = true;
  var msg = "";
  
  if (frm['height'].value.length==0)
  {
    msg += "You must enter the height of your frame.\n";
    ok = false;
  } // if
  if (frm['length'].value.length==0)
  {
    msg += "You must enter the length of your frame.\n";
    ok = false;
  } // if
  if (frm['terms'].checked==false)
  {
    msg += "You must check the box to agree to our terms.\n";
    ok = false;
  } // if

  if (!ok)
  {
    alert(msg);
  }

  return ok;
} // checkForm


/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Copyright 1999 Idocs, Inc. http://www.idocs.com
Distribute this script freely but keep this notice in place */

function numbersonly(myfield, e, dec) {
  var key;
  var keychar;

  if (window.event)
    key = window.event.keyCode;
  else if (e)
    key = e.which;
  else
    return true;
  keychar = String.fromCharCode(key);

  // control keys
  if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
    return true;

  // numbers
  else if ((("0123456789").indexOf(keychar) > -1))
    return true;

  // decimal point jump
  else if (dec && (keychar == ".")) {
    myfield.form.elements[dec].focus();
    return false;
  } else
    return false;
}


 var baseText = null;

function showPopup(w,h,popup){
  var myWidth = 0, myHeight = 0;
  var baseText = "";
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  var popUp = document.getElementById(popup);
  popUp.style.top = myHeight/2 - h/2;
  popUp.style.left = myWidth/2 - w/2;
  popUp.style.width = w + "px";
  popUp.style.height = h + "px";
  if (baseText == "") baseText = popUp.innerHTML;
  popUp.innerHTML = baseText;
  popUp.style.visibility = "visible";
  document.getElementById('opaque').style.visibility = "visible";

}


function hidePopup(what){
  document.getElementById(what).style.visibility = "hidden";
  document.getElementById("opaque").style.visibility = "hidden";
}


//http://javascript.internet.com/forms/decimals-allowed.html
//http://javascript.internet.com/forms/numbers-only.html
