﻿// load demo window
var curPopupWindow = null;

function openWindow(url, winName, width, height, center) {
	
   var xposition = 50; // Postions the window vertically in px
   var yposition = 50; // Postions the window horizontally in px

   if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
       xposition = (screen.width - 800) / 2;
       yposition = (screen.height - 600) / 2;
   } 

   // Features to specify for a new window
   args = "width=" + width + ","
   + "height=" + height + ","
   + "location=0,"
   + "menubar=0,"
   + "resizable=1,"
   + "scrollbars=0,"
   + "status=0,"
   + "titlebar=0,"
   + "toolbar=0,"
   + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only

   // Performs the opening of the window.
   	if (curPopupWindow != null) {
	   
		if (!curPopupWindow.closed) {
			curPopupWindow.close();
		}
		curPopupWindow = null;
	}
	curPopupWindow = window.open(url, winName, args, false);
	curPopupWindow.focus();

}

function openDemoWindow() {
   var center = true	
   var xposition = 0; // Postions the window vertically in px
   var yposition = 0; // Postions the window horizontally in px


   if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
       xposition = 0;
       yposition = 0;
   } 
   var width = 800
   var winName = 'Demo'
   var height = 600
   var url = 'http://www.jobehaviors.com:8080/?A=0&P=P'
   
   
   // Features to specify for a new window
   args = "width=" + width + ","
   + "height=" + height + ","
   + "location=0,"
   + "menubar=0,"
   + "resizable=1,"
   + "scrollbars=1,"
   + "status=0,"
   + "titlebar=0,"
   + "toolbar=0,"
   + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only

   // Performs the opening of the window.
   	if (curPopupWindow != null) {
	   
		if (!curPopupWindow.closed) {
			curPopupWindow.close();
		}
		curPopupWindow = null;
	}
	curPopupWindow = window.open(url, winName, args, false);
	curPopupWindow.focus();

}

function openContactWindow() {
   var center = true	
   var xposition = 0; // Postions the window vertically in px
   var yposition = 0; // Postions the window horizontally in px


   if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
       xposition = 0;
       yposition = 0;
   } 
   var width = 800
   var winName = 'Contact'
   var height = 600
   var url = 'http://www.jobehaviors.com:8080/?G=CONTACT'
   
   
   // Features to specify for a new window
   args = "width=" + width + ","
   + "height=" + height + ","
   + "location=0,"
   + "menubar=0,"
   + "resizable=1,"
   + "scrollbars=0,"
   + "status=0,"
   + "titlebar=0,"
   + "toolbar=0,"
   + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only

   // Performs the opening of the window.
   	if (curPopupWindow != null) {
	   
		if (!curPopupWindow.closed) {
			curPopupWindow.close();
		}
		curPopupWindow = null;
	}
	curPopupWindow = window.open(url, winName, args, false);
	curPopupWindow.focus();

}


function openAccountWindow() {
   var center = true	
   var xposition = 0; // Postions the window vertically in px
   var yposition = 0; // Postions the window horizontally in px


   if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
       xposition = 0;
       yposition = 0;
   } 
   var width = 800
   var winName = 'Demo'
   var height = 600
   var url = 'http://www.jobehaviors.com:8080/?A=0&P=P'
   
   
   // Features to specify for a new window
   args = "width=" + width + ","
   + "height=" + height + ","
   + "location=0,"
   + "menubar=0,"
   + "resizable=1,"
   + "scrollbars=1,"
   + "status=0,"
   + "titlebar=0,"
   + "toolbar=0,"
   + "hotkeys=0,"
   + "screenx=" + xposition + ","  //NN Only
   + "screeny=" + yposition + ","  //NN Only
   + "left=" + xposition + ","     //IE Only
   + "top=" + yposition;           //IE Only

   // Performs the opening of the window.
   	if (curPopupWindow != null) {
	   
		if (!curPopupWindow.closed) {
			curPopupWindow.close();
		}
		curPopupWindow = null;
	}
	curPopupWindow = window.open(url, winName, args, false);
	curPopupWindow.focus();

}



//Photoshop jscript
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		HOME_over = newImage("images/HOME-over.gif");
		BENEFITS_over = newImage("images/BENEFITS-over.gif");
		SERVICES_over = newImage("images/SERVICES-over.gif");
		DEMO_over = newImage("images/DEMO-over.gif");
		ACCOUNT_over = newImage("images/ACCOUNT-over.gif");
		CONTACT_over = newImage("images/CONTACT-over.gif");
		ABOUT_over = newImage("images/ABOUT-over.gif");
		preloadFlag = true;
	}
}





