function fixPNG(element) {
	if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)) {
		var src;
		if (element.tagName=='IMG') {
			if (/\.png$/.test(element.src)) {
				src = element.src;
				element.src = "bitrix/templates/retailbooks/images/ico/blank.gif";
			}
		} else {
			src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i);
			if (src) {
				src = src[1];
				element.runtimeStyle.backgroundImage="none";
			}
		}
		if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"',sizingMethod='scale')";
	}
}
//	Проверка авторизации
function SendRequest()
{                                                        
	$.post(
		'/src/auth4ajax.php', 
		{check:'Y'}, 
		function(answer) {
			if (typeof(answer) == 'object')
			{
				if (answer.IsAuthorized)
				{
					setTimeout('SendRequest()', 300000);
					return true;
				}
				else
				{
					window.location.reload();
					return false;
				}
			}
		}, 
		'json'
	);
}
function CheckAuth(IsAuthorized)
{                                                        
	if (!IsAuthorized)
	{
		if (typeof(authFormWindow) == 'object')
			if (typeof(authFormWindow.ShowLoginForm) == 'function')
				authFormWindow.ShowLoginForm();
	}
}

function function_exists( function_name ) 
{	// Return TRUE if the given function has been defined
	if (typeof function_name == 'string'){
		return (typeof window[function_name] == 'function');
	} else{
		return (function_name instanceof Function);
	}
}

