var AlertMsg='';

function openWindow(windowName, url, winWidth, winHeight, winScrolls) 
 {
  var xPos = (screen.availWidth-winWidth)/2;
  var yPos = (screen.availHeight-winHeight)/2;
 
  window.open(url, windowName, "status=no,menubar=no,personalbar=no,titlebar=no,toolbar=no,location=no,top=" + yPos + ",left=" + xPos + ",width=" + winWidth  + ",height=" + winHeight +",resizable=no, scrollbars="+ winScrolls);
 } 
 

function helpWindow(helptext) 
{
 winWidth=200;
 winHeight=200;
 var xPos = (screen.availWidth-winWidth)/2;
 var yPos = (screen.availHeight-winHeight)/2;
 helpwin=window.open('', 'help', "status=no,menubar=no,personalbar=no,titlebar=no,toolbar=no,location=no,top=" + yPos + ",left=" + xPos + ",width=" + winWidth  + ",height=" + winHeight +",resizable=no, scrollbars=yes");
 helpwin.document.write("<html><head><title>Help</title></head><LINK REL=\"StyleSheet\" HREF=\"http://drc/shop/www/site/include/help.css\" TYPE=\"text/css\"><body>"+helptext+"</html></body>");
 
} 
 

function QuickNav(sel)
{
 if (sel.selectedIndex!=0)
 {
  if (sel[sel.selectedIndex].value.search("Target=1")>0)
   window.open(sel[sel.selectedIndex].value);
  else  document.location.href=sel[sel.selectedIndex].value;
 }
     
}

function tagshow(tag)
{
 if (tag.style.display=='none')  { tag.style.display='';}
                           else  { tag.style.display='none';}
                            

} 
 

function isFieldOk(field,flabel,charset,req) 
{
 var exp=RegExp('^'+charset+'$','gis');
 var ret=false;
 
 
 if (field.value=='')
  if (req==0)  {ret=true; }
           else {AlertMsg=AlertMsg+flabel; }
 else
  if (exp.exec(field.value)) { ret=true;}
                  else AlertMsg=AlertMsg+flabel; 
                  
 if (ret) field.style.borderColor = '#00AA00'; // GREEN
     else field.style.borderColor = "#FF0000";  // RED
 
 return(ret);
  
}

function isArrayOk(value,flabel,charset,req) 
{
 var exp=RegExp('^'+charset+'$','gi');
 var ret=false;
 
 if (value=='')
  if (req==0)  {ret=true; }
           else {AlertMsg=AlertMsg+flabel; }
 else
  if (exp.exec(value)) { ret=true;}
                  else AlertMsg=AlertMsg+flabel; 
                  
  return(ret);
}


function ArrayToString(Arr)
{
 strsum='';
 
 for(i=0;i<Arr.length;i++) 
   if (Arr[i].checked) strsum+=Arr[i].value;
 
 return(strsum);
}


