
/*******************************************************
 FORM FUNCTIONS

 *******************************************************/

function clearField(tar) {
	tar.value = '';
}

function fillField(tar, def) {
	if (tar.value == '')
		tar.value = def;
}


function togle(id)
{
	if (document.getElementById(id).style.display == 'none') {
		return document.getElementById(id).style.display = 'block';
	} else {
		return document.getElementById(id).style.display = 'none';
	}
}

function togleSelect(id, tar)
{
	if(id.checked) {
		return document.getElementById(tar).style.backgroundColor = '#F6FCA4';
	} else {
		return document.getElementById(tar).style.backgroundColor = '#FFFFFF';
	}
}

function popupWindow(url, wi, he)
{
	newwindow = window.open(url, 'Detail picture', 'statusbar=0, toolbar=0, scrollbars=0, resizeable=0, width='+ wi +', height='+ he +'');
	if (window.focus) { newwindow.focus(); }
	return false;
}


/*******************************************************
 jQuery functions

 *******************************************************/

$(document).ready(function() {
	
	$("a.fancy").fancybox();
	
	$('#item_wrap').hover(function(){
		$('#item_picture').stop().fadeTo(350, 0);
		$('#item_full').stop().fadeTo(250, 1.0);
	}, function() {
		$('#item_full').stop().fadeTo(150, 0);
		$('#item_full').fadeOut();
		$('#item_picture').stop().fadeTo(350, 1.0);
	});
	
});

$(function() {
	$('#itemInfoContainer').tabs({ fxSlide: true, fxSpeed: 'fast' });
});

function swapImage(content)
{
	document.getElementById('lb_cont').innerHTML = '<img src="'+ content +'" alt="" />';
}

