/*
	common.js
	Common JavaScript functions used throughout the Nikelab site-+
*/

<!--

// This parameter should be changed to match the server path for the lab instance
var globalPath = "" ;


// Get the query string parameters
// loclist -
// loclistart -
// cmdebug - if cmdebug=yes, a javascript popup display, showing when Tracking tags are called
// ref - used when the http referrer value is passed over manually via the query string
// ugo -
// dest_url -
// idtest - 

var loclist = getValue(location.search,"loclist") ;
var loclistart = getValue(location.search,"loclistart") ;
var cmdebug = getValue(location.search,"cmdebug") ;
var ugo = getValue(location.search,"ugo") ;
var dest_url = getValue(location.search,"dest_url") ;
var idtest = getValue(location.search,"idtest") ;
var tour_id = getValue(location.search,"tour_id") ;
var participant_id = getValue(location.search,"participant_id") ;
var player_id = getValue(location.search,"player_id") ;
var cm_ref = getValue(location.search,"cm_ref") ;



function scrollOff()
{
	browser = new Object();
	if(navigator.appName.indexOf("Netscape") != -1)		browser.isNetscape 	= true;
	else if(navigator.appName.indexOf("Microsoft") != -1)	browser.isMicrosoft 	= true;

	if(browser.isNetscape)
	{
		window.scrollbars.visibility = false;

	}
	else
	{
		document.body.scroll="no";
	}
}


function openNewWindow(filePath, titleText, width, height, scbar, tbar, bars, windowName, centerFlag)
	{
	var file_path 	= 	filePath;
	var title_text	= 	titleText, win_width = width, win_height = height,
				scbar = scbar, tbar = tbar, bars = bars;
				
	if( tbar == "yes" ) 	bars = "menubar=yes,toolbar=yes" ;

	var strwindow 	= 	"toolbar=" + tbar + ",width=" + win_width + ",height=" + win_height +
				",directories=no,status=no,scrollbars=" + scbar + "," + bars + ",resizable=no,top=0 ,left=0";
				
					  
	if (navigator.appName == "Microsoft Internet Explorer")
		{
		strwindow = 	"toolbar=" + tbar + ",width=" + win_width + ",height=" + win_height + 
				",directories=no,status=no,scrollbars=" + scbar + "," + bars + ",resizable=no,top=0 ,left=0";
		} 
	
	windowName = window.open( file_path, windowName, strwindow);
	windowName.focus() ;

	var win_start_x = (screen.width - win_width)/2 ;
	var win_start_y = (screen.height - win_height)/2 
	
	if(centerFlag != false)
	windowName.moveTo(win_start_x, win_start_y) ;
	}	

// A function to return queryString parameters
function getValue ( queryString, parameterName ) {
	if ( queryString.charAt( 0 ) == "?" ) queryString = queryString.substr(1);
	var query_array = queryString.split("&");
	for (var i=0; i< query_array.length; i++ ) {
		query_array[ i ] = query_array[ i ].split("=");
		if ( query_array[ i ][ 0 ] == parameterName ) {
			return query_array[ i ][ 1 ];
			break;
		}
	}
	return "";
}




<!-- Netscape Resize Fix from MacroMedia -->
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  	else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) window.location.href=window.location.href;
}
MM_reloadPage(true);

//-->
