<!--

var viewMode = 1; // WYSIWYG
var keepGoing= false;

function Init(strName){
	document.onmousemove = mMove;

	//editWin.document.body.innerText = defaultVal;
	eval(strName + ".document.designMode = 'On'");
	eval(strName+'.focus()');
	x = eval('"' + strName + '"')
	setTimeout('doToggleViewStart(x)',10);
}

function mMove(e) { 
	mX = event.x; 
	mY = event.y; 
} 


/* Button ActionScripts */

function doCut(areaName){
	eval(areaName+".document.execCommand('Cut')"); 
}

function doCopy(areaName){
	eval(areaName+".document.execCommand('Copy')"); 
}

function doPaste(areaName){
	eval(areaName+".document.execCommand('Paste')"); 
}

function doBold(areaName){
	eval(areaName+".document.execCommand('bold', false, null)"); 
}

function doItalic(areaName){ 
	eval(areaName+".document.execCommand('italic', false, null)"); 
}

function doUnderline(areaName){
	eval(areaName+".document.execCommand('underline', false, null)"); 
}

function doLeft(areaName){
	eval(areaName+".document.execCommand('justifyleft', false, null)");
}

function doCenter(areaName){
	eval(areaName+".document.execCommand('justifycenter', false, null)");
}

function doRight(areaName){
	eval(areaName+".document.execCommand('justifyright', false, null)");
}
function doLink(areaName){
	eval(areaName+".document.execCommand('createlink')");
}
function doImage(areaName){ 
	window.open('imageBank/bildbank.asp','imagebank','toolbar=no,width=700,height=550,resize,scrollbars=yes');
}
function doAlbum(areaName){ 
	window.open('../album/linkpage.asp','album','toolbar=no,width=800,height=550,resize,scrollbars=yes');
}


var impactCord = false;
var xCord = 10;
var yCord = 10;

function doDrag(){
	if(keepGoing){
		if(!impactCord){
			xCord = mX-parseInt(document.getElementById('xWin').style.left);
			//yCord = mY-parseInt(document.getElementById('xWin').style.top);
			impactCord = true;
		}
		document.getElementById('xWin').style.top=mY-yCord;
		document.getElementById('xWin').style.left=mX-xCord;
		setTimeout("doDrag()",0);
	}
}

function showXWin(destination,iFrame,xWinWidth,xWinHeight){
	document.getElementById('xFrame').style.width=xWinWidth;
	document.getElementById('xFrame').style.height=xWinHeight;
	frames['xFrame'].location.href=destination+'?iFrameName='+iFrame;
	xWin.style.display='block';
}


function doToggleView(strName){  
	if(viewMode == 1){
		
		// Hide all controls

		iHTML = eval(strName + ".document.body.innerHTML");
		eval(strName + ".document.body.innerText = iHTML");
		eval(strName + "_Toolbar.style.display = 'none'");
		eval(strName + ".focus()");
	  
		viewMode = 2; // Code
	}
	else{
		iText = eval(strName + ".document.body.innerText");
		eval(strName + ".document.body.innerHTML = iText");

		// Show all controls
		eval(strName + "_Toolbar.style.display = 'inline'");
		eval(strName + ".focus()");
		
		viewMode = 1; // WYSIWYG
	}
}

function doToggleViewStart(strName){
	eval(strName + ".document.body.innerText = defaultVal");
	iText = eval(strName + ".document.body.innerText");
	eval(strName + ".document.body.innerHTML = iText");
	eval(strName + ".focus()");
}


/* Visual button effects */
function selOn(ctrl, bgColor){
	ctrl.style.borderColor = '#000000';
	ctrl.style.backgroundColor = bgColor;
	ctrl.style.cursor = 'hand';
}

function selOff(ctrl, bgColor){
	ctrl.style.borderColor = '#D6D3CE';
	ctrl.style.backgroundColor = bgColor;
	ctrl.style.cursor = 'hand';
}

function selDown(ctrl, bgColor){
	ctrl.style.backgroundColor = bgColor;
}
  
function selUp(ctrl, bgColor){
	ctrl.style.backgroundColor = bgColor;
}


function doSave(strName){
	textAreaName = strName + '_out';
	formName = strName + '_form';
	setForm = eval("document." + formName + "." + textAreaName + ".value");
	setForm = eval(strName + ".innerHTML");
	eval("document." + formName + ".submit()");
}
//-->
