// tkCreator 1.0 - Object Development by Emi in Teknoland RTT, 2000
function tkCreator(id,depend,left,top,width,height,vcolor,state,stack,contenido,tdiv) 
{
ie6 = (document.all) ? true : false;
ns4 = (document.layers) ? true : false;
ns6 = (document.getElementById && !document.all) ? true : false;

if (ns4||ns6) nav = true;
//	var nav = (document.layers)? true : false;
	if (ns4) {
		if (depend != null) {
			document.layers[depend].document.layers[id] = new Layer(width,document.layers[depend]);
			var aux = document.layers[depend].document.layers[id];} 
		else {
			document.layers[id] = new Layer(width);
			var aux = document.layers[id];}
		aux.name = id;aux.left = left;aux.top = top;
		if (height != null) { 
			aux.clip.height = height }
		if (vcolor != null) { 
			aux.bgColor = vcolor }
		(state == "hide") ? aux.visibility = "hide" : aux.visibility = "show";
		if (stack != null) { 
			aux.zIndex = stack }
		if (contenido != null) {
			aux.document.open();
			aux.document.write(contenido);
			aux.document.close();}
	} 
	else if (ns6) {
		var range = document.createRange();
   		range.setStartBefore(document.body.lastChild);
 			aux = '<DIV id=' + id + ' style="position:absolute;left:' + left + ';top:' + top + ';width:' + width;
		if (height != null) {
			aux += '; height:' + height;aux += '; clip:rect(0,'+width+','+height+',0)';}
		if (vcolor != null) { 
			aux += '; background-color:' + vcolor }
		(state == "hide")? aux += '; visibility:hidden' : aux += '; visibility:visible';
		if (stack != null) { 
			aux += '; z-index:' + stack }
		aux += '">';
		if (contenido != null) { 
			aux += contenido }
		aux += '</DIV>';
		if (depend != null) {	
			document.GetElementById["depend"].insertAdjacentHTML("BeforeEnd",aux);} 
		else {
	  		var docFrag = range.createContextualFragment(aux);
   			document.body.appendChild(docFrag);}
	} 
	else if (ie6) {
		var aux = '<DIV id=' + id + ' style="position:absolute;left:' + left + ';top:' + top + ';width:' + width;
		if (height != null) {
			aux += '; height:' + height;aux += '; clip:rect(0,'+width+','+height+',0)';}
		if (vcolor != null) { 
			aux += '; background-color:' + vcolor }
		(state == "hide")? aux += '; visibility:hidden' : aux += '; visibility:visible';
		if (stack != null) { 
			aux += '; z-index:' + stack }
		aux += '">';
		if (contenido != null) { 
			aux += contenido }
		aux += '</DIV>';
		if (depend != null) {	
			document.all[depend].insertAdjacentHTML("BeforeEnd",aux);} 
		else {
			document.body.insertAdjacentHTML("BeforeEnd",aux);}
	}
	
	if (tdiv == 'yes') {
		if (depend != null) {
			eval("td"+id+" = new tkDiv('td"+id+"','"+depend+"','"+id+"')");	} 
		else {
			eval("td"+id+" = new tkDiv('td"+id+"','"+id+"')");}
	}
}