function mo(that,state)
{
    if (state=='1')
    {
        var re = new RegExp ('.jpg', 'gi') ;
        that.src = that.src.replace(re, '-o.jpg') ;
    }
    if (state=='0')
    {
        var re = new RegExp ('-o.jpg', 'gi') ;
        that.src = that.src.replace(re, '.jpg') ;
    }
}

function insertflash(fname,sx,sy,params)
{
 document.write('<object type="application/x-shockwave-flash" data="'+fname+params+'" width="'+sx+'" height="'+sy+'">');
 document.write('<param name="movie" value="'+fname+params+'" />');       
// document.write('<param name="flashvars" value="'+params+'" />');       
 document.write('<img src="images/spacer.png" width="'+sx+'" height="'+sy+'" alt="banner" />');       
 document.write('</object>');       
}

function confirmLink(theLink)
{

    var is_confirmed = confirm(help_msgs['CONFIRM_DELETE']);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
}

function confirmpay(theLink)
{

    var is_confirmed = confirm(help_msgs['CONFIRM_PAY']);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
}


function smo(that,st)
{
 if (st==1)
 {
   that.className='sidemenu_over';
 }
 else
 {
   that.className='sidemenu';
 }
}

function openCalendarD(form, field) {
   width=260;
   height=190;
   if (navigator.appName == "Microsoft Internet Explorer")
   {
     height+=40;
   }
   else
   {
     height+=20;
   }
   x = parseInt(screen.width / 2.0) - (width / 2.0);
   y = parseInt(screen.height / 2.0) - (height / 2.0);
   dateField = document.getElementById(field);
   window.open("lib/calendard.php?dt="+dateField.value,"calendar", "top="+ y +",left="+ x +",width="+width+",height="+ height +",status=no,dialog=yes,minimizable=no,modal=yes,scrollbars=no");
}

function emailcheck (email)
{
 testresults=true;
  if (email!='')
  {
    var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
    if (filter.test(email))
    {
        testresults=true
    }
    else
    {
        testresults=false
    }
   } 
return (testresults)
}

