// -- Import -->
if (typeof(_scripts) == 'undefined') var _scripts = new Object();

function importJsFile(jsFile) {
	if (_scripts[jsFile] != null) return;

	var scriptElt = document.createElement('script');
	scriptElt.type = 'text/javascript';
	scriptElt.src = jsFile;
	document.getElementsByTagName('head')[0].appendChild(scriptElt);
	_scripts[jsFile] = jsFile;
}

function include(fileName) {
	document.write("<script type='text/javascript' src='"+fileName+"'></script>" );
}


// -- Google Analytics -->

importJsFile('http://www.google-analytics.com/urchin.js');

function urchinTracker1(title) {
	_uacct = 'UA-721740-4';
	if ((title == 'undefined') || (title == '')) {urchinTracker(); }
	else { urchinTracker(title); }
}


// -- Google Code for default Conversion Page -->

function GoogleConv() {
	var google_conversion_id = 1072194420;
	var google_conversion_language = "fr";
	var google_conversion_format = "1";
	var google_conversion_color = "666666";
	if (1) {
		var google_conversion_value = 1;
	}
	var google_conversion_label = "default";

	include('http://www.googleadservices.com/pagead/conversion.js');
}


// -- Achat en ligne -->

function AcheterEnLigne(num) {
	if (num != null) {
		var url = '';
		if (num == 0) {
			// Général
			urchinTracker1('/tfr/');
			url = 'http://farstone.eptimum.com/';
		} else if (num == 1) {
			// Drive Clone 2
			urchinTracker1('/tfr/DriveClone2');
			url = 'http://farstone.telechargement.fr/qte.html?REF=3879';
		} else if (num == 275) {
			// Drive Clone 3
			urchinTracker1('/tfr/DriveClone3');
			url = 'http://farstone.telechargement.fr/fiche.html?REF=655571';
		} else if (num == 3) {
			// RestoreIT 7
			urchinTracker1('/tfr/RestoreIT7');
			url = 'http://farstone.telechargement.fr/qte.html?REF=3880';
		} else if (num == 4) {
			// RestoreIT 7 Pro
			urchinTracker1('/tfr/RestoreIT7Pro');
			url = 'http://farstone.telechargement.fr/qte.html?REF=3881';
		} else if (num == 5) {
			// RestoreIT 7 Server
			urchinTracker1('/tfr/RestoreITServer');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 271) {
			// RestoreIT 8 Pro
			urchinTracker1('/tfr/RestoreIT8Pro');
			url = 'http://farstone.telechargement.fr/fiche.html?REF=652738';
		} else if (num == 7) {
			// RestoreIT 8.5 Pro
			urchinTracker1('/tfr/RestoreIT85Pro');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 201) {
			// RestoreIT Network
			urchinTracker1('/tfr/RestoreITNetwork');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 277) {
			// RestoreIT Server
			urchinTracker1('/tfr/RestoreITServer');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 10) {
			// Virtual Drive 9
			urchinTracker1('/tfr/VirtualDrive9');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 307) {
			// VirtualDrive Pro 12
			urchinTracker1('/tfr/VirtualDrive12');
			url = "pre_achat_virtualdrive12.html";			
		} else if (num == 12) {
			// Virtual Drive Burning Suite
			urchinTracker1('/tfr/VirtualDriveBurningSuite');
			url = 'http://farstone.telechargement.fr/qte.html?REF=3883';
		} else if (num == 200) {
			// Virtual Drive Network
			urchinTracker1('/tfr/VirtualDriveNetwork');
			url = 'http://switch.eptimum.com/acheter-telecharger-virtualdrive-network-280518.html';
		} else if (num == 163) {
			// Virtual Drive Tower Emulator
			urchinTracker1('/tfr/VirtualDriveTowerEmulator');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 281) {
			// Drive Clone 5
			urchinTracker1('/tfr/DriveClone5');
			url = 'http://farstone.telechargement.fr/fiche.html?REF=660323';
		} else if (num == 282) {
			// Drive Clone 5 Pro
			urchinTracker1('/tfr/DriveClone5Pro');
			url = "http://farstone.telechargement.fr/fiche.html?REF=660330";
		} else if (num == 284) {
			// Drive Clone 5 Server
			urchinTracker1('/tfr/DriveClone5Server');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 283) {
			// Drive Clone 5 Network
			urchinTracker1('/tfr/DriveClone5Network');
			url = 'http://farstone.telechargement.fr/';
		} else if (num == 297) {
			// Drive Clone 6 Express
			urchinTracker1('/buy/DriveClone6Express');
			url = 'http://farstone.eptimum.com/fiche_selection.php?cat=407&article=7249IHC';
		} else if (num == 298) {
			// Drive Clone 6 Pro
			urchinTracker1('/buy/DriveClone6Pro');
			url = "pre_achat.html";
			//url = "http://switch.eptimum.com/acheter-telecharger-driveclone-6-pro-27629G.html";
		} else if (num == 299) {
			// Drive Clone 6 Server
			urchinTracker1('/buy/DriveClone6Server');
			url = "http://switch.eptimum.com/acheter-telecharger-driveclone-6-server-277U1W.html";
		} else if (num == 300) {
			// Drive Clone 6 Enterprise
			urchinTracker1('/buy/DriveClone6Enterprise');
			url = "http://switch.eptimum.com/acheter-telecharger-driveclone-6-enterprise-server-278RWN.html";
		} else if (num == 301) {
			// Drive Clone 6 Workstation
			urchinTracker1('/buy/DriveClone6Workstation');
			url = "http://switch.eptimum.com/acheter-telecharger-driveclone-6-workstation-279HOV.html";
		} else if (num == 312) {
			// Drive Clone 7 Pro
			urchinTracker1('/buy/DriveClone7Pro');
			url="pre_achat_driveclone7pro.html";			
		}  else if (num == 313) {
			// Total Backup Recovery 7 
			urchinTracker1('/buy/TotalBackupRecovery7 ');
			url = "http://farstone.eptimum.com/index.php";
		} else if (num == 318) {
			// VirtualDrive Home 12
			urchinTracker1('/buy/VirtualDriveHome12');
			url = "http://farstone.eptimum.com/fiche_selection.php?cat=407&article=117345I4";
		} 
		
		if (url != '') {
			// document.location = url;
			window.location.replace(url);
			return true;
		}
	}
}

// -- Téléchargement -->

function Telecharger(num) {
	if (num != null) {
		var url = '';
		if (num == 0) {
			// Général
			urchinTracker1('/download/');
		} else if (num == 1) {
			// Drive Clone 2
			urchinTracker1('/download/DriveClone2');
			url='ftp://ftp.editions-profil.eu/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone.exe';
		} else if (num == 275) {
			// Drive Clone 3
			urchinTracker1('/download/DriveClone3');
			url='ftp://ftp.editions-profil.eu/Versions_Evaluation/Farstone/Windows/DriveClone/DCP3.05_French_07110816.exe';
		} else if (num == 3) {
			// RestoreIT 7
			urchinTracker1('/download/RestoreIT7');
			url = 'ftp://ftp.editions-profil.eu/Versions_Evaluation/Farstone/Windows/RestoreIT/EditionPersonnelle/RestoreIT7_perso.exe';
		} else if (num == 4) {
			// RestoreIT 7 Pro
			urchinTracker1('/download/RestoreIT7Pro');
			url = 'ftp://ftp.editions-profil.eu/Versions_Evaluation/Farstone/Windows/RestoreIT/EditionProfessionelle/RestoreIT_pro.exe';
		} else if (num == 5) {
			// RestoreIT 7 Server
			urchinTracker1('/download/RestoreIT7Server');
		} else if (num == 271) {
			// RestoreIT 8 Pro
			urchinTracker1('/download/RestoreIT8Pro');
			url = 'ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/RestoreIT/EditionProfessionelle/RestoreIT8pro.exe';
		} else if (num == 7) {
			// RestoreIT 8.5 Pro
			urchinTracker1('/download/RestoreIT85Pro');
			url = 'ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/RestoreIT/EditionProfessionelle/RestoreIT8pro.exe';
		} else if (num == 201) {
			// RestoreIT Network
			urchinTracker1('/download/RestoreITNetwork');
			url = 'ftp://ftp.editions-profil.eu/Versions_Evaluation/Farstone/Windows/RestoreIT/Network/RestoreIT_network.exe';
		} else if (num == 277) {
			// RestoreIT Server
			urchinTracker1('/download/RestoreITServer');
			url = 'ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/RestoreIT/Serveur/DCServer-3.5-10-07.exe';
		} else if (num == 10) {
			// Virtual Drive 9
			urchinTracker1('/download/VirtualDrive9');
		} else if (num == 307) {
			// VirtualDrive Pro 12
			urchinTracker1('/download/VirtualDrive12');
			url = 'ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/VirtualDrive/Standard/VirtualDrive_Pro_12.exe';
		} else if (num == 12) {
			// Virtual Drive Burning Suite
			urchinTracker1('/download/VirtualDriveBurningSuite');
		} else if (num == 200) {
			// Virtual Drive Network
			urchinTracker1('/download/VirtualDriveNetwork');
			url = 'ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/VirtualDrive/Network/VirtualDrive_network.exe';
		} else if (num == 163) {
			// Virtual Drive Tower Emulator
			urchinTracker1('/download/VirtualDriveTowerEmulator');
		} else if (num == 281) {
			// DriveClone 5
			urchinTracker1('/download/DriveClone5');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DC5.1_08062318_FR_ESD.exe';
		} else if (num == 282) {
			// DriveClone 5 Pro
			urchinTracker1('/download/DriveClone5Pro');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DCPro_5.1_08070414_Fr_oem_ESD.exe'; // DCPro_5.0_08042812_EP_Fr_ESD.exe
		} else if (num == 284) {
			// DriveClone 5 Server
			urchinTracker1('/download/DriveClone5Server');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DCServer_5.1_08070414_Fr_oem_ESD.exe'; // DCServer_5.0_08042812_Fr_EP_ESD.exe
		} else if (num == 283) {
			// DriveClone 5 Network
			urchinTracker1('/download/DriveClone5Network');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone_Network_5.0_FR.zip';
		} else if (num == 297) {
			// DriveClone 6 Express
			urchinTracker1('/download/DriveClone6Express');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone6Express_FR_09041614.exe';
		} else if (num == 298) {
			// DriveClone 6 Pro
			urchinTracker1('/download/DriveClone6Pro');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone6_Pro_FR.exe';
		} else if (num == 299) {
			// Drive Clone 6 Server
			urchinTracker1('/download/DriveClone6Server');
			url = "ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone6_Server_FR.exe";
		} else if (num == 300) {
			// Drive Clone 6 Enterprise
			urchinTracker1('/download/DriveClone6Enterprise');
			url = "ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone6_EnterpriseServer_FR.exe";
		} else if (num == 301) {
			// Drive Clone 6 Workstation
			urchinTracker1('/download/DriveClone6Workstation');
			url = "ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone6_Workstation_FR.exe";
		} else if (num == 312) {
			// DriveClone 7 Pro
			urchinTracker1('/download/DriveClone7Pro');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/DriveClone/DriveClone7/DriveClonePro7.exe';
		} else if (num == 313) {
			// Total Backup Recovery™ 7 Workstation
			urchinTracker1('/totalbackuprecovery7workstation');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/TotalBackupRecovery/TotalBackupRecovery7_Workstation.exe';
		} else if (num == 314) {
			// Total Backup Recovery™ 7 Advanced Workstation
			urchinTracker1('/download/totalbackuprecovery7advancedworkstation');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/TotalBackupRecovery/TotalBackupRecovery7_AdvancedWorkstation.exe';
		} else if (num == 315) {
			// Total Backup Recovery™ 7 Small Business Server
			urchinTracker1('/download/totalbackuprecovery7smallbusinessserver');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/TotalBackupRecovery/TotalBackupRecovery7_SmallBusinessServer.exe';
		} else if (num == 316) {
			// Total Backup Recovery™ 7 Server
			urchinTracker1('/download/totalbackuprecovery7server');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/TotalBackupRecovery/TotalBackupRecovery7_Server.exe';
		} else if (num == 317) {
			// Total Backup Recovery™ 7 Advanced Server
			urchinTracker1('/download/totalbackuprecovery7advancedserver');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/TotalBackupRecovery/TotalBackupRecovery7_AdvancedServer.exe';
		} else if (num == 318) {
			// VirtualDrive Home 12
			urchinTracker1('/download/VirtualDriveHome12');
			url='ftp://ftp.editions-profil.fr/Versions_Evaluation/Farstone/Windows/VirtualDrive/Standard/VirtualDrive_Home_12.exe';
		}

		if (url != '')
			document.location = url;
	}
}

// -- Ouverture d'une fenętre --

function OuvrirFenetre(url) {
	if (url != null) {
		param = ''; // 'toolbar=no, menubar=no, location=no, resizable=no, scrollbars=no, status=no';
		window.open(url, '', param);
	}
}


// -- Vérification d'une adresse email -->
	
	function echeck(str) 
	{
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at) == -1)
		{
		   alert("Veuillez saisir une adresse EMail valide.");
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
		{
		   alert("Veuillez saisir une adresse EMail valide.");
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
		{
		    alert("Veuillez saisir une adresse EMail valide.");
		    return false;
		}

		if (str.indexOf(at,(lat+1))!=-1)
		{
		alert("Veuillez saisir une adresse EMail valide.");
		return false;
		}

		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
		{
		alert("Veuillez saisir une adresse EMail valide.");
		return false;
		}

		if (str.indexOf(dot,(lat+2))==-1)
		{
		alert("Veuillez saisir une adresse EMail valide.");
		return false;
		}
	
		if (str.indexOf(" ")!=-1)
		{
		alert("Veuillez saisir une adresse EMail valide.");
		return false;
		}

 		return true;			
	}


// -- Verification d'un nombre -->

	function VerifNb(str, strError)
	{
		var regnb = /^\d{1,}$/;
		
		if(!regnb.test(str))
  		{
   			alert(strError);
			return false;
  		}

     		return true;
	}


function survolImg(id,etat,lien){
	src = "images/ban_DC7/bt_" + id;
	if (etat == 0){
		src += "_on";
		if (id != 0) {
			document.getElementById("ban_DC7").src = "images/ban_DC7/ban_farstone_" + id + ".jpg";
			document.getElementById("lien_DC7").href = lien;
		}
	}
	src += ".png";
	document.getElementById("bt_"+id).src = src;
}
