function swap(oIMG,strURL){

	if (oIMG) {
		if(oIMG.filters){
			oIMG.style.filter="blendTrans(duration=.5)"; //BlendTrans
		    oIMG.filters[0].Apply();
		    oIMG.filters[0].Play();
		}
	
	oIMG.src = strURL;
	}
}
function breakout_of_frame()
{
  // see http://www.thesitewizard.com/archive/framebreak.shtml
  // for an explanation of this script and how to use it on your
  // own website
  if (top.location != location) {
    top.location.href = document.location.href ;
  }
}
function savefile(){
	if(document.all){
		transferText('editbox');
		transferText('editbox');
	}	
	strForfatter = document.forms[0]["author"].value;
	strMelding = document.forms[0]["editbox_text"].value;
	strFilnavn = document.forms[0]["filnavn"].value;				
					
	if(strForfatter == "")
		alert ("Skriv inn navnet ditt!");
		else if(strMelding == "")
			alert ("Skriv inn en melding!");
																	
	else{				
		document.forms[0]["loaded"].value = "uploadFile";
		document.forms[0].submit();
		}	
	
	}
	
function newWindow(strURL,strTitle,iWidth,iHeight) {

	window.open(strURL, strTitle, 'height=' + iHeight + ',width=' + iWidth);

}	
	
function addsmile(oImg) {
	if(document.all){
		transferText('editbox');
		oBox = frames["editbox"];					
		//oBox.document.body.innerHTML = oBox.document.body.innerHTML + 'Test';
		oBox.document.body.innerHTML = oBox.document.body.innerHTML + '<IMG SRC="'+oImg.src+'">';
		
		//alert(oImg.src);				
	}
	else{
		  doc_content = document.forms[0]["editbox_text"].value + smiley;
		  document.forms[0]["editbox_text"].value = doc_content;
		  document.forms[0].focus();
  		}
}