var uploading = 0
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

function quickHelp(url){
    window.open(url, 'helpWindow', 'width=300,height=300,resizable=yes,scrollbars=yes');
}

function quickCourse(url){
    window.open(url, 'courseHelp', 'width=500,height=700,resizable=yes,scrollbars=yes');
}

function popCert(url){
    window.open(url, 'certificateWindow', 'width=812,height=600,resizable=yes,scrollbars=yes');
}

function popDemo(url){
	if (url == null) url = "demo/Using%20VisiPlan%20Online%20Web%20Activities/start.html";
	window.open(url, 'faq','toolbar=no,scrollbars=no,resizable=yes,width=1024,height=740')
}

function popEmail(type){
	window.open('FlxLearn.asp?WCI=EmailForm&type=' + type, 'email','toolbar=no,scrollbars=yes,resizable=yes,width=385,height=600')
}

function popFaq(url){
	if (url == null) url = "help/faq.htm";
	window.open(url, 'faq','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=650')
}

function pop_Faq(url){
	if (url == null) url = "faq.htm";
	window.open(url, 'faq','toolbar=no,scrollbars=yes,resizable=yes,width=600,height=650')
}

function popMainHelp(url){
	if (url == null) url = "help/help.htm";
	window.open(url, 'help','toolbar=no,scrollbars=yes,resizable=yes,width=385,height=600')
}

function popTerms(url){
	if (url == null) url = "termsAndConditions.htm";
	window.open(url, 'terms','toolbar=no,scrollbars=yes,resizable=yes,width=520,height=600')
}

function popPrivacy(url){
	if (url == null) url = "privacy.htm";
	window.open(url, 'privacy','toolbar=no,scrollbars=yes,resizable=yes,width=520,height=700')
}

function popAbout(url){
	if (url == null) {
		url = "aboutProduct.htm";
		window.open(url, 'about','toolbar=no,scrollbars=yes,resizable=yes,width=520,height=600')
		}
	else
	{
		window.open(url, 'about','menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,width=520,height=600')	
	}
}

function popUpload(){
    uploading = 1
	window.open('uploading.htm', 'upload', 'width=300,height=100');
}

function popSafeToClose(){
	if (uploading==1) {
		window.open('safeToClose.htm', 'upload', 'width=300,height=100');
	}
}

function getBrowserInfo() {
	
	if (checkIt('konqueror'))
	{
		browser = "Konqueror";
		OS = "Linux";
	}
	else if (checkIt('safari')) browser = "Safari"
	else if (checkIt('omniweb')) browser = "OmniWeb"
	else if (checkIt('opera')) browser = "Opera"
	else if (checkIt('webtv')) browser = "WebTV";
	else if (checkIt('icab')) browser = "iCab"
	else if (checkIt('msie')) browser = "Internet Explorer"
	else if (!checkIt('compatible'))
	{
		browser = "Netscape Navigator"
		version = detect.charAt(8);
	}
	else browser = "An unknown browser";
	
	if (!version) version = detect.charAt(place + thestring.length);
	
	if (!OS)
	{
		if (checkIt('linux')) OS = "Linux";
		else if (checkIt('x11')) OS = "Unix";
		else if (checkIt('mac')) OS = "Mac"
		else if (checkIt('win')) OS = "Windows"
		else OS = "an unknown operating system";
	}

	if (browser != "Internet Explorer") {
		alert("This report only functions on Windows operating systems\nusing Internet Explorer 5 and above.\nTherefore, it may not function properly on this environment.\n\nYou are using " + browser + " " + version + " on " + OS + ".");
	}

	function checkIt(string) {
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}
}
