//***************************************************************************
// BROWSER CHECK
var g_strBrowType;
var g_blnIsMac;
var g_strColl = "";
var g_strStyleObj = "";
var visOn = "";
var visOff = "";

var g_blnIsMac = (navigator.platform.indexOf("Mac")!=-1);

//if not 4.0 or above browser, send alert, else set browser type to Netscape or IE
if (parseInt(navigator.appVersion) < 4)
	var oldBrowser = true
else {	
	isNS4 = (document.layers) ? true : false;
	isIE4 = (document.all && !document.getElementById) ? true : false;
	isIE5 = (document.all && document.getElementById) ? true : false;
	isNS6 = (!document.all && document.getElementById) ? true : false;

	if (isNS4) {
		g_strBrowType = "net";
		visOn = "show";
		visOff = "hide";
	//} else if ((navigator.appName.indexOf("Explorer") != -1) || (g_blnIsMac && (navigator.appName.indexOf("Netscape") != -1) && (parseInt(navigator.appVersion) == 6))) {
	} else if (isIE4 || isIE5) {
		g_strBrowType = "ie";
		g_strColl = "all.";
		g_strStyleObj = ".style";
		visOn = "visible";
		visOff = "hidden";
	} else if (isNS6) {
		g_strBrowType = "ns6";
		g_strStyleObj = ".style";
		visOn = "visible";
		visOff = "hidden";
	}
}
//***************************************************************************


//***************************************************************************
// NS window resize bug
if (g_strBrowType == "net" || g_strBrowType == "ns6") {
	window.captureEvents(Event.Resize);
	window.onresize = reLoad;
	window.releaseEvents(Event.Resize);
}

origWidth = window.innerWidth;
origHeight = window.innerHeight;

function reLoad() {
	if (window.innerWidth != origWidth || window.innerHeight != origHeight) 
		location.reload();
}
//***************************************************************************

//***************************************************************************
// International Site Navigation
var internationalSites = new Array()
	internationalSites["it"] = "http://www.pgsoft.it"

var newURL = "";
	
function goInternational(country) {
	if (country != "") {
		if (g_strBrowType == "ns6" && navigator.userAgent.indexOf("6.0") != -1) {
			if (country == "it") newURL = "http://www.pgsoft.it";
		} else {
			newURL = internationalSites[country]
		}
		window.location.href = newURL;
	}
}
//***************************************************************************

//***************************************************************************
// Find Training Information
function goFind(courseType) {
	var formName = courseType + "Form";
	var productName = "";
	var theForm = findForm(document, formName, 0);
	if (theForm.product) {
		var productIndex = theForm.product.options.selectedIndex;
		productName = theForm.product.options[productIndex].value;
		productName = productName + "_";
	};
	var regionIndex = theForm.region.options.selectedIndex;
	var regionName = theForm.region.options[regionIndex].value;
	window.location.href = "/services/" + courseType + "/" + productName + regionName + ".html";
}

// Identify form
function findForm(doc, name, j) {
    var theForm = false;
    if (doc.forms) {
        theForm = doc.forms[name];
    }
    if (theForm) {
        return theForm;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theForm = findForm(doc.layers[j].document, name, 0);
            if (theForm) {
                return (theForm);
            }
        }
    }
    return (false);
}
//***************************************************************************


//***************************************************************************
// Open Download Window	
function startDownload(application) {
	window.open(application + ".html", application)
}
//***************************************************************************

//***************************************************************************
// Preload rollover images

	rollOver1 = new Image()
	rollOver1.src = "imgsite/btn_products_ON.gif"
	
	rollOver2 = new Image()
	rollOver2.src = "imgsite/btn_downloads_ON.gif"
	
	rollOver3 = new Image()
	rollOver3.src = "imgsite/btn_services_ON.gif"
	
	rollOver4 = new Image()
	rollOver4.src = "/images/nav/btn_support_ON.gif"
	
	rollOver5 = new Image()
	rollOver5.src = "imgsite/btn_partners_ON.gif"
	
	rollOver6 = new Image()
	rollOver6.src = "imgsite/btn_news_ON.gif"
	
	rollOver7 = new Image()
	rollOver7.src = "imgsite/btn_company_ON.gif"
	
	rollOver8 = new Image()
	rollOver8.src = "/images/nav/btn_community_ON.gif"	
	
//***************************************************************************

//***************************************************************************
// Open Product Tour Popup Window for Flash Tour

function popup(URL,name,w,h) {
	var featureStr = "";
	featureStr = "width=" + w + ",height=" + h + ",directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no"
	var newWin = window.open(URL,name,featureStr);
}

//***************************************************************************

//***************************************************************************
// Open Downloads Popup Window
function makeNewWindowLogin(URL) {
	var featureStr = "";
	featureStr = "width=600,height=440,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,status=yes";
	var name = "newWindow";
	var newWin = window.open(URL,name,featureStr);
}
//***************************************************************************

