/**
 *
 * Fabryka Slow
 *
 * Code designed, created and maintained by ChieftainY2k , www.ChieftainY2k.net
 *
 */

function insertSpecialCharsTable()
{
	var chars = "ą ę ś ć ł ń ó ż ź ß ü ö ä ë á é í ú ç è î ô à â ê û ù ï ñ б в г д ж з и й к л м н п т у ф х ц ч ш щ ъ ы ь э ю я";
	var charsTab = chars.split(" ");
	for(i=0;charsTab[i];i++)
	{
		document.write("<a href='javascript://' onClick=\"insertCharInText('"+charsTab[i]+"');\">"+charsTab[i]+"</a> ");
	};
};

function insertCharInText(ch)
{
	document.F.q.value+=ch;
};

function processSubmitForm()
{
	for(i=1;checkbox=document.getElementById('checkbox_ld_'+i);i++)
	{
		if (checkbox.checked) document.F.ld.value+=(document.F.ld.value?".":"")+checkbox.value;
	};
	saveFormState();
};

function saveFormState()
{
	setCookie("destLang",document.F.ld.value,30);
};

function restoreFormState()
{
	var destLang = getCookie("destLang");
	destLangTab = destLang.split(".");
	for(i=0;destLangId=destLangTab[i];i++)
	{
		for(i2=1;checkbox=document.getElementById('checkbox_ld_'+i2);i2++)
		{
			if (checkbox.value==destLangId) checkbox.checked=true;
		};
	};
};



function setCookie(cookieName,value,expiredays)
{
	var exdate=new Date()
	exdate.setDate(exdate.getDate()+expiredays)
	document.cookie=cookieName+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
};

function getCookie(cookieName)
{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(cookieName + "=")
	  if (c_start!=-1)
	    {
	    c_start=c_start + cookieName.length+1
	    c_end=document.cookie.indexOf(";",c_start)
	    if (c_end==-1) c_end=document.cookie.length
	    return unescape(document.cookie.substring(c_start,c_end))
	    }
	  }
	return "";
}