/** open/close any element */
function openClosePop(id)
{
	var pop = document.getElementById(id);
	if (!pop)
	{
		return;
	}
	if (pop.style.display == 'none')
	{
		pop.style.display = 'block';
	}
	else
	{
		pop.style.display = 'none';
	}
}

/**
 * basket functions
 */

function Basket() 
{
}

// show / hide basket reference
Basket.showHideRef = function(rowId)
{
	var row = document.getElementById(rowId);
	if(row.style.display == 'none')
	{
		row.style.display = '';
	}
	else
	{
		row.style.display = 'none';
	}
}

/** picVshow */

var popImg;  

function picVshow(pic_path)
{
	var img = new Image();
	img.src = pic_path;
	popImg = img;
	picVwait(pic_path);
}

function picVwait(pic_path)
{
	if(popImg.complete)
	{
		picV(pic_path, popImg.width, popImg.height);
		return;
	}
	
	window.setTimeout("picVwait('"+pic_path+"');");
}
		
function picV(pic_path, w, h)
{
	var PosLeft = parseInt((screen.width - w) / 2);
	var PosTop = parseInt((screen.height - h) / 4);
	var bw = w + 50;
	var bh = h + 50;
	var sTemp = 'screeny=' + PosTop + ',screenx=' + PosLeft + ',top=' + PosTop + ',left=' + PosLeft + ',width=' + bw + ',height=' + bh + ',toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1';
	list_window = window.open('about:blank','list_window', sTemp);
	list_window.document.open();	
	list_window.document.write('<html>\
	<body>\
	<a class="bild" href="#"  TYPE="button" VALUE="close" onClick="window.close()">\
	<img src="'+pic_path+'" style="border: 0;"/>\
	</a>\
	</body>\
	</html>');
	list_window.document.close();
	var focus = function(){list_window.focus();}
	window.setTimeout(focus, 250);
}


/**
 * message functions
 */

function showErrorFieldInfo(fieldId)
{
	if(document.getElementById(fieldId))
	{
		document.getElementById(fieldId).style.display = "block";
	}
}

function hideErrorFieldInfo(fieldId)
{
	if(document.getElementById(fieldId))
	{
		document.getElementById(fieldId).style.display = "none";
	}
}

/**
 * pop up
 */
function Popup() 
{
}

// display popup
Popup.display = function popup(url)
{
	fenster=window.open(url, "", "width=400,height=300,resizable=yes");
	fenster.focus();
}
