
function getPartnerTemplateCode(){
//variables
var domain = 'http://www.realarcade.com/partner/template/paradecl2_/';
var page = 'onlineMain';
var gameOverID = '';
var gameOverType = '';
var gameOverY = '';
var gpOver = '';
var gpOverY = '';
var firstParamSet = false;
var pageSet = false;
var userOS = navigator.appVersion;
//OS check
if (userOS.indexOf("Win")==-1) {
page = 'onlineMac';
pageSet = true;
}
//sets frame visible if not already
document.getElementById("gamesFrame").style.display = "inline";
//page generation
if(window.location.href.indexOf('ra.mygames=true')!=-1 && !pageSet) {
page = "myGames"
}
if(window.location.href.indexOf('ra.page=')!=-1 && !pageSet) {
page = window.location.href.substr(window.location.href.indexOf('ra.page='));
page = page.substring(page.indexOf('=')+1, page.indexOf(';'));
firstParamSet = page.indexOf('?')!=-1?true:false;
}
if(window.location.href.indexOf('ra.gameoverid=')!=-1 && !pageSet) {
gameOverID = window.location.href.substr(window.location.href.indexOf('ra.gameoverid='));
gameOverID = "gameid=" + gameOverID.substring(gameOverID.indexOf('=')+1, gameOverID.indexOf(';'));
gameOverID = firstParamSet?"&"+gameOverID:"?"+gameOverID;
firstParamSet = true;
}
if(window.location.href.indexOf('ra.gameovertype=')!=-1 && !pageSet) {
gameOverType = window.location.href.substr(window.location.href.indexOf('ra.gameovertype='));
gameOverType = "gametype=" + gameOverType.substring(gameOverType.indexOf('=')+1, gameOverType.indexOf(';'));
gameOverType = firstParamSet?"&"+gameOverType:"?"+gameOverType;
firstParamSet = true;
}
if(window.location.href.indexOf('ra.gameovery=')!=-1 && !pageSet) {
gameOverY = window.location.href.substr(window.location.href.indexOf('ra.gameovery='));
gameOverY = "goyoff=" + gameOverY.substring(gameOverY.indexOf('=')+1, gameOverY.indexOf(';'));
gameOverY = firstParamSet?"&"+gameOverY:"?"+gameOverY;
firstParamSet = true;
}
if(window.location.href.indexOf('ra.gpover=true')!=-1 && !pageSet) {
gpOver = "gpover=true";
gpOver = firstParamSet?"&"+gpOver:"?"+gpOver;
firstParamSet = true;
}
if(window.location.href.indexOf('ra.gpovery=')!=-1 && !pageSet) {
gpOverY = window.location.href.substr(window.location.href.indexOf('ra.gpovery='));
gpOverY = "gpyoff=" + gpOverY.substring(gpOverY.indexOf('=')+1, gpOverY.indexOf(';'));
gpOverY = firstParamSet?"&"+gpOverY:"?"+gpOverY;
firstParamSet = true;
}
document.getElementById("gamesFrame").src = domain+page+gameOverID+gameOverType+gameOverY+gpOver+gpOverY;
}