<!-- Declare All Pop-Up Windows
function open_tour( link, width, height)  {
window.open(link,"tour","width=" + width + ",height=" + height + ",left=80,top=80,location=no,resizable=no,scrollbars=no");
}

<!-- OPEN TUTORIAL POP-UPS
var tutorialWindow;
function tutorialPopUp(url)
{
	tutorialWindow=window.open(url,'name','height=400,width=200');
	if (window.focus) {tutorialWindow.focus()}
}

<!-- Begin Email Address Validation
function emailCheck (emailStr) {
var emailPat=/^(.+)@(.+)$/
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
var validChars="\[^\\s" + specialChars + "\]"
var quotedUser="(\"[^\"]*\")"
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
var atom=validChars + '+'
var word="(" + atom + "|" + quotedUser + ")"
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
	alert("Please make sure the email address you entered is valid!")
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    alert("Please make sure the email address you entered is valid!")
    return false
}

var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert("Please make sure the email address you entered is valid!")
		return false
	    }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert("Please make sure the email address you entered is valid!")
    return false
}

var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
      alert("Your email address must end in a three-letter domain, or two letter country.")
   return false
}

if (len<2) {
   var errStr="Please make sure the email address you entered is valid!"
   alert(errStr)
   return false
}
 
return true;
}
//  End -->



<!-- Macromedia preload and swap image
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.0
  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 && document.getElementById) x=document.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_showHideLayers() { //v3.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; }
}
//-->

<!-- Show/Hide Layers
function HTF_findObj(n, d) { //v4.0
  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=HTF_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function HTF_showHideLayers() { //v3.0
  var i,p,v,obj,args=HTF_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=HTF_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; }
}
//-->

<!-- VALIDATE SEARCH FORM
function search_validate(search_form)
{
  if (search_form.search_box.value == "")
  {
    alert("Please enter your search words or phrases separated by commas.");
    search_form.search_box.focus();
    return (false);
  }
  return (true);
}
//-->

<!-- VALIDATE INFORMATION FORM
function validate(newsevents)
{
  if (newsevents.name.value == "")
  {
    alert("Please give us your name.");
    newsevents.name.focus();
    return (false);
  }

  if (newsevents.phone.value == "")
  {
    alert("We will need your phone number to call you.");
    newsevents.phone.focus();
    return (false);
  }

  if (newsevents.email.value == "")
  {
    alert("Don't forget your email address!");
    newsevents.email.focus();
    return (false);
  }

  return (true);
}
//-->

<!-- VALIDATE LOGIN FORM
function login_validate(login_form)
{
  if (login_form.email.value == "")
  {
    alert("You must enter your Email Address first!");
    login_form.email.focus();
  }
  
   if (login_form.password.value == "")
  {
    alert("Don't forget your password!");
    login_form.password.focus();
  }

  if (login_form.email.value != "" && login_form.password.value != "")
  {
    var username = login_form.email.value;
    var password = login_form.password.value;
    var src = 'http://forum.viewpointcs.com/Themes/viewpoint/ViewpointLogin/LoginService.asmx/LogIn?username=' + username + '&password=' + password;
    document.getElementById('forumLoginFrame').innerHTML = '<iframe style="display:none" onload="document.login_form.submit();" src="' + src + '"></iframe>';
  }
  
  return false;
}
//-->

<!-- FORM BUTTON ONOVER
function pviiClassNew(obj, new_style) 
{
    obj.className = new_style;
}
//-->




<!-- Set First Form Field For Login Prompt
function toForm() {
    var email_check=document.getElementById('email')
        if(email_check != null) {
        document.login_form.email.focus();
    //    alert('it exists');
    }else{
    //    alert('it does not exist');
    }
    
// Replace field1 in the script with the field name of which you want to place the focus.
}
//  End -->



<!--
// Validate Feilds In Contact Us Form
 function Form_Validator(theForm)
{

  if (theForm.name.value == "")
  {
    alert("Please enter your name.");
    theForm.name.focus();
    return (false);
  }


  if (theForm.email.value == "")
  {
    alert("Please enter your email.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.company.value == "")
  {
    alert("Please enter your company.");
    theForm.company.focus();
    return (false);
  }


  if (theForm.phone.value == "")
  {
    alert("Please enter your phone.");
    theForm.phone.focus();
    return (false);
  }

   if (theForm.module.value == "")
  {
    alert("Please enter your module.");
    theForm.module.focus();
    return (false);
  }
  
   if (theForm.program.value == "")
  {
    alert("Please enter your program.");
    theForm.program.focus();
    return (false);
  }
  if (theForm.contact_method.value == "")
  {
    alert("Please select a contact method.");
    theForm.contact_method.focus();
    return (false);
  }
  
   return (true);
}
//-->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=900,height=600,left = 290,top = 262');");
}
// End -->