var browser = navigator.appName;
var dateFormat = 'dd/MM/yyyy'
var validateIconError = "";

function showError(error)
{		
	alert(error);
}
	
function hideError()
{	
}

function setValidateIconError(errorMsg)
{
	validateIconError = errorMsg;
}

function validateUploadIcon()
{
	var uploadIcon = document.getElementById("image-icon");
	var icon = document.getElementById("imageEditableIcon");
		
	if((icon.src == window.location.href || icon.src=="") && uploadIcon.value=="")
	{
		showError(validateIconError);
		return false;
	}
	
	return true;
}

function GetMouseCoordinates(e)
{
	var XY = new Object();
		
	var posx = 0;
	var posy = 0;
	if (!e) var e = window.event;
	if (e.pageX || e.pageY)
	{
		posx = e.pageX;
		posy = e.pageY;
	}
	else if (e.clientX || e.clientY) 	{
		posx = e.clientX + document.body.scrollLeft
			+ document.documentElement.scrollLeft;
		posy = e.clientY + document.body.scrollTop
			+ document.documentElement.scrollTop;
	}
	
	XY.x = posx;
	XY.y = posy;
	
	return XY;
}

function getBackgroundImageFromURL(string)
{
	var value = "";
	
	if(window.opera)
	{
		value = string.substring(5, string.length-2);
	}
	else
	{
		value = string.substring(4, string.length-1);
	}
	
	return value;
}

function refresh()
{
	window.location.href = window.location.href;
}