// javascript includes

moQualify = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))

function PreloadThis(img)
{
  if(document.images)
  {
    var a=new Image();
  }
  a.src=img;
  return a;
}

function MouseHandle(img, fm, msg)
{
  if(document.images)
  {
    document.images[fm].src=img;
  }
  status = msg;
  return true;
}

function go1()
{
  if (document.lookup1.product.options[document.lookup1.product.selectedIndex].value != "")
  {
    parent.location = document.lookup1.product.options[document.lookup1.product.selectedIndex].value
  }
}

function go2()
{
  if (document.lookup2.product.options[document.lookup2.product.selectedIndex].value != "")
  {
    parent.location = document.lookup2.product.options[document.lookup2.product.selectedIndex].value
  }
}

function go3()
{
  if (document.lookup3.product.options[document.lookup3.product.selectedIndex].value != "")
  {
    parent.location = document.lookup3.product.options[document.lookup3.product.selectedIndex].value
  }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
      window.open(theURL,winName,features);
    }

function openimagewindow(image, windowTitle, fontcolor)
{
		lrgimg = window.open("","lrgimgwin","width=322, height=275, scrollbars=0");
		lrgimg.moveTo(100,100)
		lrgimg.document.write("<html><title>" + windowTitle +"</title><body leftmargin='0' topmargin='0' marginheight='0' marginwidth='0' bgcolor='#ffffff' onload='self.resizeTo(document.popwindow.width+22,document.popwindow.height+60)'>")
		lrgimg.document.write("<table align='center' border='0' cellpadding='0' cellspacing='2'>")
		lrgimg.document.write("<tr><td align='right' valign='top'><a href='' onclick='javascript:self.close()'><font size='1' color='" + fontcolor + "' face='arial'><b>Close window</b></font></a></td></tr>")
		lrgimg.document.write("<tr><td align='center'><img src='" + image + "' name='popwindow'></td></tr>")
		lrgimg.document.write("</table></body></html>")
		lrgimg.document.close()
		lrgimg.focus()
}

//----------------------------------------------------------------------------------
//
// mOvr(src,clrOver) - called from mouseover event to change pointer to a hand and
//                     to change the color of the mouseovered item to the specified
//                     color.
//
//----------------------------------------------------------------------------------
var alreadyclicked = 0;

function mOvr(src,clrOver)
{
  if (!src.contains(event.fromElement))
  {
    if (alreadyclicked == 0)
    {
      src.style.cursor = 'hand';
    }
    src.bgColor = clrOver;
  }
}

function mOut(src,clrIn)
{
  if (!src.contains(event.toElement))
  {
    if (alreadyclicked == 0)
    {
      src.style.cursor = 'default';
    }
    src.bgColor = clrIn;
  }
}

function mClk(src)
{
  if(event.srcElement.tagName=='TD')
  {
    //prompt(src.children.tags('A')[0]);
    alreadyclicked = 1;
    src.children.tags('A')[0].click();
    //src.style.cursor = 'busy';
  }
}

//-------------------------------------------------------------------------------------------------
//
// update_form(formname, formtask, misc, block) - called from mouseover event to submit a form with
//                                                the specified form name but first will update the
//                                                value of the hidden form element 'Task' and the
//                                                values of the hidden form elements 'Misc' and
//                                                'Block' if they are specified.
//
//-------------------------------------------------------------------------------------------------
function update_form(formname, formtask, misc, misc2, misc3, misc4, misc5, misc6, misc7)
{
  document[formname].elements.Task.value=formtask;
  if (misc)
  {
    document[formname].elements.Misc.value=misc;
  }
  if (misc2)
  {
    document[formname].elements.Misc2.value=misc2;
  }
  if (misc3)
  {
    document[formname].elements.Misc3.value=misc3;
  }
  if (misc4)
  {
    document[formname].elements.Misc4.value=misc4;
  }
  if (misc5)
  {
    document[formname].elements.Misc5.value=misc5;
  }
  if (misc6)
  {
    document[formname].elements.Misc6.value=misc6;
  }
  if (misc7)
  {
    document[formname].elements.Misc7.value=misc7;
  }
  document[formname].submit();
}

function send_form(formaction)
{
  document.forms.main.action=formaction;
  document.main.submit();
}

var windowNameArray = null
var windowPntrArray = null
var browserType = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)"

function launchWindow( url, HT, WD )
{
  var windowOptions
  var myLocation = url
  var WN = "newWindow"
  var AR = "yes"
  var TB = "no"
  var LC = "no"
  var SB = "no"
  var DR = "no"
  var ST = "no"
  var MB = "no"
  var RS = "yes"
  var CH = "yes"
  switch( arguments.length )
  {
    case 16:
    case 15:
    case 14:
    case 13: CH = arguments[12];
    case 12: RS = arguments[11];
    case 11: MB = arguments[10];
    case 10: ST = arguments[9];
    case  9: DR = arguments[8];
    case  8: SB = arguments[7];
    case  7: LC = arguments[6];
    case  6: TB = arguments[5];
    case  5: AR = arguments[4];
    case  4: WN = arguments[3];
  }

  windowOptions  = "height="
  windowOptions += HT
  windowOptions += ",width="
  windowOptions += WD
  windowOptions += ",alwaysRaised="
  windowOptions += AR
  windowOptions += ",toolbar="
  windowOptions += TB
  windowOptions += ",location="
  windowOptions += LC
  windowOptions += ",scrollbars="
  windowOptions += SB
  windowOptions += ",directories="
  windowOptions += DR
  windowOptions += ",status="
  windowOptions += ST
  windowOptions += ",menubar="
  windowOptions += MB
  windowOptions += ",resizable="
  windowOptions += RS
  windowOptions += ",copyhistory="
  windowOptions += CH
  if( ! windowNameArray )
  {
    windowNameArray = new Array()
    windowPntrArray = new Array()
  }
  for( index=0; index < windowNameArray.length; ++index )
  {
    if( windowNameArray[index] == WN )
    {
      break
    }
  }

  var msieBrowser = navigator.appName.indexOf("Microsoft") != -1
  if( ! windowPntrArray[index] || windowPntrArray[index].closed  )
  {
    windowNameArray[index] = WN
    windowPntrArray[index] = window.open( myLocation, WN ,windowOptions )
  }
  else
  {
    if( msieBrowser )
    {
      windowPntrArray[index].close()
      while( ! windowPntrArray[index].closed )
      {
      }
      windowPntrArray[index] = window.open( myLocation, WN ,windowOptions )
    }
    else
    {
      windowPntrArray[index].focus()
    }
  }
}

