//For Live URLS - wll change the Title tag for UK ONLY
if (String(document.location.href).indexOf("//www.extremepamplona.com")>0 ) {
		document.location.href = "http://www.sureformen.co.uk/";
	}
if (String(document.location.href).indexOf("//www.extremepamplona.com/?l=en-GB")>0 ) {
		document.location.href = "http://www.sureformen.co.uk/";
	}	
if ( String(document.location.href).indexOf("//www.extremepamplona.com") > 0 ) {
	document.title = "Sure for Men Extreme Pamplona";
}


//For the redirection from http://www.powerpamplona.com/ to locale-specific sites

redirectToLocalSite('en-GB', 'http://www.suresportmen.com/');
redirectToLocalSite('en-gb', 'http://www.suresportmen.com/');
redirectToLocalSite('nl-NL', 'http://www.rexona.nl/');
redirectToLocalSite('nl-nl', 'http://www.rexona.nl/');
redirectToLocalSite('ro-RO', 'http://www.powerpamplona.ro');
redirectToLocalSite('ro-ro', 'http://www.powerpamplona.ro');
redirectToLocalSite('da-DK', 'http://www.rexona.dk');
redirectToLocalSite('da-dk', 'http://www.rexona.dk');
redirectToLocalSite('hr-HR', 'http://www.powerpamplona.com');
redirectToLocalSite('hr-hr', 'http://www.powerpamplona.com');
redirectToLocalSite('de-DE', 'http://www.powerpamplona.com');
redirectToLocalSite('de-de', 'http://www.powerpamplona.com');

function redirectToLocalSite(locale, localSiteUrl) {
	//var productionUrl = 'localhost'; //uncomment for local test
	var productionUrl = 'pamplona.com'; 		// redirect only occurs on production site
	var stagingUrl = 'uat.rexonapowerpamplona.akqa.com';// and UAT

	if ((String(document.location.href).indexOf(productionUrl)>0 ) || (String(document.location.href).indexOf(stagingUrl)>0 )) {
		if(String(document.location.href).indexOf("l=" + locale)>0) {
			document.location.href = localSiteUrl;
		}
	}
}

//For UK Testing Only


if ( String(document.location.href).indexOf("//uat.rexonapowerpamplona.akqa.com") > 0 ) {
	document.title = "Sure for Men Extreme Pamplona";
}
if ( String(document.location.href).indexOf("//dev.rexonapowerpamplona.akqa.com") > 0 ) {
	document.title = "Sure for Men Extreme Pamplona";
}

// localRedirect - changes the location of the site if the local isn't correct
function localRedirect(culture) {
	

	if ( culture=="en-GB" && String(document.location.href).indexOf("//www.powerpamplona.com")>0 ) {
		document.location.href = "http://www.sureformen.co.uk/";
	}
	if ( culture!="en-GB" && String(document.location.href).indexOf("//www.extremepamplona.com")>0 ) {
		document.location.href = "http://www.powerpamplona.com/?l="+culture+"&dl=main";
	}
}

/*Event Terms and Conditions */
function openRegterms(culture) {
	if (culture == "nl-NL") {
	   window.open("http://u1.peersphere.net/unilever/controller/Legal/Rexona/Actievoorwaarden-achtervolging",'terms','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} else {
		window.open("/Registration/Terms.aspx?l=" + culture,'regterms','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	}
}

/*Privacy Policy */
function openPolicy(culture) {
	if (culture == "nl-NL") {
	   window.open("http://u1.peersphere.net/unilever/controller/Legal/Rexona/Privacyverklaring",'Privacy','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} else {
		window.open("/Privacy/Privacy.aspx?l=" + culture,'Privacy','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	}
}

/*Game Terms */
function openGameterms(culture) {
	if (culture == "nl-NL") {
	   window.open("http://u1.peersphere.net/unilever/controller/Legal/Rexona/Actievoorwaarden-gratis",'gameterms','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} else if (culture == "ro-RO") {
	   window.open("",'gameterms','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} else {
		window.open("/PrizeRegistration/Terms.aspx?l=" + culture,'gameterms','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	}
}

/* gohome */
function openGoHome(culture) {
	if (culture == "nl-NL") {
		window.open("http://actie.rexonapower.nl/",'GoHome');
	}
	if (culture == "de-DE") {
		window.open("http://www.rexonamen.de",'GoHome');
	}
	if (culture == "hr-HR") {
		window.open("http://www.rexonaformen.com.hr",'GoHome');
	}
	if (culture == "ro-RO") {
		window.open("http://www.powerpamplona.ro",'GoHome');
	}
	if (culture == "en-GB") {
		window.open("/GBProduct/sureformen.htm",'GoHome');
	}
}   

function openTeamGB(culture) {
	if (culture == "en-GB") {
		window.location="/GBPage/";
	}
	
}   

/* ContactUs */
function openContactUs(culture) {
	if (culture == "nl-NL") {
		window.open("http://u1.peersphere.net/unilever/controller/Legal/Rexona/Contact",'ContactUs','width=600,height=600,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	}
	if (culture == "en-GB") {
		window.open("/ContactUs/Default.aspx",'ContactUs','width=470,height=300,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	}
}

/*German Instructions*/
function openGameInstructions(culture) {
	if (culture == "de-DE") {
	   window.open("/Game/instructions_de-DE.htm",'gameinstructions','width=470,height=250,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} 
}

/*German Imprint*/
function openImprint(culture) {
	if (culture == "de-DE") {
	   window.open("/imprint/default.aspx",'imprint','width=470,height=250,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} 
}


/*German Event Message*/
function openEventMessage(culture) {
	if (culture == "de-DE") {
	   window.open("/Registration/event_de-DE.htm",'event','width=470,height=150,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} 
}


/*German Game Online Terms*/
function openGameOnlineTerms(culture) {
	if (culture == "de-DE") {
	   window.open("/Game/onlinegameterms_de-DE.htm",'imprint','width=470,height=350,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
	} 
}

/*German Game Contact Terms*/
function openGermanContact (culture) {
    if (culture == "de-DE") {
	   window.open("/ContactUs/contactus.aspx",'ContactUs','width=420,height=350,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
    }
}

/*German Game Contact Terms*/
function openGermanGamePopup (culture) {
    if (culture == "de-DE") {
	   window.open("/game/pop-up2_de-DE.htm",'gamepopup','width=470,height=250,menubar=0,toolbar=0,location=0,directories=0,scrollbars=1,status=0,resizable=0');
    }
}

