function openWin(URL,width,height,scroll,resize, status, menubar, toolbar, location, directories) {
	noUrl = false	
	if (URL == "" || URL == null) { URL="about:blank"; noUrl=true }
	if (width == "" || width == null ) { width = 640 }
	if (height == "" || height == null ) { height = 480 }
	if (scroll == "" || scroll == null ) { scroll = 1 }
	if (resize == "" || resize == null ) { resize = 1 }
	if (status == "" || status == null ) { status = 1 }
	if (menubar == "" || menubar == null) {menubar=0}
	if (toolbar == "" || toolbar == null) {toolbar=0}
	if (location == "" || location == null) {location=0}
	if (directories == "" || directories == null) {directories=0}
	
	PARMS = 'toolbar='+toolbar +',location='+location +',directories='+directories +',status='+status +',menubar='+menubar +',scrollbars=' + scroll + ',resizable=' + resize + ',width=' + width + ',height=' + height
  var newWin = window.open(URL,"NEW",PARMS)  
  
	if (noUrl) {
		newWin.document.writeln("<BR><BR><FONT color='red'>It seems like you forgot to put in a value for URL when you called for <I>openWin()</I></FONT>")
		newWin.document.close()
	}
	return;
}

function openFullScreenWin(u) {
	var w = screen.availWidth * (100/100);
	var h = screen.availHeight * (100/100);
	var parms = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+',top=1,left=1';
	var windowname = 'fullscreenpop';
	
	window.open(u,windowname,parms);
}

/*
function fullScreenPop(popurl){
	var w = screen.availWidth * (100/100)
	var h = screen.availHeight * (100/100)
	var parms = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+',top=1,left=1'
	var windowname = 'fullscreenpop'
	
	var fSPurl = '../../../microsites/9-3S/index2.html?market=GLOBAL&language=en'
	
	window.open(popurl,windowname,parms)
}
*/

function getCleanUrl() {
	URL = document.URL
	myParamStartPos = URL.indexOf("?",0)
	if(myParamStartPos>0){
		URL = document.URL.substr(0,myParamStartPos)
		return URL
	}
	else return URL
}

function getParam(name) 
{
	var param;
	var idxStart = document.URL.indexOf('?');
	
	if (idxStart >= 0) {
		// get the query string, prepend and append & to make searching easier
		idxStart += 1;
		var url = "&"+document.URL.substring(idxStart, document.URL.length)+"&";
		
		// found the param?
		idxStart = url.indexOf("&"+name+"=");
		if (idxStart >= 0) {
			idxStart += name.length+2;
			var idxEnd = url.indexOf("&", idxStart);
			param = url.substring(idxStart, idxEnd);
		} else debug("Couldn't find param: "+name, "DEBUG");
	}
	
	debug("getParam('"+name+"') = "+param, "DEBUG");
	return param;
} // getParam(name)


function changeUrlParams(params){
	currentCleanUrl = getCleanUrl()
	newUrl = currentCleanUrl + "?" +params
	document.location = newUrl
}

function getServerInfo() {
 return document.location.host
 //alert(document.location.port)
}
//Swaps image
// LAF: this doesn't look netscape compatible, especitially with layers
function swapImage(imgName,imgSrc) {
	document.images[imgName].src=imgSrc
}


// debug level setting for displaying debug messages with the debug() function
// this can be set in any javascript file or block
var DEBUG; // 'DEBUG', 'ERROR', 'WARNING'


// debug message alerts
// uses the global variable DEBUG 
// msg = the message to display in the alert
// logLevel = only displays the msg if the current log level, or higher, is being used
// where log levels are: debug, warning, info
// if DEBUG='DEBUG' all messages are shown, i.e. debug, error, and warning messages
// if DEBUG='WARNING' only warning and error messages are shown
// if DEBUG='ERROR' only error messages are shown
function debug(msg, logLevel) {
	//if (!DEBUG) DEBUG = getParam("DEBUG");
	if (!DEBUG || (DEBUG=='')) return; // debugging is turned off
	if (!logLevel) logLevel = 'DEBUG'; // default
	if (DEBUG != 'DEBUG') {
		if ((DEBUG == 'ERROR') && (logLevel != 'ERROR')) return;
		if ((DEBUG == 'WARNING') && (logLevel == 'DEBUG')) return;
	}
	alert('Debug level: '+DEBUG+'\nMessage level: '+logLevel+'\n'+msg);
}


function TopNav()
{
document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' "+"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='700' height='50'>"+
"<param name='movie' value='flash/topnav.swf'>"+
"<param name='quality' value='high'>"+
"<embed src='flash/topnav.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='700' "+"height='50'></embed></object>")
}




function openEnhancedSpecsWithID(cpart){
        var triggerID = 0
        var ctype = ''
        for (i=0; i< mappedArray.length; i++) {
                if (cpart == mappedArray[i][0]) {
                        triggerID = mappedArray[i][1]
                        ctype = mappedArray[i][2]
                        }
        }

        cpart = triggerID
        PARMS = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=false,resizable=0,width=678,height=356';
        var url = ""
        if (ctype == "w" || ctype == "s") url = "http://www.saab.com/microsites/9-5/95.xml"
        else if(ctype=="93s") url = "93s_enhancements_container.xml"
        if(ctype!='') {
                var enhancedSpec = window.open(url +"?market="+market+"&language="+language+"&ctype=" + ctype + "&cpart=" + cpart, "Saab95", PARMS)
        }
}

function openFullScreenWin(u) {
	
	var w = screen.availWidth * (99/100);
	var h = screen.availHeight * (99/100);
	var parms = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width='+w+',height='+h+',top=1,left=1';
	var windowname = 'fullscreenpop';
	
	var newfullscreenWin = window.open(u,windowname,parms);
  
	return;
	
}