//youtube load
function youtubeLOAD(id,link){
document.getElementById(id).innerHTML = '<iframe title="YouTube video player" width="425" height="349" src="http://www.youtube.com/embed/'+link+'" frameborder="0" allowfullscreen ></iframe><div style="text-align: right; cursor: pointer; width: 425px;" onclick="youtubeCLOSE('+id+')">[bezár]</div>';
}
function youtubeCLOSE(id){
document.getElementById(id).innerHTML = '';
}
//PRIVÁT CHAT//////////////
PCHuid='';
chat_timer='';
pchat_timer='';
pchat_chktimer='';
scrollPOS='';
POLISTscrollPOS='';
elozoTITLE='';
function titleRESET(){
if (elozoTITLE) document.title = elozoTITLE;
}
//privi értesítő
function pchatCHK(){
pchat_chktimer = setInterval(pchatCHKX,10000);
}
function pchatCHKX(){
if (document.getElementById('NiceChatDiv').style.display == 'none') var a = new Ajax.Request("ajaxjobs/chatchk.php",{method: 'post', parameters: 'chk=1',onComplete: pchatCHKXvissza});
}
function pchatCHKXvissza(a){
if (a.responseText > 0){
chatDiv(a.responseText);
elozoTITLE = document.title;
document.title = 'Új üzenet(ek) a csevegőn!';
}
}
//privi bezár
function pchatCLOSE(pcid,pref){
PCHuid='';
createCookieX('nice_chatcookie','asd',1);
var a = new Ajax.Request("ajaxjobs/chat.php",{method: 'post', parameters: 'pcid=' + pcid + '&pref=' + pref,onComplete: chatKERESX});
}
//user chat megnyitás//////
function pchatOPEN(uid){
chatDiv(uid);
}
//////////////////////////
//checkbox pipa klikk / mindenki vagy csak az
//ismerősök legyenek az chat online listában
function privi_ism_cookie(){
ismjel = readCookieX('only_ism');
if (ismjel) eraseCookieX('only_ism');
else createCookieX('only_ism','asd',1);
priviOLISTx();
}
/////////////////////////////////////////////
//chat online lista nyit / csuk//////////////////
function priviOLIST(){
if (document.getElementById('pCHATlist').style.display == 'inline'){
document.getElementById('pCHATlist').style.display = 'none';
clearInterval(pchat_timer);
eraseCookieX('privi_olist');
}else{
createCookieX('privi_olist','asd',1);
document.getElementById('pCHATlist').style.display = 'inline';
priviOLISTx();
if (pchat_timer) clearInterval(pchat_timer);
pchat_timer = setInterval(priviOLISTx,20000);
}
}
////////////////////////////////////////////
//chat online list frissítése
function priviOLISTx(){
if (document.getElementById("chat_OU_scroll")){
POLISTobjDiv = document.getElementById("chat_OU_scroll");
POLISTscrollPOS = POLISTobjDiv.scrollTop;
}
ism = readCookieX('privi_ism');
var a = new Ajax.Request("ajaxjobs/chat_online_list.php",{method: 'post', parameters: 'ism='+ism,onComplete: priviOLISTxvissza});
}
function priviOLISTxvissza(a){
document.getElementById('pCHATlist').innerHTML = a.responseText;
POLISTobjDiv = document.getElementById("chat_OU_scroll");
if (POLISTscrollPOS) POLISTobjDiv.scrollTop = POLISTscrollPOS;
}
///////////////////////////////////////////
//CHAT VÉGE///////////////////////////////
//kézi lapozás
function pickeypager(e){
var keynum;
if(window.event) // IE;
{
keynum = e.keyCode;
}
else if(e.which) // Netscape/Firefox/Opera;
{
keynum = e.which;
}
if (retext[0]){
if (keynum == "37") picQuery(retext[5],retext[3]);
else if (keynum == "39") picQuery(retext[5],retext[4]);
}
}
document.onkeydown = pickeypager;
//////////////////////////////////
function wslikeLIST(wid,wsnev){
wsname = wsnev;
var a = new Ajax.Request("ajaxjobs/wslikelist.php",{method: 'post', parameters: 'wid=' + wid,onComplete: wslikeLISTVISSZA});
}
function wslikeKLIST(uid,wsnev){
wsname = wsnev;
var a = new Ajax.Request("ajaxjobs/wslikelist.php",{method: 'post', parameters: 'uid=' + uid,onComplete: wslikeKLISTVISSZA});
}
function wslikeLISTVISSZA(a){
s = a.responseText;
ablak("400px","150px","<font style='color: #ffffff;'>"+ wsname +" követői</font>",s);
}
function wslikeKLISTVISSZA(a){
s = a.responseText;
ablak("400px","150px","<font style='color: #ffffff;'>"+ wsname +" kedvenc weboldalai</font>",s);
}
function mouseYxcv(evt){
if (evt.pageY) return evt.pageY;
else if (evt.clientY){
   return evt.clientY + (document.documentElement.scrollTop ?
   document.documentElement.scrollTop :
   document.body.scrollTop);
   }
else return null;
}
function mouseXxcv(evt){
if (evt.pageX) return evt.pageX;
else if (evt.clientX){
   return evt.clientX + (document.documentElement.scrollLeft ?
   document.documentElement.scrollLeft :
   document.body.scrollLeft);
   }
else return null;
}
function name_menu_pos(e,id){
//if (!e) e = window.event;
if (document.getElementById(id).style.top == '' && e){
Ypos = mouseYxcv(e);
Xpos = mouseXxcv(e);
document.getElementById(id).style.left = (Xpos-10) + 'px';
document.getElementById(id).style.top = Ypos + 'px';
}
}
function reComm(me){
document.getElementById(me).innerHTML = '<textarea name="reuz_'+me+'" id="reuz_'+me+'" cols="62" rows=1 onkeyup="tareaLimiter(this,\'tareamsg_'+me+'\')"></textarea><br><span id="tareamsg_'+me+'"></span> <input type="submit" name="Submit" value="Mehet" class="button" onclick="comSubmit(\''+me+'\')"/>';
}
function comSubmit(me){
Val = document.getElementById('reuz_'+me).value;
document.getElementById('tareamsg_'+me).innerHTML ='<img src="images/ajax-loader2.gif">';
if (Val != "" && Val!="Hiba! Nem írtál semmit!"){
Val = encodeURIComponent(Val);
var a = new Ajax.Request("ajaxjobs/recomment.php",{method: 'post', parameters: 'txt=' + Val + '&reid=' + me,onComplete: comSubmitVISSZA});
}else{
document.getElementById('reuz_'+me).innerHTML = "Hiba! Nem írtál semmit!";
document.getElementById('tareamsg_'+me).innerHTML ='';
}
}
function comList(me){
document.getElementById('CList_'+me).innerHTML ='<img src="images/ajax-loader2.gif">';
var a = new Ajax.Request("ajaxjobs/recomment_list.php",{method: 'post', parameters: 'reid=' + me,onComplete: comSubmitVISSZA});
}
function comSubmitVISSZA(a){
retext = a.responseText.split('@',3);
document.getElementById('X'+retext[0]).innerHTML = retext[1];
document.getElementById(retext[0]).innerHTML = retext[2];
}
function bLoad(limit,wherex){
where = encodeURIComponent(wherex);
start = document.getElementById('endBid').value;
document.getElementById('more_loader').innerHTML ='<img src="images/ajax-loader2.gif" align=center>';
var a = new Ajax.Request("ajaxjobs/beszlist_more.php",{method: 'post', parameters: 'where=' + where + '&start=' + start + '&limit=' + limit,onComplete: bLoadVISSZA});
}
function bLoadVISSZA(a){
retext = a.responseText.split('@',2);
document.getElementById('endBid').value = retext[0];
document.getElementById('more_load').innerHTML = document.getElementById('more_load').innerHTML+ retext[1];
document.getElementById('more_loader').innerHTML = '';
}
function beszdele(beszid){
var a = new Ajax.Request("ajaxjobs/beszdele.php",{method: 'post', parameters: '&beszid=' + beszid,onComplete: beszdeleVISSZA});
}
function beszdeleVISSZA(a){
//asd_alert(a.responseText);
document.getElementById(a.responseText).innerHTML = '';
document.getElementById(a.responseText+'_2').innerHTML = '';
document.getElementById(a.responseText+'_3').innerHTML = '';
asd_alert("A bejegyzés törölve lett");
}
function linkF(){
if (document.getElementById('linkviewdele').style.display == 'none') {
txt = document.getElementById('uz').value + ' ';
httppos = txt.indexOf('http://');
wwwpos = txt.indexOf('www.');
if (wwwpos > -1 || httppos > -1){
//document.getElementById('share_submit').disabled = true;
document.getElementById('share_submit_loader').innerHTML ='<img src="images/ajax-loader2.gif" align=center>';
spacepos = txt.lastIndexOf(' ');
if (wwwpos > -1 && httppos > -1 || httppos > -1) link = txt.slice(httppos,spacepos);
else if (wwwpos > -1) link = 'http://' + txt.slice(wwwpos,spacepos);
link = link.replace(' ','');
link = encodeURIComponent(link);
var a = new Ajax.Request("ajaxjobs/beszlink_data.php",{method: 'post', parameters: '&url=' + link,onComplete: visszalinkF});
}
}
return false;
}
function linkF2(){
txt = document.getElementById('beszurl').value + ' ';
httppos = txt.indexOf('http://');
wwwpos = txt.indexOf('www.');
if (wwwpos > -1 || httppos > -1){
//document.getElementById('share_submit').disabled = true;
document.getElementById('share_submit_loader').innerHTML ='<img src="images/ajax-loader2.gif" align=center>';
spacepos = txt.lastIndexOf(' ');
if (wwwpos > -1 && httppos > -1 || httppos > -1) link = txt.slice(httppos,spacepos);
else if (wwwpos > -1) link = 'http://' + txt.slice(wwwpos,spacepos);
link = link.replace(' ','');
link = encodeURIComponent(link);
var a = new Ajax.Request("ajaxjobs/beszlink_data.php",{method: 'post', parameters: '&url=' + link,onComplete: visszalinkF});
}else document.getElementById('share_submit_loader').innerHTML = 'HIBA! helytelenül írta be a hivatkozást!';
return false;
}
function visszalinkF(a){
linkcode = a.responseText.split('{{@}}',3);
if (linkcode[0]){
document.getElementById('beszurl_div').innerHTML = linkcode[0];
document.getElementById('linkviewdele').style.display = 'inline';
//document.getElementById('share_submit_loader').innerHTML ='<input type=submit name="share_submit" id="share_submit" value=Megosztás class=button>';
document.getElementById('attachment').value = linkcode[0];
if (linkcode[2] && linkcode[1]) linkpics(linkcode[1],linkcode[2]);
}else{
document.getElementById('share_submit_loader').innerHTML = 'HIBA! valószínűleg helytelenül írtad be a hivatkozást!';
}
document.getElementById('share_submit_loader').innerHTML ='<input type="submit" name="share_submit" id="share_submit" value="Megosztás" class="button">';
return false;
}
function ifSpace(e){
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
if (code == 32) linkF();
return false;
}
function Lreset(){
document.getElementById('beszurl_div').innerHTML = 'Link megosztása: <input type=text id="beszurl" size=56"> <input type=submit id="csatol" name=csatol value=Csatol class=button onclick="return linkF2()">';
document.getElementById('linkviewdele').style.display = 'none';
document.getElementById('attachment').value = '';
}
function linkpics(linkcode,url){
picurl = linkcode.split(' ');
allpicnr = picurl.length;
if (picurl[0].indexOf('http://')  > -1) document.getElementById('urlpicdiv').innerHTML = '<table width=200 height=100><tr><td colspan=2 align=center><a href="'+ url +'" target="_blank"><img src="' + picurl[0] + '" style="max-width: 200px; max-height: 200px;"></a></td></tr><tr><td align=center onclick="picklikk('+ (allpicnr-1) +',\''+ url +'\',\''+ linkcode +'\');" title="kép váltása" alt="kép váltása" style="cursor: pointer;">&lt;&lt;</td><td align=center onclick="picklikk(1,\'' + url + '\',\''+ linkcode +'\');" title="kép váltása" alt="kép váltása" style="cursor: pointer;">&gt;&gt;</td></tr></table>';
else document.getElementById('urlpicdiv').innerHTML = '<a href="'+ url +'" target="_blank"><img src="images/news.jpg" style="max-width: 200px"></a>';
document.getElementById('attachment').value = document.getElementById('beszurl_div').innerHTML;
return false;
}
function picklikk(klikk,url,linkcode){
picurl = linkcode.split(' ');
allpicnr = picurl.length;
if (klikk < 0) klikk = allpicnr-2;
if (klikk > allpicnr-2) klikk = 0;
document.getElementById('urlpicdiv').innerHTML = '<table width=170 height= 150><tr><td colspan=2 align=center><a href="'+ url +'" target="_blank"><img src="' + picurl[klikk] + '" style="max-width: 200px; max-height: 200px;"></a></td></tr><tr><td align=center onclick="picklikk('+ (klikk-1) +',\''+ url +'\',\''+ linkcode +'\');" title="kép váltása" alt="kép váltása" style="cursor: pointer;">&lt;&lt;</td><td align=center onclick="picklikk('+ (klikk+1) +',\''+ url +'\',\''+ linkcode +'\');" title="kép váltása" alt="kép váltása" style="cursor: pointer;">&gt;&gt;</td></tr></table>';
document.getElementById('attachment').value = document.getElementById('beszurl_div').innerHTML;
return;
}
function like(me,img,where){
document.getElementById('likespan_'+me).innerHTML ='<img src="images/ajax-loader2.gif">';
//if (where=='img') var a = new Ajax.Request("ajaxjobs/imglike.php",{method: 'post', parameters: 'img=' + img + '&likeid=' + me + '&where=' + where,onComplete: likeVISSZA});
var a = new Ajax.Request("ajaxjobs/like.php",{method: 'post', parameters: 'likeid=' + me + '&img=' + img + '&where=' + where,onComplete: likeVISSZA});
}
function likeVISSZA(a){
retext = a.responseText.split('@',3);
document.getElementById('likespan_'+retext[0]).innerHTML =retext[1];
document.getElementById('countlike_'+retext[0]).innerHTML =retext[2];
}
function likeTitle(id){
id = encodeURIComponent(id);
var a = new Ajax.Request("ajaxjobs/liketitle.php",{method: 'post', parameters: 'likeid=' + id,onComplete: likeTitleVISSZA});
}
function likeTitleVISSZA(a){
retext = a.responseText.split('@',2);
document.getElementById('liketitle_'+retext[0]).title = retext[1];
//asd_alert('Nekik tetszik: '+retext[1]);
}
function likeTitleClick(id,title){
id = encodeURIComponent(id);
var a = new Ajax.Request("ajaxjobs/liketitle.php",{method: 'post', parameters: 'likeid_C=' + id + '&title=' + title,onComplete: likeTitleClickVISSZA});
}
function likeTitleClickVISSZA(a){
s = a.responseText;
ablak("400px","150px","<font style='color: #ffffff;'>Nekik tetszik</font>",s);
//asd_alert('Nekik tetszik: '+retext[1]);
}
function imgcommSubmit(imglink,alanyuid){
txt = document.getElementById('imgComment').value;
if (txt.length > -1){
txt = encodeURIComponent(txt);
document.getElementById('loader').innerHTML ='<img src="images/ajax-loader2.gif">';
var a = new Ajax.Request("ajaxjobs/imgcomment_list.php",{method: 'post', parameters: 'imglink=' + imglink+'&txt='+txt+'&alanyuid='+alanyuid,onComplete: imgcommSubmitVISSZA});
}else document.getElementById('loader').innerHTML ='Nem írtál szöveget, így nem tudjuk elküldeni!';
}
function imgcommSubmitVISSZA(a){
document.getElementById('imgComment').value='';
document.getElementById('imgCommList').innerHTML = a.responseText;
document.getElementById('loader').innerHTML ='A hozzászólás bejegyzésre került';
setTimeout('document.getElementById("loader").innerHTML =""',2000);
}
function pollcommSubmit(id){
txt = document.getElementById('pollComment').value;
if (txt.length > -1){
txt = encodeURIComponent(txt);
document.getElementById('loader').innerHTML ='<img src="images/ajax-loader2.gif">';
var a = new Ajax.Request("ajaxjobs/pollcomment_list.php",{method: 'post', parameters: 'id=' + id + '&txt=' + txt,onComplete: pollcommSubmitVISSZA});
}else document.getElementById('loader').innerHTML ='Nem írtál szöveget, így nem tudjuk elküldeni!';
}
function pollcommSubmitVISSZA(a){
document.getElementById('pollComment').value='';
document.getElementById('pollCommList').innerHTML = a.responseText;
document.getElementById('loader').innerHTML ='A hozzászólás bejegyzésre került';
setTimeout('document.getElementById("loader").innerHTML =""',2000);
}
function kepFel(cmd,id){
var a = new Ajax.Request("ajaxjobs/kepfel.php",{method: 'post', parameters: 'cmd=' + cmd, onComplete: kepFelVISSZA});
pdirNAME = cmd;
uid = id;
}
function gallery(id,cmd){
var a = new Ajax.Request("ajaxjobs/gallery.php",{method: 'post', parameters: 'id=' + id + '&cmd=' + cmd, onComplete: kepFelVISSZA});
}
function kepFelVISSZA(a){
retext = a.responseText.split('|?|',2);
document.getElementById('alt_kep').innerHTML = retext[0];
if (retext[1]) pdirNAME = retext[1];

if (retext[2]) uid = retext[2];

jQuery(function(){
	jQuery('#swfupload-control').swfupload({
		upload_complete_handler: 'index.php',
		upload_url: "ajaxjobs/kepfel.php?param=picupload&cmd=" + pdirNAME + "&uid=" + uid,
		file_post_name: 'filename',
		file_size_limit : "5120",
		file_types : "*.jpg;*.png;*.gif",
		file_types_description : "Image files",
		file_upload_limit : 20,
		flash_url : "images/swfupload/swfupload.swf",
		button_image_url : 'images/swfupload/upload.png',
		button_width : 114,
		button_height : 29,
		button_window_mode : 'transparent',
		button_placeholder : jQuery('#button')[0],
		debug: false
	})
		.bind('fileQueued', function(event, file){
			var listitem='<li id="'+file.id+'" >'+
				'Kép: <em>'+file.name+'</em> ('+Math.round(file.size/1024)+' KB) <span class="progressvalue" ></span>'+
				'<div class="progressbar" ><div class="progress" ></div></div>'+
				'<p class="status" >Folyamatban</p>'+
				'<span class="cancel" >&nbsp;</span>'+
				'</li>';
			jQuery('#log').append(listitem);
			jQuery('li#'+file.id+' .cancel').bind('click', function(){
				var swfu = jQuery.swfupload.getInstance('#swfupload-control');
				swfu.cancelUpload(file.id);
				jQuery('li#'+file.id).slideUp('fast');
			});
			// start the upload since it's queued
			jQuery(this).swfupload('startUpload');
		})
		.bind('fileQueueError', function(event, file, errorCode, message){
			alert('Túl nagy fájlméret: '+file.name);
		})
		.bind('fileDialogComplete', function(event, numFilesSelected, numFilesQueued){
			jQuery('#queuestatus').text('kiválasztva: '+numFilesSelected+' db kép / ebből feltölthető: '+numFilesQueued+' db');
		})
		.bind('uploadStart', function(event, file){
			jQuery('#log li#'+file.id).find('p.status').text('Feltöltés...');
			jQuery('#log li#'+file.id).find('span.progressvalue').text('0%');
			jQuery('#log li#'+file.id).find('span.cancel').hide();
		})
		.bind('uploadProgress', function(event, file, bytesLoaded){
			//Show Progress
			var percentage=Math.round((bytesLoaded/file.size)*100);
			jQuery('#log li#'+file.id).find('div.progress').css('width', percentage+'%');
			jQuery('#log li#'+file.id).find('span.progressvalue').text(percentage+'%');
		})
		.bind('uploadSuccess', function(event, file, serverData){
			var item=jQuery('#log li#'+file.id);
			item.find('div.progress').css('width', '100%');
			item.find('span.progressvalue').text('100%');
			var pathtofile='';
			item.addClass('success').find('p.status').html('kész!!! '+pathtofile);
		})
		.bind('uploadComplete', function(event, file){
			// upload has completed, try the next one in the queue
			jQuery(this).swfupload('startUpload');
			var swfu = jQuery.swfupload.getInstance('#swfupload-control');
if (swfu.getStats().files_queued == 0){
//window.location = window.location;
kepFel(pdirNAME,uid);
}
		})	
});
}
function picQuery(uid,img){
var a = new Ajax.Request("ajaxjobs/gallery_pic.php",{method: 'post', parameters: 'img=' + img +'&alanyuid='+uid,onComplete: picQueryVISSZA});
}
function picQueryVISSZA(a){
retext = a.responseText.split('@',6);
ablak("1024px","550px","<font style='color: #ffffff;'>"+retext[2]+"</font>",retext[0]);
document.getElementById('loader').innerHTML ='<img src="images/ajax-loader2.gif">';
var a = new Ajax.Request("ajaxjobs/imgcomment_list.php",{method: 'post', parameters: 'imglink='+retext[1],onComplete: IMGcommLISTloadVISSZA});
}
function IMGcommLISTloadVISSZA(a){
document.getElementById('imgCommList').innerHTML = a.responseText;
//alert(a.responseText);
document.getElementById('loader').innerHTML ='';
}
function pollQuery(id,full){
document.getElementById('loader').innerHTML ='<img src="images/ajax-loader2.gif">';
var a = new Ajax.Request("ajaxjobs/pollcomment_list.php",{method: 'post', parameters: 'id='+id+'&full='+full,onComplete: pollcommLISTloadVISSZA});
}
function pollcommLISTloadVISSZA(a){
document.getElementById('pollCommList').innerHTML = a.responseText;
//alert(a.responseText);
document.getElementById('loader').innerHTML ='';
}
function newpicAlbum(){
s = 'Add meg az új album nevét:<br><input type=text id="newPicAid"> <input type=submit value="Új album" onclick="newpicAlbumS()" class=submit>';
ablak("400px","70px","<font style='color: #ffffff;'>Új album létrehozása</font>",s);
}
function newpicAlbumS(){
aname = encodeURIComponent(document.getElementById('newPicAid').value);
s = '<img src="images/ajax-loader2.gif">';
ablak("400px","70px","<font style='color: #ffffff;'>Új album létrehozása</font>",s);
var a = new Ajax.Request("ajaxjobs/kepfel.php",{method: 'post', parameters: 'albumname=' + aname,onComplete: kepFelVISSZA});
ablak("400px","70px","<font style='color: #ffffff;'>Új album létrehozása</font>","Az album elkészült");
setTimeout(ablak_csuk_osszes,2000);
}
function setGall(cmd,param){
if (param=='albtitle' || param=='imgtitle') txt = document.getElementById(cmd).value;
else txt = 0;
var a = new Ajax.Request("ajaxjobs/kepfel.php",{method: 'post', parameters: 'cmd=' + cmd + '&param='+ param +'&txt=' + txt,onComplete: kepFelVISSZA});
}
/*//ajax upload
function $m(theVar){
	return document.getElementById(theVar)
}
function remove(theVar){
	var theParent = theVar.parentNode;
	theParent.removeChild(theVar);
}
function addEvent(obj, evType, fn){
	if(obj.addEventListener)
	    obj.addEventListener(evType, fn, true)
	if(obj.attachEvent)
	    obj.attachEvent("on"+evType, fn)
}
function removeEvent(obj, type, fn){
	if(obj.detachEvent){
		obj.detachEvent('on'+type, fn);
	}else{
		obj.removeEventListener(type, fn, false);
	}
}
function isWebKit(){
	return RegExp(" AppleWebKit/").test(navigator.userAgent);
}
function ajaxUpload(form,url_action,id_element,html_show_loading,html_error_http,cmd){
	var detectWebKit = isWebKit();
	form = typeof(form)=="string"?$m(form):form;
	var erro="";
	if(form==null || typeof(form)=="undefined"){
		erro += "The form of 1st parameter does not exists.\n";
	}else if(form.nodeName.toLowerCase()!="form"){
		erro += "The form of 1st parameter its not a form.\n";
	}
	if($m(id_element)==null){
		erro += "The element of 3rd parameter does not exists.\n";
	}
	if(erro.length>0){
		alert("Error in call ajaxUpload:\n" + erro);
		return;
	}
	var iframe = document.createElement("iframe");
	iframe.setAttribute("id","ajax-temp");
	iframe.setAttribute("name","ajax-temp");
	iframe.setAttribute("width","0");
	iframe.setAttribute("height","0");
	iframe.setAttribute("border","0");
	iframe.setAttribute("style","width: 0; height: 0; border: none;");
	form.parentNode.appendChild(iframe);
	window.frames['ajax-temp'].name="ajax-temp";
	var doUpload = function(){
		removeEvent($m('ajax-temp'),"load", doUpload);
		var cross = "javascript: ";
		cross += "void(0);";
		$m(id_element).innerHTML = html_show_loading;
		$m('ajax-temp').src = cross;
		if(detectWebKit){
        	remove($m('ajax-temp'));
        }else{
        	setTimeout(function(){ remove($m('ajax-temp'))}, 250);
        }
	kepFel(cmd)
    }
	addEvent($m('ajax-temp'),"load", doUpload);
	form.setAttribute("target","ajax-temp");
	form.setAttribute("action",url_action);
	form.setAttribute("method","post");
	form.setAttribute("enctype","multipart/form-data");
	form.setAttribute("encoding","multipart/form-data");
	if(html_show_loading.length > 0){
		$m(id_element).innerHTML = html_show_loading;
	}
	form.submit();
}
//ajax upload end */
function chatDiv(uid){
if (uid > 0){
PCHuid = uid;
pi_CONT=uid;
}else{
PCHuid = '';
pi_CONT='asd';
}
if (document.getElementById('NiceChatDiv').style.display == 'inline' && !uid && uid!='0'){
document.getElementById('NiceChatDiv').style.display = 'none';
clearInterval(chat_timer);
eraseCookieX('nice_chatcookie');
}else{
createCookieX('nice_chatcookie',pi_CONT,1);
document.getElementById('NiceChatDiv').style.display = 'inline';
chatKERES();
if (chat_timer) clearInterval(chat_timer);
chat_timer = setInterval(chatKERES2,4000);
}
}
function enteRR(e){
if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}
if (characterCode == 13){
chatMEHET();
}
}
function chatMEHET(){
ctxt = document.getElementById("chat_tx").value;
ctxt = encodeURIComponent(ctxt);
document.getElementById("chat_tx").value="";
var a = new Ajax.Request("ajaxjobs/chat.php",{method: 'post', parameters: 'ctxt=' +ctxt+ '&uid=' + PCHuid,onComplete: chatKERESX});
//var a = new Ajax.Request("ajaxjobs/chat.php?ctxt="+ctxt,{method: 'get', onComplete: chatKERESX});
}
function chatKERES(){
var a = new Ajax.Request("ajaxjobs/chat.php",{method: 'post', parameters: 'uid=' + PCHuid,onComplete: chatKERESX});
}
function chatKERES2(){
objDivx = document.getElementById("chat_scroll");
//objChatTable = document.getElementById("chat_tablecont");
//alert(objDivx.scrollTop +' | '+ objDivx.style.height);
scrollPOS = objDiv.scrollTop;
var a = new Ajax.Request("ajaxjobs/chat.php",{method: 'post', parameters: 'uid=' + PCHuid, onComplete: chatKERESX});
}
function chatKERESX(a){
document.getElementById("chatTXT").innerHTML = a.responseText;
objDiv = document.getElementById("chat_scroll");
if (!scrollPOS) objDiv.scrollTop = objDiv.scrollHeight;
else objDiv.scrollTop = scrollPOS;
}
function createCookieX(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 readCookieX(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 eraseCookieX(name) {
	createCookie(name,"",-1);
}
function nice_cookie_chk(){
//alert('ok');
nicechatCOOKIE=readCookieX('nice_chatcookie');
if (nicechatCOOKIE){
if (nicechatCOOKIE!='asd') PCHuid = nicechatCOOKIE;
document.getElementById('NiceChatDiv').style.display = 'inline';
chatKERES();
chat_timer = setInterval(chatKERES2,4000);
}
if (readCookieX('privi_olist')=='asd'){
document.getElementById('pCHATlist').style.display = 'inline';
priviOLISTx();
pchat_timer = setInterval(priviOLISTx,20000);
}
}
function notify_list(){
if (document.getElementById('notify_list').style.display == 'none') var a = new Ajax.Request("ajaxjobs/notify_list.php",{method: 'post', parameters: 'mode=list',onComplete: notify_listVISSZA});
else{
setInterval(notify_bg,3000);
document.getElementById('notify_list').style.display = 'none';
document.getElementById('notify_list').innerHTML = '';
}
}
function notify_listVISSZA(a){
document.getElementById('notify_list').style.display = 'block';
document.getElementById('notify_list').innerHTML = a.responseText;
}
function notify_bg(){
document.getElementById('notify').style.background = 'url("images/ico/alarm.png")';
document.getElementById('notify').style.backgroundRepeat = 'no-repeat';
document.title = "Bejelentkezve: " + userNAME;
}
function notify(){
var a = new Ajax.Request("ajaxjobs/notify_list.php",{method: 'post', parameters: 'mode=check',onComplete: notifyVISSZA});
}
function notifyVISSZA(a){
if (parseInt(a.responseText) > 0){
//alert('visszajön');
document.getElementById('notify').style.background = 'red';
document.getElementById('notify').innerHTML = a.responseText;
document.title = a.responseText + " értesítés érkezett";
if (notyfyNR < parseInt(a.responseText) && playS == 1) playSound("sound/cough.swf");
if (document.getElementById('notify_list').style.display == 'block') var a = new Ajax.Request("ajaxjobs/notify_list.php",{method: 'post', parameters: 'mode=list',onComplete: notify_listVISSZA});
notyfyNR = a.responseText;
}
}
 function playSound(soundfile) {
document.getElementById("soundeffect").innerHTML=
 "<embed src='"+soundfile+"' hidden='true' autostart='true' loop='false' type='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'/>";
 }
function start_notify(){
notify();
setInterval(notify,30000);
}
notyfyNR = 0;
function myTilt(){
var a = new Ajax.Request("ajaxjobs/mytilt.php",{onComplete: myTiltVISSZA});
}
function tiltOFF(id){
var a = new Ajax.Request("ajaxjobs/mytilt.php",{method: 'post', parameters: 'tiltoff_id=' + id,onComplete: myTiltVISSZA});
}
function myTiltVISSZA(a){
s = a.responseText;
ablak("400px","150px","<font style='color: #ffffff;'>Akiket letiltottál</font>",s);
//asd_alert('Nekik tetszik: '+retext[1]);
}
function soundCHK(){
if (readCookieX('soundoff')==1){
document.getElementById("soundoff").innerHTML = '<img src="images/ico/soundon.png" border=0>';
document.getElementById("soundoff").title = 'Figyelmeztető hang be';
playS = 0;
}else{
document.getElementById("soundoff").innerHTML = '<img src="images/ico/soundoff.png" border=0>';
document.getElementById("soundoff").title = 'Figyelmeztető hang ki';
playS = 1;
}
}
function soundOFF(){
if (readCookieX('soundoff')==1){
eraseCookieX('soundoff');
document.getElementById("soundoff").innerHTML = '<img src="images/ico/soundoff.png" border=0>';
document.getElementById("soundoff").title = 'Figyelmeztető hang ki';
playS = 1;
}else{
createCookieX('soundoff',1,365);
document.getElementById("soundoff").innerHTML = '<img src="images/ico/soundon.png" border=0>';
document.getElementById("soundoff").title = 'Figyelmeztető hang be';
playS = 0;
}
}
