//functions for creating popup windows

function popupD(daURL) {
	leftPos = 0;
	topPos = 0;
	if (screen) {
		leftPos = screen.width/2-200;
		topPos = screen.height/2-75;
	}

	daWindow = window.open(daURL,'daWindow','width=400,height=150,scrollbars=no,resizable=no,left=' + leftPos + ',top=' + topPos );
	daWindow.focus();
}

function popupW(daURL, w, h) {
	leftPos = 0;
	topPos = 0;
	if (screen) {
		leftPos = screen.width/2-(w/2);
		topPos = screen.height/2-(h/2);
	}

	daWindow = window.open(daURL,'daWindow','width=' + w + ',height=' + h + ',scrollbars=no,resizable=yes,left=' + leftPos + ',top=' + topPos );
	daWindow.focus();
}

function popup(daURL) {

daWindow = window.open(daURL,'daWindow','width=350,height=400,scrollbars=yes,resizable=yes,left=0,top=0');
daWindow.focus();
}

// functions and variable declarations for highlighting table cells on rollover

var color = '';
var outColor = '';
var overColor = '#333333';

function over(id) {
    if (document.all) {
        window.color = window.document.all[id].style.background;
        window.document.all[id].style.background = overColor;
    }
}

function out(id) {
    if (document.all) {
        window.document.all[id].style.background = outColor;
    }
}


function doHead(hType) {
  if(hType != '') {
    iView.document.execCommand('formatblock', false, hType);  
    // doFont(selFont.options[selFont.selectedIndex].value);
  }
}
										
viewMode = 1;

function toggleView() {  
    if(viewMode == 1)
    {
      iHTML = iView.document.body.innerHTML;
      iView.document.body.innerText = iHTML;
      viewMode = 2; // Code
    }
    else
    {
      iText = iView.document.body.innerText;
      iView.document.body.innerHTML = iText;      
      viewMode = 1; // WYSIWYG
    }
}


