var varSubmitForm = 0;
function disableSubmitButtonAndSubmitSearch(theForm, lang) {
	var status = true;
	if(theForm.question_box.value==""){
		if (lang == "en") {
			alert("Please enter a value!");
		} else {
			alert("S'il vous pla\356t, entrez une valeur!");
		}
		varSubmitForm=0;
		theForm.question_box.focus();
		status = false;
	} else if (varSubmitForm==0){
		varSubmitForm=1;
	} else {
		if (lang == "en") {
			alert("Your search is already submitted.\n Please wait...");
		} else {
			alert("Votre recherche est en cours.\n Attendez s'il vous pla\356t...");
		}
		status = false;
	}
		if(status) theForm.submit();
}

function launchWin(location){
    //INSERT CODE BELOW THAT REDIRECTS MAIN WINDOW
    //ex. history.back(); or window.location="URL";
    //END REDIRECT CODE

    //set the x & y coordinates to center the popup window

    //PC Health Check needs a bigger window than the other pages

    if(location=="pcHealthCheck.html" || location=="zksServices.html" || location=="securityScan.html" || location=="minSysReq.html" || location=="minSysReqMSN.html"){
		var left = (screen.width/2) - (501/2);
		var top = (screen.height/2) - (445/2) - 20;
		var height = "399";
		var width = "489";
    }
    else{
		var top = (screen.height/2) - (398/2) - 20;
		var left = (screen.width/2) - (501/2);
		var height = "354";
		var width = "489";
    }

    var fullQueryStr = "http://eserv.sympatico.ca/netassistant/welcomeLauncher.html?nextPage=" + location;

    window.open(fullQueryStr,null,"height=" + height + ",width=" + width + ",top=" + top + ",left=" + left + ",status=yes,toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no");
}

var win_handle;
function openflash(filename, width, height, show_close) {
	// show_close: boolean value to indicate to show close buttons on bottom of popup,
	// new flash have these as part of the movies, older ones do not
	if(typeof(show_close) == 'undefined') {show_close = true;}

	if(show_close != true && show_close != false) {show_close = true;}

	window_width = width;
	// make popup higher in height, so account for bottom exit buttons
	if(show_close)
	{
		window_height = height + 50;
	}
	else
	{
		window_height = height;
	}

	win_handle = window.open ("../tutorial/flashpopup.cfm?flashwidth=" + width + "&flashheight=" + height + "&filename=" + filename + "&show_close=" + show_close, "win_handle", "toolbar=no,dependent=no,location=no,directories=no,status=yes,menubar=no,scrollbars=auto,resizable=yes,width=" + window_width + ",height=" + window_height);
}

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 popper(thisUrl,thisWindow,thisWidth,thisHeight,thisTop,thisLeft) {
	optionString = ('width=' + thisWidth + ',height=' + thisHeight + ',top=' + thisTop + ',left=' + thisLeft + ',status=no,menubar=no,resizable=no,scrollbars=yes');
	mainWin = window.open(thisUrl,thisWindow,optionString);
	mainWin.focus();
}