/** Version : 1.2 * Last modified : (K. Breynck) 02.03.2004 * Author : BBDO InterOne Hamburg (W. Rauch) * Copyright : BMW Group 2002-2004 * * Unique scripting solutions that are provided for BMW Group sites are for use exclusively * within BMW Group projects. No other use of these solutions is permitted. * **/ var actualFramesetPath; var contentFrameSource; var framesetPage = "index.jsp"; //Name of the Frameset-Page(s) var initContentURL; var allowedDomain = new Array(); allowedDomain[0] = "://www.mini."; allowedDomain[1] = "://projects"; allowedDomain[3] = "://ecom.bmwgroup."; allowedDomain[4] = "://localhost"; allowedDomain[5] = "://172.23.56.123"; allowedDomain[6] = "://webi.muc"; var domainIsAllowed; function checkForFrameset(indexDistanceIndicator) { var myPath = self.location.href.split("?")[0]; var myName = myPath; var newLocation =""; if(!(parent.frames.length > 2)) { if(!isNaN(parseInt(indexDistanceIndicator))) { // Use the indexDistanceIndicator to locate the nearest higher-level frameset for (i=0; i <= parseInt(indexDistanceIndicator); i++) { myPath = myPath.substr(0,myPath.lastIndexOf("/")); } myPath += "/"; myName = myName.substring(myPath.length, myName.length); newLocation = myPath + framesetPage + "?content=" + myName + escape(self.location.search); } else { // Extract the filename and append it to the frameset page in that folder myName = myName.substr(myName.lastIndexOf("/")+1,myName.length); myPath = self.location.href.split("?")[0]; myPath = myPath.substr(0,myPath.lastIndexOf("/")+1); newLocation = myPath + framesetPage + "?content=" + myName + escape(self.location.search); } self.location.href = newLocation; } } function checkNscForFrameset(framesetPath) { var tempUrl = self.location.href.split("://")[0] + "://"; tempUrl += escape(self.location.href.substr(tempUrl.length,self.location.href.length)); if(!(parent.frames.length > 2)) { top.location.href = framesetPath + '?content=' + tempUrl; } } function getFramesetPath() { var tempSubstr; if(location.host) { // server tempSubstr = location.href.substr(location.href.split("?")[0].substr(0,(location.href.split("?")[0].lastIndexOf(location.host) + location.host.length)).length, location.href.length); tempSubstr = tempSubstr.split("?")[0].substr(0,(tempSubstr.split("?")[0].lastIndexOf("/")+1)); } else { // local tempSubstr = location.href.split("?")[0]; tempSubstr = tempSubstr.substr(0,(tempSubstr.lastIndexOf("/")+1)); } return tempSubstr; } function pageHandler() { actualFramesetPath = ((contentFramePath.indexOf("://") != -1) ? "" : getFramesetPath()); contentFramePath = ((contentFramePath.indexOf(location.host) != -1) ? contentFramePath.split(top.location.host)[1] : contentFramePath); contentFrameParam = (((!location.query.content) && (location.search != "")) ? location.search : contentFrameParam); contentFramePath = (((contentFramePath.indexOf("://") != -1)) ? contentFramePath : (((actualFramesetPath != "") && (contentFramePath.lastIndexOf(actualFramesetPath) != -1)) ? contentFramePath.substr((contentFramePath.lastIndexOf(actualFramesetPath) + actualFramesetPath.length), contentFramePath.length) : contentFramePath)); contentFrameSource = ((flashCheckIsActive) ? flashCheckSource + "?contentFrameSource=" + actualFramesetPath + contentFramePath + escape(contentFrameParam) : actualFramesetPath + contentFramePath + contentFrameParam); if(location.query.content) { if(location.query.content.indexOf("://") != -1) { for (var i=0; i < allowedDomain.length; i++) { if(location.query.content.indexOf(allowedDomain[i]) != -1) { domainIsAllowed = true; break; } } if(domainIsAllowed) { initContentURL = ((flashCheckIsActive) ? flashCheckSource + "?contentFrameSource=" + escape(location.query.content) : location.query.content); } else { initContentURL = contentFrameSource; } } else { actualFramesetPath = getFramesetPath(); initContentURL = ((flashCheckIsActive) ? flashCheckSource + "?contentFrameSource=" + actualFramesetPath + escape(location.query.content) : actualFramesetPath + location.query.content); } } else { initContentURL = contentFrameSource; } }