// JavaScript Document
function getPPrice(prod,curr,caff,ctyp,csep,mode)
/*
	prod : product number									- number from 0 to 5
	curr : currency												- 3 letters (EUR, USD, GBP, YEN, etc..)
	caff : show / hide currency						- 1 letter (Y, N)
	ctyp : currency type (symbol / text)	- 1 letter (S, T)
	csep : currency separation character	- character
	mode : rendering modes								- 1 digit (1: product name only, 2: price only, 3: product name & price)
*/
{
	// product order : PRE, STA, PER, OFF, PDF, WEB.
	var lProd = ["SYSTRAN Professional Premium","SYSTRAN Professional Standard","SYSTRAN Personal","SYSTRAN Office Translator","SYSTRAN PDF Translator","SYSTRAN WebTranslator"];
	var lGlob = [
								[["910.00","359.00","75.00","179.00","49.00","39.00"],"EUR","&#x0080;"],
								[["614.53","242.43","50.64","120.88","33.09","26.33"],"GBP","&#x00A3;"],
								[["899.00","299.00","69.00","179.00","59.00","29.00"],"USD","&#x0024;"],
								[["107,829.00","42,539.00","8,887.00","21,210.00","5,806.00","4,621.00"],"YEN","&#x00A5;"]
							];

	var iList = "", iExis = "", fCurr = "", fSepa = "", fOutp = "";

	if( curr && caff && ctyp )
		{
			for( var i=0; i < lGlob.length; i++ ) // loop to find the correct array to use.
				{
					if( curr == lGlob[ i ][1] )
						{ iList = i; iExis = "Y"; }
				}
			if( iExis ) // if we found a match, then proceed.
				{
					if( caff == "Y" ) // if we want to display the currency.
						{
							if( ctyp == "S" ) // in Symbol type.
								{
									fCurr = lGlob[ iList ][2];
									if( iList == "1" || iList == "2" ) // special case for currencies to be displayed before the price.
										{ fOutp = fCurr + lGlob[ iList ][0][ prod ]; }
									else
										{ fOutp = lGlob[ iList ][0][ prod ] +"&nbsp;"+ fCurr; }
								}
							else if( ctyp == "T" ) // in Textual type.
								{
									fCurr = lGlob[ iList ][1];
									fOutp = lGlob[ iList ][0][ prod ] + fCurr;
								}
						}
					else
						{ fOutp = lGlob[ iList ][0][ prod ]; }
				}
			else
				{ fOutp = "error"; }
			if( csep ) // separation character usage
				{ fSepa = "&nbsp;"+ csep +"&nbsp;"; }

			switch( mode )
				{
					case"1": fOutp = lProd[ prod ]; break;
					case"2": fOutp = fOutp; break;
					case"3": fOutp = lProd[ prod ] + fSepa + fOutp; break;
				}
		}
	else if( !curr )
		{ fOutp = lProd[ prod ]; }
	document.write( fOutp );
}

