/*
	common.js - functions for user site

	eclat CommunitySystem
	Copyright (c) 2004-2005 MaJestic 12. All rights reserved.
*/

function checkFrame(type)
{
	if (type == 'top')
	{
		self == top
			|| (top.location.href = self.location.href);
	}
	else if (type == 'main_ph801fy')
	{
		if (!(self == top || self == top.frames['main_ph801fy']))
		{
			nowHref = self.location.href;
			top.location.href = 'http://www.eclat.cc/home/ph801fy/';
			top.frames['main_ph801fy'].location.href = nowHref;
		}
	}
	else if (type == 'menu_ph801fy')
	{
		self == top || self == top.frames['menu_ph801fy']
			|| (top.location.href = 'http://www.eclat.cc/home/ph801fy/');
	}
}

function eitherOwnerOrGuest()
{
	if (document.cookie.indexOf('HOME=1;') == -1)
	{
		var elements = document.getElementsByTagName("*");

		for (var i = 0, len = elements.length; i < len; i++)
			elements[i].className == 'for-owner'
				&& (elements[i].className = 'for-guest');
	}
}
