function ProductCookie()
	{
		if (cookiesAllowed()==true) 
		{
			deleteCookie('spazioCookie')
			str = parent.document.title+'|'+parent.location.href;
			setCookie('spazioCookie',str, 7)
		}
	}
function CookieLoad()
	{
		if (cookiesAllowed()==true) 
		{		
			if (getCookie('spazioCookie') != null) 
			{ 
				pro = getCookie('spazioCookie')
				pro = pro.split('|');
				
				hrefX = pro[1]
				var go = 1;
				var Idx1 = hrefX.search('exterior');
				if(Idx1== -1)
				{
					var Idx2 = hrefX.search('interior');
					if(Idx2== -1)
					{
						var Idx3 = hrefX.search('transformers');
						if(Idx3== -1)
						{
							go = 0;
						}
						else
						{
							var section = 'transformers';
						}						
					}
					else
					{
						var section = 'interior';
					}				
				}
				else
				{
					var section = 'exterior';
				}
				if (go == 1)
				{
					out = '<div class="txt">Recent Product:</div><a href="javascript:openProduct(\''+pro[1]+'\',\''+section+'\')" >'+lengthChk(pro[0])+'</a><br><i style="color:#fff">'+section+'</i>';
					document.write(out);
				}
			}
		}
	}

function lengthChk(str)
	{
		str= str.split(' ');
		out = ''
		for (var i=0; i<str.length; i++)
		{
		if (i == str.length-1 ) 
		{out +=  length2(str[i])} else {out +=  length2(str[i])+' '}  
		}
		return out;
	}

function length2(str)
	{
		
		if (str.length > 11) {str = '';}
		return str;
	}

function write(id,str){ document.getElementById(id).innerHTML = str;	}
function cookiesAllowed() { setCookie('checkCookie', 'test', 1);  if (getCookie('checkCookie')) { deleteCookie('checkCookie'); return true;  }  return false; }

function setCookie(name,value,expires, options)
	{
		if (options===undefined) { options = {}; }
		if ( expires ) { var expires_date = new Date(); expires_date.setDate(expires_date.getDate() + expires)   }
		document.cookie = name+'='+escape( value ) + ( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + (( options.path ) ? ';path=' + options.path : '' ) + ( ( options.domain ) ? ';domain=' + options.domain : '' ) + ( ( options.secure ) ? ';secure' : '' );
	}

function getCookie(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 deleteCookie( name, path, domain )
	{
		if ( getCookie( name ) ) document.cookie = name + '=' + ( ( path ) ? ';path=' + path : '') + ( ( domain ) ? ';domain=' + domain : '' ) +  ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
	}