// JavaScript Document //Support Email var support_email="lucentisdirect-d@gene.com"; var path=""; //Targets function setTarget() { //Strings var action; var hostname; //hostname string var environment; //dev, qa, ua, cdm, local --- default is prod var target; //This is the target in the login form var action; //this is the login form action url var logoutTarget; //target for logout button var iFrameSrc; //iFrame source var forgotPassword; var forgotUserName; //Pull Host Name from URL: from info I received the four host names should be: //lucentisdirect-dev.gene.com <--DEV //lucentisdirect-qa.gene.com <--QA //lucentisdirect-ua.gene.com <--UA //lucentisdirect.gene.com <--PROD hostname = window.location.hostname; //alert(hostname); //Search Host String for environment tags if (hostname.search(/dev/) >= 0) { environment = "dev"; } if (hostname.search(/qa/) >= 0) { environment = "qa"; } if (hostname.search(/ua/) >= 0) { environment = "ua"; } if (hostname.search(/cdm/) >= 0) { environment = "cdm"; } if (hostname.search(/cdmiwlwin10/) >= 0) { environment = "cdmiwlwin10"; } if (hostname.search(/local/) >= 0) { environment = "local"; } if(remoteHost=='10.1.19.27'){ environment = "remotecdmi"; } //Set target and action based on environment switch(environment) { case 'dev': target = "https://b2bdev.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://lucentisdirect-dev.gene.com:20122/LucentisDirect/orderOnlineLI.html"; action = "https://b2bdev.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bdev.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://lucentisdirect-dev.gene.com:20122/LucentisDirect/"; iFrameSrc = "https://b2bdev.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT0000000FkBr%26portalId=060700000000wOK "; forgotPassword = "https://b2bdev.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bdev.gene.com/siteminderagent/forms/forgotUserName.html"; break; case 'qa': target= "https://b2bqa.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://lucentisdirect-qa.gene.com/LucentisDirect/orderOnlineLI.html"; action = "https://b2bqa.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bqa.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://lucentisdirect-qa.gene.com/LucentisDirect/"; iFrameSrc = "https://b2bqa.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://cs1.salesforce.com/secur/login_portal.jsp?orgId=00DS00000007qqG%26portalId=060700000000wOK"; forgotPassword = "https://b2bqa.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bqa.gene.com/siteminderagent/forms/forgotUserName.html"; path="http://lucentisdirect-qa.gene.com/media/"; break; case 'ua': target= "https://b2bua.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://lucentisdirect-ua.gene.com/LucentisDirect/orderOnlineLI.html"; action = "https://b2bua.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bua.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://lucentisdirect-ua.gene.com/LucentisDirect/"; iFrameSrc = "https://b2bua.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT0000000KtVg%26portalId=060700000000wOK"; forgotPassword = "https://b2bua.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bua.gene.com/siteminderagent/forms/forgotUserName.html"; path="http://lucentisdirect-ua.gene.com/media/"; break; case 'cdm': target = "https://b2bqa.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://cdmdigiweb:8080/lucentis/orderOnlineLI.html"; action = "https://b2bqa.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bqa.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://cdmdigiweb:8080/lucentis/"; iFrameSrc = "https://b2bqa.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT00000000qJ9&portalId=060700000000wOK"; forgotPassword = "https://b2bqa.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bqa.gene.com/siteminderagent/forms/forgotUserName.html"; break; case 'cdmiwlwin10': target = "https://b2bqa.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://cdmiwlwin10/LucentisDirect/orderOnlineLI.html"; action = "https://b2bqa.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bqa.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://cdmiwlwin10/LucentisDirect/"; iFrameSrc = "https://b2bqa.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT00000000qJ9&portalId=060700000000wOK"; forgotPassword = "https://b2bqa.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bqa.gene.com/siteminderagent/forms/forgotUserName.html"; path="http://cdmiwlwin10:8000/LucentisDirect/"; break; case 'remotecdmi': target = "https://b2bqa.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://cdmiwlwin10/LucentisDirect/orderOnlineLI.html"; action = "https://b2bqa.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bqa.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://cdmiwlwin10/LucentisDirect/"; iFrameSrc = "https://b2bqa.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT00000000qJ9&portalId=060700000000wOK"; forgotPassword = "https://b2bqa.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bqa.gene.com/siteminderagent/forms/forgotUserName.html"; path="http://cdmiwlwin10.thecdmgroup.com/LucentisDirect/"; break; case 'local': target = "https://b2bqa.gene.com/lwo/reflector.jsp?FINAL_TARGET=http://localhost/orderOnlineLI.html"; action = "https://b2bqa.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2bqa.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://localhost/ "; iFrameSrc = "https://b2bqa.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://tapp0.salesforce.com/secur/login_portal.jsp?orgId=00DT00000000qJ9&portalId=060700000000wOK"; forgotPassword = "https://b2bqa.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2bqa.gene.com/siteminderagent/forms/forgotUserName.html"; path="http://localhost/LucentisDirect/"; break; default: target="https://b2b.gene.com/cportal/reflector.jsp?FINAL_TARGET=http://www.lucentisdirect.com/LucentisDirect/orderOnlineLI.html"; action = "https://b2b.gene.com/siteminderagent/forms/login_cportal.fcc"; logoutTarget="https://b2b.gene.com/siteminderagent/forms/logoff.fcc?TARGET=http://www.lucentisdirect.com/LucentisDirect/"; iFrameSrc = "https://b2b.gene.com/idp/startSSO.ping?PartnerSpId=gene.com&TargetResource=https://na5.salesforce.com/secur/login_portal.jsp?orgId=00D70000000Irda%26portalId=060700000000wOK"; forgotPassword = "https://b2b.gene.com/idm/ext/anonProcessLaunch.jsp?newView=true&id=GNE_WF_External_ForgotMyPassword"; forgotUserName = "https://b2b.gene.com/siteminderagent/forms/forgotUserName.html"; path="http://lucentisdirect.com/media/"; break; } //Get target and form elements by id and set the appropriate urls if (document.getElementById("login_target") != null) { document.getElementById("login_target").value = target; } if (document.getElementById("Login") != null) { document.getElementById("Login").action = action; } if (document.getElementById("logoutTarget") != null) { document.getElementById("logoutTarget").href = logoutTarget; } if (document.getElementById("iframe") != null) { document.getElementById("iframe").src = iFrameSrc; } if (document.getElementById("forgotUserName") != null) { document.getElementById("forgotUserName").href = forgotUserName; } if (document.getElementById("forgotPassword") != null) { document.getElementById("forgotPassword").href = forgotPassword; } } window.onload = init; function init() { setTarget(); setSupportEmail(); } function setPath() { //Strings var action; var hostname; //hostname string var environment; //dev, qa, ua, cdm, local --- default is prod var target; //This is the target in the login form var action; //this is the login form action url var logoutTarget; //target for logout button var iFrameSrc; //iFrame source var forgotPassword; var forgotUserName; //Pull Host Name from URL: from info I received the four host names should be: //lucentisdirect-dev.gene.com <--DEV //lucentisdirect-qa.gene.com <--QA //lucentisdirect-ua.gene.com <--UA //lucentisdirect.gene.com <--PROD hostname = window.location.hostname; //alert(hostname); //Search Host String for environment tags if (hostname.search(/dev/) >= 0) { environment = "dev"; } if (hostname.search(/qa/) >= 0) { environment = "qa"; } if (hostname.search(/ua/) >= 0) { environment = "ua"; } if (hostname.search(/cdm/) >= 0) { environment = "cdm"; } if (hostname.search(/cdmiwlwin10/) >= 0) { environment = "cdmiwlwin10"; } if(remoteHost=='10.1.19.27'){ environment = "remotecdmi"; } if (hostname.search(/local/) >= 0) { environment = "local"; } //Set target and action based on environment switch(environment) { case 'dev': break; case 'qa': path="http://lucentisdirect-qa.gene.com/media/"; break; case 'ua': path="http://lucentisdirect-ua.gene.com/media/"; break; case 'cdm': break; case 'cdmiwlwin10': path="http://cdmiwlwin10:8000/LucentisDirect/"; //path=""; break; case 'remotecdmi': path="http://cdmiwlwin10.thecdmgroup.com/LucentisDirect/"; //path=""; break; case 'local': path="http://localhost:8080/LucentisDirect/"; break; default: path="http://lucentisdirect.com/media/"; break; } //alert(path); } function setSupportEmail() { if (!document.getElementById("support_email") == false) { document.getElementById("support_email").value= support_email; } } setPath();