
function deleteQCheck() {
        if(document.omlq.delete_q.checked == true) {
        if(window.confirm("WARNING!\n\nThis will permanently delete this quote and all it's items.\n\nAre you sure you want to continue?")){
        document.omlq.submit();
        }
        }
}


function fieldFocus(field) {
if(document.oml){
        document.oml.elements[field].focus();
        }
}


function doDecimals(val) {
ttl = "" + parseInt(val * 100)/100;
dec1 = ttl.substring(ttl.length-3, ttl.length-2);
dec2 = ttl.substring(ttl.length-2, ttl.length-1);
if (dec1 != '.') { // adds trailing zeroes if necessary
        if (dec2 == '.') {ttl += "0"}   else {ttl += ".00"}
        if (ttl == ".00") {ttl = "0.00"}
        }
return ttl
}

var $text = new Array();
$text[1] = "your membership record";
$text[2] = "this membership record";
$text[3] = "course";
$text[4] = "course code";
$text[5] = "this record";


function warn($rectype) {
        if(document.oml.deleteme && document.oml.deleteme.checked == true  ){
        		
        	$record = $text[$rectype];
        	if(!$record){$record = "this record";}
        	
                if(window.confirm("WARNING!\n\nThis will permanently delete " + $record + ".\n\nAre you sure you want to continue?")){
                          return true;
                          }
                else {
                          return false;
                          }
          }
}

// POP-UP for Help
function NewHelpWindow(mypage) {
win = window.open(mypage, "help", 'height=300,width=550,top=10,left=10,scrollbars=1,resizable');
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//  POP-UP for Use form
function NewUserWindow(mypage) {
win = window.open(mypage, "profile", 'height=700,width=600,top=10,left=10,scrollbars=1,resizable');
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}



document.onclick = function(e)
{
  var target = e ? e.target : window.event.srcElement;

  while (target && !/^(a|body)$/i.test(target.nodeName))
  {
    target = target.parentNode;
  }

  if (target && target.getAttribute('rel')
      && target.rel == 'external')
  {
    var external = window.open(target.href);

    return external.closed;
  }
}
