self.name="homeandi";

if (document.layers){
	document.write('<meta http-equiv="Content-Type" content="text/html; charset=TIS-620">');
}else{
	document.write ('<meta http-equiv="Content-Type" content="text/html; charset=windows-874">');
	document.write ('<meta name="description" CONTENT="เรื่องบ้าน ครบเรื่องบ้าน บริการตรงใจคุณ">');
}

//--------------------------------------------------------------------------------------------------------------------------------------------------
function setCookie(name,value,expire){
	document.cookie = name + "=" + escape(value) + ((expire==null) ? "" : ("; expires=" + expire.toGMTString()));
}
//--------------------------------------------------------------------------------------------------------------------------------------------------
function getCookie(Name)
{
	return getCookieItem('sansiri',Name)
}
//--------------------------------------------------------------------------------------------------------------------------------------------------
function getCookieItem(Name,Key)
{
	var Value = new String;
	var search = Name + "=";
	if (document.cookie.length>0)
	{
		offset=document.cookie.indexOf(search)
		if(offset != -1)
		{
			offset += search.length;
			end=document.cookie.indexOf(";",offset);
			if(end == -1){
				end=document.cookie.indexOf(" ",offset);
				if(end==-1)
					end = document.cookie.length;
			}
			Value = unescape(document.cookie.substring(offset,end))
		}
	}

	if (Key==null || Key=='')
	{
		return Value;
	}

	search = Key + "=";
	if (Value.length>0)
	{
		offset=Value.indexOf(search)
		if(offset != -1)
		{
			offset += search.length;
			end=Value.indexOf("&",offset);
			if(end==-1)
				end = Value.length;

			Value = unescape(Value.substring(offset,end));
		}
	}

	return Value;
}


function popup(url,width,height,scrollbar)
{
	window.open(url,'popup','width=' + width + ',height=' + height +',scrollbars=' + scrollbar);
}