function makeRequest(page, type, data, data2)
{
	var urlstring = page;
	if (page.indexOf('?') > -1)
		urlstring += '&';
	else
		urlstring += '?';
	urlstring += 'request='+type+'&data='+data+'&data2='+data2;
	window.location.href = urlstring;
}

function setProduct(productid)
{
	var pid = parseInt(productid);
	document.getElementById('productid').value = productid;
	document.getElementById('title').value = document.getElementById('title'+pid).value;
	document.getElementById('description').value = document.getElementById('description'+pid).value;
	document.getElementById('image').value = document.getElementById('image'+pid).value;
	document.getElementById('weight').value = document.getElementById('weight'+pid).value;
	document.getElementById('price').value = document.getElementById('price'+pid).value;
	if (document.getElementById('stock'+pid).checked == true)
		document.getElementById('stock').value = 'checked';
	return true;
}

function setText(textid)
{
	var pid = parseInt(textid);
	document.getElementById('textid').value = textid;
	document.getElementById('text').value = document.getElementById('text'+pid).value;
	document.getElementById('textorder').value = document.getElementById('textorder'+pid).value;
	return true;
}

function setImage(imageid)
{
	var pid = parseInt(imageid);
	document.getElementById('imageid').value = imageid;
	document.getElementById('image').value = document.getElementById('image'+pid).value;
	document.getElementById('imageorder').value = document.getElementById('imageorder'+pid).value;
	return true;
}

function setOffer(offerid)
{
	var pid = parseInt(offerid);
	document.getElementById('offerid').value = offerid;
	document.getElementById('offprodid').value = document.getElementById('offprodid'+pid).value;
	document.getElementById('offerinfo').value = document.getElementById('offerinfo'+pid).value;
	return true;
}

function checkDelete()
{
	if (confirm('Are you sure you want to delete this product, paragraph, image or category?'))
		return true;
	return false;
}
