function changeStyle(style,komponent){
   	if (komponent!=null){
		komponent.className = style;
	}
}

function loadIframe(theURL) {
	document.getElementById("mainContent").src=theURL;
}

// resizes Iframe according to content
function resizeMe(obj){
	docHeight = iFrameStaevne.document.body.scrollHeight;
	obj.style.height = docHeight + 'px';
 }
 
function clickButton(buttonId){
   var buttonToClick = document.getElementById(buttonId);
   if (buttonToClick!=null){
      buttonToClick.click();
   }
}


     // Replaces all instances of the given substring.
     String.prototype.replaceAll = function(
     strTarget, // The substring you want to replace
     strSubString // The string you want to replace in.
     ){
     var strText = this;
     var intIndexOfMatch = strText.indexOf( strTarget );
      
     // Keep looping while an instance of the target string
     // still exists in the string.
     while (intIndexOfMatch != -1){
     // Relace out the current instance.
     strText = strText.replace( strTarget, strSubString )
      
     // Get the index of any next matching substring.
     intIndexOfMatch = strText.indexOf( strTarget );
     }
      
     // Return the updated string with ALL the target strings
     // replaced out with the new substring.
     return( strText );
     }
