
var fslFormWin = null;
var x=0;
var y=0;
var screenw = screen.availWidth;
var screenh = screen.availHeight;

/*
 * This function is responsible for opening the FSL form in the new window.
 */
function openFSLForm1() {

	var URL = "";

	if (navigator.appName == 'Netscape') {
		if(checkMinorVerNS6(navigator.userAgent)){
			URL = "../FSL/fsl_dload.jsp";
		} else {
			URL = "FSL/fsl_dload.jsp";
		}
	} else if (navigator.appName == 'Microsoft Internet Explorer') {
		if(navigator.platform.indexOf('Mac')!=-1){
			URL = "FSL/fsl_dload.jsp";
		} else {
			if(navigator.userAgent.indexOf('Opera') != -1){
				URL = "FSL/fsl_dload.jsp";
			} else {
				URL = "../FSL/fsl_dload.jsp";
			}
		}
 	}

	if (fslFormWin != null) {
	 	if (fslFormWin.closed == false) {
			fslFormWin.focus();
		}
	}

	fslFormWin = window.open(URL,"FurnitureSymbols", "width=538,height=500,scrollbars=yes,menubar=no,directories=no,location=no,toolbar=no,resizable=yes");
}


function openFSLForm2() {

	var URL = "";

	if (navigator.appName == 'Netscape') {
		if(checkMinorVerNS6(navigator.userAgent)){
			URL = "../FSL/fsl_order.jsp";
		} else {
			URL = "FSL/fsl_order.jsp";
		}
	} else if (navigator.appName == 'Microsoft Internet Explorer') {
		if(navigator.platform.indexOf('Mac')!=-1){
			URL = "FSL/fsl_order.jsp";
		} else {
			if(navigator.userAgent.indexOf('Opera') != -1){
				URL = "FSL/fsl_order.jsp";
			} else {
				URL = "../FSL/fsl_order.jsp";
			}
		}
 	}

	if (fslFormWin != null) {
	 	if (fslFormWin.closed == false) {
			fslFormWin.focus();
		}
	}

	fslFormWin = window.open(URL,"FurnitureSymbols", "width=538,height=500,scrollbars=yes,menubar=no,directories=no,location=no,toolbar=no,resizable=yes");
}

	/*
	 * Calculates the window position for the
	 */
	 function getWindowPostion() {

	  	if (x != 0 && y != 0){
			x = x+24;
			y = y+24;

		}
		else {
			x	= (screenw-555)/2;
			y	= (screenh-410)/2;
		}

		if(((x+555)>screenw) ||  ((y+410)>screenh)) {
			x=0;
			y=0;
		}

	 }
	 /*
	 Called when the browser used is Netscape. If the NS version is 6.1+ it returns true and the corresponding chaged URL is called.
	 */

	 function checkMinorVerNS6(userAgent) {
			var index  = userAgent.indexOf("Netscape");
	 		var browserver = userAgent.substring(index);
	 		var tempArr = browserver.split("/");
	 		var verArr = tempArr[1].split(".");
	 		if(verArr[0] == '6'){
				if (verArr[1] >= 1){
		 			return true;
	 			} else {
		 			return false;
	 			}
	 		}
	 		return false;

	 }
