function Delete_Cookie( name, path, domain )
{
	if ( Get_Cookie( name ) ) document.cookie = name + "=" + ( ( path ) ? ";path=" + path : "") + ( ( domain ) ? ";domain=" + domain : "" ) + ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function Get_Cookie( name )
{
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) )
	{
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function showLayer(id)
{
	$('#'+id).show('slow');
}

function hideLayer(id)
{
	$('#'+id).hide('slow');
}

function showInfoLayer(title,info,type)
{
	var d=document.getElementById('inform');
	switch(type)
	{
		case 'del':
			d.className='del';
			break;
		case 'info':
			d.className='info';
			break;
		case 'ok':
			d.className='ok';
			break;
		case 'alert':
			d.className='alert';
			break;
		default:
			d.className='info';
			break;
	}
	d.innerHTML='<h1>'+title+'</h1>'+'<p>'+info+'</p>';
	$('#inform').show('slow');
	Delete_Cookie('cms_action','','');
	setTimeout("hideInfoLayer()",10000);
}

function hideInfoLayer()
{
	$('#inform').hide('slow');
}

function popupOpen()
{
	var url=document.location+'/mode,print';
	window.open( url, "PrintVersion");
}

function wo(url,width,height)
{
	window.open( url, "PrintVersion", "width="+width+", height="+height);
}


function PNG(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 = "/web/themes/default/img/t.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 showPrintable(url) {
        var winSets = 'left=0,top=0,height=600,width=800,menubar=no,toolbar=no,resizable=yes,status=no,scrollbars=yes';
        var prWin = window.open( url, "winPrint", winSets);
}