/**
 * This code was originally created by http://www.qloud.com/. Some of the code might have been added or changed.
 * You can view the original source here: http://www.qloud.com/js/Config.js
 */

// Options: "development", "production"
var serverEnvironment = "production";

//var serverEnvironment = "production";

function Config()
{
}
Config.detectSystemData=function()
{
	var usrAg=navigator.userAgent.toLowerCase();
	//get browser name
	if(usrAg.indexOf("msie")!=-1)
	{
		Config.browserName="msie";
		Config.browserVersion=parseInt(usrAg.substr(usrAg.indexOf("msie")+5,1));
	}
	else if(usrAg.indexOf("firefox")!=-1)
	{
		Config.browserName="firefox";
	}
	else if(usrAg.indexOf("safari")!=-1)
	{
		Config.browserName="safari";
	}
	else if(usrAg.indexOf("opera")!=-1)
	{
		Config.browserName="opera";
	}
	//get platform
	if(usrAg.indexOf("linux")!=-1)
	{
		Config.platform="linux";
	}
	else if(usrAg.indexOf("win")!=-1&&usrAg.indexOf("darwin")==-1)
	{
		Config.platform="windows";
	}
	else if(usrAg.indexOf("mac")!=-1)
	{
		Config.platform="mac";
	}
	
	//get the plugin that is used for playing the tracks
	if(Config.platform=="windows" || Config.platform=="mac")
	{
		
		if(Config.platform=="mac")
		{
			for(var i=0; i<navigator.plugins.length;i++)
			{				
				if(navigator.plugins[i].name.toLowerCase().indexOf("windows media")!=-1 || navigator.plugins[i].name.toLowerCase().indexOf("windowsmedia")!=-1)
				{
					Config.plugin="windows media player";
					break;
				}
			}
		}
		else
		{
			Config.plugin="windows media player";
		}
	}
	else
	{
		for(var i=0; i<navigator.plugins.length;i++)
		{
			if(navigator.plugins[i].name.toLowerCase().indexOf("real player")!=-1 || navigator.plugins[i].name.toLowerCase().indexOf("realplayer")!=-1)
			{
				Config.plugin="real player";
				break;
			}
		}
	}
}

if( serverEnvironment == "production" ){
	Config.server = "www.finetune.com";
	Config.baseURL = "http://www.finetune.com/as/";
} else {
	Config.server = "testlb.finetune.com";
	Config.baseURL = "http://testlb.finetune.com/as/";
}

Config.newbiePage = "index.php";
Config.mainPage = "index2.html"; 

// variables which are erased from the environment on every page load
Config.volatileVariables = new Array();
Config.validSearchConditions = new Array();	
Config.browserName="mozilla";
Config.platform="";
Config.plugin="none";
Config.detectSystemData();

Config.debug = 0;


