/*
Loads and write the flash header without activating the security settings
*/

// Flash header Script
/******************** Event registration ********************/
if(window.attachEvent) //IE
{
	window.attachEvent("onload", _initPageFunction);
}
else if(window.addEventListener) //DOM
{
	window.addEventListener("load", _initPageFunction, false);

}

_sCurrentIntegration = "none";

function _initPageFunction()
{
	_initFlashClients();
	_setIntegration();
	_initFlashVideoEcom();
	_initPageNavigationHighlight();
	_checkoutFirstLoad();
	_checkIntegration();
}

function _initFlashClients()
{
	var flashClients = document.getElementById("oFlashClient");
}

function _initActorsFlash()
{
var fo = new FlashObject("/img/medias/cercle_acteur.swf", "oFlashActors", "430", "530", "9", "FFFFFF");
	fo.addParam("wmode", "transparent");
	fo.addParam("menu", "false");
	fo.addParam("quality", "high");
	fo.addParam("swLiveConnect", "true");
	fo.addParam("allowScriptAccess", "always");
	fo.addVariable("ecomLang", EcommercePageCulture);
	fo.write("actorsFlash"); 
}

function _initGalleryClientsFlash()
{
var fo = new FlashObject("/img/medias/galleryclient/galleryclients.swf", "oFlashClients", "560", "400", "9", "FFFFFF");
	fo.addParam("wmode", "transparent");
	fo.addParam("menu", "false");
	fo.addParam("quality", "high");
	fo.addParam("swLiveConnect", "true");
	fo.addParam("allowScriptAccess", "always");
	fo.addVariable("lang", EcommercePageCulture);
	fo.write("customersFlash"); 
}

function _initFlashVideoEcom()
{
	var fo = new FlashObject("/img/medias/ecommerce_video.swf", "oFlashEcom", "497", "205", "9", "FFFFFF");
	fo.addParam("wmode", "transparent");
	fo.addParam("menu", "false");
	fo.addParam("quality", "high");
	fo.addParam("swLiveConnect", "true");
	fo.addParam("allowScriptAccess", "always");
	fo.addVariable("theLang", EcommercePageCulture);
	fo.addVariable("kecomint", integration);
	if(document.getElementById("videoEcomFlash"))
	{
		fo.write("videoEcomFlash"); 
	}
}

function _initClient()
{
	var fo = new FlashObject("/img/medias/clients/bannerClient.swf", "oFlashClient", "600", "300", "9", "FFFFFF");
	fo.addParam("wmode", "transparent");
	fo.addParam("menu", "false");
	fo.addParam("quality", "high");
	fo.addParam("swLiveConnect", "true");
	fo.addParam("allowScriptAccess", "always");
	fo.addVariable("theLang", EcommercePageCulture);
	if(document.getElementById("clientFlashContainer"))
	{
		fo.write("clientFlashContainer"); 
	}
	/*
	if(navigator.appName == "Opera")
	{
		document.getElementById("oFlashClient").style.marginLeft = "-45px";
	}*/
}

function rolloverFlash()
{
	//alert(document.getElementById("oFlashClient").style.marginLeft);
	document.getElementById("oFlashClient").style.zIndex = "300";	
	//alert(document.getElementById("oFlashClient").style.marginLeft);
}

function rolloutFlash()
{
	document.getElementById("oFlashClient").style.zIndex = "1";
}

function _initPageNavigationHighlight()
{
	if(document.getElementById("pageDetector"))
	{
		/*var page = document.getElementById("pageDetector").innerHTML;
		var navigation = document.getElementById("mainNavigation");
		iLink = 0;
		while(iLink < navigation.getElementsByTagName("a").length)
		{
			oLink = navigation.getElementsByTagName("a")[iLink];
			sLinkHref = oLink.href;
			if(sLinkHref.indexOf(page) > -1)
			{
				oLink.style.backgroundPosition = "bottom";
			}
			iLink++;
		}*/
		
		if(document.getElementById("leftMenuAlign"))
		{
			var leftMenu = document.getElementById("leftMenuAlign");
			iLink = 0;
			while(iLink < leftMenu.getElementsByTagName("a").length)
			{
				oLink = leftMenu.getElementsByTagName("a")[iLink];
				sLinkHref = oLink.href;
				
				var pageLink = document.Form1.action;
				
				if(pageLink.indexOf("?") > -1)
				{
					pageLink = pageLink.substr(0, pageLink.indexOf("?"));
				}
				
				if(sLinkHref.indexOf(pageLink) > -1)
				{
					oLink.parentNode.parentNode.className = "selectedFeature";
				}
				iLink++;
			}
		}
	}
	

}

function pricingChangeDemand()
{
	document.getElementById("pricingDemandContent").style.display = "block";
	document.getElementById("pricingAdvancedContent").style.display = "none";
	
	document.getElementById("pricingButtonAdvanced").style.backgroundPosition = "bottom";
	document.getElementById("pricingButtonDemand").style.backgroundPosition = "top";
}

function pricingChangeAdvanced()
{
	document.getElementById("pricingAdvancedContent").style.display = "block";
	document.getElementById("pricingDemandContent").style.display = "none";
	
		document.getElementById("pricingButtonDemand").style.backgroundPosition = "bottom";
	document.getElementById("pricingButtonAdvanced").style.backgroundPosition = "top";
}

function pricingChangeCarte()
{
	document.getElementById("startingFeeContentCarte").style.display = "block";
	document.getElementById("startingFeeContentAll").style.display = "none";
	
	document.getElementById("startingFeeTabAll").style.backgroundPosition = "bottom";
	document.getElementById("startingFeeTabCarte").style.backgroundPosition = "top";
}

function pricingChangeAll()
{
	document.getElementById("startingFeeContentAll").style.display = "block";
	document.getElementById("startingFeeContentCarte").style.display = "none";
	
	document.getElementById("startingFeeTabCarte").style.backgroundPosition = "bottom";
	document.getElementById("startingFeeTabAll").style.backgroundPosition = "top";
}

function _setIntegration()
{
	var tQueryStrings = qs();
	integration = "none";
	
	if(tQueryStrings.length > 0)
	{
		for(var i = 0; i < tQueryStrings.length; i++)
		{
			if(tQueryStrings[i].indexOf("kecomint") != -1)
			{
				if(document.getElementById("ecomIntValue"))
				{
					integration = tQueryStrings[i].substr(9).toUpperCase();
					titleIntegration = document.getElementById("ecomIntValue");
					
					if(integration == "AX")
					{
						if(EcommercePageCulture == "en-US")
						{
							titleIntegration.innerHTML = "<br>Fully Integrated with Microsoft Dynamics AX";
						}
						else
						{
							titleIntegration.innerHTML = "<br>compl&egrave;tement int&eacute;gr&eacute;e avec Microsoft Dynamics AX";
						}
					}
					else if(integration == "GP")
					{
						if(EcommercePageCulture == "en-US")
						{
							titleIntegration.innerHTML = "<br>Fully Integrated with Microsoft Dynamics GP";
						}
						else
						{
							titleIntegration.innerHTML = "<br>compl&egrave;tement int&eacute;gr&eacute;e avec Microsoft Dynamics GP";
						}
					}
					else if(integration == "ACOMBA")
					{
						if(EcommercePageCulture == "en-US")
						{
							titleIntegration.innerHTML = "<br>Fully Integrated with Acomba";
						}
						else
						{
							titleIntegration.innerHTML = "<br>compl&egrave;tement int&eacute;gr&eacute;e avec Acomba";
						}
				  }
				  else if (integration == "QB") {
				    if (EcommercePageCulture == "en-US") {
				      titleIntegration.innerHTML = "<br>Fully Integrated with QuickBooks";
				    }
				    else {
				      titleIntegration.innerHTML = "<br>compl&egrave;tement int&eacute;gr&eacute;e avec QuickBooks";
				    }
				  }
				  else if (integration == "NAV") {
				    if (EcommercePageCulture == "en-US") {
				      titleIntegration.innerHTML = "<br>Fully Integrated with Microsoft Dynamics NAV";
				    }
				    else {
				      titleIntegration.innerHTML = "<br>compl&egrave;tement int&eacute;gr&eacute;e avec Microsoft Dynamics NAV";
				    }
				  }
				}
			}
		}
	}
}

function _getQS()
{
	var params = qs();
	
	if(params != "" && params.length != 1)
	{
		siteUrl = params[1].substr(8);
		
		var tLinks = document.getElementsByTagName("a");
		for(i=0; i<tLinks.length; i++)
		{
			if(tLinks[i].href.indexOf("mailto", 0) == -1 && tLinks[i].className != "linknochange")
			{
				var linkUrl = tLinks[i].href.substr(tLinks[i].href.indexOf(".com/") + 4);
				tLinks[i].href = "http://" + siteUrl + linkUrl;
			}
		}
	}
}

function qs() 
{
	var query = window.location.search.substring(1);
	var parms = query.split('&');
	return parms;
} 

function checkoutMethodStarting(clicked)
{
	if(document.getElementById("creditCardInfoStartup") && document.getElementById("creditCardInfoMonthly"))
	{
		if(clicked.id == "radCreditCard")
		{
			document.getElementById("creditCardInfoStartup").style.display = "block";
		}
		else if(clicked.id == "radCheque")
		{
			document.getElementById("creditCardInfoStartup").style.display = "none";
		}
		else if(clicked.id == "radCreditCard_copy1")
		{
			document.getElementById("creditCardInfoMonthly").style.display = "block";
		}
		else if(clicked.id == "radCheque2")
		{
			document.getElementById("creditCardInfoMonthly").style.display = "none";
		}
	}
}

function checkoutChangeCard(selected)
{
	if(document.getElementById("creditCardInfoStartup"))
	{
		if(selected.id == "lstCreditCardType")
		{
			if(selected.value == "mc")
			{
				document.getElementById("startingFeesImage").src = "/img/common/creditCardMasterCard.gif";
			}
			else if(selected.value == "visa")
			{
				document.getElementById("startingFeesImage").src = "/img/common/creditCardVisa.gif";
			}
		}
	}
	
	if(document.getElementById("creditCardInfoMonthly"))
	{	
		if(selected.id == "lstCreditCardTypeMonthly")
		{
			if(selected.value == "mc")
			{
				document.getElementById("monthlyImage").src = "/img/common/creditCardMasterCard.gif";
			}
			else if(selected.value == "visa")
			{
				document.getElementById("monthlyImage").src = "/img/common/creditCardVisa.gif";
			}
		}
	}
}

function checkoutChangepackage(myPackage)
{
	//reviewPackageImage
	if(EcommercePageCulture == "en-US")
	{
		if(document.getElementById("reviewPackageImage"))
		{
			if(myPackage.value == "radPackageBronze")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/bronze.gif";
				document.getElementById("reviewPackageImage").alt = "Bronze package";
				document.getElementById("reviewPackageImage").title = "Bronze package";
			}
			else if(myPackage.value == "radPackageSilver")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/silver.gif";
				document.getElementById("reviewPackageImage").alt = "Silver package";
				document.getElementById("reviewPackageImage").title = "Silver package";
			}
			else if(myPackage.value == "radPackageGold")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/gold.gif";
				document.getElementById("reviewPackageImage").alt = "Gold package";
				document.getElementById("reviewPackageImage").title = "Gold package";
			}
			else if(myPackage.value == "radPackagePlatinum")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/platinum.gif";
				document.getElementById("reviewPackageImage").alt = "Platinum package";
				document.getElementById("reviewPackageImage").title = "Platinum package";
			}
			
			checkoutCalculatePrice();
		}
	}
	else
	{
		if(document.getElementById("reviewPackageImage"))
		{
			if(myPackage.value == "radPackageBronze")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/bronze.gif";
				document.getElementById("reviewPackageImage").alt = "Forfait bronze";
				document.getElementById("reviewPackageImage").title = "Forfait bronze";
			}
			else if(myPackage.value == "radPackageSilver")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/silver.gif";
				document.getElementById("reviewPackageImage").alt = "Forfait argent";
				document.getElementById("reviewPackageImage").title = "Forfait argent";
			}
			else if(myPackage.value == "radPackageGold")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/gold.gif";
				document.getElementById("reviewPackageImage").alt = "Forfait or";
				document.getElementById("reviewPackageImage").title = "Forfait or";
			}
			else if(myPackage.value == "radPackagePlatinum")
			{
				document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/platinum.gif";
				document.getElementById("reviewPackageImage").alt = "Forfait platine";
				document.getElementById("reviewPackageImage").title = "Forfait platine";
			}
			checkoutCalculatePrice();
		}
	}
}

function checkoutCalculatePrice()
{
	
	var bronzebase = 100;
	var silverbase = 175;
	var goldbase = 250;
	var platinumbase = 350;
	
	var acomba = 75;
	var gp = 125;
	var ax = 200;
	var nav = 200;
	
	var standaloneStart = 0;
	var acombaStart = 2000;
	var gpStart = 7000;
	var axStart = 12000;
	var navStart = 12000;
	
	var integration = "";
	var domainName = "";
	var startupFee = 2950;
	var monthlyFee = 0;
	var selectedIntegration = "ni";
	
	/* NEW PRICING VARIABLES */
	var con_STARTUPSTANDALONE = 2950;
	var con_STARTUPNONSTANDARD = 2950;
	var con_STARTUPACOMBA = 4950;
	var con_STARTUPQUICKBOOKS = 3450;
	var con_STARTUPAX = 19950;
	var con_STARTUPNAV = 14950;
	var con_STARTUPGP = 12950;
	var con_STARTUPSAP = 12450;
	var con_STARTUPSAPDESIGN = 18950;
	var con_STARTUPACCPAC = 9950;
	var con_STARTUPCRM = 7950;
	
	var con_ACOMBABRONZE = 125;
	var con_ACOMBASILVER = 175;
	var con_ACOMBAGOLD = 250;
	var con_ACOMBAPLATINUM = 325;

	var con_NONSTANDARDABRONZE = 225;
	var con_NONSTANDARDSILVER = 325;
	var con_NONSTANDARDGOLD = 425;
	var con_NONSTANDARDPLATINUM = 525;

	var con_QUICKBOOKSBRONZE = 125;
	var con_QUICKBOOKSSILVER = 175;
	var con_QUICKBOOKSGOLD = 250;
	var con_QUICKBOOKSPLATINUM = 325;
	
	var con_STANDALONEBRONZE = 79;
	var con_STANDALONESILVER = 100;
	var con_STANDALONEGOLD = 175;
	var con_STANDALONEPLATINUM = 250;
	
	var con_GPBRONZE = 225;
	var con_GPSILVER = 325;
	var con_GPGOLD = 425;
	var con_GPPLATINUM = 525;

	var con_CRMBRONZE = 225;
	var con_CRMSILVER = 325;
	var con_CRMGOLD = 425;
	var con_CRMPLATINUM = 525;

	var con_SAPBRONZE = 225;
	var con_SAPSILVER = 325;
	var con_SAPGOLD = 425;
	var con_SAPPLATINUM = 525;

	var con_SAPDESIGNBRONZE = 350;
	var con_SAPDESIGNSILVER = 550;
	var con_SAPDESIGNGOLD = 650;
	var con_SAPDESIGNPLATINUM = 800;

	var con_ACCPACBRONZE = 225;
	var con_ACCPACSILVER = 300;
	var con_ACCPACGOLD = 375;
	var con_ACCPACPLATINUM = 475;
	
	var con_AXSILVER = 450;
	var con_AXGOLD = 550;
	var con_AXPLATINUM = 650;

	var con_NAVSILVER = 375;
	var con_NAVGOLD = 450;
	var con_NAVPLATINUM = 550;

	if(getQueryVariable('s'))
	{
		var nPricing = getQueryVariable('s');
		startupFee = h2d(nPricing);
	}
	
	

	if(document.getElementById("lstProduct"))
	{
		if(document.getElementById("lstProduct").selectedIndex == 2 || document.getElementById("lstProduct").selectedIndex == 3)
		{
			document.getElementById('radPackageBronze').disabled = true;
			if(document.getElementById('radPackageBronze').checked == true)
			{
				document.getElementById('radPackageSilver').checked = true;
			}
		}
		else
		{
			document.getElementById('radPackageBronze').disabled = false;
		}
	}
	
	if(document.getElementById("txtDomainName_txt"))
	{
		if(EcommercePageCulture == "en-US")
		{
			domainName = document.getElementById("txtDomainName_txt").value;
			
			if(domainName == "")
			{
				domainName = "None for the moment";
			}
			document.getElementById("reviewDomainName").innerHTML = domainName;
			
			
			integration = document.getElementById("lstProduct").value;
			
			
			switch (integration)
			{
				case "standalone":
					integration = "Standalone k-eCommerce";
					startupFee = con_STARTUPSTANDALONE;
					selectedIntegration = "ni";
					monthlyFee = 0;
					break;
				case "ax":
					integration = "k-eCommerce integrated with Microsoft Dynamics AX";
					startupFee = con_STARTUPAX;
					selectedIntegration = "ax";
					monthlyFee = 0;
					break;
			  case "nav":
			    integration = "k-eCommerce integrated with Microsoft Dynamics NAV";
			    startupFee = con_STARTUPNAV;
			    selectedIntegration = "nav";
			    monthlyFee = 0;
			    break;
				case "gp":
					integration = "k-eCommerce integrated with Microsoft Dynamics GP";
					startupFee = con_STARTUPGP;
					selectedIntegration = "gp";
					monthlyFee = 0;
					break;
				case "nonstandard":
					integration = "k-eCommerce with a Non-Standard Integration";
					startupFee = con_STARTUPNONSTANDARD;
					selectedIntegration = "ns";
					monthlyFee = 0;
					break;
				case "crm":
					integration = "k-eCommerce integrated with Microsoft Dynamics CRM";
					startupFee = con_STARTUPCRM;
					selectedIntegration = "crm";
					monthlyFee = 0;
					break;
				case "sapbusinessone":
					integration = "k-eCommerce integrated with SAP Business One";
					startupFee = con_STARTUPSAP;
					selectedIntegration = "sap";
					monthlyFee = 0;
					break;
				case "sapdesign":
					integration = "k-eCommerce integrated with SAP Business ByDesign";
					startupFee = con_STARTUPSAPDESIGN;
					selectedIntegration = "sapdesign";
					monthlyFee = 0;
					break;
				case "acomba":
					integration = "k-eCommerce integrated with Acomba";
					startupFee = con_STARTUPACOMBA;
					selectedIntegration = "ac";
					monthlyFee = 0;
					break;
				case "qb":
					integration = "k-eCommerce integrated with QuickBooks";
					startupFee = con_STARTUPQUICKBOOKS;
					selectedIntegration = "qb";
					monthlyFee = 0;
					break;
				case "accpac":
					integration = "k-eCommerce integrated with Sage ERP Accpac";
					startupFee = con_STARTUPACCPAC;
					selectedIntegration = "accpac";
					monthlyFee = 0;
					break;
			}
			
			document.getElementById("reviewIntegrationType").innerHTML = integration;
			document.getElementById("reviewStartingFees").innerHTML = "$"+ startupFee;
			document.getElementById("orderStartupFee").innerHTML = "$"+ startupFee;
		}
		else	
		{
			domainName = document.getElementById("txtDomainName_txt").value;
			
			if(domainName == "")
			{
				domainName = "Aucun pour l'instant";
			}
			document.getElementById("reviewDomainName").innerHTML = domainName;
			
			
			integration = document.getElementById("lstProduct").value;		
			
			
			switch (integration)
			{
				case "standalone":
					integration = "k-eCommerce sans aucune int&eacute;gration";
					startupFee = con_STARTUPSTANDALONE;
					selectedIntegration = "ni";
					monthlyFee = 0;
					break;
				case "ax":
					integration = "k-eCommerce int&eacute;gr&eacute; avec Microsoft Dynamics AX";
					startupFee = con_STARTUPAX;
					selectedIntegration = "ax";
					monthlyFee = 0;
					break;
			  case "nav":
			    integration = "k-eCommerce int&eacute;gr&eacute; avec Microsoft Dynamics NAV";
			    startupFee = con_STARTUPNAV;
			    selectedIntegration = "nav";
			    monthlyFee = 0;
			    break;
				case "gp":
					integration = "k-eCommerce int&eacute;gr&eacute; avec Microsoft Dynamics GP";
					startupFee = con_STARTUPGP;
					selectedIntegration = "gp";
					monthlyFee = 0;
					break;
				case "nonstandard":
					integration = "k-eCommerce avec une int&eacute;gration non-standard";
					startupFee = con_STARTUPNONSTANDARD;
					selectedIntegration = "ns";
					monthlyFee = 0;
					break;
				case "crm":
					integration = "k-eCommerce int&eacute;gr&eacute; avec Microsoft Dynamics CRM";
					startupFee = con_STARTUPCRM;
					selectedIntegration = "crm";
					monthlyFee = 0;
					break;
				case "sapbusinessone":
					integration = "k-eCommerce int&eacute;gr&eacute; avec SAP Business One";
					startupFee = con_STARTUPSAP;
					selectedIntegration = "sap";
					monthlyFee = 0;
					break;
				case "sapdesign":
					integration = "k-eCommerce int&eacute;gr&eacute; avec SAP Business ByDesign";
					startupFee = con_STARTUPSAPDESIGN;
					selectedIntegration = "sapdesign";
					monthlyFee = 0;
					break;
				case "acomba":
					integration = "k-eCommerce int&eacute;gr&eacute; avec Acomba";
					startupFee = con_STARTUPACOMBA;
					selectedIntegration = "ac";
					monthlyFee = 0;
					break;
				case "qb":
					integration = "k-eCommerce int&eacute;gr&eacute; avec QuickBooks";
					startupFee = con_STARTUPQUICKBOOKS;
					selectedIntegration = "qb";
					monthlyFee = 0;
					break;
				case "accpac":
					integration = "k-eCommerce int&eacute;gr&eacute; avec Sage Accpac ERP";
					startupFee = con_STARTUPACCPAC;
					selectedIntegration = "accpac";
					monthlyFee = 0;
					break;
			}
			
			document.getElementById("reviewIntegrationType").innerHTML = integration;
			document.getElementById("reviewStartingFees").innerHTML = startupFee + "$";
			document.getElementById("orderStartupFee").innerHTML = startupFee + "$";
		}


			var val = 0;
			for( i = 0; i < document.Form1.radPackage.length; i++ )
			{
				if( document.Form1.radPackage[i].checked == true )
				val = document.Form1.radPackage[i].value;
			}
			if(val == "radPackageBronze")
			{
				if(selectedIntegration == "ni")
				{
					monthlyFee = con_STANDALONEBRONZE;
				}
				if (selectedIntegration == "ns") {
					monthlyFee = con_NONSTANDARDBRONZE;
				}
				else if(selectedIntegration == "gp")
				{
					monthlyFee = con_GPBRONZE;
				}
				else if (selectedIntegration == "crm") {
					monthlyFee = con_CRMBRONZE;
				}
				else if (selectedIntegration == "sap") {
					monthlyFee = con_SAPBRONZE;
				}
				else if (selectedIntegration == "sapdesign") {
					monthlyFee = con_SAPDESIGNBRONZE;
				}
				else if(selectedIntegration == "ac")
				{
					monthlyFee = con_ACOMBABRONZE;
				}
				else if (selectedIntegration == "accpac") {
					monthlyFee = con_ACCPACBRONZE;
				}
			  else if (selectedIntegration == "qb") {
			    monthlyFee = con_QUICKBOOKSBRONZE;
			  }

				if(EcommercePageCulture == "en-US")
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/bronze.gif";
				}
				else
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/bronze.gif";
				}
			}
			else if(val == "radPackageSilver")
			{
				if(selectedIntegration == "ni")
				{
					monthlyFee = con_STANDALONESILVER;
				}
				if (selectedIntegration == "ns") {
					monthlyFee = con_NONSTANDARDSILVER;
				}
				else if(selectedIntegration == "gp")
				{
					monthlyFee = con_GPSILVER;
				}
				else if (selectedIntegration == "crm") {
					monthlyFee = con_CRMSILVER;
				}
				else if (selectedIntegration == "sap") {
					monthlyFee = con_SAPSILVER;
				}
				else if (selectedIntegration == "sapdesign") {
					monthlyFee = con_SAPDESIGNSILVER;
				}
				else if (selectedIntegration == "accpac") {
					monthlyFee = con_ACCPACSILVER;
				}
				else if(selectedIntegration == "ac")
				{
					monthlyFee = con_ACOMBASILVER;
				}
				else if(selectedIntegration == "ax")
				{
					monthlyFee = con_AXSILVER;
			  }
			  else if (selectedIntegration == "nav") {
			    monthlyFee = con_NAVSILVER;
			  }
			  else if (selectedIntegration == "qb") {
			    monthlyFee = con_QUICKBOOKSSILVER;
			  }
				
				if(EcommercePageCulture == "en-US")
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/silver.gif";
				}
				else
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/silver.gif";
				}
			}
			else if(val == "radPackageGold")
			{
				if(selectedIntegration == "ni")
				{
					monthlyFee = con_STANDALONEGOLD;
				}
				if (selectedIntegration == "ns") {
					monthlyFee = con_NONSTANDARDGOLD;
				}
				else if(selectedIntegration == "gp")
				{
					monthlyFee = con_GPGOLD;
				}
				else if (selectedIntegration == "crm") {
					monthlyFee = con_CRMGOLD;
				}
				else if (selectedIntegration == "sap") {
					monthlyFee = con_SAPGOLD;
				}
				else if (selectedIntegration == "sapdesign") {
					monthlyFee = con_SAPDESIGNGOLD;
				}
				else if (selectedIntegration == "accpac") {
					monthlyFee = con_ACCPACGOLD;
				}
				else if(selectedIntegration == "ac")
				{
					monthlyFee = con_ACOMBAGOLD;
				}
				else if(selectedIntegration == "ax")
				{
					monthlyFee = con_AXGOLD;
			  }
			  else if (selectedIntegration == "nav") {
			    monthlyFee = con_NAVGOLD;
			  }
			  else if (selectedIntegration == "qb") {
			    monthlyFee = con_QUICKBOOKSGOLD;
		  	}
				if(EcommercePageCulture == "en-US")
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/gold.gif";
				}
				else
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/gold.gif";
				}
			}
			else if(val == "radPackagePlatinum")
			{
				if(selectedIntegration == "ni")
				{
					monthlyFee = con_STANDALONEPLATINUM;
				}
				if (selectedIntegration == "ns") {
					monthlyFee = con_NONSTANDARDPLATINUM;
				}
				else if(selectedIntegration == "gp")
				{
					monthlyFee = con_GPPLATINUM;
				}
				else if (selectedIntegration == "crm") {
					monthlyFee = con_CRMPLATINUM;
				}
				else if (selectedIntegration == "sap") {
					monthlyFee = con_SAPPLATINUM;
				}
				else if (selectedIntegration == "sapdesign") {
					monthlyFee = con_SAPDESIGNPLATINUM;
				}
				else if (selectedIntegration == "accpac") {
					monthlyFee = con_ACCPACPLATINUM;
				}
				else if(selectedIntegration == "ac")
				{
					monthlyFee = con_ACOMBAPLATINUM;
				}
				else if(selectedIntegration == "ax")
				{
					monthlyFee = con_AXPLATINUM;
		    }
			  else if (selectedIntegration == "nav") {
			    monthlyFee = con_NAVPLATINUM;
			  }
		    else if (selectedIntegration == "qb") {
		      monthlyFee = con_QUICKBOOKSPLATINUM;
		    }
				
				if(EcommercePageCulture == "en-US")
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/en-us/platinum.gif";
				}
				else
				{
					document.getElementById("reviewPackageImage").src = "/img/pricingTitles/packages/fr-ca/platinum.gif";
				}
			}
			
			if(EcommercePageCulture == "en-US")
			{
				document.getElementById("reviewMonthlyFees").innerHTML = "$"+ monthlyFee;
				document.getElementById("orderMonthlyFee").innerHTML = "$"+ monthlyFee;
			}
			else
			{
				document.getElementById("reviewMonthlyFees").innerHTML = monthlyFee + "$";
				document.getElementById("orderMonthlyFee").innerHTML = monthlyFee + "$";
			}

			document.getElementById('hideStartingFees').value = startupFee;
			document.getElementById('hideMonthlyFees').value = monthlyFee;
		}
}

function _checkoutFirstLoad()
{
	checkoutCalculatePrice();
/*
	if(EcommercePageCulture == "en-US")
	{
		if(document.getElementById("reviewIntegrationType"))
		{
			document.getElementById("reviewIntegrationType").innerHTML = "Standalone k-eCommerce";
		}
		
		if(document.getElementById("reviewDomainName"))
		{
			document.getElementById("reviewDomainName").innerHTML = "None for the moment";
		}
		
		if(document.getElementById("reviewStartingFees"))
		{
			document.getElementById("reviewStartingFees").innerHTML = "$1200";
		}
		
		if(document.getElementById("reviewMonthlyFees"))
		{
			document.getElementById("reviewMonthlyFees").innerHTML = "$100";
		}
	}
	else
	{
		if(document.getElementById("reviewIntegrationType"))
		{
			document.getElementById("reviewIntegrationType").innerHTML = "k-eCommerce sans aucune intégration";
		}
		
		if(document.getElementById("reviewDomainName"))
		{
			document.getElementById("reviewDomainName").innerHTML = "Aucun pour l'instant";
		}
		
		if(document.getElementById("reviewStartingFees"))
		{
			document.getElementById("reviewStartingFees").innerHTML = "$1200";
		}
		
		if(document.getElementById("reviewMonthlyFees"))
		{
			document.getElementById("reviewMonthlyFees").innerHTML = "$100";
		}
	}
	*/
}

function uncheckMonthly()
{
	if(document.getElementById("monthlyAcomba"))
	{
		document.getElementById("monthlyAcomba").checked = false;
	/*	document.getElementById("monthlyAcombaTxt").style.fontWeight = "normal";
		document.getElementById("startingAcombaTxt").style.fontWeight = "normal";*/
	}
	
	if(document.getElementById("monthlyGP"))
	{
		document.getElementById("monthlyGP").checked = false;
		/*document.getElementById("monthlyGPTxt").style.fontWeight = "normal";
		document.getElementById("startingGPTxt").style.fontWeight = "normal";*/
	}
	
	if(document.getElementById("monthlyAX"))
	{
		document.getElementById("monthlyAX").checked = false;
	/*	document.getElementById("monthlyAXTxt").style.fontWeight = "normal";
		document.getElementById("startingAXTxt").style.fontWeight = "normal";*/
  }

  if (document.getElementById("monthlyNAV")) {
    document.getElementById("monthlyNAV").checked = false;
    /*	document.getElementById("monthlyAXTxt").style.fontWeight = "normal";
    document.getElementById("startingAXTxt").style.fontWeight = "normal";*/
  }

  if (document.getElementById("monthlyQB")) {
    document.getElementById("monthlyQB").checked = false;
    /*	document.getElementById("monthlyAXTxt").style.fontWeight = "normal";
    document.getElementById("startingAXTxt").style.fontWeight = "normal";*/
  }
	
	/*document.getElementById("monthlyBaseTxt").style.fontWeight = "normal";
	document.getElementById("startingBaseTxt").style.fontWeight = "normal";*/
}

function uncheckStarting()
{
	if(document.getElementById("startingAcomba"))
	{
		document.getElementById("startingAcomba").checked = false;
	/*	document.getElementById("monthlyAcombaTxt").style.fontWeight = "normal";
		document.getElementById("startingAcombaTxt").style.fontWeight = "normal";*/
	}
	
	if(document.getElementById("startingGP"))
	{
		document.getElementById("startingGP").checked = false;
	/*			document.getElementById("monthlyGPTxt").style.fontWeight = "normal";
		document.getElementById("startingGPTxt").style.fontWeight = "normal";*/
	}
	
	if(document.getElementById("startingAX"))
	{
		document.getElementById("startingAX").checked = false;
		/*		document.getElementById("monthlyAXTxt").style.fontWeight = "normal";
		document.getElementById("startingAXTxt").style.fontWeight = "normal";*/
	}
	
	/*document.getElementById("monthlyBaseTxt").style.fontWeight = "normal";
	document.getElementById("startingBaseTxt").style.fontWeight = "normal";*/
}

function calculatePrice()
{
	var bronzebase = 100;
	var silverbase = 175;
	var goldbase = 250;
	var platinumbase = 350;
	
	var acomba = 75;
	var gp = 125;
	var ax = 200;
	
	var baseStart = 2950;
	var acombaStart = 2000;
	var gpStart = 7000;
	var axStart = 12000;
	
	var priceMonthlyBronze = 0;
	var priceMonthlySilver = 0;
	var priceMonthlyGold = 0;
	var priceMonthlyPlatinum = 0;
	var priceStarting = 0;

	var buyProductSelected = "ni";
	var buyStartingFees = 0;
	
	if(document.getElementById("startingAcomba") && document.getElementById("startingGP") && document.getElementById("startingAX") && document.getElementById("startingPriceTotal"))
	{
		priceStarting = baseStart;
		
		priceMonthlyBronze = bronzebase;
		priceMonthlySilver = silverbase;
		priceMonthlyGold = goldbase;
		priceMonthlyPlatinum = platinumbase;
		
		if(document.getElementById("startingAcomba").checked == true)
		{
			priceStarting = baseStart + acombaStart;
			priceMonthlyBronze += acomba;
			priceMonthlySilver += acomba;
			priceMonthlyGold += acomba;
			priceMonthlyPlatinum += acomba;

			buyProductSelected = "ac";
		}
		else if(document.getElementById("startingAX").checked == true)
		{
			priceStarting = baseStart + axStart;
			if(EcommercePageCulture == "fr-CA")
			{
				priceMonthlyBronze = "N/D";
			}
			else
			{
				priceMonthlyBronze = "N/A";
			}
			priceMonthlySilver += ax;
			priceMonthlyGold += ax;
			priceMonthlyPlatinum += ax;

			buyProductSelected = "ax";
		}
		else if(document.getElementById("startingGP").checked == true)
		{
			priceStarting = baseStart + gpStart;
			priceMonthlyBronze += gp;
			priceMonthlySilver += gp;
			priceMonthlyGold += gp;
			priceMonthlyPlatinum += gp;

			buyProductSelected = "gp";
		}
		priceStarting += "";
		
		if(document.getElementById("startingAX").checked == true)
		{
			document.getElementById("monthlyPriceTotalBronze").innerHTML = priceMonthlyBronze;
		}
		else
		{
			if(EcommercePageCulture == "fr-CA")
			{
				document.getElementById("monthlyPriceTotalBronze").innerHTML = priceMonthlyBronze + ".<sup style='font-size:12px;'>00</sup>$";
			}
			else
			{
				document.getElementById("monthlyPriceTotalBronze").innerHTML = "$" + priceMonthlyBronze + ".<sup style='font-size:12px;'>00</sup>";
			}
		}
		if(EcommercePageCulture == "fr-CA")
		{
			document.getElementById("monthlyPriceTotalSilver").innerHTML = priceMonthlySilver + ".<sup style='font-size:12px;'>00</sup>$";
			document.getElementById("monthlyPriceTotalGold").innerHTML = priceMonthlyGold + ".<sup style='font-size:12px;'>00</sup>$";
			document.getElementById("monthlyPriceTotalPlatinum").innerHTML = priceMonthlyPlatinum + ".<sup style='font-size:12px;'>00</sup>$";
			if(priceStarting.length == 5)
			{
				document.getElementById("startingPriceTotal").innerHTML = priceStarting.substr(0, 2) + " " + priceStarting.substr(2) + ".<sup style='font-size:12px;'>00</sup>$";
			}
			else
			{
				document.getElementById("startingPriceTotal").innerHTML = priceStarting.substr(0, 1) + " " + priceStarting.substr(1) + ".<sup style='font-size:12px;'>00</sup>$";
			}
		}
		else
		{
			document.getElementById("monthlyPriceTotalSilver").innerHTML = "$" + priceMonthlySilver + ".<sup style='font-size:12px;'>00</sup>";
			document.getElementById("monthlyPriceTotalGold").innerHTML = "$" + priceMonthlyGold + ".<sup style='font-size:12px;'>00</sup>";
			document.getElementById("monthlyPriceTotalPlatinum").innerHTML = "$" + priceMonthlyPlatinum + ".<sup style='font-size:12px;'>00</sup>";
			if(priceStarting.length == 5)
			{
				document.getElementById("startingPriceTotal").innerHTML = "$" + priceStarting.substr(0, 2) + " " + priceStarting.substr(2) + ".<sup style='font-size:12px;'>00</sup>";
			}
			else
			{
				document.getElementById("startingPriceTotal").innerHTML = "$" + priceStarting.substr(0, 1) + " " + priceStarting.substr(1) + ".<sup style='font-size:12px;'>00</sup>";
			}
		}


		if(document.getElementById("startingAX").checked == true)
		{
			document.getElementById('lnkBuyBronzePlan').style.display = 'none';
		}
		else
		{
			document.getElementById('lnkBuyBronzePlan').style.display = '';
			
		}

		document.getElementById('lnkBuyBronzePlan').href = 'https://secure.k-ecommerce.com/checkout.aspx?ps=' + buyProductSelected + 'b';
		document.getElementById('lnkBuySilverPlan').href = 'https://secure.k-ecommerce.com/checkout.aspx?ps=' + buyProductSelected + 's';
		document.getElementById('lnkBuyGoldPlan').href = 'https://secure.k-ecommerce.com/checkout.aspx?ps=' + buyProductSelected + 'g';
		document.getElementById('lnkBuyPlatinumPlan').href = 'https://secure.k-ecommerce.com/checkout.aspx?ps=' + buyProductSelected + 'p';
		
	}
}

function pricingCheckMe(me)
{
	if(me.id.indexOf("monthly") > -1)
	{
		uncheckStarting();
		document.getElementById("starting" + me.value).checked = true;
	}
	else
	{
		uncheckMonthly();
		document.getElementById("monthly" + me.value).checked = true;
	}
	calculatePrice();
}

function h2d(h) 
{
	return parseInt(h,16);
}

function d2h(d)
{
	return d.toString(16);
}

function getQueryVariable(variable) 
{  
	var query = window.location.search.substring(1);  
	var vars = query.split("&");  

	for (var i=0;i<vars.length;i++) 
	{    
		var pair = vars[i].split("=");
		if (pair[0] == variable) 
		{      
			return pair[1];    
		}  
	} 
}

function anim(sEl)
{

	var sLnkText = "";

	if(EcommercePageCulture)
	{
		if(EcommercePageCulture == "en-US")
		{
			sLnkText = "<strong>less</strong>";
		}
		else
		{
			sLnkText = "<strong>moins</strong>";
		}	
	}

	$(document).ready(function() {	

		var sLnk = "#" + sEl;
		var sHref = "javascript:hide('" + sEl + "')";
		var oDiv = $(sLnk).attr('rel');
		
		$(sLnk).html(sLnkText);
		$(sLnk).attr("href", sHref).attr("class", "lnkLess");

		animatedcollapse.show(oDiv);

	});

}

function hide(sEl)
{

	var sLnkText = "";

	if(EcommercePageCulture)
	{
		if(EcommercePageCulture == "en-US")
		{
			sLnkText = "<strong>more</strong>";
		}
		else
		{
			sLnkText = "<strong>plus</strong>";
		}	
	}
	$(document).ready(function() {	

		var sLnk = "#" + sEl;
		var sHref = "javascript:anim('" + sEl + "')";
		var oDiv = $(sLnk).attr('rel');
		
		$(sLnk).html(sLnkText);
		$(sLnk).attr("href", sHref).attr("class", "lnkMore");

		animatedcollapse.hide(oDiv);
	});
}

function _initAnimatedDiv()
{
	animatedcollapse.addDiv('divFeaturesB2C', 'fade=1');
	animatedcollapse.addDiv('divFeaturesB2B', 'fade=1');
	animatedcollapse.addDiv('divFeaturesPrivateSales', 'fade=1');
	animatedcollapse.addDiv('divFeaturesSalesPortal', 'fade=1');
	animatedcollapse.addDiv('divFeaturesCustomerService', 'fade=1');
	animatedcollapse.addDiv('divFeaturesIntegrationAX', 'fade=1');
	animatedcollapse.addDiv('divFeaturesIntegrationGP', 'fade=1');
	animatedcollapse.addDiv('divFeaturesCustomerAccount', 'fade=1');
	animatedcollapse.addDiv('divFeaturesCatalogBrowsing', 'fade=1');
	animatedcollapse.addDiv('divFeaturesProductCatalog', 'fade=1');
	animatedcollapse.addDiv('divFeaturesCustomDesign', 'fade=1');
	animatedcollapse.addDiv('divFeaturesShoppingCart', 'fade=1');
	animatedcollapse.addDiv('divFeaturesOnlinePayments', 'fade=1');
	animatedcollapse.addDiv('divFeaturesShipping', 'fade=1');
	animatedcollapse.addDiv('divFeaturesEmarketing', 'fade=1');
	animatedcollapse.addDiv('divFeaturesSEO', 'fade=1');
	animatedcollapse.addDiv('divFeaturesLocalization', 'fade=1');
	animatedcollapse.addDiv('divFeaturesControlCenter', 'fade=1');
	animatedcollapse.addDiv('divFeaturesSynchronization', 'fade=1');
	animatedcollapse.addDiv('divFeaturesSecurePlatform', 'fade=1');
	animatedcollapse.addDiv('divFeaturesDeployment', 'fade=1');
	animatedcollapse.addDiv('divFeaturesSecurity', 'fade=1');
	animatedcollapse.addDiv('divFeaturesSaasHosting', 'fade=1');

	animatedcollapse.init();
}

/********************************************************************/

function _checkIntegration() {
  var integration = Get_Cookie("kecommerceint");
//  alert(integration);

  if (integration == null || integration == "none") {
    _sCurrentIntegration = "none";
    /*$("#menuFeatures").attr("href", "javascript:selectIntegration();");
    $("#menuPricing").attr("href", "javascript:selectIntegration();");
    $("#menuIntegration").attr("href", "javascript:selectIntegration();");*/
  }
  else if (integration == "varax") {
  _sCurrentIntegration = "varax";
    setPopupDisplay("AX");
   // $("body").attr("id", "intAx");
  /*  $("#menuFeatures").attr("href", "/featuresax.aspx");
    $("#menuPricing").attr("href", "/pricingax.aspx");
    $("#menuIntegration").attr("href", "/integrationax.aspx");*/
  }
  else if (integration == "varnav") {
    _sCurrentIntegration = "varnav";
    setPopupDisplay("NAV");
    // $("body").attr("id", "intAx");
    /*  $("#menuFeatures").attr("href", "/featuresax.aspx");
    $("#menuPricing").attr("href", "/pricingax.aspx");
    $("#menuIntegration").attr("href", "/integrationax.aspx");*/
  }
  else if (integration == "vargp") {
  _sCurrentIntegration = "vargp";
  setPopupDisplay("GP");
//  $("body").attr("id", "intGp");
 /* $("#menuFeatures").attr("href", "/featuresgp.aspx");
  $("#menuPricing").attr("href", "/pricinggp.aspx");
  $("#menuIntegration").attr("href", "/integrationgp.aspx");*/
 }
 else if (integration == "varcrm") {
 	_sCurrentIntegration = "varcrm";
 	setPopupDisplay("CRM");
 	//  $("body").attr("id", "intGp");
 	/* $("#menuFeatures").attr("href", "/featuresgp.aspx");
 	$("#menuPricing").attr("href", "/pricinggp.aspx");
 	$("#menuIntegration").attr("href", "/integrationgp.aspx");*/
 }
 else if (integration == "varb1") {
 	_sCurrentIntegration = "varb1";
 	setPopupDisplay("Sap");
 	//  $("body").attr("id", "intGp");
 	/* $("#menuFeatures").attr("href", "/featuresgp.aspx");
 	$("#menuPricing").attr("href", "/pricinggp.aspx");
 	$("#menuIntegration").attr("href", "/integrationgp.aspx");*/
 }
 else if (integration == "varsapdesign") {
 	_sCurrentIntegration = "varsapdesign";
 	setPopupDisplay("SapDesign");
 	//  $("body").attr("id", "intGp");
 	/* $("#menuFeatures").attr("href", "/featuresgp.aspx");
 	$("#menuPricing").attr("href", "/pricinggp.aspx");
 	$("#menuIntegration").attr("href", "/integrationgp.aspx");*/
 }
 else if (integration == "accpac") {
 	_sCurrentIntegration = "accpac";
 	setPopupDisplay("Accpac");
 	// $("body").attr("id", "intAx");
 	/*  $("#menuFeatures").attr("href", "/featuresax.aspx");
 	$("#menuPricing").attr("href", "/pricingax.aspx");
 	$("#menuIntegration").attr("href", "/integrationax.aspx");*/
 }
  else if (integration == "revendeur acomba") {
  _sCurrentIntegration = "revendeur acomba";
  setPopupDisplay("Acomba");
 // $("body").attr("id", "intAcomba");
 /* $("#menuFeatures").attr("href", "/featuresacomba.aspx");
  $("#menuPricing").attr("href", "/pricingacomba.aspx");
  $("#menuIntegration").attr("href", "/integrationacomba.aspx");*/
  }
  else if (integration == "varstd") {
  _sCurrentIntegration = "varstd";
  setPopupDisplay("Standalone");
//  $("body").attr("id", "intStandalone");
 /* $("#menuFeatures").attr("href", "/featuresstandalone.aspx");
  $("#menuPricing").attr("href", "/pricingstandalone.aspx");
  $("#menuIntegration").attr("href", "/integrationstandalone.aspx");*/
  }
  else if (integration == "quickbooks") {
    _sCurrentIntegration = "quickbooks";
    setPopupDisplay("Quickbooks");
    // $("body").attr("id", "intAx");
    /*  $("#menuFeatures").attr("href", "/featuresax.aspx");
    $("#menuPricing").attr("href", "/pricingax.aspx");
    $("#menuIntegration").attr("href", "/integrationax.aspx");*/
}
}

/**********************************************************/
function Get_Cookie(check_name) {
  var a_all_cookies = document.cookie.split(';');
  var a_temp_cookie = '';
  var cookie_name = '';
  var cookie_value = '';
  var b_cookie_found = false;

  for (i = 0; i < a_all_cookies.length; i++) {
    a_temp_cookie = a_all_cookies[i].split('=');

    cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

    if (cookie_name == check_name) {
      b_cookie_found = true;
      if (a_temp_cookie.length > 1) {
        cookie_value = unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g, ''));
      }
      return cookie_value;
      break;
    }
    a_temp_cookie = null;
    cookie_name = '';
  }
  if (!b_cookie_found) {
    return null;
  }
}

function Set_Cookie(name, value, expires, path, domain, secure) {
  var today = new Date();
  today.setTime(today.getTime());

  if (expires) {
    expires = expires * 1000 * 60 * 60;
  }
  var expires_date = new Date(today.getTime() + (expires));

  document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}

/*********************************************/
function setIntegrationViaPopup(integration, nextPage) {
 // Set_Cookie("kecommerceint", integration, 1000);
  window.location = nextPage;
}

function setPopupDisplay(integration) {
	var iNbIntegrations = 0;
  $("#popupIntegrationSelectedContainer").append($("#popupInt" + integration));
  $("#popupInt" + integration).css("cursor", "default");
  $("#popupInt" + integration).css("background-position", "top");
  $("#popupIntegrationSelected").css("display", "block");

  if (document.getElementById("popupIntStandalone")) {
    iNbIntegrations++;
  }

  if (document.getElementById("popupIntAX")) {
    iNbIntegrations++;
  }

  if (document.getElementById("popupIntNAV")) {
    iNbIntegrations++;
  }

  if (document.getElementById("popupIntQuickbooks")) {
    iNbIntegrations++;
  }

  if (document.getElementById("popupIntGP")) {
    iNbIntegrations++;
   }

   if (document.getElementById("popupIntSap")) {
   	iNbIntegrations++;
   }

   if (document.getElementById("popupIntSapDesign")) {
   	iNbIntegrations++;
   }

   if (document.getElementById("popupIntAccpac")) {
   	iNbIntegrations++;
   }

  if (document.getElementById("popupIntAcomba")) {
    iNbIntegrations++;
  }

  if (iNbIntegrations == 1) {
    $("#oucHeader_oucMainNavigation_lblChooseERP").css("display", "none");
  }
}

function _displayRightIntegrations(sSelected){
  if (sSelected == "features") {
    if (document.getElementById("popupIntStandalone")) {
      document.getElementById("popupIntStandalonePricing").style.display = "none";
      document.getElementById("popupIntStandaloneFeatures").style.display = "block";
      document.getElementById("popupIntStandalone").style.display = "none";
    }
    if (document.getElementById("popupIntAX")) {
      document.getElementById("popupIntAXPricing").style.display = "none";
      document.getElementById("popupIntAXFeatures").style.display = "block";
      document.getElementById("popupIntAX").style.display = "none";
    }
    if (document.getElementById("popupIntNAV")) {
      document.getElementById("popupIntNAVPricing").style.display = "none";
      document.getElementById("popupIntNAVFeatures").style.display = "block";
      document.getElementById("popupIntNAV").style.display = "none";
    }
    if (document.getElementById("popupIntGP")) {
      document.getElementById("popupIntGPPricing").style.display = "none";
      document.getElementById("popupIntGPFeatures").style.display = "block";
      document.getElementById("popupIntGP").style.display = "none";
    }
    if (document.getElementById("popupIntAcomba")) {
      document.getElementById("popupIntAcombaPricing").style.display = "none";
      document.getElementById("popupIntAcombaFeatures").style.display = "block";
      document.getElementById("popupIntAcomba").style.display = "none";
    }
  }

  if (sSelected == "pricing") {
    if (document.getElementById("popupIntStandalone")) {
      document.getElementById("popupIntStandalonePricing").style.display = "block";
      document.getElementById("popupIntStandaloneFeatures").style.display = "none";
      document.getElementById("popupIntStandalone").style.display = "none";
    }
    if (document.getElementById("popupIntAX")) {
      document.getElementById("popupIntAXPricing").style.display = "block";
      document.getElementById("popupIntAXFeatures").style.display = "none";
      document.getElementById("popupIntAX").style.display = "none";
    }
    if (document.getElementById("popupIntNAV")) {
      document.getElementById("popupIntNAVPricing").style.display = "block";
      document.getElementById("popupIntNAVFeatures").style.display = "none";
      document.getElementById("popupIntNAV").style.display = "none";
    }
    if (document.getElementById("popupIntGP")) {
      document.getElementById("popupIntGPPricing").style.display = "block";
      document.getElementById("popupIntGPFeatures").style.display = "none";
      document.getElementById("popupIntGP").style.display = "none";
    }
    if (document.getElementById("popupIntAcomba")) {
      document.getElementById("popupIntAcombaPricing").style.display = "block";
      document.getElementById("popupIntAcombaFeatures").style.display = "none";
      document.getElementById("popupIntAcomba").style.display = "none";
    }

  }

  if (sSelected == "integration") {
      if (document.getElementById("popupIntStandalone")) {
        document.getElementById("popupIntStandalonePricing").style.display = "none";
        document.getElementById("popupIntStandaloneFeatures").style.display = "none";
        document.getElementById("popupIntStandalone").style.display = "block";
      }
      if (document.getElementById("popupIntAX")) {
        document.getElementById("popupIntAXPricing").style.display = "none";
        document.getElementById("popupIntAXFeatures").style.display = "none";
        document.getElementById("popupIntAX").style.display = "block";
      }
      if (document.getElementById("popupIntNAV")) {
        document.getElementById("popupIntNAVPricing").style.display = "none";
        document.getElementById("popupIntNAVFeatures").style.display = "none";
        document.getElementById("popupIntNAV").style.display = "block";
      }
      if (document.getElementById("popupIntGP")) {
        document.getElementById("popupIntGPPricing").style.display = "none";
        document.getElementById("popupIntGPFeatures").style.display = "none";
        document.getElementById("popupIntGP").style.display = "block";
      }
      if (document.getElementById("popupIntAcomba")) {
        document.getElementById("popupIntAcombaPricing").style.display = "none";
        document.getElementById("popupIntAcombaFeatures").style.display = "none";
        document.getElementById("popupIntAcomba").style.display = "block";
      }
  }
}

function removeNavigation() {
	if ($(".supportLink")) {
		$(".supportLink").css("display", "none");
	}

	if ($(".cultureText")) {
		$(".cultureText").css("display", "none");
	}

	if($("#kecommerceLogo")){
		$("#kecommerceLogo").removeAttr("href");
	}
}


