
///////////////////////////////////////////////////////////////////////////////
$(document).ready(function(){
	if(window.mailtoAntiSpam) mailtoAntiSpam();
	$('input[type=text]:not(.typetext)').addClass('typetext');
	$('input[type=password]:not(.typetext)').addClass('typetext');
	$('input[type=checkbox]:not(.typecheckbox)').addClass('typecheckbox');
	$('input[type=radio]:not(.typeradio)').addClass('typeradio');
	$('input[type=file]:not(.typefile)').addClass('typefile');
	$('input[type=submit]:not(.typesubmit)').addClass('typesubmit');
	$('input[type=reset]:not(.typesubmit)').addClass('typesubmit');
	$('a.submit').click(function(){
		var form = $(this).parents('form').get(0);
		if(!form.onsubmit) form.submit();
		else if(form.onsubmit.apply(form)) form.submit();
		return false;
		});
	$('IFRAME.allowTransparency').attr('allowTransparency', 'true');
	if(window.initOverLabels) setTimeout(initOverLabels, 50);
	});

///////////////////////////////////////////////////////////////////////////////
function mailtoAntiSpam(){
	$("span[class='email']").each(function(){
		var mailtoVal = $(this).html().replace(' kukac ', '@').replace(' at ', '@').replace(' pont ', '.').replace(' dot ', '.');
		var titleVal = $(this).attr('title').replace(' kukac ', '@').replace(' at ', '@').replace(' pont ', '.').replace(' dot ', '.');
		if(!titleVal) titleVal = mailtoVal;
		var s = mailtoVal.match(/subject=([^&]*)/);
		if(s) mailtoVal = mailtoVal.replace(/(subject=)([^&]*)/, '$1'+escape(s[1]));
		$(this).replaceWith('<a href="mailto:'+mailtoVal+'" class="email" title="'+titleVal+'">'+titleVal+'</a>')
		});
	}

///////////////////////////////////////////////////////////////////////////////
function writeToPopup(content){
	var consoleRef = window.open('','popupconsole','width=800,height=500,menubar=0,toolbar=1,status=0,scrollbars=1,resizable=1');
	consoleRef.document.writeln('<html><head><title>Popup Console</title></head><body style="font:11px Helvetica,Arial,sans-serif;" onload="self.focus();">'+content+'</body></html>');
	consoleRef.document.close();
	}

