	function commentshow( id )
	{
		document.getElementById( id+'_small' ).style.display = 'none';
		document.getElementById( id+'_big' ).style.display = 'block';
	}

	function commenthide( id )
	{
	document.getElementById( id+'_big' ).style.display = 'none';
	document.getElementById( id+'_small' ).style.display = 'block';
	document.getElementById( id+'_quick' ).style.display = 'none';
}

function quickreply( id )
{
	disp = document.getElementById( id+'_quick' ).style.display;
	if ( disp != 'block' )
	{
		document.getElementById( id+'_quick' ).style.display = 'block';
	}else
	{
		document.getElementById( id+'_quick' ).style.display = 'none';
	}
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function postquick( id, defuri, defmail, defnick, item, mode )
{
	document.getElementById( id+'_submit' ).style.display = 'none';
	try
	{
		nickname = encodeURIComponent( document.getElementById( id+'_nick' ).value );
		mail = encodeURIComponent( document.getElementById( id+'_mail' ).value );
		website = encodeURIComponent( document.getElementById( id+'_website' ).value );
	}
	catch ( err )
	{
		nickname = '';
		mail = '';
		website = '';
	}
	nickname = ( nickname == encodeURIComponent( defnick ) ) ? '' : nickname;
	mail = ( mail == encodeURIComponent( defmail ) ) ? '' : mail;
	website = ( website == encodeURIComponent( defuri ) ) ? '' : website;
	title = encodeURIComponent( document.getElementById( id+'_title' ).value );
	content = encodeURIComponent( document.getElementById( id+'_content' ).value );
	if ( typeof( item ) == "undefined" )
	{
		item = document.getElementById( id+'_itemid' ).value;
	}
	if ( typeof( mode ) == "undefined" )
	{
		mode = document.getElementById( id+'_mode' ).value;
	}
	pikce3 = encodeURIComponent( document.getElementById( id+'_pikce3' ).value );

	cookie = encodeURIComponent( nickname )+'::'+encodeURIComponent( mail )+'::'+encodeURIComponent( website );
	createCookie( 'swizecBlogCommentForm', cookie);

	x_postquick( id, nickname, mail, website, title, content, item, mode, pikce3, postquick2 );
}

function postquick2( get )
{
	if ( get[ 0 ] == 1 )
	{
		document.getElementById( get[ 1 ]+'_quick' ).style.display = 'none';
		window.location.reload( true );
	}else
	{
		document.getElementById( get[ 1 ]+'_error' ).innerHTML = get[ 2 ]+'<br />';
		document.getElementById( get[ 1 ]+'_submit' ).style.display = 'block';
	}
}
