var isNN = (navigator.appName.indexOf("Netscape")!=-1);

function delDefault(e,o){
	if(o.firstTime){
		return;
	}
	o.firstTime=true;
	o.value="";
}

function OnEnter(e, functionName){
	var keyCode = (isNN) ? e.which : e.keyCode; 
	if(keyCode == 13){
		if(e.keyCode == 13) {
			if (functionName != '')
				eval(functionName);
		}
	}
}
function AddTopicURLInput (parent_selector) {
	$(parent_selector).append("<input type='text' name='urls[]' value='' style='width: 80%;margin-bottom:10px;' />&nbsp;&nbsp;<a onClick='AddTopicURLInput(\""+parent_selector+"\");'>+</a>");
}
function Search(text,content,date_from,date_to){
	if(text.length < 3){
		alert('A keresett kifejezés rövidebb, mint 3 karakter!');
		return;
	}
	document.location.href='/forum/kereses/szoveg/' + text + '/content/' + content + '/date_from/' + date_from + '/date_to/' + date_to + '/';
}
(function($) {

$.fn.clickUrl = function() {  
	var regexp = /(href="|src=")?((ftp|http|https):\/\/(\w+:{0,1}\w*@)?([a-zA-Z\-.0-9]+)(:[0-9]+)?(\/([a-zA-Z0-9_#!:.?+=&%@;!\-\/])*)?)/gi; 
	this.each(function() {  
		$(this).html(  
			$(this).html().replace(regexp,function($0,$1,$2){return $1 ? $0 : '<a href="'+$0+'" target="_blank">'+$0+'</a>';
			})  
		);  
	});  
	return $(this);  
}  
})(jQuery);