/* Javascript Librairy */

var font_style = "../css/font_style.css";
var global_style = "../css/global_style.css";
var quotium_global = "../jscript/quotium_global.js";

/*****************************************************************************/
function display_eMail(name, subject)	{
	var subject, email;
	
	switch(name)	{
		case ("info"):
				email = "info@quotium.com";
				subject = "Demande%20informations";
				break;
		case ("usinfo"):
				email = "usinfo@quotium.com";
				subject = "Asking%20informations";
				break;
		case ("mcg-software"):
				email = "info@mcg-software.dk";
				subject = "Asking%20informations";
				break;
		case ("recrutement"):	
				email = "recrutement@quotium.com";
				break;
		case ("partenaires"):	
				email = "info@quotium.com";
				subject = "Demande%20de%20Partenariat";
				break;
		case ("support"):	
				email = "support@quotium.com";
				subject = "Demande%20informations";
				break;
		case ("newsletter"):	
				email = "info@quotium.com";
				subject = "Newsletter%20Desabonnement";
				break;
	}
	document.write("<a href=mailto:" + email + "&subject=" + subject + ">" + email + "</a>");
}
/*****************************************************************************/
function openMap(loc)	{
	var dloc, popup;
	dloc = 'map/map.php?plan=' + loc;
	popup = window.open(dloc, 'Aggrandissement_Plan', 'resizable=yes, menubar=1, width=815, height=615, screenX=150, screenY=150, top=150, left=150');
}

<!--
function printPage() {
	var pageTitle = document.getElementById("titlePrint").innerHTML;	// Define Title
	var pageZone = document.getElementById("divPrint").innerHTML;			// Define Content
	
	if ( document.getElementById("subTitlePrint") != null )	{
		var pageSubTitle = document.getElementById("subTitlePrint").innerHTML;	// Define subTitle
		var Headers = getHeadersPrint(pageTitle, pageSubTitle);
	}
	else	{
		var Headers = getHeadersPrint(pageTitle, "");
	}
	var Footers = getFootersPrint();
	
	// Open a new Window
	var frame = window.open("", "Print_Page", "width=660, height=600, toolbar=0, menubar=1, scrollbars=1, resizable=0, status=0, location=0, left=10, top=10");
	
	// Add data
	frame.document.write("" + Headers + pageZone + Footers);
	frame.document.close();
	return;
}

function getHeadersPrint(title, subTitle)	{
	var gHeaders = '';
	gHeaders += '<html>\n';
	gHeaders += '\t<head>\n';
	gHeaders += '\t\t<title>Quotium: Impression Page</title>\n';
	gHeaders += '\t\t<link rel="stylesheet" href="'+font_style+'" type="text/css" />\n';
	gHeaders += '\t\t<link rel="stylesheet" href="'+global_style+'" type="text/css" />\n';
	gHeaders += '\t\t<style>\n';
	gHeaders += '\t\t.celluleprint 	{\n';
	gHeaders += '\t\t\tpadding-top: 5px;\n';
	gHeaders += '\t\t\tpadding-right: 5px;\n';
	gHeaders += '\t\t\tpadding-left: 5px;\n';
	gHeaders += '\t\t}\n';
	gHeaders += '\t\t.h2{\n';
	gHeaders += '\t\t\tpadding-top: 5px;\n';
	gHeaders += '\t\t\tpadding-right: 5px;\n';
	gHeaders += '\t\t\tpadding-left: 5px;\n';
	gHeaders += '\t\t}\n';
	gHeaders += '\t\t</style>\n';
	gHeaders += '\t</head>\n';
	gHeaders += '\t<body bgcolor="#FFFFFF" onload="window.print();">\n'; //  window.close();
	gHeaders += '\t\t<table width="600" align="center" bgcolor="#FFFFFF" cellpadding="0" cellspacing="0">\n';
	gHeaders += '\t\t\t<tr valign="top">\n';
	gHeaders += '\t\t\t\t<td class="celluleprint">\n';
	gHeaders += '\t\t\t\t\t<table width="100%" border="0">\n';
	gHeaders += '\t\t\t\t\t\t<tr height="50px">\n';
	gHeaders += '\t\t\t\t\t\t\t<td width="40%" align="left"><img src="../images/logos/logo_print.png" alt="" /></td>\n';
	gHeaders += '\t\t\t\t\t\t\t<td width="60%" align="right"><font class="normal_20_red">' + title + '</font></td>\n';
	gHeaders += '\t\t\t\t\t\t</tr>\n';
	gHeaders += '\t\t\t\t\t\t<tr height="10px">\n';
	gHeaders += '\t\t\t\t\t\t\t<td align="center" valign="top" colspan="2"><hr /></td>\n';
	gHeaders += '\t\t\t\t\t\t</tr>\n';
	gHeaders += '\t\t\t\t\t</table>\n';
	gHeaders += '\t\t\t\t\t<font class="bold_14_black">' + subTitle + '</font><br />\n';
	return gHeaders;
}

function getFootersPrint()	{
	var gFooters = '';
	gFooters += '\t\t\t\t\t<br />\n';
	gFooters += '\t\t\t\t\t<hr />\n';
	gFooters += '\t\t\t\t\tQuotium Technologies &copy;2007 - Tous droits réservés. \n';
	gFooters += '\t\t\t\t</td>\n';
	gFooters += '\t\t\t</tr>\n';
	gFooters += '\t\t</table>\n'; 
	gFooters += '\t</body>\n';
	gFooters += '</html>';
	
	return gFooters;
}
//-->

<!--
function openPopup(fileName)	{
	var File = new Array;
	File = getDescriptionPopup(fileName);
	fileLink = File[0];
	fileTitle = File[1];
	fileDesc = File[2];
	
	var Headers = getHeadersPopup();
	var Footers = getFootersPopup(fileTitle, fileDesc);
	
	var image = '\t\t\t\t\t<img src="../images/' + fileLink + '" alt="Quotium: Aggrandissement Capture Ecran" name="imagePopup" onclick=\'window.close();\'>';
	
	// Open a new Window
	var frame = window.open("", "Popup", "width=800, height=600, resizable=1, scrollbars=1, menubar=1, toolbar=0, status=0, location=0, left=200, top=200");
	
	// Add data
	frame.document.write("" + Headers + image + Footers);
	frame.document.close();
	return;
}

function getHeadersPopup()	{
	var gHeaders = '';
	gHeaders += '<html>\n';
	gHeaders += '\t<head>\n';
	gHeaders += '\t\t<title>Popup Affichage Capture Ecran</title>\n';
	gHeaders += '\t\t<link rel="stylesheet" href="'+font_style+'" type="text/css" />\n';
	gHeaders += '\t\t<script language="JavaScript" type="text/JavaScript" src="'+quotium_global+'"></script>\n';
	gHeaders += '\t</head>\n';
	gHeaders += '\t<body bgcolor="#FFFFFF" onload=\'checkSize()\'>\n';
	gHeaders += '\t\t<table width="100%" border="0" cellspacing="0" cellpadding="0">\n';
	gHeaders += '\t\t\t<tr>\n';
	gHeaders += '\t\t\t\t<td><img src="../images/logos/logo_popup.png" alt="" /></td>\n';
	gHeaders += '\t\t\t</tr>\n';
	gHeaders += '\t\t</table>\n';
	gHeaders += '\t\t<table width="100%" align="center" cellspacing="0" cellpadding="7" border="0">\n';
	gHeaders += '\t\t\t<tr>\n';
	gHeaders += '\t\t\t\t<td align="center" valign="top" width="100%">\n';
	return gHeaders;
}

function getFootersPopup(title, desc)	{
	var gFooters = '';
	gFooters += '\t\t\t\t</td>\n';
	gFooters += '\t\t\t</tr>\n';
	gFooters += '\t\t\t<tr>\n';
	gFooters += '\t\t\t\t<td align="center" valign="middle" width="100%">\n';
	gFooters += '\t\t\t\t\t<div><h3>' + desc + '</h3></div>\n';
	gFooters += '\t\t\t\t</td>\n';
	gFooters += '\t\t\t</tr>\n';
	gFooters += '\t\t</table>\n'; 
	gFooters += '\t</body>\n';
	gFooters += '</html>';
	return gFooters;
}

/*******************************************************************************************************************************/

function getDescriptionPopup(file)	{
	var descTab = new Array;
	
	// Solutions
	descTab["itil"] = new Array("schemas/itil.png", "ITIL", "Représentation schématique de la version 3");
	
	// QTest
	descTab["LoadTestView"] = new Array("qtest/LoadTestView.png", "Vue d'un test de charge", "Ecran de suivi d'un test de charge");
	
	descTab["qtest01"] 		= new Array("schemas/qtest01.png", "schema_01", "desc schema_01");
	descTab["qtest02"] 		= new Array("schemas/qtest02.png", "schema_02", "Représentation du fonctionnement de Qtest");
	
	descTab["cpu"] 					= new Array("qtest/cpu.png", "cpu", "Moniteur Linux: Suivi de l'activité CPU");
	descTab["processes"] 		= new Array("qtest/processes.png", "processes", "Moniteur Linux: Suivi de l'activité des processus");
	descTab["Web_Modules"] 	= new Array("qtest/Web_Modules.png", "Web_Modules", "Moniteur WebSphere 6: Présentation des Web Modules");
	descTab["WebSphere_Server"] = new Array("qtest/WebSphere_Server.png", "WebSphere_Server", "Moniteur WebSphere 6: Suivi de la CPU et consomation mémoire");
	
	descTab["AnomaliesProfile"] = new Array("qtest/AnomaliesProfile.png", "AnomaliesProfile", "Paramétrage des règles de détection d'anomalies");
	descTab["anomaliesList"] 		= new Array("qtest/anomaliesList.png", "anomaliesList", "Liste des anomalies détectées");
	
	descTab["ReportDesigner"] = new Array("qtest/ReportDesigner.png", "ReportDesigner", "Création d'un modèle de rapport");
	descTab["ReportDesignerChart"] = new Array("qtest/ReportDesignerChart.png", "ReportDesignerChart", "Création d'un modèle de graphe");
	descTab["GenerateReport"] = new Array("qtest/GenerateReport.png", "GenerateReport", "Génération d'un Rapport");
	descTab["report"] 			= new Array("qtest/report.png", "report", "Exemple de rapport généré");
	
	descTab["webservice1"] = new Array("qtest/webservice1.png", "webservice1", "Création d'un scénario de test de services web");
	
	descTab["storyboard"] 	= new Array("qtest/storyboard.gif", "Storyboard", "Storyboard Qtest");
	descTab["ScriptEditor51"] 	= new Array("qtest/scripteditor.gif", "ScriptEditor", "ScriptEditor Qtest");
	descTab["Detail"] 	= new Array("qtest/Replay_Detail.gif", "Analyse des temps de reponse", "Analyse detaillee des temps de reponse");
	descTab["Synth"] 	= new Array("qtest/Replay_Synth.gif", "Vue fonctionnelle du rejeu", "Vue fonctionnelle du rejeu");

// Qap
	descTab["pet_shop"] = new Array("qap/pet_shop.png", "pet_shop", "desc pet_shop");
	descTab["dashboard"] = new Array("qap/dashboard.png", "dashboard", "desc dashboard");
	descTab["reporting_01"] = new Array("qap/reporting_01.png", "reporting_01", "desc reporting_01");
	descTab["reporting_02"] = new Array("qap/reporting_02.png", "reporting_02", "desc reporting_02");
	
	descTab["JCA_Ressources"] = new Array("qap/JCA_Ressources.png", "JCA_Ressources", "Moniteur JBOSS: Suivi des ressources JCA");
	descTab["Physical_Disk"] = new Array("qap/Physical_Disk.png", "Physical_Disk", "Moniteur Windows: Suivi des accès disques");
	
	descTab["pres"] = new Array("qap/pres.jpg", "Présentation", "Logiciel Qap");
	descTab["schema01"] = new Array("qap/schema01.jpg", "Schema 1", "Exemple de Diagramme");
	descTab["schema02"] = new Array("qap/schema02.jpg", "Schema 2", "Exemple de Courbe");
	descTab["schema03"] = new Array("qap/schema03.jpg", "Schema 3", "Exemple de Camenbert");
	
	// QMonitor
	descTab["anomaliesListQmonitor"] = new Array("qmonitor/anomaliesList.png", "anomaliesList", "Liste des anomalies détectées");
	descTab["Web_Modules_JBoss"] = new Array("qmonitor/Web_Modules.png", "Web_Modules", "Moniteur JBOSS: Présentation des Web Modules");
	descTab["System"] = new Array("qmonitor/System.png", "System", "Moniteur Windows: Informations Système");
	
	return descTab[file];
}

// Function Resize Popup
function checkSize() {
	// If image completly downloaded
	if (document.images[1].complete) {
		//Navigator Verification
		//alert("appName => " + navigator.appName);
		if ( navigator.appName == "Microsoft Internet Explorer" )	{
			var checkWidth = document.images[1].width + 140;
			var checkHeight = document.images[1].height + 100;
		}
		else if ( navigator.appName == "Opera" )	{
			var checkWidth = document.images[1].width + 40;
			var checkHeight = document.images[1].height + 165;
		}
		else {
			var checkWidth = document.images[1].width + 40;
			var checkHeight = document.images[1].height + 170;
		}
	
		var PosX = ( screen.availWidth - checkWidth ) / 2; 
		var PosY = ( screen.availHeight - checkHeight ) / 2; 
		
		window.resizeTo(checkWidth, checkHeight);
		window.moveTo(PosX,PosY);
		window.focus();
	}
	else {
		setTimeout('checkSize()',25);
	}
}
//-->


function openDemo(product)	{
	
	//var path = "http://www.quotium.fr/products/";
	//var path = "http://wi57.webindustrie.fr/quotiumfr/products/";
	var path = "../products/";
	
	if(product == "qtest")	{
		var demo_path = path + "Qtest_Video_ScriptEditor/Qtest_Video_ScriptEditor.html";
	}
	else if(product == "qap")	{
		var demo_path = path + "QAPDemo/Qap_Demo.php?product=qap&demo=demo_principale";
	}
	// Open a new Window
	var frame = window.open(demo_path, "Quotium_Demo", "width=900, height=675, resizable=1, scrollbars=1, menubar=1, toolbar=0, status=0, location=0, left=200, top=200");

	return;
}

function pprint(trux)	{
	alert(trux);
}