function clearField() {
	if (document.getElementById('search').value == 'Поиск') document.getElementById('search').value="";
}
function fillField() {
	if (document.getElementById('search').value == '') document.getElementById('search').value="Поиск";
}
function show() {
	document.getElementById('full').style.display = 'block';
	document.getElementById('goshow').style.display = 'none';
	document.getElementById('gohide').style.display = 'block';
}
function hide() {
	document.getElementById('full').style.display = 'none';
	document.getElementById('goshow').style.display = 'block';
	document.getElementById('gohide').style.display = 'none';
}
function chooseThumb(id, num, path, img, width, height) {
	var mc=document.getElementById('pics');
	var kids =mc.childNodes;
	for (var i = 0; i < kids.length; i++) {
		if (kids[i].tagName == 'IMG') kids[i].className = '';
	}
	document.getElementById('thumbPic' + num).className = 'selected';
	/*document.getElementById('mainpic').src = path;*/
document.getElementById('mainpicdiv').innerHTML="<img style='cursor:pointer;' src='" + path + "' onClick=\"draw('" + id + "', '" + num +"', " + width + ", " + height + ");\" class='mainpic' id='mainpic' />";
}
function recalculate(myData) {
var idList=myData;
var idData = idList.split(",");
var i=0;
var result="";
for (i=0; i<idData.length; i=i+1) {
result=result + idData[i] + ":" + document.getElementById('quan' + idData[i]).value + "/";
}
document.getElementById('resultQuanList').value=result;
document.forms.changeQuanList.submit();
}
function draw(id,num,width,height) {
	var left = (screen.availWidth - width) / 2;
	var top = (screen.availHeight - height) / 2;
	height = height + 40;
	
	window.open('/showpic.php?id=' + id + '&num=' + num,'','width=' + width + ',height=' + height + ',top=' + top + ',left=' + left);
	
}
