function verify()
{
        if(document.formam.txtemail.value == "")
        {
                alert("Please Insert Your Email Address.")
                return false
        }
        if(document.formam.txtemail.value != "")
        {
                var email1 = document.formam.txtemail.value;
                at = email1.indexOf('@',0);
                if(email1 == -1 || email1.indexOf('.',at)== -1)
                {
                        alert("Invalid Email Address.")
                        return false
                }
                else
               {
                        x = email1.indexOf('@', 0)
                    y = email1.indexOf('.', 0)
                           if ((x==y+1) || (x==y-1))
                        {
                                alert("Invalid Email Address.")
                                return false
                    }
                }

        }



        newwindow=window.open("","pop","height=200,width=400,resizeable=no");
        document.forms['formam'].target = "pop";
        document.forms['formam'].action="addmailinglist.php";
        document.forms['formam'].submit();
        document.forms['formam'].reset();

        return true;
}



function winopen(abc)
{
        window.open(abc,"st","height=200,width=400,resizeable=no")
}

function winopen2(abc)
{
        window.open(abc,"st","height=500,width=800,resizable=yes,scrollbars=yes")
}

function winopen3(abc)
{
        window.open(abc,"st","height=500,width=500,resizable=yes,scrollbars=yes")
}

var newwin;

function openNewWindow(topic,topic_id){
        var servername = "www.trollandtoad.com";
        var url;
        var WindowName;
        var WindowWidth;
        var WindowHeight;
        if (topic=="ShowFullShot") {
                topic_id=escape(topic_id);
                url = "http://" + servername + "/products/fullshot.php?fullshot=" + topic_id;

                WindowName = "FullImage";
                WindowWidth = 550;
                WindowHeight = 375;
        }
        else if (topic=="productnotify.php") {
                url = "/products/" + topic + "?" + topic_id;
                WindowName = "TrollAndToad";
                WindowWidth = 500;
                WindowHeight = 250;
        }
        else if (topic=="graphpage.php") {
                url =  topic + "?" + topic_id;
                WindowName = "TrollAndToad";
                WindowWidth = 750;
                WindowHeight = 700;
        }
        else {
                url = topic + "?" + topic_id;
                WindowName = "TrollAndToad";
                WindowWidth = 550;
                WindowHeight = 525;
        }

        browser_name = navigator.appName;
        browser_version = parseFloat(navigator.appVersion);

        //macs
        if (navigator.appVersion.indexOf("Mac")!=-1) {
                //MAC IE (yes status bar)
                if (browser_name == "Microsoft Internet Explorer")         {
                        newwin = window.open(url,WindowName,'resizable=yes,scrollbars=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',status=yes,location=no,toolbar=no,menubar=no');
                }
                //MAC Netscape 3.0 (yes status bar)
                if (browser_name == "Netscape" && browser_version < 4.01)        {
                        newwin = window.open(url,WindowName,'resizable=yes,scrollbars=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',status=yes,location=no,toolbar=no,menubar=no');
                }
                 //MAC Netscape 4.0+  (focus, no status bar)
                 else {
                                 newwin = window.open(url,WindowName,'resizable=yes,scrollbars=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',status=yes,location=no,toolbar=no,menubar=no');
                                newwin.focus();
                }
        }
        //PCs
        else if (browser_name == "Microsoft Internet Explorer" && browser_version < 4) {
                        //IE 3,4 (no focus, no status bar)
                        newwin = window.open(url,WindowName,'resizable=yes,scrollbars=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',status=yes,location=no,toolbar=no,menubar=no');
        }

        else if (browser_name == "Netscape" && browser_version < 4.01) {
                                //Netscape 3 (focus, yes status bar)
                                newwin = window.open(url,WindowName,'resizable=yes,scrollbars=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',status=yes,location=no,toolbar=no,menubar=no');
                                newwin.focus();
                                newwin.refer = self;

        }
        else {
                                //Netscape 4 .0+, IE 5 (focus, no status bar)
                                if(newwin)
                                {
                                        newwin.close();
                                        newwin = null;
                                }

                                newwin = window.open(url,WindowName,'resizable=yes,scrollbars=yes,width=' + WindowWidth + ',height=' + WindowHeight + ',status=yes,location=no,toolbar=no,menubar=no');
                                newwin.opener=window;
                                newwin.focus();
        }
}


function placeFocus(otherfoc) {
  if (otherfoc == "ana" || otherfoc == "other"){
    if (document.forms.length > 1) {
      var field = document.forms[1];
      for (i = 0; i < field.length; i++) {
        if(field.elements[i].name != undefined) {
          if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
            if (otherfoc == "ana"){
              document.forms[1].elements[2].focus();
            }
            else if (otherfoc == "other"){
              document.forms[1].elements[i].focus();
            }
            break;
          }      
        }
      }
    }
  }
}

function goPage(page){
  window.location = page	
}

