// Author: Michał Daniel, Cube

function byID(id)
{
	var obj;
	if (document.getElementById) obj = document.getElementById(id);
	else if (document.all) obj = document.all[id];
	else if (document.layers) {
		obj 	  = document.layers[id];
		obj.style = document.layers[id];	
	}
	return obj;	
}

function overBg(o)
{
	o.style.backgroundImage = "url(templates/admin/images/bullet-neutral.jpg)";
}

function outBg(o, what)
{
	o.style.backgroundImage = "url(templates/admin/images/bullet-"+what+".jpg)";
}

function setHour(hour)
{
	byID("hour").value = hour;
}


/*
onMouseOver
onMouseOut
var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById) && !(document.all)? true:false;

var winW = (ns4||ns6)? windowWidth = window.innerWidth-16 : windowWidth = document.body.offsetWidth-20
var winH = (ns4||ns6)? windowHeight = window.innerHeight : windowHeight = document.body.offsetHeight

var windowLayerX = (windowWidth/2) - (0.25*windowWidth);
var windowLayerY = (windowHeight/8) - 20;

var Windows =
{
	obj: null,
	layers: null, // dragable layers
	
	init: function() 
	{
		if (!document.body || !document.body.getElementsByTagName) { return false; }
		Windows.layers = new Array();
		tagsA = document.body.getElementsByTagName('a'); 	
		for (i = 0; i < tagsA.length; i++) 
		{
			if ((tagsA[i].id).match(/^.*_show$/i)) {
				tagsA[i].onclick = this.showClick;
				
			}
			else if ((tagsA[i].id).match(/^.*_hide$/i)) {
				tagsA[i].onclick = this.hideClick;
				Windows.layers.push(tagsA[i].getAttribute('id').slice(0, -5));
			}
		}	
		for (i = 0; i < Windows.layers.length; i++) 
		{
			ddo = byID(Windows.layers[i]); 
			ddo.index = i; 
			ddo.onmousedown = Windows.mouseDown;
			if (isNaN(parseInt(ddo.style.top))) ddo.style.top = windowLayerY + "px";
			if (isNaN(parseInt(ddo.style.left))) ddo.style.left = windowLayerX + "px";			
		}		
		return true;
	},
	
	showClick: function(e)
	{
		e = e||event; 
		try {
			element = this;
			id = element.getAttribute('id').slice(0, -5);
			byID(id).style.visibility = "visible";	
			return false;
		}
		catch(err) { }
	},
	
	hideClick: function(e)
	{
		e = e||event; 
		try {
			element = this;
			id = element.getAttribute('id').slice(0, -5);
			byID(id).style.visibility = "hidden";		
			return false;	
		}
		catch(err) {}				
	},

	fixIE : function(e)
	{
		if (typeof e == 'undefined') e = window.event;
		if (typeof e.layerX == 'undefined') e.layerX = e.offsetX; 
		if (typeof e.layerY == 'undefined') e.layerY = e.offsetY; 
		return e;
	},
	
	mouseDown : function(e) 
	{
		var ddo = Windows.obj = this;
		e = Windows.fixIE(e);		
		ddo.lastMouseX = e.clientX;
		ddo.lastMouseY = e.clientY;
		
		for(i = 0; i < Windows.layers.length; i++) {
  			byID(Windows.layers[i]).style.zIndex = 1;
		}
		byID(Windows.layers[ddo.index]).style.zIndex = 2;
				
		document.onmousemove  = Windows.mouseMove;
		document.onmouseup 	  = Windows.mouseUp;			
		return false;
	},
	
	mouseMove : function(e)
	{	
		e = Windows.fixIE(e);	
		var ddo = Windows.obj;
		var cX = e.clientX;
		var cY = e.clientY;
		var x = parseInt(ddo.style.left);
		var y = parseInt(ddo.style.top);
		var nx, ny;	
			
		nx = x + ((cX - ddo.lastMouseX)*1);	
		ny = y + ((cY - ddo.lastMouseY)*1);	
		
		Windows.obj.style.top = ny + "px";
		Windows.obj.style.left = nx + "px";
		Windows.obj.lastMouseX = cX;
		Windows.obj.lastMouseY = cY;
			
		return false;
	},
	
	mouseUp : function(e)
	{ 	
		document.onmousemove  = null;
		document.onmouseup 	  = null;
		Windows.obj 		  = null;
	}
}

Windows.init();
*/

