var ground = "";



function changeColor(wcolour,ground) {

if (ground=="bg"){
	document.all["pickbgcolour"].style.backgroundColor = '#' + wcolour;		
	idContenido.document.body.bgColor = wcolour;
	cmdExec("BackColor",wcolour);
	idContenido.document.setBackgroundColor = '#' + wcolour;
	Noticia.fondo.value = wcolour	
	idContenido.focus();

} else {
	document.all["pickfgcolour"].style.backgroundColor = '#' + wcolour;		
	cmdExec("ForeColor",wcolour);	
	}
}
	
function showColor(posX,posY,what){	
	e = window.event;		
	with (document.all["colorbox"]){			
		style.left = e.clientX+4;			
		style.top  = e.clientY-18;			
		style.visibility = 'visible';		
	}
ground = what;
}
function Boton_Over(eBoton){
	eBoton.style.borderBottom = "buttonshadow solid 1px";
	eBoton.style.borderLeft = "buttonhighlight solid 1px";
	eBoton.style.borderRight = "buttonshadow solid 1px";
	eBoton.style.borderTop = "buttonhighlight solid 1px";
	}
function Boton_Out(eBoton){
	eBoton.style.borderColor = "threedface";
	}
function Boton_Down(eBoton){
	eBoton.style.borderBottom = "buttonhighlight solid 1px";
	eBoton.style.borderLeft = "buttonshadow solid 1px";
	eBoton.style.borderRight = "buttonhighlight solid 1px";
	eBoton.style.borderTop = "buttonshadow solid 1px";
	}
function Boton_Up(eBoton){
	eBoton.style.borderBottom = "buttonshadow solid 1px";
	eBoton.style.borderLeft = "buttonhighlight solid 1px";
	eBoton.style.borderRight = "buttonshadow solid 1px";
	eBoton.style.borderTop = "buttonhighlight solid 1px";
	eBoton = null; 
	}
var isHTMLMode=false

function document.onreadystatechange(){
  	idContenido.document.designMode="On"
	}
function cmdExec(cmd,opt) {
  	if (isHTMLMode){alert("Desactiva la casilla  ' HTML'");return;}
  	idContenido.document.execCommand(cmd,false,opt);idContenido.focus();
	}
function setMode(bMode){
	var sTmp;
  	isHTMLMode = bMode;

  	if (isHTMLMode)
  	{
  		sTmp=idContenido.document.body.innerHTML
  		idContenido.document.body.innerText=sTmp;
  	} 
	else
	{
		sTmp=idContenido.document.body.innerText
		idContenido.document.body.innerHTML=sTmp
		idContenido.document.setBackgroundColor = Noticia.fondo.value
  		idContenido.document.body.bgColor = Noticia.fondo.value
	}
  	idContenido.focus();
	}
function CrearLink(){
	if (isHTMLMode){alert("Desactiva la casilla  ' HTML'");return;}
	cmdExec("CreateLink");
	}

function fninit()
	{
	for(i=0;i<document.all.length;i++) document.all(i).unselectable = "on";
	idContenido.unselectable = "off";
	wcolor = Noticia.fondo2.value;
	if (wcolor != "")
	{
		idContenido.document.setBackgroundColor = wcolor;
	}else{
		idContenido.document.setBackgroundColor = '000000';
	}
	}
function Guardar() 
	{
	if (isHTMLMode){alert("Desactiva la casilla  ' HTML'");return;}
  	Noticia.texto.value = idContenido.document.body.innerHTML;

  	Noticia.submit();
 	}	
	
	function VistaPrevia(form,h,w)
	{
		aWindow = window.open('','VistaPrevia','width=' + w + ',height=' + h + ',scrollbars=yes,toolbars=yes,menubar=yes,resizable=yes')
		aWindow.document.open()
		aWindow.document.write(idContenido.document.body.innerHTML)
		aWindow.document.setBackgroundColor = form1.fondo.value
		aWindow.document.body.bgColor = form1.fondo.value
	}
		function GetSelection(strBefore, strAfter, strContent) {
		var Selection = idContenido.document.selection.createRange();
		if (Selection.text != "" && Selection.text != null) {
			Selection.text = strBefore + Selection.text + strAfter;
		} else {
			idContenido.document.body.innerHTML = idContenido.document.body.innerHTML + strBefore + strContent + strAfter;
		}
	}	
	function NuevoDocumento()
	{
		s = confirm('CUIDADO !!! Esto borrara todo el documento actual')
		if (s){
			idContenido.document.body.innerHTML = ''
			
			idContenido.focus();		
		}
	}
	
		function EnviarEmail()
	{
FormMail_Txt_Open = '<div id=FormulariodeNoticia><form action = EnviarEmail.asp    Method = POST >';
		FormMail_Txt_Body = '<b>Envianos tu comentario rellenando el siguiente formulario</b><br><b>Tu e-mail:</b> <input type = text size = 30 name = E_From><br>';
		FormMail_Txt_Body = FormMail_Txt_Body + '<input size = 30 type=hidden value =MurciaWeb@MurciaWeb.com  name=E_AddAddress>';
		FormMail_Txt_Body = FormMail_Txt_Body + '<br><b>Tu Comentario</b>:<br><textarea cols = 30 rows = 10 name = E_Body wrap = virtual></textarea><br><input type = submit>';
		FormMail_Txt_Close = '</form></div>';
		idContenido.document.body.innerHTML = FormMail_Txt_Open + idContenido.document.body.innerHTML + FormMail_Txt_Body + FormMail_Txt_Close;
		idContenido.focus();
	}
<!--
function openWindow(url,width,height) 
{
  popupWin = window.open(url,'Complementos','width=' + width + ',height=' + height + ',scrollbars=1,toolbars=0,menubar=0,resizable=0')
}
function openWindow2(url,width,height) 
{
  popupWin = window.open(url,'Complementos','width=' + width + ',height=' + height + ',scrollbars=0,toolbars=0,menubar=0,resizable=0')
}


-->