<!-- Standard QualityTrainingPortal.com JavaScript file  -->

function doPopUpOutline(courseID){
var pos = "left=0,top=0";
var URL = "http://qualitytrainingportal.com/courses_avail/"+courseID+"_outln.htm"
window.open(URL,"PopUp","scrollbars=yes,width=450,height=500,"+pos);
}

function doPopUpObjectives(courseID){
var pos = "left=0,top=0";
var URL = "http://qualitytrainingportal.com/courses_avail/"+courseID+"_obj.htm"
window.open(URL,"PopUp","scrollbars=yes,width=450,height=500,"+pos);
}

function doPopUpCSCPatch(PatchNum){
var pos = "left=0,top=0";
var URL = "http://qualitytrainingportal.com/customers/csc/patches/"+PatchNum+"patch.htm"
window.open(URL,"PopUp","scrollbars=yes,width=450,height=500,"+pos);
}


function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}

function doPopUpForm(formname){
var pos = "left=0,top=0";
var URL = "http://qualitytrainingportal.com/resources/"+formname+".htm"
window.open(URL,"PopUp","scrollbars=yes,width=650,height=550,"+pos);
}

function doPopUpResourceCenter(URL){
var leftLoc = (screen.width/2)-325;
var topLoc = (screen.height/2)-275;
var winFeatures = "scrollbars=yes,resizable=yes,width=650,height=550,left="+leftLoc+",top="+topLoc;
var winHndl = window.open(URL,"ResourceCenter",winFeatures);
}

function doPopUpWhyOnline(URL){
var pos = "left=0,top=0";
window.open(URL,"PopUp","scrollbars=yes,width=450,height=500,"+pos);
}

function ValidateWebDemoForm()
{
        var FirstName = document.WebDemoForm.FirstName;
        var LastName = document.WebDemoForm.LastName;
	var email = document.WebDemoForm.email;
	var emailconf = document.WebDemoForm.emailconf;
	var Title = document.WebDemoForm.Title;
	var telephone = document.WebDemoForm.telephone;
	var company = document.WebDemoForm.company;
	var Country = document.WebDemoForm.Country;
	var PhoneExt = document.WebDemoForm.PhoneExt;
	var FindWeb = document.WebDemoForm.FindWeb;
	var WebOther = document.WebDemoForm.WebOther
	var demoProgram = document.WebDemoForm.demoProgram;
	var securityQuestion = document.WebDemoForm.securityQuestion;	
    
        if (FirstName.value == "")
    {
        window.alert("Please enter your first name.");
        FirstName.focus();
        return false;
    }
        if (LastName.value == "")
    {
        window.alert("Please enter your last name.");
        LastName.focus();
        return false;
    }    
	if (email.value == "")
	{
	    window.alert("Please enter a valid e-mail address.");
	    email.focus();
	    return false;
	}

	if (email.value.indexOf("@", 0) < 0)
	{
	    window.alert("Please enter a valid e-mail address.");
	    email.focus();
	    return false;
	}
	
	if (email.value.indexOf(".", 0) < 0)
	{
	    window.alert("Please enter a valid e-mail address.");
	    email.focus();
	    return false;
	}
    if (Title.value == "")
    {
        window.alert("Please enter your job title.  If you are self-employed, enter self-employed.");
        Title.focus();
        return false;
    }
    if (telephone.value == "")
    {
        window.alert("Please enter your telephone number.");
        telephone.focus();
        return false;
    }
    if (Country.selectedIndex == -1 || Country.options[Country.selectedIndex].text == "" || Country.options[Country.selectedIndex].text.toLowerCase() == "choose"){
        window.alert("Please select the country you live in.");
        Country.focus();
        return false;
    }
    if (company.value == "")
    {
        window.alert("Please enter your company or enter 'self' if no company.");
        company.focus();
        return false;
    }
    if (FindWeb.selectedIndex == -1 || FindWeb.options[FindWeb.selectedIndex].text == "" || FindWeb.options[FindWeb.selectedIndex].text.toLowerCase() == "choose"){
        window.alert("Please tell us how you found our website.");
        FindWeb.focus();
        return false;
    }
    if (FindWeb.options[FindWeb.selectedIndex].text == "Other - Please Specify Below"){
        if (WebOther.value == ""){
            window.alert("Please describe how you found our website.");
            WebOther.focus();
            return false;
        }
    }

	var blnchecked = false;
	for (var j = 0; j < demoProgram.length; j++){
		if (demoProgram[j].checked){
			blnchecked = true;
		}
	}
	if (!blnchecked){
		window.alert("Please select a course your are most interested in OR please select the Not Interested in a demo at this time option.");
		return false;
	}
    if (securityQuestion.value != "7")
    {
        window.alert("Please answer the security question. It asks, What does 3 plus 4 equal?  Do not spell out the answer.  Just enter the number - hint, it is 7.");
        securityQuestion.focus();
        return false;
    }

	return true;
}


