/*

Js functions
---------------------------------------------------------------------

Copyright (C) 2005 Marek 'juneau' Klusak, <stopar@tiscali.cz>
Web: http://rs.reality-show.net

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/


function popen(par1, par2, par3, par4){
	window.open('../admin/x_foto_gal.php?slozka=' + par1 + '&soubor=' + par2 + '&x=' + par3 + '&y=' + par4,'','resizable=yes,scrollbars=auto,width=' + par3 + ' height=' + par4 + '');
	}



function vlozSyntaxi(co,formular)
	{
	var t;
	switch(co)
		{
		case 'bold':	t = '**...**';
		break;
		case 'em':	t = '*...*';
		break;
		case 'q':	t = '>>...<<';
		break;
		case 'a':	t = '\"odkaz\":[adresa]';
		break;
		case 'code':	t = '`...`';
		break;
		case 'list': t = '-  ...\n-  ...\n-  ...';
		break;
		case 'acronym':	t = '"..."((vysvětlení))';
		break;
		}
	
	var text = document.getElementById(formular).value;
	document.getElementById(formular).value = text + t;
	}




// zvyraznovani odstavce
var pole = window.location.href.split("#");

if(pole[1])
{
	if(pole[1].substring(0,9) == "odstavec-")
		{
		var odstavec = pole[1];
		document.getElementById(odstavec).className +=" zvyraznit";
		}
	else if(pole[1].substring(0,5) == "comm-")
		{
		var odstavec = pole[1];
		document.getElementById(odstavec).className +=" komentar-zvyraznit";
		}
	else if(pole[1].substring(0,5) == "post-")
		{
		var odstavec = pole[1];
		document.getElementById(odstavec).className +=" post-blok-zvyraznit";
		}
}

// o tomhle se hezky rozepsal pixy: http://www.pixy.cz/pixylophone/2005_03_archiv.html#1110561223




function reference(cislo,formular) {
	var obsahPole = document.getElementById(formular).value;
	if (obsahPole != '')
		obsahPole += '\n';
	document.getElementById(formular).value = obsahPole + '['+cislo+']';
}
