// $Id: common.js,v 1.1.1.1.2.4 2007/11/11 16:56:52 lukian Exp $

var glob_isIE	= document.all			? true : false;
var glob_isDOM	= document.getElementById	? true : false;
var glob_isNS4	= document.layers		? true : false;

function glob_getBlock( BlockName ) {
	if ( glob_isDOM )	return document.getElementById( BlockName );
	if ( glob_isIE )	return document.all.BlockName;
	if ( glob_isNS4 )	return document.layers[ BlockName ];
}

function firstLoadExec() {

	return ;

	//alert( '??' );
	if ( cGet( 'elidoLoaded' ) == 1 ) {
		glob_getBlock( 'logoImageId' ).style.display = 'block';
		glob_getBlock( 'tufImageId' ).style.display = 'block';
		return true;
	}

	new Effect.Grow( 'logoImageId' );
	new Effect.Grow( 'tufImageId' );

	cSet( 'elidoLoaded', 1, 1 );
}

function cGet( cName ) {
	if ( document.cookie.length > 0 ) {
		var begin = document.cookie.indexOf( cName + "=" );
		var end;
		if ( begin != -1 ) {
			begin += cName.length + 1;
			end    = document.cookie.indexOf( ";", begin );
			if ( end == -1 ) end = document.cookie.length;
			return unescape( document.cookie.substring( begin, end ) );
		}
	}
	return '';
}


function cSet ( cName, cValue, cExp ) {
	document.cookie = cName + "=" + escape( cValue ) + ';path=/;';
}

function getRandomString() {
	var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}