function goLive (rsp)
	{
	alertd(" scrpt=" + scrpt + " latestFeedZkatter="+window.latestFeedZkatter+" rsp="+rsp,"goLive","",1);
	if (!window.liveUpdOff)
		{
		rspEx= rsp.split("\t")
		nmsgs= parseInt(rspEx[0])
		zktrs= parseInt(rspEx[1])
		zkid= parseInt(rspEx[2])
		window.srvtmstmp= parseInt(rspEx[3])
		ago()
		if (!zktrs || window.latestFeedZkatter == zkid) hideLive()
		if (nmsgs) document.getElementById('liveIncmMenu').innerHTML= '(' + nmsgs + ')'
		if (zktrs && window.latestFeedZkatter < zkid)
			{
			if (activeFeedPage == 1 && activeFeedMode == 'list') window.latestFeedZkatter= rspEx[2]
			liveUpd(zktrs)
			}
		}
	setTimeout("simple_ajax(_Gp_jlive + '?s=' + scrpt + '&lzk=' + window.latestFeedZkatter,'goLive')",5000)
	}

function liveUpd(zktrs)
	{
	if (!window.liveUpdOff)
		{
		if (activeFeedPage == 1 && activeFeedMode == 'list') simple_ajax(_Gp_jz_feed + '?page=1&tXp=1','updateFeed')
		else
			{
			obj= document.getElementById('live_update')
			if (zktrs > 1) s= 's', t= 'them'
			else s= '', t= 'it'
			txt= '<span>' + zktrs + '</span> new Zkattering' + s + ' added since you loaded this feed. <a href="javascript://" onclick="hideLive(1);refreshFeed(1)">&raquo; Refresh to see ' + t + '</a>'
			obj.innerHTML= txt
			$('#live_update').animate({'height':'20px'},'slow')
			}
		}
	}

function hideLive(flag)
	{
	if (flag) window.liveUpdOff= true
	$('#live_update').animate({'height':'0px'},'slow')
	}

function zoomPlayback()
	{
	alert ('zoom playback')
	}

function liveUpateXXX(totalreslive, feedfrlastzklive){
	livecheckflag=0;
	alertd("totalreslive="+totalreslive,"liveUpate","000000");
	alertd(" latestFeedZkatter="+window.latestFeedZkatter+" feedfrlastzklive="+feedfrlastzklive,"setpage_listcheck","000000");
	if((feedfrlastzklive>window.latestFeedZkatter)&&totalreslive>1){ // CHANGE TO > OR == TO TEST
		newzklive=totalreslive-1;
	if(isPrfLook)
		livediv='<a href="javascript://" onclick="liveormanual();sa_mainsearch(0);">'+newzklive+'</a> new zkattering'+((newzklive>1)?'s':'')+' added by '+prfscrname+' since you loaded this feed. <a href="'+site_absolute_path+prfscrname+'">&raquo;</a> <a href="'+site_absolute_path+prfscrname+'"><b>Refresh</b></a> to see '+((newzklive>1)?'them':'it');
	else
		livediv='<a href="javascript://" onclick="liveormanual();sa_mainsearch(0);">'+newzklive+'</a> new zkattering'+((newzklive>1)?'s':'')+' added by '+((newzklive>1)?'':'a')+' friend'+((newzklive>1)?'s':'')+' since you loaded this feed. <a href="'+_Gp_home+'">&raquo;</a> <a href="'+_Gp_home+'"><b>'+((refreshview_link)?'Click view':'Refresh')+'</b></a> to see '+((newzklive>1)?'them':'it');
	document.getElementById('live_update').style.display='block';
	if(refreshview_link)
		document.getElementById('live_update').style.border="2px solid #9F0000";
	else
		document.getElementById('live_update').style.border="2px solid #CCDC6F";
	document.getElementById('live_update').innerHTML=livediv;
	alertd("newzklive="+newzklive,"setpage_listcheck","000000");
	}
	}

function checkLen(obj,limit)
	{
	if (obj.value.length > limit) obj.value= obj.value.substr(0,limit)
	}

function insertAfter(newChild, refChild) 
	{ 
	refChild.parentNode.insertBefore(newChild,refChild.nextSibling); 
	}

function rmObj(obj)
	{
	obj.parentNode.removeChild(obj)
	}

function insertAfter (newChild,refChild) 
	{ 
	refChild.parentNode.insertBefore(newChild,refChild.nextSibling)
	} 

function include(filename)
	{
	var head= document.getElementsByTagName('head')[0]
	script= document.createElement('script')
	script.type= 'text/javascript'
	script.src= filename
	head.appendChild(script)
	}

function ajax()
	{
	var xmlHttp= null
	try { xmlHttp = new XMLHttpRequest() }
	catch (e)
		{
		try
			{ xmlHttp=new ActiveXObject('Msxml2.XMLHTTP') }
		catch (e)
			{ xmlHttp=new ActiveXObject('Microsoft.XMLHTTP') }
		}
	return xmlHttp
	}

function noWebCam()
	{
	noZkatterAllowed('Your don\'t have webcam!')
	}

/**
 * Usage: finds the integer in fromstr between the strings - strbegin and strend
 * VjsIntCut(xmlHttpresponse,'&lt;valemancount value="','"&gt;count&lt;/valemancount&gt;');
 */
function VjsIntCut(fromstr,strbegin,strend){
	stpos=strlen(strbegin);
	stpos=strpos(fromstr,strbegin)+stpos;
	//alertd(escape(substr(fromstr,stpos)),"VjsIntCut","880000");
	endpos=strpos(fromstr, strend);
	return parseInt(substr(fromstr, stpos, endpos-stpos));
}

/**
 * Usage: finds the string in fromstr between the strings - strbegin and strend
 * VjsStrCut(xmlHttpresponse,'&lt;valemancount value="','"&gt;count&lt;/valemancount&gt;');
 */
function VjsStrCut(fromstr,strbegin,strend){
	stpos=strlen(strbegin);
	stpos=strpos(fromstr,strbegin)+stpos;
	//alertd(escape(substr(fromstr,stpos)),"VjsStrCut","880000");
	endpos=strpos(fromstr, strend);
	return substr(fromstr, stpos, endpos-stpos);
}

function keyCheck(key)
	{
	var keys= new Array
	keys[20]= true // Caps Lock
	keys[16]= true // Shift
	keys[17]= true // Ctrl
	keys[18]= true // Alt
	keys[27]= true // Esc
	//keys[32]= true // Space
	keys[45]= true // Ins
	keys[36]= true // Home
	keys[35]= true // End
	keys[33]= true // Page Up
	keys[34]= true // Page Down
	keys[144]= true // Num Lock
	keys[9]= true // Tab
	keys[38]= true // Up
	keys[40]= true // Down
	keys[37]= true // Left
	keys[39]= true // Right
	for (var i in keys) if (key==i) return true
	return false
	}

function balloonLoader()
	{
	include('balloons/config.js')
	include('balloons/script.js')
	include('balloons/box.js')
	include('balloons/yahoo-dom-event.js')
	}

function sending()
	{
	document.getElementById('rsp').setAttribute('disabled','disabled')
	document.getElementById('rsp').style.backgroundColor= 'white'	
	document.getElementById('rsp').style.backgroundImage= 'url(images/loader_big.gif)'
	document.getElementById('send').style.visibility= 'hidden'
	}

function sendDone()
	{
	document.getElementById('respArea').style.visibility= 'hidden'
	document.getElementById('send').style.visibility= 'hidden'
	document.getElementById('closep').style.visibility= 'hidden'
	document.getElementById('chrLeft').style.visibility= 'hidden'
	document.getElementById('title').innerHTML= 'Delivery confirmation'
	document.getElementById('snddone').style.display= 'block'
	setTimeout("killRespPopFade()",2000)
	}

function showMSGjs(obj,srcname,id,from,msgid)
	{
	if (document.getElementById('rspPop')) document.getElementById('rspPop').parentNode.removeChild(document.getElementById('rspPop'))
	respHtml= '<div id="respPopup">'
	respHtml+= '<div id="top"></div>'
	respHtml+= '<div id="bottom"></div>'
	respHtml+= '<div id="title">Reply to ' + srcname + ':</div>'
	respHtml+= '<a href="javascript://" onclick="killRespPop()"><img src="images/close20px.png" id="closep"></a>'
	respHtml+= '<div id="respArea">'
	respHtml+= boxRfStart
	respHtml+= '<textarea id="rsp" onkeyup="txtLength(this)" onkeydown="escapeEnterCheck(event)"></textarea>'
	respHtml+= boxRfEnd
	respHtml+= '</div>'
	respHtml+= '<div id="snddone">'
	respHtml+= boxRfStart
	respHtml+= '<div id="doneText">'
	respHtml+= '<strong>Zkatdroid has successfully delivered<br>your message to <em>' + srcname + '</em>.</strong>'
	respHtml+= '</div>'
	respHtml+= boxRfEnd
	respHtml+= '</div>'
	respHtml+= '<div id="chrLeft"><img src="_img/_btn/send.png" onclick="sending(); sa_sendmsg(' + msgid + ')" id="send">Characters left: <strong id="charleft">255</strong></div>'
	respHtml+= '<input type="hidden" id="to_friend_id" value="'+from+'"/>';
	respHtml+= '<input type="hidden" id="to_zid" value="'+id+'"/>';
	respHtml+= '</div>'
	relPop= document.createElement('div')
	relPop.className= 'absolutePoint'
	relPop.id= 'rspPop'
	relPop.innerHTML= respHtml
	obj.parentNode.insertBefore(relPop,obj)
	document.getElementById('rsp').focus()
	}

function infoPop(obj,srcname,frcase,id,from,msgid)
	{
	if (document.getElementById('rspPop')) document.getElementById('rspPop').parentNode.removeChild(document.getElementById('rspPop'))
	respHtml= '<div id="respPopup" style="left:-700px;top:0px">'
	respHtml+= '<div id="top"></div>'
	respHtml+= '<div id="bottom"></div>'
	respHtml+= '<div id="title" style="font-size:20px">Friends request delivered</div>'
	respHtml+= '<a href="javascript://" onclick="killRespPop()"><img src="images/close20px.png" id="closep"></a>'
	respHtml+= '<div id="respArea">'
	respHtml+= boxRfStart
	respHtml+= '<textarea id="rsp" onkeyup="txtLength(this)" onkeydown="escapeEnterCheck(event)" style="visibility:hidden"></textarea>'
	respHtml+= boxRfEnd
	respHtml+= '</div>'
	respHtml+= '<div id="snddone" style="display:block">'
	respHtml+= boxRfStart
	respHtml+= '<div id="doneText">'
	if(frcase==2)
		respHtml+= '<strong style="font-size:18px;font-weight:500;top:25px">You`ve received a friends request from <span style="color:#9f0000">' + srcname + '</span>.<br><br>If you want confirm this request<br/> and become a friend of ' + srcname + '.</strong>'
	else if(frcase==3)
		respHtml+= '<strong style="font-size:18px;font-weight:500;top:25px">You`ve sent a friends request to <span style="color:#9f0000">' + srcname + '</span>.<br/><br/>All you have to do now is sit back<br/>and wait for confirmation.</strong>'
	respHtml+= '</div>'
	respHtml+= boxRfEnd
	respHtml+= '</div>'
	respHtml+= '<div id="chrLeft" style="visibility:hidden"><img src="_img/_btn/send.png" onclick="sending(); sa_sendmsg(' + msgid + ',' + id + ')" id="send">Characters left: <strong id="charleft">255</strong></div>'
	respHtml+= '<input type="hidden" id="to_friend_id" value="'+from+'"/>';
	respHtml+= '<input type="hidden" id="to_zid" value="'+id+'"/>';
	respHtml+= '</div>'
	relPop= document.createElement('div')
	relPop.className= 'absolutePoint'
	relPop.id= 'rspPop'
	relPop.innerHTML= respHtml
	obj.parentNode.insertBefore(relPop,obj)
	document.getElementById('rsp').focus()
	}

function escapeEnterCheck(e)
	{
	if (e.keyCode==27) killRespPop()
	//if (e.keyCode==13 && document.getElementById('send').style.visibility=='visible') sendDone()
	}

function txtLength(obj)
	{
	document.getElementById('send').style.visibility= 'visible'
	if (obj.value.length==0) document.getElementById('send').style.visibility= 'hidden'
	if (obj.value.length>255) obj.value=obj.value.substr(0,255);
	document.getElementById('charleft').innerHTML=255-obj.value.length;
	}

function killRespPopFade()
	{
	$('#respPopup').fadeOut(600, function(){ $('#rspPop').remove(); });
	}

function killRespPop()
	{
	document.getElementById('rspPop').parentNode.removeChild(document.getElementById('rspPop'))
	}

function isset(varname){
 return(typeof(window[varname])!='undefined');
}

function removeChildbyParentNode(id){
	var child=document.getElementById(id);
	child.parentNode.removeChild(child);
}

function removediv(child){
	var d = document.getElementById(child).parentNode;
	var d_nested = document.getElementById(child);
	d.removeChild(d_nested);
}

function selfremovediv(child){
	var d = self.parent.document.getElementById(child).parentNode;
	var d_nested = self.parent.document.getElementById(child);
	d.removeChild(d_nested);
}

function tooltable(pic,name)
	{
	var html="<table><tr><td align=\"center\" width=\"50\" height=\"50\"><img src=\""+pic+"\" /></td><td>"+name+"</td></tr></table>";
	return html;
	}

function uploadDone()
	{
	document.getElementById('postCheck').style.display= 'block'
	}

function onOverFr(id,userid,fruserid){
	document.getElementById('sel_id').value=userid;
	document.getElementById('sel_friend').value=fruserid;
	document.getElementById('sel_hiddenid').value='range_'+userid;
	var tmp=document.getElementById('whole_'+id);
	var tmpblocked=document.getElementById('whole_'+id+'_blocked').value;
	if(tmpblocked=="1"){
		tmp.style.backgroundColor='#ff8080';
		tmp.style.backgroundImage='';
	}else{
		tmp.style.backgroundColor='#d1d1d1';
		tmp.style.backgroundImage='url(images/list_itm_bg.png)';
	}
}

function onOutFr(id){
	var tmp=document.getElementById('whole_'+id);
	var tmpblocked=document.getElementById('whole_'+id+'_blocked').value;
	//alertd('whole_'+id+'_blocked');

	tmp.style.backgroundImage='url(images/pix.gif)';
	if(tmpblocked=="1"){
		tmp.style.backgroundColor='#ff8080';
	}else{
		tmp.style.backgroundColor='#ffffff';
	}
}

function respOver(id,obj){
	obj.className='sr_container_hover';
	if(document.getElementById('imgSR_share_response_icon'+id))
		document.getElementById('imgSR_share_response_icon'+id).style.display='inline';
	if(document.getElementById('imgR_share_response_icon'+id))
		document.getElementById('imgR_share_response_icon'+id).style.display='inline';
}
function respOut(id,obj){
	obj.className='sr_container';
	if(document.getElementById('imgSR_share_response_icon'+id))
		document.getElementById('imgSR_share_response_icon'+id).style.display='none';
	if(document.getElementById('imgR_share_response_icon'+id))
		document.getElementById('imgR_share_response_icon'+id).style.display='none';
}

function cC(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 rC(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 dC(name)
	{
	cC(name,'',-1);
	}

function setFadersNew()
	{
	}

function setFaders()
	{
	if (document.getElementById('sr_diviframe_1'))
		{
		for (var f=1; f<21; f++)
			if (document.getElementById('sr_diviframe_'+f))
				animatedcollapse.addDiv('sr_diviframe_'+f,'fade=0,speed=500,height=520px,group=zfeeds,hide=1')
		animatedcollapse.init()
		animatedcollapse.ontoggle=function($,ifrdiv,state)
			{
			if (state=='block') $.scrollTo('#top_' + ifrdiv.id.substr(13),500);
			}
		}
	//alertd('Action','setFaders','ffff00',1)
	}

//function copy4paste(obj)//DUPLICATED FUNCION DELETE THE UNNECESSARY ONE
//	{
//	obj.focus();
//	obj.select();
//	txt= obj.value.createTextRange()
//	txt.execCommand('Copy')
//	}

function tweet(zid)
	{
	xmlHttp= ajax()
	xmlHttp.open('get','_ajax/?tweet=' + zid)
	xmlHttp.send(null)	
	}

function tabReset()
	{
	divs= document.getElementsByTagName('div')
	for (f=0; f<divs.length; f++) if (divs[f].className=='sel_div') divs[f].className= 'des_div'
	if (document.getElementById('tab_con')) document.getElementById('tab_con').innerHTML= ''
	if (document.getElementById('list_found')) document.getElementById('list_found').innerHTML= ''
	}

function tabDefault()
	{
	divs= document.getElementsByTagName('div')
	for (f=0; f<divs.length; f++) if (divs[f].className=='des_div') return divs[f].id
	}

function facebook()
	{
	xmlHttp= ajax()
	xmlHttp.open('get','_ajax/?facebook=true')
	xmlHttp.send(null)	
	}

function validateCaptcha(){
	challengeField = $("input#recaptcha_challenge_field").val();
	responseField = $("input#recaptcha_response_field").val();
	var html = $.ajax({
		type: "POST",
		url: site_absolute_path+"ajax/ajax.recaptcha.php",
		data: "recaptcha_challenge_field=" + challengeField + "&recaptcha_response_field=" + responseField,
		async: false
	}).responseText;

	if(html == "success"){
		return true;
	} else {
		return false;
	}
}

/**
 * Functions managing the default text, placed in --input boxes--
 *
 * @param object obj - the input object, usually=this
 * @param string txt - the default text
 */
function mFull(obj,txt){
	if(obj.value=='')
		obj.value=txt;
	return obj.value;
}
function mEmpty(obj,txt){
	if(obj.value==txt)
		obj.value='';
	return obj.value;
}
/*	END	*/

/**
 * Changes the state of a checkbox-picture(CP) and the hidden field related to the immage.
 * 
 * @param string checkid - the id of the CP
 * @param integer to - if is 1 the CP will be checked, if 0 the CP will be unchecked, if is 2 it will toggle
 */
function togglecheck(checkid,to,dots){
	alertd("","togglecheck");
	if(dots=='')
		dots='';
	pic=document.getElementById(checkid); //pic handle
	hid=document.getElementById('h'+checkid); //hidden handle
	alertd("to "+to);
	if (to==0||(hid&&hid.value=='1'&&to==2)){
		alertd("enters 1");
		if(pic)
			pic.src=dots+'images/unchecked.png';
		if(hid)
			hid.value='0';
	}else if(to==1){
		alertd("enters 2");
		if(pic)
			pic.src=dots+'images/checked.png';
		if(hid)
			hid.value='1';
	}else{
		alertd("enters 3");
		if(pic)
			pic.src=dots+'images/checked.png';
		if(hid)
			hid.value='1';
	}
}

function radioValue(radioNodeList) 
	{
	for (i=radioNodeList.length-1; i>-1; i--) if (radioNodeList[i].checked) return radioNodeList[i].value
	return ''
	}

function changeRadio(obj){
	if(obj.src.indexOf('full')==-1)
		obj.src=obj.src.replace('empty','full');
	else
		obj.src=obj.src.replace('full','empty');
}

/**
 * Selects the radio button in the radio group, permits different radio-groups on one page
 *
 * @param string groupname - name of the group of radio buttons
 * @param integer radio_number - is the count of the radio buttons
 * @param integer rad_id - is the id of the button that is clicked beginning with the 0 for the first button
 * @param string relativepathtoimage - path to the images for example 'images/'
 */
function selectradio(groupname,radio_number,rad_id,relativepathtoimage){
	for(var i=0; i<radio_number; i++){
		if(i!=rad_id)
			document.getElementById(groupname+'rad_id_'+i).src=relativepathtoimage+'empty_dot.png';
	}
	eval(groupname+"clicked=rad_id;");
	document.getElementById(groupname+'rad_id_'+rad_id).src=relativepathtoimage+'full_dot.png';
}

function tf2in(val)
	{
	if (val) return 1
	return 0
	}

function ntwrk(obj,e,name)
	{
	ajxDrp= document.getElementById('ajxDrop_'+name);
	if (!window.ntwrkDef)
		window.ntwrkDef= obj.value;
	if (e.type == 'focus' && obj.value == window.ntwrkDef)
		obj.value= '';
	if (e.type == 'blur' && obj.value == '')
		obj.value= window.ntwrkDef;
	if ( (obj.value == '' || obj.value == window.ntwrkDef) && (scrpt!=_Gp_searchfront&&scrpt!=_Gp_searchresults) )
		document.getElementById('networkX_'+name).style.backgroundImage= 'url(_img/true.png)'
	else
		document.getElementById('networkX_'+name).style.backgroundImage= 'url(_img/false.gif)';
	list(obj.value,name);
	}

function ntwrkIco(obj,e,name)
	{
	if (!window.ntwrkDef) window.ntwrkDef= document.getElementById(name+'d').value
	if (e.type=='click')
		{
		if (obj.src.substr(obj.src.length-8) == 'down.png') 
			{
			obj.src= '_img/_btn/up.png'
			document.getElementById(name+'d').value= ''
			}
		else
			{
			document.getElementById(name+'d').value= ''
			document.getElementById(name+'d').style.backgroundColor= ''
			document.getElementById(name+'d').style.color= ''
			document.getElementById(name+'d').removeAttribute('disabled')
			document.getElementById(name+'d').focus()
			obj.src= '_img/_btn/down.png'
			}
		if (document.getElementById('ajxDrop_'+name).style.display == 'block')
			{
			document.getElementById('ajxDrop_'+name).style.display= 'none'
			}
		}
	if (substr_count(obj.src,'xOmu') && e.type=='mouseover') document.getElementById('inpBtn_'+name).src= '_img/_btn/xOmo.png'
	if (substr_count(obj.src,'xOmo') && e.type=='mouseout') document.getElementById('inpBtn_'+name).src= '_img/_btn/xOmu.png'
	}

function list(str,name)
	{
	cnt= radioValue(document.joinZ['netCntr'])
	xmlHttp= ajax()
	xmlHttp.open('get','_ajax/?'+name+'=1&str=' + str + '&ctr=' + cnt)
	xmlHttp.onreadystatechange = function()
		{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
			{
			if (xmlHttp.responseText)
				{
				document.getElementById('ajxDrop_'+name).style.display= 'block';
				responseArray= xmlHttp.responseText.substr(0,xmlHttp.responseText.length-1).split("\n");
				out= '';
				for (f=0; f<responseArray.length; f++)
					{
					responseArrayParts= responseArray[f].split("\t")
					out+= '<a href="javascript://" id="' + responseArrayParts[0] + '" title="' + responseArrayParts[2] + '" onclick="set(this,\''+name+'\')">' + responseArrayParts[1] + '</a>'
					}
				document.getElementById('ajxDrop_'+name).innerHTML= '<div>' + out + '</div>'
				}
			else document.getElementById('ajxDrop_'+name).style.display= 'none'
			}
		}
	xmlHttp.send(null)
	}

function set(obj,name)
	{
	window.activeNetwork= obj.innerHTML;
	window.activeNetworkId= obj.id;
	window.activeNetworkHash= obj.title;
	document.getElementById(name+'d').value= '#'+obj.title;
	if (document.getElementById(name+'dId')) document.getElementById(name+'dId').value= obj.id
	if (document.getElementById('search'))
		{
		document.getElementById('search').value= obj.title
		}
	document.getElementById(name+'d').style.backgroundColor= 'white';
	document.getElementById(name+'d').style.color= 'gray';
	document.getElementById(name+'d').setAttribute('disabled','disabled');
	document.getElementById('inpBtn_'+name).src= '_img/_btn/xOmu.png';
	document.getElementById('ajxDrop_'+name).style.display= 'none';
	document.getElementById('networkX_'+name).style.backgroundImage= 'url(_img/true.png)';
	checkNetwork(name);
	}

function checkNetwork(name)
	{
	xmlHttp= ajax()
	xmlHttp.open('get','_ajax/?searchNetFriends=' + name )
	xmlHttp.onreadystatechange = function()
		{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200 && xmlHttp.responseText)
			{
			document.getElementById('countRslts').innerHTML= 'Found <span>' + xmlHttp.responseText + '</span> users belong to:&nbsp; &nbsp; &nbsp; &nbsp;#' + name
			if (xmlHttp.responseText > 0)
				{
				//document.getElementById('realTime').href= _Gp_search+'?ss=' + escape('#') + name + '&clicked=0&sres=1&clickedlink=3'
				document.getElementById('realTime').href= _Gp_search+'?gsearch='+escape(name)+'&gsearchPar=results,1,all,school'
				document.getElementById('countRsltsLinks').style.display= 'block'
				document.getElementById('ntwrkSrchBtn').style.visibility= 'visible'				
				}
			else
				{
				document.getElementById('countRsltsLinks').style.display= 'none'
				document.getElementById('ntwrkSrchBtn').style.visibility= 'hidden'
				}
			}
		}
	xmlHttp.send(null)
	}

function doInfoEx(obj)
	{
	if (document.getElementById('infoExTbl').style.display=='none' || !document.getElementById('infoExTbl').style.display)
		{
		document.getElementById('infoExTbl').style.display= 'block'
		if (document.getElementById('addFriend')) document.getElementById('addFriend').style.display= 'block'
		//obj.innerHTML= 'minimize&nbsp;&laquo;'
		}
	else
		{
		document.getElementById('infoExTbl').style.display= 'none'
		if (document.getElementById('addFriend')) document.getElementById('addFriend').style.display= 'none'
		//obj.innerHTML= 'profile&nbsp;&raquo;'
		}
	}

function noActClose(){
	if (noActCloseCheck && document.getElementById(window.activeAddFriendId)) document.getElementById(window.activeAddFriendId).onclick= window.activeAddFriendOnClick
}

function copy4paste(obj)//DUPLICATED FUNCION DELETE THE UNNECESSARY ONE
	{ 
	var text_val= eval(obj)
	text_val.focus()
	text_val.select()
	}

function clC()
	{
	dC('oauth_token')
	dC('oauth_token_secret')
	}

function chck(net)
	{
	if (!document.getElementById(net).disabled) document.getElementById(net).disabled= 'true'
	}

var selected_link=0;
function changeselectedlink(names_prfx,link_id,total){
	for(var i=0; i<total; i++){
		if(i!=link_id)
			document.getElementById(names_prfx+i).className='normal';
	}
	document.getElementById(names_prfx+link_id).className='clicked';
	return link_id;
}

function JustClose(noact,jsact){//alertd(jsact);
	jQuery('#pendingvalue').html(parseInt(jQuery('#pendingvalue').html())+1);
	jQuery('#TB_overlay').remove();
	jQuery('#TB_window').remove();
	var tmp=unescape(jsact);
	//alertd(tmp);
	if(!noact)eval(tmp);
}

function changeCountry(obj)
	{
	active= '_img/_btn/radio_active.png'
	inactive= '_img/_btn/radio.png'
	if (window.inFolder)
		{
		active= '../_img/_btn/radio_active.png'
		inactive= '../_img/_btn/radio.png'			
		}
	hide= 'US'
	if (obj.id == 'US') hide= 'UK'
	obj.src= active
	document.getElementById(hide).src= inactive
	document.getElementById(hide + 'lst').style.display= 'none'
	document.getElementById(obj.id + 'lst').style.display= 'inline'
	}

function setActiveNetwork()
	{
	sxCombo= document.getElementsByTagName('input')
	for (f=0; f<sxCombo.length; f++)
		if (sxCombo[f].name == 'event-combo__sexyCombo') 
			{
			sxCombo[f].value= window.acitveNetwork
			document.getElementById('ntwrkd').value= window.acitveNetwork.substr(1)
			}
	if (document.getElementById('thisisschoolsearch')) checkNetwork(document.getElementById('ntwrkd').value)
	}

function fakeClick(id)
	{
	var evt= document.createEvent('MouseEvents');
	evt.initEvent('click', true, true);
	document.getElementById(id).dispatchEvent(evt); 	
	}

function FB_cookie()
	{
	cC('facebook',true)
	}

function FB_Share_Wall()
	{
	FB_titleText= ''
	FB_titleText+= 'found this zkattering...'
	FB_commentText= 'share this Zkattering made by ' + window.zkatterOwner + ' on ' +  window.zkatterDate + ':'
	FB_commentText+= '<br /><br />'
	FB_commentText+= window.zkatterOwner + ' from ' + window.zkatterPlace + ' says:<br>'
	FB_commentText+= window.zkatterText
	FB_commentText+= '<br /><br />'
	FB_commentText+= '<a href="' + site_absolute_path + zk_url_folder + window.zkatterId + '" target="_blank">more about this zkattering...</a>'
	FB_commentText+= '<br /><br />'
	FB_commentText+= '<a href="http://www.zkatter.com" target="_blank">Not a Zkatterer? Join now! It`s exciting!</a>'
	FB_src= site_absolute_path + '_img/?p=' + window.zkatterOwnerId + ',' + window.zkatterId + ',5'
	FB_href= site_absolute_path + zk_url_folder + window.zkatterId
	FB.Connect.showFeedDialog(FACEBOOK_WALL_TEMPLATE, {'ztitle':FB_titleText, 'ztext':FB_commentText,'images':[{'src':FB_src,'href':FB_href}]}, null, null, null, FB.RequireConnect.equire, null, null, null)
	}

function FBpop()
	{
	var evt = document.createEvent('MouseEvents');
	evt.initEvent('click', true, true);
	document.getElementById('RES_ID_fb_login').dispatchEvent(evt); 
	}

function FB_shareZ()
	{
	if (rC('facebook'))
		{
		FB_Share_Wall()
		}
	else
		{
		FBpop()
		}
	}

function FBok()
	{
	FB_Share_Wall()
	}

function twitPop(flg)
	{
	if (flg == 5) // FROM SHARE
		{
		turnOffTwitterShareButton()
		document.getElementById('shareStatus').innerHTML= 'Share of Zkattering in progress: Please Login on Twitter!'
		}
	window.open(site_absolute_path + 'ext/?from=' + flg,'zktTwt','status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0,height=420,width=800')
	}

function oauthToken (fromWhere, screen_name)
	{
	window.twitter_screen_name= screen_name
	if (fromWhere == 1) // FROM INDEX 
		top.location.href= site_absolute_path + _Gp_join;
	if (fromWhere == 2) // FROM TAB PRIVACY
		{	
		document.getElementById('twtc').style.filter= 'alpha(opacity=30)'
		document.getElementById('twtc').style.opacity= '.3'
		location.href= location.href
		}
	if (fromWhere == 3) // FROM ADD_ZKATTERING
		{
		document.getElementById('tws').style.display= 'none'
		document.getElementById('twop').style.display= 'inline'
		}
	if (fromWhere == 4) // FROM WELCOME
		{
		document.getElementById('TW_wlcm').removeAttribute('onclick')
		document.getElementById('TW_wlcm').removeAttribute('onmouseover')
		document.getElementById('TW_wlcm').setAttribute('onmouseover',"balloon.showTooltip(event,'You are connected with <b>twitter</b> (" + window.twitter_screen_name + ")')")
		document.getElementById('TW_wlcm_tick').style.backgroundImage= 'url(_img/_flg/tick1.png)'
		document.getElementById('TWx').src= '_img/_btn/fbSyncX.png'
		}
	if (fromWhere == 5) // FROM SHARE
		shareThisZkatter()
	if (fromWhere == 6) // FROM PREREGISTRATION
		top.location.href= site_absolute_path + 'registration/preregistration.php'
	return true
	}

function turnOffTwitterShareButton()
	{
	window.turnOffTwitLink= 1
	document.getElementById('twSh').removeAttribute('onclick')
	document.getElementById('twSh').removeAttribute('onmouseover')
	document.getElementById('twSh').setAttribute('onmouseover',"balloon.showTooltip(event,'Sharing in progress!')")
	document.getElementById('twShImg').src= '_img/load66.gif';
	}

function shareThisZkatter()
	{
	document.getElementById('shareStatus').innerHTML= 'Share of Zkattering in progress!'
	if (!window.turnOffTwitLink) turnOffTwitterShareButton()
	xmlHttp= ajax()
	xmlHttp.open('get','_ajax/?shareZkatter2twitter=' + window.zkatterId)
	xmlHttp.onreadystatechange = function()
		{
		if (xmlHttp.readyState == 4 && xmlHttp.status == 200 && xmlHttp.responseText)
			{
			if (xmlHttp.responseText == '0')
				{
				document.getElementById('shareStatus').innerHTML= 'You have allready Tweet this Zkattering!'
				document.getElementById('twShImg').src= '_img/pix.gif'
				document.getElementById('twSh').removeAttribute('onmouseover')
				document.getElementById('twSh').setAttribute('onmouseover',"balloon.showTooltip(event,'You have allready share this Zkattering<br>with <b>Twitter</b> (" + window.twitter_screen_name + ").')")
				}
			else
				{
				document.getElementById('shareStatus').innerHTML= 'Done... This Zkattering, now Twitting!'
				document.getElementById('twShImg').src= '_img/pix.gif'
				document.getElementById('twSh').removeAttribute('onmouseover')
				document.getElementById('twSh').setAttribute('onmouseover',"balloon.showTooltip(event,'Zkattering share complete! Click to see it...')")
				document.getElementById('twSh').removeAttribute('href')
				document.getElementById('twSh').setAttribute('href','http://twitter.com/' + window.twitter_screen_name)
				document.getElementById('twSh').setAttribute('target','_blank')
				}
			}
		}
	xmlHttp.send(null)
	}

function abuse (rsp, obj)
	{
	obj.style.opacity= '1'
	obj.removeAttribute('onclick')
	obj.removeAttribute('onmouseover')
	obj.setAttribute('onmouseover',"balloon.showTooltip(event,'You have already reported this zkattering.<br>We are checking it very soon. Thanks!')")
	abuseReason(obj.parentNode.id)
	}

function abuseReason(ids)
	{
	ex= ids.split('_')
	fid= ex[0]
	zid= ex[1]
	if (document.getElementById('rspPop')) document.getElementById('rspPop').parentNode.removeChild(document.getElementById('rspPop'))
	respHtml= '<div id="respPopup">'
	respHtml+= '<div id="top"></div>'
	respHtml+= '<div id="bottom"></div>'
	respHtml+= '<div id="title">Thank you for flagging this content. Please give additional details:</div>'
	respHtml+= '<a href="javascript://" onclick="killRespPop()"><img src="images/close20px.png" id="closep"></a>'
	respHtml+= '<div id="respArea">'
	respHtml+= boxRfStart
	respHtml+= '<textarea id="rsp" onkeyup="txtLength(this)" onkeydown="escapeEnterCheck(event)"></textarea>'
	respHtml+= boxRfEnd
	respHtml+= '</div>'
	respHtml+= '<div id="snddone">'
	respHtml+= boxRfStart
	respHtml+= '<div id="doneText">'
	respHtml+= '<strong>You report has submited.<br>Thank you.</strong>'
	respHtml+= '</div>'
	respHtml+= boxRfEnd
	respHtml+= '</div>'
	respHtml+= '<div id="chrLeft"><img src="_img/_btn/send.png" onclick="sending(); ajaxAbuse(' + zid + ')" id="send">Characters left: <strong id="charleft">255</strong></div>'
	respHtml+= '<input type="hidden" id="to_friend_id" value=""/>';
	respHtml+= '<input type="hidden" id="to_zid" value=""/>';
	respHtml+= '</div>'
	relPop= document.createElement('div')
	relPop.className= 'absolutePoint'
	relPop.id= 'rspPop'
	relPop.innerHTML= respHtml
	insertAfter(relPop,document.getElementById('sr_container_' + fid))
	document.getElementById('rsp').focus()
	}

function ajaxAbuse(zid)
	{
	simple_ajax('_ajax/?abuseReason=' + zid + '&reason=' + escape(document.getElementById('rsp').value), 'ajaxAbuseDone')
	}

function ajaxAbuseDone()
	{
	killRespPop()
	}

function showHideInfo(obj, e, zid)
	{
	if (e.type == 'mouseover')
		{
		document.getElementById('frnt_' + zid).style.visibility= 'visible' // visibility:hidden;
		document.getElementById('back_' + zid).style.visibility= 'visible'
		document.getElementById('picsShowFtr_' + zid).style.visibility= 'visible'
		}
	if (e.type == 'mouseout')
		{
		document.getElementById('frnt_' + zid).style.visibility= 'hidden'
		document.getElementById('back_' + zid).style.visibility= 'hidden'
		document.getElementById('picsShowFtr_' + zid).style.visibility= 'hidden'
		}
	}

function friendDirectDone(rsp, obj)
	{
	if (rsp == '1') obj.innerHTML= ''
	}

function switchFlag (flg, obj)
	{
	}

function friendSearchMode (obj)
	{
	obj.blur()
	if (obj.innerHTML == 'A-Z') tabFocus(document.getElementById('list'))
	else 
		{
		if (document.getElementById('nrbTxt').innerHTML != 'Nearby') document.getElementById('nrbTxt').innerHTML= 'Nearby'
		document.getElementById('nrbldr').src= '_img/loader/15red.gif'
		locateMe()
		}
	}

function friendSearchNearby (rsp)
	{
	document.getElementById('list_found').innerHTML= rsp
	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	}

function nearbyNA()
	{
	document.getElementById('nrbldr').src= '_img/pix.gif'
	document.getElementById('nrbTxt').innerHTML= 'Nearby (Sorry. We can not find your location.)'
	}