function Config()
{
	this.spacerPath = '../images/spacer.gif';
	this.galleryPath = '../script_upload/gallery/';
}

config = new Config();


function transparent2(element)
{
	if(/MSIE (5\.5|6).+Win/.test(navigator.userAgent)) 
	{
		var src = element.src;
		element.src = config.spacerPath; 
		if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
	}
}

function transparent(element)
{
	if(/MSIE (5\.5|6).+Win/.test(navigator.userAgent))
	{
		var src = element.src;
		if(/\.png$/.test(element.src))
		{ 
			element.src = config.spacerPath;
			if (src)
			{
				element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='scale')";
			}
		}   
	}
}

function showPic(pic, width, height)
{ 
	sDesrc = "width=" + width + ", height=" + height + ", status=no, toolbar=no, menubar=no, scrollbars=no";
	win = window.open("gallery_image.php?pic=" + pic, "", sDesrc);
}


var send = function(link)
{
	var dataToSend = document.getElementById('calendar_y').value + "." + document.getElementById('calendar_m').value;
	var ajax = new httpAjaxRequest(); 
	if(ajax)
	{  
		ajax.prepareHash({date:dataToSend}); 
		ajax.open("GET", "ajax.php");
		ajax.send();
		ajax.getData();
		ajax.onreadystatechange = function()
		{ 
			data = ajax.getResult();
			document.getElementById("calendar_div").innerHTML = data.calendar; 
		}  
	}
 	else 
 	{
 		window.location = link + document.getElementById('calendar_y').value + "." + document.getElementById('calendar_m').value;
 	}
}

function writeCookie(cookieName, cookieContent, cookieExpireTime)
{
	var cookiePath = '/';
	if(cookieExpireTime > 0)
	{
		var expDate = new Date()
		expDate.setTime(expDate.getTime()+cookieExpireTime*1000*60*60)
		var expires = expDate.toGMTString()
		document.cookie = cookieName + "=" + escape(cookieContent) + ";path=" + escape(cookiePath) + ";expires=" + expires + ";";
	}
    else
    {
		document.cookie = cookieName + "=" + escape(cookieContent) + ";path=" + escape(cookiePath) + ";";
	}
}

function readCookie(cookieName)
{
	var ourCookie = document.cookie;
	if(!ourCookie || ourCookie == "")
	{
		return "";
	}
	ourCookie = ourCookie.split(";")
	var i = 0;
	var Cookie;
	while(i < ourCookie.length)
	{
		Cookie = ourCookie[i].split("=")[0];
		if(Cookie.charAt(0) == " ")
		{
			Cookie = Cookie.substring(1);
		}
		if(Cookie == cookieName)
		{
			return unescape(ourCookie[i].split("=")[1]);
		}
		i++;
	}
	return "";
}

function deleteCookie(cookieName)
{
	var cookiePath = '/';
	document.cookie = cookieName + "=" + readCookie(cookieName) + ";path=" + escape(cookiePath) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT;";
}

