function Hover(id)
{
	document.getElementById(id).src = document.getElementById(id).src.replace('-norm', '-hover');
}
function unHover(id)
{
	document.getElementById(id).src = document.getElementById(id).src.replace('-hover', '-norm');
}

function ShowHide(id)
{
	element = document.getElementById(id);
	if (element.style.display == 'none')
		element.style.display = '';
	else
		element.style.display = 'none'
}




function ShowCanvas()
{
	canvas = document.getElementById('canvas');
	//alert('x');
	//alert(document.body.offsetHeight);
	canvas.style.height = (document.body.offsetHeight+50)+'px';
	canvas.style.width = document.body.offsetWidth+'px';
	canvas.style.display = 'table-cell';
}

function ShowImage(url, title)
{
	document.getElementById('canvascell').style.height = (document.body.offsetHeight)+'px';
	document.getElementById('fullimage').src = url;
	ShowCanvas();
}
function HideImage()
{
	document.getElementById('fullimage').src = "";
	document.getElementById('canvas').style.display = "none";
}

function ActionConfirm(url)
{
	if (confirm('Are you sure you want to do this action?'))
		window.location.href= url;
}

// sites order
function ItemUp()
{
	list = document.getElementById('list');
	
	index = list.selectedIndex;
	if (index == -1) return;
	if (index == 0) return;
	
	option = list.options[index]; option_temp =  list.options[index-1];
	
	list.remove(index);
	list.add(option, option_temp);
}

function ItemDown()
{
	list = document.getElementById('list');
	
	index = list.selectedIndex;
	if (index == -1) return;
	if (index == list.length-1) return;
	
	option = list.options[index]; option_temp =  list.options[index+1];
	
	list.remove(index+1);
	list.add(option_temp, option);
}

function SaveList()
{
	value = '';
	
	list = document.getElementById('list');
	for (i=0; i<list.length; i++)
	{
		if (i > 0) value = value + ' ';
		value = value + list.options[i].value;
	}
		
	document.getElementById('itemlist').value = value;
}