function changeClass(obj, new_class)
{
    obj.className = new_class;
}

function changeBgColor(obj, new_color)
{
	obj.style.backgroundColor=new_color;
}

function changePic(name, pic)
{
	name.src = pic;
}

function emptyfield (field, defaultval, blur) {
	
	if ( blur == true ) {
	
		if (field.value == '') {
			field.value = defaultval;
		}
	
	} else {
	
		if (field.value == defaultval) {
			field.value = '';
		}
	
	}
		
	return true;
}
function selectCheckbox (sType)
{
	for (var i = 0; i < document.formName.elements.length; i++)
	{
		document.formName.elements[i].checked = sType;
	}
}
function openGame(){
	window.open('http://www.unicommerce.si/flash/tileGame.html','Igra','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,width=750,height=570,left=10,top=10');
	return false
}


function showPuzzle (id)
{
	width = 660;
	height = 382;
	left_pos = (screen.width / 2) - (width / 2);
	top_pos = (screen.height / 2) - (height / 2);

	window.open('?wireframe=puzzle&puzzleId='+id, name, 'width=' + width + ',height=' + height + ',left=' + left_pos + ',top=' + top_pos +'');
	
	return false;	
}