//*****************************
// measurement function for HomePage personalization
// @param lang - lang of app, "en_US", "fr_FR", etc...
// @param diffTag - unique measurement string
//*****************************
function persMeasure(lang,diffTag,qs){
//alert(lang + " " + diffTag + " " + qs);
var eventName = "frop";
var page = "";
var refPage = "http://" + siteURL + "/" + lang + "/index.html";
var randomnumber=Math.floor(Math.random()*9999999999);
var ck = "";
ck = getCookie("sauid");
page = escape("/" + lang + "/" + diffTag + ".html");
if (qs){
page = page + "?" + qs;
}
var url= "http://stats.surfaid.ihost.com/rc/images/uc.GIF?1.20&events&"+eventName+"&http%3A//" + siteURL + page + "&" + refPage + "&&&" + ck + "&&&&&&" + randomnumber;
//alert(url);
infoImg.src = url;
}
function bioNav(path){
goLink(path);
}
function loadFullBio(id){
goLink("/" + lang + "/bios/overview/" + id + ".html");
}
function goLink(query,url){
document.location.href = query + "?promo=personalization";
}
function openRelatedContent(path){
goLink(path);
}
function openSlamTracker(courtID){
launch('score',courtID);
}
function openMatchStats(statDay,matchID,matchSuffix){
//alert("/" + lang + "/scores/stats/day" + statDay + "/" + matchID + "" + matchSuffix + ".html");
document.location.href = "/" + lang + "/scores/stats/day" + statDay + "/" + matchID + "ms.html";
}
function getCookieString(cookieName) {
var cookieValue = getCookieValue(cookieName);
if (cookieValue == false) {
return ("none");
} else {
return (cookieValue);
}
}
function minimizePers(){
document.getElementById("persFlashHolderParent").style.height = "190px";
}
function maximizePers(){
document.getElementById("persFlashHolderParent").style.height = "395px";
}
function writePersonalization(persLang){
var flashvars = {
configLoc: "/en_FR/xml/man/personalization/hmPsConfig.xml",
lang: persLang,
fullVersion: "true"
};
var params = {
menu: "false",
allowFullScreen: "false",
quality: "high",
bgcolor: "#A3C2A3",
allowScriptAccess: "sameDomain",
wmode: "opaque"
};
var attributes = {
id: "playerTracking",
name: "playerTracking"
};
swfobject.embedSWF("/rgr/flash/HPpers_RP.swf", "persFlashHolderRP", "256", "395", "9.0.0", false, flashvars, params, attributes);
document.getElementById("persFlashHolderParent").style.height = "190px";
}
if (hasReqestedFlashVersion){
writePersonalization(lang);
}
else if (lang == "en_FR"){
document.getElementById('hpMyRG').style.background = "url('/images/home/rg_pers_altBg_e.jpg')";
document.getElementById('hpMyRG').innerHTML = "<br><br><br><br><br><br><br><br><a href='/en_FR/flashupgrade.html?fl=false' class='scbWinName'>Flash 9 is necessary<br>to view my ROLAND GARROS.<br>Upgrade here.</a>";
}
else if (lang == "fr_FR"){
document.getElementById('hpMyRG').style.background = "url('/images/home/rg_pers_altBg_f.jpg')";
document.getElementById('hpMyRG').innerHTML = "<br><br><br><br><br><br><br><br><a href='/fr_FR/flashupgrade.html?fl=false' class='scbWinName'>Flash 9 est necessaire<br>pour suivre mon ROLAND GARROS.<br>Installer Macromedia Flash Player.</a>";
}
else if (lang == "es_FR"){
document.getElementById('hpMyRG').style.background = "url('/images/home/rg_pers_altBg_s.jpg')";
document.getElementById('hpMyRG').innerHTML = "<br><br><br><br><br><br><br><br><a href='/es_FR/flashupgrade.html?fl=false' class='scbWinName'>Se requiere Flash 9 para<br>mi ROLAND GARROS.<br>Actualice su Flash player.</a>";
}
//***************************************************
// accept loggin calls from flash
//***************************************************
var debug = false;
if (qsParse.get("debug") == "true"){
debug = true;
}
var log;
function flashLog(type,message){
message = unescape(message);
if (debug && log){
switch (type){
case "trace": log.trace(message); break;
case "debug": log.debug(message); break;
case "info": log.info(message); break;
case "warn": log.warn(message); break;
case "error": log.error(message); break;
case "fatal": log.fatal(message); break;
default: break;
}
}
}
function traceDebug(msg){
flashLog("debug","JS - " + msg);
}
//*******************************
// Initialize log4javascript logger
//*******************************
function startLogging(){
log = log4javascript.getLogger("mylogger");
// Create a PopUpAppender with default options
var popUpAppender = new log4javascript.PopUpAppender();
// Change the desired configuration options
//popUpAppender.setFocusPopUp(true);
//popUpAppender.setNewestMessageAtTop(true);
// Add the appender to the logger
log.addAppender(popUpAppender);
// Test the logger
log.info("HP Pers init");
window.focus();
}
if (debug){
var e = document.createElement("script");
e.src = "/rgr/js/log4javascript.js";
e.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(e);
}
