function refreshImage()
{
	try
	{
		document.getElementById('refreshverificationimage').src = 'Class.Verificationimage.inc.php?j='+Math.random();
		return false;
	} catch(e) {
		alert(e.message);
	}
	return false;
}
function checkNewsForm()
{
	email = document.getElementById('tswemail').value;
	usersName = document.getElementById('tswname').value;
	verify = document.getElementById('verify').value;
	msg = "";
	if(email == '')
	{
		msg += "Please insert your email address\n";	
	}
	if(usersName == '')
	{
		msg += "Please insert your name\n";	
	}
	if(verify == '')
	{
		msg += "Please insert the text displayed in the image";	
	}
	if(msg != '')
	{
		alMsg = "Sorry there seems to be an error please\n";
		alMsg += "correct the errors displayed\n\n";
		alMsg += "---------------------------------------\n";
		alMsg += msg;
		alert(alMsg);
		return false;
	}
	return true;
}
function deleteimageconfirm()
{
	if(confirm("Are you sure you want to delete this photo") == true)
	{
		location.href="worker.php?case=deleteimage&image="+arguments[0];
	}
}
function enlargeImage()
{
	try
	{
		document.getElementById('enlargedImage').src = '/images/real/'+arguments[0]+'.'+arguments[1];
		//document['enlargedImage'].src = '/images/real/'+arguments[0]+'.'+arguments[1];
	}
	catch(e)
	{
		alert(e.message);	
	}
}
currentPage = 0;
function changePage()
{
	//alert(arguments[0]);
	try
	{
		if(arguments[0] != currentPage)
		{
			newPage = arguments[0] + 1;
			document.getElementById('currentPageSpan').innerHTML = newPage;
			document.getElementById('saleItemContainer'+currentPage).style.display = 'none';
			document.getElementById('saleItemContainer'+arguments[0]).style.display = 'block';
			currentPage = arguments[0];
		}
	}
	catch(e)
	{
		alert(e.message);	
	}
}
function confirmDeleteItem()
{
	if(null != arguments[0])
	{
		if(confirm('Do you really want to delete this item') == true)
		{
			window.location.href = '/worker.php?case=deleteitem&itemid='+arguments[0];
		}
	}
}
function checkimages()
{
	err = '';
	if(document.getElementById('newimage').value == '') err += 'Please select your main image\n';
	if(document.getElementById('thumbimage').value == '') err += 'Please select your thumbnail image';
	if(err != '')
	{
		alert(err);
		return false;
	}
	return true;
}
