// JavaScript Document

var brouseAct;
if (!brouseAct) brouseAct = {};

brouseAct.detect = function()
{
	this.init();
	var tmp = this.getFontSize();
	this.size = tmp;
};

brouseAct.detect.prototype.minHeight = function( idItem, shiftSize )
{
	//alert(idItem);
};

brouseAct.detect.prototype.init = function()
{
	this.default_size = 13;
	this.size = 4;
	this.fixWidth = 1046;
};

brouseAct.detect.prototype.getElement = function(ele)
{
	if (ele && typeof ele == "string")
		return document.getElementById(ele);
	return ele;
};
// Cookie:
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.

brouseAct.detect.prototype.writeCookie = function(name, value, hours)
{
	var expire = "";
	if(hours != null)
	{
		expire = new Date((new Date()).getTime() + hours * 3600000);
		expire = "; expires=" + expire.toGMTString();
	}
	document.cookie = name + "=" + escape(value) + expire;
};

brouseAct.detect.prototype.readCookie = function(name)
{
	var cookieValue = "";
	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.length;
			cookieValue = unescape(document.cookie.substring(offset, end))
		}
	}
	return cookieValue;
};
// Font:

brouseAct.detect.prototype.fontReSize = function( par )
{
	this.size = Number(this.size);
	if ( par == undefined ) par = 0;
	var n_size = this.size + par;
	if( n_size >= 0 && n_size <= 4 )
	{
		this.size = n_size;
		this.writeCookie( 'globalFontDocumentSize', this.size );
		document.body.style.fontSize = ( this.default_size + this.size ) + 'px';

		switch( this.size )
		{
			case 0:
				this.attachDocSettings( 'visible', 'visible', '0', '11px', '0', '25px 25px', '324px' );
			break;
			case 2:
				this.attachDocSettings( 'visible', 'hidden', '0', '13px', '-2px', '25px 26px', '302px' );
			break;
			case 4:
				this.attachDocSettings( 'hidden', 'hidden', '10px', '14px', '-3px', '25px 28px', '290px' );
			break;
		}
	}
};

brouseAct.detect.prototype.attachDocSettings = function( p1, p2, p3, p4, p5, p6, p7 )
{
	if(this.getElement('bst10')) this.getElement('bst10').style.visibility = p1;
	if(this.getElement('bst11')) this.getElement('bst11').style.visibility = p2;
	if(this.getElement('bst'))
	{		this.getElement('bst').style.paddingTop   = p3;
		this.getElement('bst').style.fontSize     = p4;
	}

	this.getElement('tlink').style.fontSize   = p4;
	this.getElement('tlink').style.marginTop  = p5;

	this.getElement('bstTitle').style.backgroundPosition = p6;
	this.getElement('rss').style.left     = p7;
};

brouseAct.detect.prototype.getFontSize = function()
{
	var fSize = this.readCookie( 'globalFontDocumentSize' );
	if ( fSize ) return fSize;

	this.writeCookie( 'globalFontDocumentSize', this.size );
	return this.size;
};

