window.name = "MainCatalog";

//if (getCookie("cmywidth")) {
//    setCookie("nevermind","nevermind");
//}
//Else {
//    if (screen.height >= 865 && screen.width >= 1024) {
//        setCookie("cmywidth","820");
//        setCookie("cmyheight","865");
//        /** window.resizeTo("820","865"); */
//    }
//    else {
//    if (screen.height <= 600 && screen.width <= 800) {
//        setCookie("cmywidth",screen.width);
//        setCookie("cmyheight",screen.height);
//        /** window.resizeTo(screen.width,screen.height); */
//    }
//    else {
//        setCookie("cmywidth","820");
//        setCookie("cmyheight","865");
//        /** window.resizeTo("820","865"); */
//       }
//    }
//}


function makevisible(cur,which){
    if (which==0)
        cur.filters.alpha.opacity=100
    Else
        cur.filters.alpha.opacity=20
}


/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1)
    {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    }
    else
    {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1)
    {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name))
    {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
    var ok=false;
    document.MM_returnValue = false;
    with (navigator) {
        if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
            ok=(plugins && plugins[plgIn]);
        } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
            if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) {
                ok=window.MM_flash;
                var mycatch = "Catch 1";
            } else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) {
                ok=window.MM_dir;
                var mycatch = "Catch 2";
            } else {
                ok=autoGo;
                var mycatch = "Catch 3";
            }
        }
        if (!ok) { theURL=altURL; }
        //if (theURL) { window.location=theURL; }
        document.write(' + theURL + ');
    }
}

with (navigator) {
    if (appName.indexOf('Microsoft')!=-1 && appVersion.indexOf('Mac')==-1) {
        document.write('<scr'+'ipt language="VBScript">\nOn error resume next\nMM_dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\nMM_flash = NOT IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</script>');
    }
}

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
        browser = "Konqueror";
        OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
        browser = "Netscape Navigator"
        version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
        if (checkIt('linux')) OS = "Linux";
        else if (checkIt('x11')) OS = "Unix";
        else if (checkIt('mac')) OS = "Mac"
        else if (checkIt('win')) OS = "Windows"
        else OS = "an unknown operating system";
}

function checkIt(string)
{
        place = detect.indexOf(string) + 1;
        thestring = string;
        return place;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function popOrder(strURL) {
    if(window.popupWin) {
            if(popupWin.closed != true) {
                    window.popupWin.focus();
                    window.popupWin.location = strURL;
            } else {
                    popupWin = window.open(strURL, "Trebro", 'resizable=no,resize=no,scrollbars=no,status=no,width=640,height=370,left=50,top=10');
            }
    } else {
            popupWin = window.open(strURL, "Trebro", 'resizable=no,resize=no,scrollbars=no,status=no,width=640,height=370,left=50,top=10');
    }
}

function popOrderCoveredWagon(strURL) {
    if(window.popupWin) {
            if(popupWin.closed != true) {
                    window.popupWin.focus();
                    window.popupWin.location = strURL;
            } else {
                    popupWin = window.open(strURL, "Trebro", 'resizable=yes,resize=yes,scrollbars=yes,status=no,width=718,height=600,left=50,top=10');
            }
    } else {
            popupWin = window.open(strURL, "Trebro", 'resizable=yes,resize=yes,scrollbars=yes,status=no,width=718,height=600,left=50,top=10');
    }
}

function popOrderPDF(strURL) {
    if(window.popupWin) {
            if(popupWin.closed != true) {
                    window.popupWin.focus();
                    window.popupWin.location = strURL;
            } else {
                    popupWin = window.open(strURL, "Trebro", 'resizable=yes,resize=yes,scrollbars=auto,status=no,width=640,height=370,left=50,top=10');
            }
    } else {
            popupWin = window.open(strURL, "Trebro", 'resizable=yes,resize=yes,scrollbars=auto,status=no,width=640,height=370,left=50,top=10');
    }
}

function popOrderProdPic(strURL) {
    if(window.popupWinProdView) {
            if(popupWinProdView.closed != true) {
                    window.popupWinProdView.focus();
                    window.popupWinProdView.location = strURL;
            } else {
                    popupWinProdView = window.open(strURL, "popupWinProdView", 'resizable=no,resize=no,scrollbars=no,status=no,width=445,height=303,left=150,top=110');
            }
    } else {
            popupWinProdView = window.open(strURL, "popupWinProdView", 'resizable=no,resize=no,scrollbars=no,status=no,width=445,height=303,left=150,top=110');
    }
}

function ProdPicClose() {
    if(window.popupWinProdView) {
        if(popupWinProdView.closed != true) {
            window.popupWinProdView.close(); 
        }
    }
}

function popOrderProdVid(strURL) {
    if(window.popupWinVidView) {
            if(popupWinVidView.closed != true) {
                    window.popupWinVidView.focus();
                    window.popupWinVidView.location = strURL;
            } else {
                    popupWinVidView = window.open(strURL, "popupWinVidView", 'resizable=yes,resize=yes,scrollbars=no,status=no,width=480,height=360,left=50,top=10');
            }
    } else {
            popupWinVidView = window.open(strURL, "popupWinVidView", 'resizable=yes,resize=yes,scrollbars=no,status=no,width=480,height=360,left=50,top=10');
    }
}

function ProdVidClose() {
    if(window.popupWinVidView) {
        if(popupWinVidView.closed != true) {
            window.popupWinVidView.close(); 
        }
    }
}

function MainCatalogWindowOpen(strURL) {
    if(window.MainCatalog) {
        MainCatalog = window.open(strURL, "MainCatalog", '');
        if(window.PartsViewer) {
            window.PartsViewer.close();
        }
    } else {
        MainCatalog = window.open(strURL, "MainCatalog", '');
        window.PartsViewer.close(); 
        if(window.PartsViewer) {
            window.PartsViewer.close();
        }
    }
}

function PartsViewerOpen(strURL) {
    if(window.PartsViewer) {
         window.PartsViewer.close(); 
    }
    PartsViewer = window.open(strURL, 'PartsViewer', 'resizable=no,resize=no,scrollbars=no,status=no,width=285,height=315,left=50,top=10');
    window.PartsViewer.focus();
}

function PartsViewerClose() {
    if(window.PartsViewer) {
        if(PartsViewer.closed != true) {
            window.PartsViewer.close(); 
        }
    }
}

function SchematicViewOpen(strURL) {
    if (screen.width >= 800 && screen.height >= 913) {
        set_window_width = 726;
        set_window_height = 913;
        scrollbar_setting = "no";
        resize_setting = "no";
    } else {
        set_window_width = 726;
        set_window_height = (screen.Height - 20);
        scrollbar_setting = "yes";
        resize_setting = "yes";
    }
    if(window.SchematicView) {
        window.SchematicView.close();
    }
    SchematicView = window.open(strURL, 'SchematicView', 'resizable=' + resize_setting + ',resize=' + resize_setting + ',scrollbars=' + scrollbar_setting + ',status=no,width=' + set_window_width + ',height=' + set_window_height + ',left=0,top=0');
    window.SchematicView.focus();
}

function SchematicViewClose() {
    if(window.SchematicView) {
        if(SchematicView.closed != true) {
            window.SchematicView.close(); 
        }
    }
}

function FamilyAlbumViewOpen(strURL) {
    set_window_width = screen.width;
    set_window_height = screen.height;
    scrollbar_setting = "no";
    resize_setting = "no";
    if(window.FamilyAlbumView) {
        window.FamilyAlbumView.close();
    }
    FamilyAlbumView = window.open(strURL, 'FamilyAlbumView', 'resizable=' + resize_setting + ',resize=' + resize_setting + ',scrollbars=' + scrollbar_setting + ',status=no,width=' + set_window_width + ',height=' + set_window_height + ',left=0,top=0');
    window.FamilyAlbumView.focus();
}

function FamilyAlbumViewClose() {
    if(window.FamilyAlbumView) {
        if(FamilyAlbumView.closed != true) {
            window.FamilyAlbumView.close(); 
        }
    }
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function P7_Snap() { //v2.63 by PVII
 var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}

//Contents for menu_company
var menu_company=new Array()
menu_company[0]='<a href="/company.php">About Trebro</a>'
menu_company[1]='<a href="/testimonials.php">Testimonials</a>'
menu_company[2]='<a href="#" onClick="FamilyAlbumViewOpen(\'/family/\');return false;">Family Album</a>'

//Contents for menu_products
var menu_products=new Array()
menu_products[0]='<a class="bodyK" href="/autostack.php">Trebro AutoStack&reg;</a>'
menu_products[1]='<a class="bodyK" href="/harvestack.php">Trebro HarveStack&reg;</a>'
menu_products[2]='<a class="bodyK" href="/autoslab.php">Trebro AutoSlab&reg;</a>'
menu_products[3]='<a class="bodyK" href="/quadlift.php">Trebro QuadLift&reg;</a>'
menu_products[4]='<a class="bodyK" href="/sc2010.php">Trebro SC2010&reg;</a>'
menu_products[5]='<a class="bodyK" href="/usedequipment.php">Used Equipment for Sale</a>'
menu_products[6]='<a target="new_window" class="bodyK" href="http://www.stillwaterleasing.com">Preferred Equip. Leasing Co.</a>'

//Contents for menu_orderparts
var menu_orderparts=new Array()
menu_orderparts[0]='<a href="/contact.php">Order by Phone</a>'
menu_orderparts[1]='<a href="/catalog/">Online Ordering</a>'

//Contents for menu_support
var menu_support=new Array()
menu_support[0]='<a href="/support.php">Download Manuals</a>'
menu_support[1]='<a href="/news/service_school.php">Service Schools</a>'

//Contents for menu_events
var menu_news=new Array()
menu_news[0]='<a href="/calendar/">Events</a>'
menu_news[1]='<a href="/news.php">Highlights</a>'
menu_news[2]='<a href="/news/archives.php">Archives</a>'

//Contents for menu_contacts
var menu_contact=new Array()
menu_contact[0]='<a href="/contact.php">Sales Reps</a>'
menu_contact[1]='<a href="/contact.php">Service Techs</a>'
menu_contact[2]='<a href="/contact.php">Corporate Office</a>'
menu_contact[3]='<a href="/contact.php">Plant Office</a>'

//Contents for menu_harvestack, and so on
var menu_catalog_harvestack=new Array()
menu_catalog_harvestack[0]='<a href="/catalog/harvestack01.php">HS101-HS218</a>'
menu_catalog_harvestack[1]='<a href="/catalog/harvestack.php">HS219-And Up</a>'
menu_catalog_harvestack[2]='<a href="/support.php">Download Manuals</a>'

//Contents for menu_autostack, and so on
var menu_catalog_autostack=new Array()
menu_catalog_autostack[0]='<a href="/catalog/autostack.php">AS001-And Up</a>'
menu_catalog_autostack[1]='<a href="/support.php">Download Manuals</a>'

//Contents for menu_autoslab, and so on
var menu_catalog_autoslab=new Array()
menu_catalog_autoslab[0]='<a href="/support.php">Download Manuals</a>'

//Contents for menu_shortcut, and so on
var menu_catalog_shortcut=new Array()
menu_catalog_shortcut[0]='<a href="/support.php">Download Manuals</a>'

//Contents for menu_quadlift, and so on
var menu_catalog_quadlift=new Array()
menu_catalog_quadlift[0]='<a href="/support.php">Download Manuals</a>'


var menuwidth='100px' //default menu width
var menubgcolor='#c4cbe5'  //menu bgcolor
var disappeardelay=1  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function MyContactForm(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Name\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Mail_to.value == "")
  {
    alert("Please enter a value for the \"Mailing Address\" field.");
    theForm.Mail_to.focus();
    return (false);
  }

  if (theForm.Mail_to.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"Mailing Address\" field.");
    theForm.Mail_to.focus();
    return (false);
  }

  if (theForm.Mail_to.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"Mailing Address\" field.");
    theForm.Mail_to.focus();
    return (false);
  }

  if (theForm.City.value == "")
  {
    alert("Please enter a value for the \"City or Town\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"City or Town\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.City.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"City or Town\" field.");
    theForm.City.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.City.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"City or Town\" field.");
    theForm.City.focus();
    return (false);
  }

  if (theForm.State.value == "")
  {
    alert("Please enter a value for the \"State or Province\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"State or Province\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.State.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"State or Province\" field.");
    theForm.State.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f";
  var checkStr = theForm.State.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter and whitespace characters in the \"State or Province\" field.");
    theForm.State.focus();
    return (false);
  }

  if (theForm.Zip.value == "")
  {
    alert("Please enter a value for the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Zip.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789--";
  var checkStr = theForm.Zip.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"-\" characters in the \"Zip\" field.");
    theForm.Zip.focus();
    return (false);
  }

  if (theForm.Country.value == "")
  {
    alert("Please enter a value for the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.Country.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ";
  var checkStr = theForm.Country.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter characters in the \"Country\" field.");
    theForm.Country.focus();
    return (false);
  }

  if (theForm.country_code.value == "")
  {
    alert("Please enter a value for the \"country_code\" field.");
    theForm.country_code.focus();
    return (false);
  }

  if (theForm.country_code.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \"country_code\" field.");
    theForm.country_code.focus();
    return (false);
  }

  if (theForm.country_code.value.length > 4)
  {
    alert("Please enter at most 4 characters in the \"country_code\" field.");
    theForm.country_code.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.country_code.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch == "," && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"country_code\" field.");
    theForm.country_code.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"country_code\" field.");
    theForm.country_code.focus();
    return (false);
  }

  if (theForm.area_code.value == "")
  {
    alert("Please enter a value for the \"area_code\" field.");
    theForm.area_code.focus();
    return (false);
  }

  if (theForm.area_code.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"area_code\" field.");
    theForm.area_code.focus();
    return (false);
  }

  if (theForm.area_code.value.length > 5)
  {
    alert("Please enter at most 5 characters in the \"area_code\" field.");
    theForm.area_code.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.area_code.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch == "," && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"area_code\" field.");
    theForm.area_code.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"area_code\" field.");
    theForm.area_code.focus();
    return (false);
  }

  if (theForm.number.value == "")
  {
    alert("Please enter a value for the \"number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.number.value.length < 7)
  {
    alert("Please enter at least 7 characters in the \"number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.number.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"number\" field.");
    theForm.number.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.number.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch == "," && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \"number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \"number\" field.");
    theForm.number.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ0123456789-@.";
  var checkStr = theForm.email.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only letter, digit and \"@.\" characters in the \"email\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.Questions.value == "")
  {
    alert("Please enter a value for the \"Questions\" field.");
    theForm.Questions.focus();
    return (false);
  }

  if (theForm.Questions.value.length > 500)
  {
    alert("Please enter at most 500 characters in the \"Questions\" field.");
    theForm.Questions.focus();
    return (false);
  }
  return (true);
}




function zoomImage(imageElement, xFactor, yFactor) {
  imageElement.width =
    Math.round(document.imageName.width * xFactor);
  imageElement.height = 
    Math.round(document.imageName.height * yFactor);
  if (imageElement.useMap)
    zoomMap (imageElement.useMap.substring(1), xFactor, yFactor);
}

function zoomMap(mapName, xFactor, yFactor) {
  if (document.all) {
    var map = document.all[mapName];
    var areas = map.all.tags('AREA');
  }
  else if (document.getElementsByName) {
    var map = document.getElementsByName(mapName)[0];
    var areas = map.getElementsByTagName('AREA');
  }
  if (areas) {
    for (var a = 0; a < areas.length; a++) {
      var coords = areas[a].coords.split(/\s*,\s*/);
      if (areas[a].shape.toLowerCase() == 'rect' ||
          areas[a].shape.toLowerCase() == 'poly') {
        for (var p = 0; p < coords.length; p += 2) {
          coords[p] = Math.round(coords[p] * xFactor);
          coords[p + 1] = Math.round(coords[p + 1] * yFactor);
        }
      }
      else if (areas[a].shape.toLowerCase() == 'circle') {
        coords[0] = Math.round(coords[0] * xFactor);
        coords[1] = Math.round(coords[1] * yFactor);
        coords[2] = Math.round(coords[2] * (xFactor < yFactor ? xFactor 
: yFactor));
      }
      areas[a].coords = coords.join(', ');
    }
  }
}








// Porforms the resizing of the shcematic image
//
//var zoomfactor=0.05; //Enter factor (0.05=5%)
//
//function zoomhelper(){
//	if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){
//		whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix;
//		whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix;
//	}
//}
//
//function zoom(originalW, originalH, what, state){
//	if (!document.all&&!document.getElementById) return;
//	
//	whatcache=eval("document.images."+what);
//	prefix=(state=="in")? 1 : -1;
//	
//	if (whatcache.style.width==""||state=="restore"){
//		whatcache.style.width=originalW;
//		whatcache.style.height=originalH;
//		if (state=="restore") return;
//	}
//	else{
//		zoomhelper();
//	}
//	beginzoom=setInterval("zoomhelper()",100); //<!--HAVE A LOOK AT THIS LINE AS MAXIMUM IMAGE HEIGHT-->
//}
//
//function clearzoom(){
//	if (window.beginzoom) clearInterval(beginzoom);
//}


//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblclick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}