function abre(loco,ancho,alto,barrita){
prop='statusbar=no,scrollbars='+barrita+',height='+alto+',width='+ancho;
window.open(loco, "",'\"'+prop+'\"');

}



function addEvent(elem, eventType, handler)
{
	if (!elem.eventHandlers) elem.eventHandlers = [];
	if (!elem.eventHandlers[eventType])
	{
		elem.eventHandlers[eventType] = [];
		if (elem['on' + eventType]) elem.eventHandlers[eventType].push(elem['on' + eventType]);
		elem['on' + eventType] = handleEvent;
	}
	elem.eventHandlers[eventType].push(handler);
}

function removeEvent(elem, eventType, handler)
{
	var handlers = elem.eventHandlers[eventType];
	for (var i in handlers) if (handlers[i] == handler) delete handlers[i];
}

function handleEvent(e)
{
	var returnValue = true;
	if (!e) e = fixEvent(event);
	var handlers = this.eventHandlers[e.type]
	for (var i in handlers)
	{
		this.$$handleEvent = handlers[i];
		returnValue = !((returnValue && this.$$handleEvent(e)) === false);
	}
	return returnValue;
}

function fixEvent(e)
{
	// add W3C standard event methods
	e.preventDefault = fixEvent.preventDefault;
	e.stopPropagation = fixEvent.stopPropagation;
	return event;
};

fixEvent.preventDefault = function() {
	this.returnValue = false;
};

fixEvent.stopPropagation = function() {
	this.cancelBubble = true;
};			


window.Blinkx = function(args){
Blink(this.id);
}
window.Blink = function(args){
  // Set the color and seconds below, e.g., [args,'COLOR',SECONDS]
 	args = (/,/.test(args))?  args.split(/,/):  [args,'#FFD100',10];
 	var who = document.getElementById(args[0]);
 	var count = parseInt(args[2]);
 	if (--count <=0) {
  		who.style.backgroundColor = '';
  		if(who.focus) who.focus();
 	} else {
  		args[2]=count+'';
  		who.style.backgroundColor=(count%2==0)? '': args[1];
 	 	args='\"'+args.join(',')+'\"';
  		setTimeout("Blink("+args+")",500);
 	}
}
function fademe(){
//alert(this.id);
NLBfadeBg(this.id,'#FF0000','#FFFFFF','1000');
}

function changeStyle(file) {
document.getElementById('stylesheet').href = 'theme/'+file+'/css/style.css';
}
function  changeStylex(){
changeStyle(this.id)
}