// JavaScript Document
<!--
// Example:
// writeCookie("myCookie", "my name", 24);
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
function createCookie(name,value,days)
{
	if (days)
	{
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name)
{
	createCookie(name,"",-1);
}

function setmovie(){
	if(readCookie("play_movie") == 'no'){
		createCookie('play_movie','yes','365');
		//alert("cookie play_movie set to yes")
	}
	else if(readCookie("play_movie") == 'yes'){
		createCookie('play_movie','no','365');
		//alert("cookie play_movie set to no")
	}
	else{
		createCookie('play_movie','no','365');
		//alert("cookie play_movie set to no")
	}
}

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 centerwindow() {
	if(navigator.appName == "Microsoft Internet Explorer") {
		windowWidth = document.body.offsetWidth;
		windowHeight = document.body.offsetHeight;
	}
	else {
		windowWidth = window.outerWidth;
		windowHeight = window.outerHeight;
	}
	
	if(windowWidth > screen.width) {
		window.moveTo(0,0);
		window.resizeTo(screen.width,screen.height-50);
//		alert('Small Screen - Screen Width:'+screen.width+'Screen Height:'+screen.height);
	}
	else {
		winXpos = (screen.width - windowWidth) / 2;
		winYpos = (screen.height - windowHeight) / 2;
		window.moveTo(winXpos,winYpos);
//		alert('Big Screen - Screen Width:'+screen.width+'Screen Height:'+screen.height);
	}
}	


function browserCheck() {
	if((navigator.appName.indexOf("Netscape"))&&(navigator.appVersion.indexOf("4."))) {
		alert('Netscape 4.77');
		//window.location.href= downloadbrowser.htm;
	}
}

function fmovie() {
	if(navigator.appName == "Microsoft Internet Explorer"){
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="575" HEIGHT="200" id="intro movie" ALIGN="">');
		document.write('<PARAM NAME=movie VALUE="Flashmovie/intro_movie.swf">');
		document.write('<param name="WMode" value="Transparent">');
		document.write('<PARAM NAME=quality VALUE=high>');
		document.write('<PARAM NAME=scale VALUE=noscale>');
		document.write('<PARAM NAME=bgcolor VALUE=#FFFFFF>');
		document.write('<EMBED src="Flashmovie/intro_movie.swf" quality=high scale=noscale bgcolor=#FFFFFF  WIDTH="575" HEIGHT="200" NAME="introMovie" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
		document.write('</OBJECT>');
	}
	else {
		document.write('<img src="images/home-heading-img.jpg" width="575" height="200" /> ');
	}
}


function swClass(obj, new_style) {
    obj.className = new_style;
}

function zoomScreen(imgName) { //v2.0
	document.imgZoom.imgName.value=imgName;
	if(830 >= screen.width) {
	window.open('../zScreen.htm','sys2Kscreen','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height-20);
	} else {
	window.open('../zScreen.htm','sys2Kscreen','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=850,height=655');
	}
}

function zScreen(imgName) { //v2.0
	document._appscreens.imgName.value=imgName;
	if(830 >= screen.width) {
	window.open('../zScreen.htm','sys2Kscreen','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+screen.width+',height='+screen.height-20);
	} else {
	window.open('../zScreen.htm','sys2Kscreen','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=850,height=655');
	}
}

function dateCountdown(eventDate){
	var date = new Date(eventDate);
	var now = new Date();
	var diff = date.getTime() - now.getTime();
	var days = Math.floor(diff / (1000 * 60 * 60 * 24));
	if (days > 1) {
		document.write(days+1 + " days until ");
	}
	else if (days == 1) {
		document.write("Only two days until ");
	}
	else if (days == 0) {
		document.write("Tomorrow is ");
	}
	else if (days == -2) {
		document.write(Math.abs(days+1) + " day since ");
	}
	else if (days < -2) {
		document.write(Math.abs(days+1) + " days since ");
	}
	else {
		document.write("Today is ");
	}
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

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 enrollmentForm() { //v2.0
  window.open('http://vainet'+homelocation+'.vaihome.com/lotusweb/enroll.nsf/enrollment?OpenFrameset','EnrollmentForm','scrollbars=yes,width=650,height=500');
}

function no_classes() {
alert('There are no scheduled classes for this month yet.')
}

// pc added
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function DirectionsFor(theURL) { //v2.0
  window.open('../directions/'+theURL+'.htm','Directions','scrollbars=yes,width=650,height=500');
}

function DForm() { //v2.0
  window.open('../directions/DirectionForm.htm','DForm','scrollbars=yes,width=300,height=240');
}

function MapSearch() { //v2.0
  window.open('http://www.mapquest.com/directions/main.adp?go=1&do=nw&ct=NA&1y=US&1a='+document.contact.ADDRESS.value+'&1p=&1c='+document.contact.CITY.value+'&1s='+document.contact.STATE.value+'&1z='+document.contact.ZIP.value+'&1ah=&2y=US&2a='+'120 Comac St'+'&2p=&2c='+'Ronkonkoma'+'&2s='+'NY'+'&2z='+'11779'+'&2ah=&lr=2&x=62&y=13');
}  

function enrollmentForm() { //v2.0
  window.open('http://vainet'+homelocation+'.vaisw.com/lotusweb/enroll.nsf/enrollment?OpenFrameset','EnrollmentForm','scrollbars=yes,width=650,height=500');
}

function informationForm() { //v2.0
  window.open('http://vainet'+homelocation+'.vaisw.com/lotusweb/enroll.nsf/MoreInfo?OpenFrameset','InformationForm','scrollbars=yes,width=650,height=500');
}

function evalForm() { //v2.0
  window.open('https://vainet'+homelocation+'.vaisw.com/lotusweb/tevals.nsf/userEval?OpenForm','EvaluationForm','scrollbars=yes,status=yes,resizable=yes,width=760,height=500');
}

function seminarForm() { //v2.0
  window.open('http://vainet'+homelocation+'.vaisw.com/lotusweb/seminarreg.nsf/userRegistration?OpenForm','SeminarForm','scrollbars=yes,width=650,height=500');
}

function dealerForm() { //v2.0
  window.open('http://dealer'+homelocation+'.myvai.com/lotusweb/dconference03.nsf/userRegistration?OpenForm','DealerForm','scrollbars=yes,width=675,height=550');
}

function userForm() { //v2.0
  window.open('http://user'+homelocation+'.myvai.com/lotusweb/uconference03.nsf/userRegistration?OpenForm','UserForm','scrollbars=yes,width=675,height=550');
}

function logIn() { //v2.0
    window.location.href='http://vainet'+homelocation+'.vaisw.com/';
}

function classSchedule() {
    window.location.href= site_root+"Education-Training/Schedule/"+def_schedule;
}

function Home() {
    window.location.href= site_root
}
   
function onlineSupport() { //v2.0
  window.open('http://support'+homelocation+'.vaisw.com','VAINET','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}

function logInWEBEX() { //v2.0
  window.open('http://vaihome.webex.com','VAINET','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
}
//end pc added
//-->