
	function CreateForm(i, d)
	{
		var imgObj = document.getElementById(i);
		var divObj = document.getElementById(d);
	
		if (divObj.style.display == "none")
		{
			divObj.style.display = "block";
			//imgObj.src = "template/images/minus.gif";
		}
		else
		{
			divObj.style.display = "none";
			//imgObj.src = "template/images/plus.gif";
		}
	}

	function oc(i, d, c)
	{
		var imgObj = document.getElementById(i);
		var divObj = document.getElementById(d);

		if (divObj.className == "none")	
		{
			divObj.className = "display";
			imgObj.src = "../admin/images/minus.gif";
			setCookie(c, 'display');
		} else
		{
			divObj.className = "none";
			imgObj.src = "../admin/images/plus.gif";
			setCookie(c, 'none');
		}
	}

	function setCookie(c_name,value,expiredays)
	{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
	}
	
	function getCookie(c_name)
	{
		if (document.cookie.length>0)
		{
			c_start=document.cookie.indexOf(c_name + "=");
			if (c_start!=-1)
			{
				c_start=c_start + c_name.length+1;
				c_end=document.cookie.indexOf(";",c_start);
				if (c_end==-1) 
				{
					c_end=document.cookie.length;
				}
				return unescape(document.cookie.substring(c_start,c_end));
			}
		}
		return "";
	}
	
	function setDateIntervalPair(dateString, type, delimiter)
	{
		var date 	= new Date();
		var parts 	= dateString.toString().split("-");
		date.setFullYear(
				parseInt(parts[0], 10),			// év
				parseInt(parts[1], 10) - 1,		// hó (0-11)
				parseInt(parts[2], 10)			// nap (1-31)
		);
		var iv = 86400 * 7;
		if (type == 'start')
		{
			iv = iv * -1;
		} 
		date.setSeconds(parseInt(date.getSeconds()) + iv);
		var month = date.getMonth() + 1;
		if (month < 10)
		{
			month = "0" + month;
		}
		var day = date.getDate();
		if (day < 10)
		{
			day = "0" + day;
		}
		return date.getFullYear() + delimiter + month + delimiter + day;
	}
	
	function justNumber(id)
	{
		document.getElementById(id).value=document.getElementById(id).value.replace(/[^0-9.]/g, "");		
	}
	
	function openPopUpWindow(url)
	{
		window.open(url,"popupwindow","menubar=0,resizable=1,location=0,toolbar=0,titlebar=0,status=0,scrollbars=0,dependent=1,width=" + screen.width + ",height=" + screen.height + ",top=0,left=0");
	}
