	var ns4 = (document.layers)? true:false;
	var ie4 = (document.all)? true:false;
	function newwin(xUrl,xTitle,xOptions){
	  whatever = window.open(xUrl, xTitle, xOptions);
	  whatever.focus();
	}
	function newUploadWin() {
	  //flash has a limit on the length of the HREF param in the <A> tag, must hard-code certain parts to reduce it.
	  whatever = window.open('http://www.t1mmy.net/visionTool.html','visionTool','width=750,height=250,xscreenX=100,xscreenY=100,status=0,xtop=210,xleft=280,resizeable=0');
	  whatever.focus();
	}
	function newUploadWinSubmit() {
	   whatever = window.open('','visionTool','width=650,height=250,xscreenX=100,xscreenY=100,status=0,xtop=210,xleft=280,resizeable=0');
	  whatever.focus();
	}
	function newRingerWin(xUrl) {
	  //flash has a limit on the length of the HREF param in the <A> tag, must hard-code certain parts to reduce it.
	  whatever = window.open('http://www.t1mmy.net/cgi-bin/visionRingersPreview.cgi?'+xUrl,'visionTool','width=450,height=250,xscreenX=100,xscreenY=100,status=0,xtop=210,xleft=280,resizeable=0');
	  whatever.focus();
	}
	function submitForm() {
	    newUploadWinSubmit();
	    document.visionForm.submit();
	}
	function helpFormSubmit(theForm) {
	  if (helpFormCheck(theForm)) {
	    newHelpWin();
	  } else {
	    return false;
	  }
	}
	function helpFormCheck(theForm) {
	  if (theForm.fileName.value == "") {
	    alert("Please enter the FileName.");
	    theForm.fileName.focus();
	    return false;
	  }
	  if (theForm.message.value == "") {
	    alert("Please enter a message about your problem.");
	    theForm.message.focus();
	    return false;
	  }
	  if (theForm.fileType.value == "") {
	    alert("Please select the type of file.");
	    theForm.fileType.focus();
	    return false;
	  }
	  if (theForm.model.value == "") {
	    alert("Please enter your Phone Model.");
	    theForm.model.focus();
	    return false;
	  }
	  if (theForm.email.value == "") {
	    alert("Please enter your email so I can contact you.");
	    theForm.email.focus();
	    return false;
	  }
	  re = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	  _email = theForm.email.value;
	  if (!re.test(_email)){
	    alert("Please enter a valid email address.");
	    theForm.email.focus();
	    return false;
	  }

	  //if (theForm.phoneNumber.value == "") {
	    //alert("Please enter your Phone Number.  This is for tracking only--I won't call you.");
	    //theForm.phoneNumber.focus();
	    //return false;
	  //}
	  return true;
	}
	function newHelpWin() {
	    var win = window.open('about:blank', 'helpPopUp' , 'toolbar=no,scrollbars=no,width=450,height=250,xscreenX=100,xscreenY=100,status=0,xtop=210,xleft=280,resizeable=0'); 
  	    win.focus(); 
	    return true; 
	}
        var _x = 0;
        var _y = 0;
        var isIE = document.all?true:false;
        if (!isIE) document.captureEvents(Event.MOUSEMOVE);
        document.onmousemove = getMousePosition;
        function getMousePosition(e) {
                if (!isIE) {
                        _x = e.pageX;
                        _y = e.pageY;
                } else {
                        _x = event.clientX + document.body.scrollLeft;
                        _y = event.clientY + document.body.scrollTop;
                }
                return true;
        }
        function popUp(text) {
                if (!text) return;
                if (ie4) {
                        var popThing = document.all['popUpThing'];
                        popThing.style.posLeft = _x + 12;
                        popThing.style.posTop = _y + 12;
                        popThing.innerHTML = text;
                        popThing.style.visibility = 'visible';
                } else if (ns4) {
                        var popThing = document.layers['popUpThing'];
                        popThing.left = _x + 12;
                        popThing.top = _y + 12;
                        popThing.document.open();
                        popThing.document.write('<SPAN style="background-color: #EEEEEE">'+text+'</SPAN>');
                        popThing.document.close();
                        popThing.visibility = 'show';
                } else if (document.getElementById) {
                        var popThing = document.getElementById('popUpThing');
                        popThing.style.left = _x + 12;
                        popThing.style.top = _y + 12;
                        popThing.innerHTML = text;
                        popThing.style.visibility = 'visible';
                }
        }
	function popDown() {
                if (ie4) 
                        document.all['popUpThing'].style.visibility = 'hidden';
		else if (ns4)
                        document.layers['popUpThing'].visibility = 'hide';
                else 
                        document.getElementById('popUpThing').style.visibility='hidden';
        }
	function showButtonText(buttonName, bShow) {
		if (document.images[buttonName]) {
			if (ns4) {
				if (bShow) 
					document.images[buttonName].visibility = 'visible';
				else
					document.images[buttonName].visibility = 'hidden';
			} else {
				if (bShow)
					document.images[buttonName].style.visibility='visible';
				else
					document.images[buttonName].style.visibility='hidden';
			}
		}

	}
