﻿var NS4 = navigator.appName.indexOf("Netscape") != -1 && navigator.appVersion.charAt(0) == "4";
  if (NS4) {
          document.write('<STYLE>');
          document.write('#space { position: relative; z-order: 200; left: 0px; top: 0px; width: 448px; height: 320px; }'); /*was 526x475 */
          document.write('</STYLE>');
  }
  
  function imgPreView(imgName) {
    if (document.images) {
      if (!NS4) {
        document["imgPrev"].src = imgName;
      } else {
        document.layers["space"].document.open();
        document.layers["space"].document.write('<span><img src="' + imgName + '" alt="" hspace=0 vspace=0 border=0 name="imgPrev"></span>');
        document.layers["space"].document.close();
      }
    } 
  }
  
  function openWebFTP(viewtype, targetfield)
  {    
    newwins = window.open("/members/viewFile.aspx?type=" + viewtype + "&f1=" + targetfield, "webFTP","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=760,height=600");
    newwins.focus();  
  }
  
  function openViewLogoBanner(viewtype)
  {
    newwins = window.open("/members/viewLogoBanner.aspx?type=" + viewtype, "viewimage","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=560,height=300");
    newwins.focus();  
  }
  
  function openInvoice(code, code2)
  {
    newwins = window.open("/members/paymentDetail.aspx?code=" + code + "&code2=" + code2, "viewInvoice","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500");
    newwins.focus();  
  }
  
  function clearImage(fieldid)
  {
    document.getElementById(fieldid).value = '';
  }
  
  function selectFile(fieldname, imgurl)
  {
    window.opener.document.getElementById(fieldname).value = imgurl;
    
    opener.focus();
    window.close();  
  }
  
  function resize(which, max) {
    var elem = document.getElementById(which);
    
    if (elem == undefined || elem == null) return false;
    
    if (max == undefined) max = 200;
    
    if (elem.width > max) elem.width = max;
  } 
  
  
  function showhidelayers(id)
  {
	  layerid=this.document.getElementById(id);
	  sw(layerid,(layerid.style.display!="block"));	
  }
  function sw(layerid,show)
  {
	  if (show==true)
	  {
		  layerid.style.display="block";
	  }
	  else
	  {
		  layerid.style.display="none";
	  }
  }
  
  function mouseOnFAQs(id)
  {
    document.getElementById(id).style.backgroundColor = "#f7f7f7";
  }
  
   function mouseOffFAQs(id)
  {
    document.getElementById(id).style.backgroundColor = "#FFFFFF";
  }
  
  function checkAllEmail(checkVal)
  {
    for(i = 0; i < document.forms[0].elements.length; i++)
    {
      elm = document.forms[0].elements[i]
      
      if (elm.type == 'checkbox')
      {
        {
          elm.checked = checkVal
        }
      }
    }
  }
  
