function Adv_Load(file, w, h, arg)
{
	if(arg == true)
	{
		/*if(!Get_Cookie('adv_nissan.elblag.pl'))
		{*/
			var win_width = (screen.width-w) / 2;
			var win_height = (screen.height-h) / 2;
			document.getElementById('adv_layer').style.width = w;
			document.getElementById('adv_layer').style.height = h;
			document.getElementById('adv_layer').style.top = win_height;
			document.getElementById('adv_layer').style.left = win_width;
			document.getElementById('adv_layer').innerHTML = Flash(w, h, file);
			
			/*Set_Cookie('adv_nissan.elblag.pl', '1', 24, '/', '', '');
		}*/
	}
}

function Hide()
{
	document.getElementById('adv_layer').style.display = 'none';
}

function Flash(w, h, path)
{
	return('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">'
	+'<param name="movie" value="'+path+'" />'
	+'<param name="quality" value="high" />'
	+'<param name="menu" value="0" />'
	+'<embed src="'+path+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="0"></embed>'
	+'</object>');
}

function Set_Cookie(name, value, expires, path, domain, secure) 
{
	var today = new Date();
	today.setTime(today.getTime());

	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if (expires)
	{
		expires = expires * 1000 * 60 * 60;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}

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 ) );
}