/* 
MicrositeAOFbehaviours.js
Version: 2008-03-19 msc
Version: 2009-02-13 rsc
*/

/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* getElementsByClassName */
/* optimierte getElementsByClassName (wp) */
document.getElementsByClassName = function(className) {
  var children = document.getElementsByTagName('*') || document.all;
  var elements = new Array();
  
  for (var i = 0; i < children.length; i++) {
    var child = children[i];
    var classNames = child.className.split(' ');
    for (var j = 0; j < classNames.length; j++) {
      if (classNames[j] == className) {
        elements.push(child);
        break;
      }
    }
  }
  return elements;
} 

function changeURL2Login(){
	var sURL = document.URL;
	var iIndexPWPS = sURL.indexOf("/portal/wps/");
	var iIndexWPS = sURL.indexOf("/wps/portal");
	if( iIndexPWPS < 0){
		sURL = sURL.substring( 0, iIndexWPS) + "/wps/my" + sURL.substring(iIndexWPS + 5);
	}else{
		sURL = sURL.substring( 0, iIndexPWPS) + "/wps/my" + sURL.substring(iIndexPWPS + 12);
	};
	if(sURL.indexOf("http:") >= 0){
		sURL = "https:" + sURL.substring( 5);
	};
	window.location.href = sURL;
}	


/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* calls listed functions via body onLoad="startFunctions();"  */
function startFunctions(){
	preloadImages();
}

