
//var page = "";
/*
TARGET SPECIFIC COUNTRIES ELSE US DOLLAR

EN – EU, US and UK

DE – EU and US

ES – EU and US

FR – EU and US

PT – EU and US

RU – US

home page show £ , $ etc
id="currency"

*/
function currencySymbol(CCID){

	var arrCountryCode = [];
	arrCountryCode.push({code:"GB",sym:"&pound;",cc:"GBP",nm:"pound",home:1});
	arrCountryCode.push({code:"IT",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"NL",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"IE",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"SI",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"DE",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"AT",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"CH",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"ES",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"FR",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"BE",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"LU",sym:"&euro;",cc:"EURO",nm:"euro",home:1});
	arrCountryCode.push({code:"PT",sym:"&euro;",cc:"EURO",nm:"euro",home:1});	
	arrCountryCode.push({code:"RU",sym:"$",cc:"USD",nm:"dollar",home:1});
	arrCountryCode.push({code:"FI",sym:"$",cc:"USD",nm:"dollar",home:1});
	arrCountryCode.push({code:"GR",sym:"$",cc:"USD",nm:"dollar",home:1});
	arrCountryCode.push({code:"HU",sym:"$",cc:"USD",nm:"dollar",home:1});
	arrCountryCode.push({code:"PL",sym:"$",cc:"USD",nm:"dollar",home:1});
	arrCountryCode.push({code:"RO",sym:"$",cc:"USD",nm:"dollar",home:1});
	arrCountryCode.push({code:"SE",sym:"$",cc:"USD",nm:"dollar",home:1});
	

/*

IT   Italy
NL
IE
SI
------------------
DE
AT
CH
--------
ES
-----------
FR
BE
LU
---------
PT
------
RU


*/
		
	var COUNTRY_CODE = CCID;
	var symbol = "$";
	var scode = "USD";

	var getML = window.location.href;
	getML = getML.substring(7,9);
	if(getML == "ww"){
		getML = "en";
	}

	if(page == "home"){			
		
		var strFileName = "bonus_en_dollar.png";
		var strAltTag = "$500 welcome bonus";
		var strCurrencySymbol = "$";



		strFileName = "bonus_" + getML + "_dollar.png";
		
		function findCurrency(n){
			if(n == '&pound;'){
				return "£";
			}
			else if(n == '&euro;'){
				return "€";
			}
			else{
				return "$";
			}
		}
		
		for(i = 0; i < arrCountryCode.length; i++){
			if(arrCountryCode[i].home == "1"){
				var tmpML = getML;
				if(tmpML == "en"){
					tmpML = "gb";
				}
				if(COUNTRY_CODE == arrCountryCode[i].code && COUNTRY_CODE.toLowerCase() == tmpML && tmpML != 'ru'){	
				
					strFileName = "bonus_" + getML + "_" + arrCountryCode[i].nm + ".png";
					strCurrencySymbol = findCurrency(arrCountryCode[i].sym);
					break;
				}				
				else if(COUNTRY_CODE == arrCountryCode[i].code && COUNTRY_CODE.toLowerCase() != tmpML && tmpML != 'ru'){	

					strFileName = "bonus_" + getML + "_dollar.png";
					strCurrencySymbol = findCurrency('$');
					break;
				}			
				else if(COUNTRY_CODE == 'RU' || tmpML == 'ru'){

					strFileName = "bonus_ru.png";
					strCurrencySymbol = findCurrency('$');
					break;
				}	
			}			
		}
	
		var arrAltTag = [];
		arrAltTag.push({ml:"en",alt:"$500 welcome bonus"});
		arrAltTag.push({ml:"de",alt:"500 " + strCurrencySymbol + " Begrüßungsbonus"});
		arrAltTag.push({ml:"es",alt:"Bono de bienvenida de " + strCurrencySymbol + "500"});
		arrAltTag.push({ml:"fr",alt:"500 " + strCurrencySymbol + " de bonus de bienvenue"});
		arrAltTag.push({ml:"ru",alt:"Бонус в 500 " + strCurrencySymbol + ""});
		arrAltTag.push({ml:"pt",alt:"Bônus de boas-vindas de " + strCurrencySymbol + " 500,00"});		
				
		for(i = 0; i < arrAltTag.length; i++){
			if(getML == arrAltTag[i].ml){
				strAltTag =  arrAltTag[i].alt;
			}
		}

		if(document.getElementById("home_bonus"))document.getElementById("home_bonus").innerHTML = '<a href="/news/items/100_free.html"><img alt="' + strAltTag + '" src="http://www.partycasino.com/images/home/' + strFileName + '" /></a>';
		if(document.getElementById("currency"))document.getElementById("currency").innerHTML = strCurrencySymbol;
	}	
	else{
		for(i = 0; i < arrCountryCode.length; i++){
			
			var tmpML = getML;
			if(tmpML == "en"){
				tmpML = "gb";
			}			
		
			if(COUNTRY_CODE == arrCountryCode[i].code && COUNTRY_CODE.toLowerCase() == tmpML){			
				symbol = arrCountryCode[i].sym;
				scode = arrCountryCode[i].cc;
				break;
			}
			else if(COUNTRY_CODE == arrCountryCode[i].code && COUNTRY_CODE.toLowerCase() != tmpML){			
				symbol = '$';
				scode = 'USD';
				break;
			}			
			else if(COUNTRY_CODE == 'RU' || COUNTRY_CODE.toLowerCase() == 'ru'){
				symbol = '$';
				scode = 'USD';
				break;
			}				
		}	
		var aSpan=document.getElementsByTagName('span');
		for(var i=0; i<aSpan.length; i++) {

			if(aSpan[i].className == 'currency'){
			    aSpan[i].innerHTML = symbol;
			   
			}	
			if(aSpan[i].className == 'code'){
			    aSpan[i].innerHTML = scode;
			}			
		}			
	}
}	
function getCookie(c_name){
	var CCID = "US";
	if(document.cookie.length > 0){
		c_start = document.cookie.indexOf(c_name + "=");
		if(c_start != -1){
			c_start = c_start + c_name.length + 1;
			c_end = document.cookie.indexOf(";",c_start);
			if(c_end == -1) c_end = document.cookie.length;
			CCID = unescape(document.cookie.substring(c_start,c_end));
		}
	}	
	return CCID;
}	

function insert(){
//	currencySymbol("GB");
	currencySymbol(getCookie("CCID"));
}
