function noErrorMessages () { return true; }
window.onerror = noErrorMessages;

var mainurl="http://www.hotnot.lt";
function playmp3(URL,color) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(mainurl+'/minimp3.php?sn='+URL+'&pcol='+color, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=213,height=70');");
}
function mp3player(color) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(mainurl+'/mp3player.php', '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=230,height=490');");
}

function setCursor(el,st,end) {
	if(el.setSelectionRange) {
		el.focus();
		el.setSelectionRange(st,end);
	} else {
		if(el.createTextRange) {
			range=el.createTextRange();
			range.collapse(true);
			range.moveEnd('character',end);
			range.moveStart('character',st);
			range.select();
		}
	}
}

function sypsena(txtarea, val, position) {

    if (document.selection) {
    txtarea.focus();
    sel = document.selection.createRange();
    sel.text = val;
    }

    else if (txtarea.selectionStart || txtarea.selectionStart == '0') {

    	var startPos = txtarea.selectionStart;
        var endPos = txtarea.selectionEnd;

        txtarea.value = txtarea.value.substring(0, startPos)
        + val
        + txtarea.value.substring(endPos, txtarea.value.length);
    } else {
        txtarea.value += val;
    }

    if(position == 1){
    	setCursor(txtarea,txtarea.value.length-6,txtarea.value.length-6)
    }else if(position == 2){
    	setCursor(txtarea,txtarea.value.length-10,txtarea.value.length-10)
    }

};

function checkEnter(e){
var characterCode

if(e && e.which){
e = e
characterCode = e.which
}
else{
e = event
characterCode = e.keyCode
}

if(characterCode == 13){
document.getElementById('message_input_id').blur();
return false
}
else{
return true
}

}

function minimp3(sn,color){

	var ajaxRequest;  // The variable that makes Ajax possible!

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('minimp3');

			ajaxDisplay.innerHTML = ajaxRequest.responseText;
			//alert(ajaxRequest.responseText);
		}
	}
	var URL;

	URL='minimp3.php?sn='+sn+'&pcol='+color;


//alert(mainurl+"/"+URL);
	ajaxRequest.open("GET", mainurl+"/"+URL, true);

	ajaxRequest.send(null);

}

function minimp32(sn,color){

	var ajaxRequest;  // The variable that makes Ajax possible!

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('minimp3');

			ajaxDisplay.innerHTML = ajaxRequest.responseText;
			//alert(ajaxRequest.responseText);
		}
	}
	var URL;

	URL='minimp32.php?sn='+sn+'&pcol='+color;


//alert(mainurl+"/"+URL);
	ajaxRequest.open("GET", mainurl+"/"+URL, true);

	ajaxRequest.send(null);

}

function ajax_multi(location, tag_name, load, var1, data1, var2, data2, var3, data3, var4, data4, var5, data5){

	g=false;
	if(window.XMLHttpRequest){
		g=new XMLHttpRequest();
		if(g.overrideMimeType){
			g.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g){
		alert('Can not create XMLHTTP-instance');
		return false;
	}

	var data = var1+"="+data1+"&"+var2+"="+data2+"&"+var3+"="+data3+"&"+var4+"="+data4+"&"+var5+"="+data5;

	if(tag_name != null){ g.onreadystatechange=function(){ al_multi(tag_name, load); }; }
	g.open('POST',location,true);
	g.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	g.send(data);
};

function al_multi(tag_name, load){
	if(g.readyState==4){
		if(g.status==200){
			document.getElementById(tag_name).innerHTML =g.responseText;

		}else{
			alert('Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.');
		}
	}else{
		if (load != 5) {
			if(load == '1'){
				document.getElementById(tag_name).innerHTML ='<br><br><br><br><br><br><br><center><img src="http://www.hotnot.lt/images/loading.gif"></center>';
			}else if(load == '2'){
				document.getElementById(tag_name).innerHTML ='<br><center><img src="http://www.hotnot.lt/images/loading.gif"></center><br>';
			}else if(load == '3'){
				document.getElementById(tag_name).innerHTML ='<br><br><br><br><br><br><br><br><center><img src="http://www.hotnot.lt/img/loading_prof.gif"></center><br>';
			}else if(load == '4'){
				document.getElementById(tag_name).innerHTML ='<br><center><img src="http://www.hotnot.lt/img/loading_prof.gif"></center><br>';
			}else if(load == '6'){
				document.getElementById(tag_name).innerHTML ='<br><br><center><img src="http://www.hotnot.lt/img/loading_ball.gif"></center><br><br>';
			}
		}

	}

};

function skins_get(){

	g=false;
	if(window.XMLHttpRequest){
		g=new XMLHttpRequest();
		if(g.overrideMimeType){
			g.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g){
		alert('Can not create XMLHTTP-instance');
		return false;
	}



	g.onreadystatechange=function(){ al_skins(); };
	g.open('POST',mainurl+'/skins_ajax.php',true);
	g.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	g.send(null);
};

function al_skins(){
	if(g.readyState==4){
		if(g.status==200){
			document.getElementById('skins_division').innerHTML =g.responseText;
		}else{
			alert('Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.');
		}
	}else{
		document.getElementById('skins_division').innerHTML ='<br><br><br><center><img src="http://www.hotnot.lt/images/loading.gif"></center>';
	}

};

function search_get(){

	g=false;
	if(window.XMLHttpRequest){
		g=new XMLHttpRequest();
		if(g.overrideMimeType){
			g.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g){
		alert('Can not create XMLHTTP-instance');
		return false;
	}



	g.onreadystatechange=function(){ al_search(); };
	g.open('POST',mainurl+'/search_ajax.php',true);
	g.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	g.send(null);
};

function al_search(){
	if(g.readyState==4){
		if(g.status==200){
			document.getElementById('search_window').innerHTML =g.responseText;
		}else{
			alert('Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.');
		}
	}else{
		document.getElementById('search_window').innerHTML ='<br><br><br><center><img src="http://www.hotnot.lt/images/loading.gif"></center>';
	}

};


function tikrinti_atsiliepima(frm, id_var, vardas_var, ats){

	var zinute = "";

	if(frm.message.value.length < 3){
		var zinute = zinute+"Atsiliepimas turi būti mažiausiai 3 simbolių ilgio.\n";
	}

	if(zinute != ""){
		alert("Susidūrėme su šiomis klaidomis:\n"+zinute);
		return false;
	}else{

		if (ats == '1'){
			//forma.submit();
			if(frm.atsiliepimas[1].checked == true){
				var atsp = '1';
			}else{
				var atsp = '0';
			}
		}else{
			var atsp = '2';
		}

		ajax_multi(mainurl+'/procedura_ats.php?veiksmas=rasyti_atsiliepima&id='+id_var+'&vardas='+vardas_var, 'profile_content', '1', 'message', frm.message.value, 'atsiliepimas', atsp);

	}

};

function online(){

	g_onl=false;
	if(window.XMLHttpRequest){
		g_onl=new XMLHttpRequest();
		if(g_onl.overrideMimeType){
			g_onl.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g_onl=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g_onl=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g_onl){
		alert('Can not create XMLHTTP-instance');
		return false;
	}

	g_onl.open('GET', 'http://www.hotnot.lt/online.php', true);
	g_onl.send(null);
};

function tikrinti_nauja_info(){

	g_on=false;
	if(window.XMLHttpRequest){
		g_on=new XMLHttpRequest();
		if(g_on.overrideMimeType){
			g_on.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g_on=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g_on=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g_on){
		alert('Can not create XMLHTTP-instance');
		return false;
	}


	g_on.onreadystatechange=function(){ info_tikrintojas(); };
	g_on.open('GET', 'http://www.hotnot.lt/tikrinti_info.php', true);
	g_on.send(null);
};

function info_tikrintojas(){
	if(g_on.readyState==4){
		if(g_on.status==200){

		if(g_on.responseText != ''){

				var split_info = g_on.responseText.split("\t");
			if(	document.getElementById('mail_id_span') != null){

				if(parseInt(split_info[0]) > 0){
					document.getElementById('mail_id_span').innerHTML = '(+'+split_info[0]+')';
				}else if(parseInt(split_info[0]) == 0){
					document.getElementById('mail_id_span').innerHTML = '';
				}

				if(parseInt(split_info[1]) > 0){
					document.getElementById('single_id_span').innerHTML = '(+'+split_info[1]+')';
				}else if(parseInt(split_info[1]) == 0){
					document.getElementById('single_id_span').innerHTML = '';
				}

				if(parseInt(split_info[2]) > 0){
					document.getElementById('double_id_span').innerHTML = '(+'+split_info[2]+')';
				}else if(parseInt(split_info[2]) == 0){
					document.getElementById('double_id_span').innerHTML = '';
				}

				if(parseInt(split_info[3]) > 0){
					document.getElementById('feedback_id_span').innerHTML = '(+'+split_info[3]+')';
				}else if(parseInt(split_info[3]) == 0){
					document.getElementById('feedback_id_span').innerHTML = '';
				}

				if(parseInt(split_info[4]) > 0){
					document.getElementById('friends_id_span').innerHTML = '(+'+split_info[4]+')';
				}else if(parseInt(split_info[4]) == 0){
					document.getElementById('friends_id_span').innerHTML = '';
				}

			}


				if(split_info[5] != ''){

					var mail_data = split_info[5];


					document.getElementById('notify_alert').innerHTML = mail_data;
					document.getElementById('notify_alert').style.zIndex = '9999';
					document.getElementById('notify_alert').style.display = '';

					change_title(document.title);


				}

			}

		}

	}
};

function change_title(title){

		if(document.title.substr(0, 15) != '*Nauja žinutė* ') { document.title = '*Nauja žinutė* '+title+''; }

}

function change_title_back(title){

	if(document.title.substr(0, 15) == '*Nauja žinutė* ') { document.title = document.title.substr(15, document.title.length); }

}


function skins_right(){
	var limit = (parseInt(document.getElementById('total_skins').value) * 169) - 847;
	var length = parseInt(document.getElementById('skins_move').style.left);
	if(length>-limit){
		document.getElementById('skins_move').style.left = length-169+'px';
	}

}


function skins_left(){
	var length = parseInt(document.getElementById('skins_move').style.left);
	if(length!=0){
		document.getElementById('skins_move').style.left = length+169+'px';
	}
}


function skins_unselect_all(save_tag, preview_tag, style_doc, style_id){

	if(document.getElementById(save_tag).style.display == 'block'){
		ajax_multi(mainurl+'/save_skin.php?skin='+style_id);

		document.getElementById('skins_main').style.zIndex='0';
		document.getElementById('skins_main').style.display='none';
		document.getElementById('button_below_id').className='button_below_middle';
	}

	if(document.getElementById(preview_tag).style.display == 'block'){
		document.getElementById('stylesheet_skins').href = mainurl+'/styles/'+style_doc+'.css';
	}

	var obj = document.getElementById('skins_move');
	var tags = obj.getElementsByTagName('DIV');
	for(var no=0;no<tags.length;no++){
		if(tags[no].className=='save_skin'){
			tags[no].style.display = 'none';
		}
	}



	document.getElementById(save_tag).style.display = 'block';
	document.getElementById(preview_tag).style.display = 'none';

}

function popUp(URL, width, height) {
	day = new Date();
	id = day.getTime();
	if(width == ''){
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=470,height=295');");
	}else{
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width="+width+",height="+height+"');");
	}
}

setInterval ( "tikrinti_nauja_info()", 60000 );


//setInterval ( "online()", 60000 );


var isDOM=document.getElementById?1:0,isIE=document.all?1:0,isNS4=navigator.appName=='Netscape'&&!isDOM?1:0,isOp=self.opera?1:0,isDyn=isDOM||isIE||isNS4;function getRef(i,p){p=!p?document:p.navigator?p.document:p;return isIE?p.all[i]:isDOM?(p.getElementById?p:p.ownerDocument).getElementById(i):isNS4?p.layers[i]:null};function getSty(i,p){var r=getRef(i,p);return r?isNS4?r:r.style:null};if(!self.LayerObj)var LayerObj=new Function('i','p','this.ref=getRef(i,p);this.sty=getSty(i,p);return this');function getLyr(i,p){return new LayerObj(i,p)};function LyrFn(n,f){LayerObj.prototype[n]=new Function('var a=arguments,p=a[0],px=isNS4||isOp?0:"px";with(this){'+f+'}')};LyrFn('x','if(!isNaN(p))sty.left=p+px;else return parseInt(sty.left)');LyrFn('y','if(!isNaN(p))sty.top=p+px;else return parseInt(sty.top)');if(typeof addEvent!='function'){var addEvent=function(o,t,f,l){var d='addEventListener',n='on'+t,rO=o,rT=t,rF=f,rL=l;if(o[d]&&!l)return o[d](t,f,false);if(!o._evts)o._evts={};if(!o._evts[t]){o._evts[t]=o[n]?{b:o[n]}:{};o[n]=new Function('e','var r=true,o=this,a=o._evts["'+t+'"],i;for(i in a){o._f=a[i];r=o._f(e||window.event)!=false&&r;o._f=null}return r');if(t!='unload')addEvent(window,'unload',function(){removeEvent(rO,rT,rF,rL)})}if(!f._i)f._i=addEvent._i++;o._evts[t][f._i]=f};addEvent._i=1;var removeEvent=function(o,t,f,l){var d='removeEventListener';if(o[d]&&!l)return o[d](t,f,false);if(o._evts&&o._evts[t]&&f._i)delete o._evts[t][f._i]}}function FSMenu(myName,nested,cssProp,cssVis,cssHid){this.myName=myName;this.nested=nested;this.cssProp=cssProp;this.cssVis=cssVis;this.cssHid=cssHid;this.cssLitClass='highlighted';this.menus={root:new FSMenuNode('root',true,this)};this.menuToShow=[];this.mtsTimer=null;this.showDelay=0;this.switchDelay=125;this.hideDelay=500;this.showOnClick=0;this.hideOnClick=true;this.animInSpeed=0.2;this.animOutSpeed=0.2;this.animations=[]};FSMenu.prototype.show=function(mN){with(this){menuToShow.length=arguments.length;for(var i=0;i<arguments.length;i++)menuToShow[i]=arguments[i];clearTimeout(mtsTimer);if(!nested)mtsTimer=setTimeout(myName+'.menus.root.over()',10)}};FSMenu.prototype.hide=function(mN){with(this){clearTimeout(mtsTimer);if(menus[mN])menus[mN].out()}};FSMenu.prototype.hideAll=function(){with(this){for(var m in menus)if(menus[m].visible&&!menus[m].isRoot)menus[m].hide(true)}};function FSMenuNode(id,isRoot,obj){this.id=id;this.isRoot=isRoot;this.obj=obj;this.lyr=this.child=this.par=this.timer=this.visible=null;this.args=[];var node=this;this.over=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);clearTimeout(mtsTimer);if(!isRoot&&!visible)node.show();if(menuToShow.length){var a=menuToShow,m=a[0];if(!menus[m]||!menus[m].lyr.ref)menus[m]=new FSMenuNode(m,false,obj);var c=menus[m];if(c==node){menuToShow.length=0;return}clearTimeout(c.timer);if(c!=child&&c.lyr.ref){c.args.length=a.length;for(var i=0;i<a.length;i++)c.args[i]=a[i];var delay=child?switchDelay:showDelay;c.timer=setTimeout('with('+myName+'){menus["'+c.id+'"].par=menus["'+node.id+'"];menus["'+c.id+'"].show()}',delay?delay:1)}menuToShow.length=0}if(!nested&&par)par.over()}};this.out=function(evt){with(node)with(obj){if(isNS4&&evt&&lyr&&lyr.ref)lyr.ref.routeEvent(evt);clearTimeout(timer);if(!isRoot&&hideDelay>=0){timer=setTimeout(myName+'.menus["'+id+'"].hide()',hideDelay);if(!nested&&par)par.out()}}};if(this.id!='root')with(this)with(lyr=getLyr(id))if(ref){if(isNS4)ref.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT);addEvent(ref,'mouseover',this.over);addEvent(ref,'mouseout',this.out);if(obj.nested){addEvent(ref,'focus',this.over);addEvent(ref,'click',this.over);addEvent(ref,'blur',this.out)}}};FSMenuNode.prototype.show=function(forced){with(this)with(obj){if(!lyr||!lyr.ref)return;if(par){if(par.child&&par.child!=this)par.child.hide();par.child=this}var offR=args[1],offX=args[2],offY=args[3],lX=0,lY=0,doX=''+offX!='undefined',doY=''+offY!='undefined';if(self.page&&offR&&(doX||doY)){with(page.elmPos(offR,par.lyr?par.lyr.ref:0))lX=x,lY=y;if(doX)lyr.x(lX+eval(offX));if(doY)lyr.y(lY+eval(offY))}if(offR)lightParent(offR,1);visible=1;if(obj.onshow)obj.onshow(id);lyr.ref.parentNode.style.zIndex='2';setVis(1,forced)}};FSMenuNode.prototype.hide=function(forced){with(this)with(obj){if(!lyr||!lyr.ref||!visible)return;if(isNS4&&self.isMouseIn&&isMouseIn(lyr.ref))return show();if(args[1])lightParent(args[1],0);if(child)child.hide();if(par&&par.child==this)par.child=null;if(lyr){visible=0;if(obj.onhide)obj.onhide(id);lyr.ref.parentNode.style.zIndex='1';setVis(0,forced)}}};FSMenuNode.prototype.lightParent=function(elm,lit){with(this)with(obj){if(!cssLitClass||isNS4)return;if(lit)elm.className+=(elm.className?' ':'')+cssLitClass;else elm.className=elm.className.replace(new RegExp('(\\s*'+cssLitClass+')+$'),'')}};FSMenuNode.prototype.setVis=function(sh,forced){with(this)with(obj){if(lyr.forced&&!forced)return;lyr.forced=forced;lyr.timer=lyr.timer||0;lyr.counter=lyr.counter||0;with(lyr){clearTimeout(timer);if(sh&&!counter)sty[cssProp]=cssVis;var speed=sh?animInSpeed:animOutSpeed;if(isDOM&&speed<1)for(var a=0;a<animations.length;a++)animations[a](ref,counter,sh);counter+=speed*(sh?1:-1);if(counter>1){counter=1;lyr.forced=false}else if(counter<0){counter=0;sty[cssProp]=cssHid;lyr.forced=false}else if(isDOM){timer=setTimeout(myName+'.menus["'+id+'"].setVis('+sh+','+forced+')',50)}}}};FSMenu.animSwipeDown=function(ref,counter,show){if(show&&(counter==0)){ref._fsm_styT=ref.style.top;ref._fsm_styMT=ref.style.marginTop;ref._fsm_offT=ref.offsetTop||0}var cP=Math.pow(Math.sin(Math.PI*counter/2),0.75);var clipY=ref.offsetHeight*(1-cP);ref.style.clip=(counter==1?((window.opera||navigator.userAgent.indexOf('KHTML')>-1)?'':'rect(auto,auto,auto,auto)'):'rect('+clipY+'px,'+ref.offsetWidth+'px,'+ref.offsetHeight+'px,0)');if(counter==1||(counter<0.01&&!show)){ref.style.top=ref._fsm_styT;ref.style.marginTop=ref._fsm_styMT}else{ref.style.top=((0-clipY)+(ref._fsm_offT))+'px';ref.style.marginTop='0'}};FSMenu.animFade=function(ref,counter,show){var done=(counter==1);if(ref.filters){var alpha=!done?' alpha(opacity='+parseInt(counter*100)+')':'';if(ref.style.filter.indexOf("alpha")==-1)ref.style.filter+=alpha;else ref.style.filter=ref.style.filter.replace(/\s*alpha\([^\)]*\)/i,alpha)}else ref.style.opacity=ref.style.MozOpacity=counter/1.001};FSMenu.animClipDown=function(ref,counter,show){var cP=Math.pow(Math.sin(Math.PI*counter/2),0.75);ref.style.clip=(counter==1?((window.opera||navigator.userAgent.indexOf('KHTML')>-1)?'':'rect(auto,auto,auto,auto)'):'rect(0,'+ref.offsetWidth+'px,'+(ref.offsetHeight*cP)+'px,0)')};FSMenu.prototype.activateMenu=function(id,subInd){with(this){if(!isDOM||!document.documentElement)return;var fsmFB=getRef('fsmenu-fallback');if(fsmFB){fsmFB.rel='alternate stylesheet';fsmFB.disabled=true}var a,ul,li,parUL,mRoot=getRef(id),nodes,count=1;var lists=mRoot.getElementsByTagName('ul');for(var i=0;i<lists.length;i++){li=ul=lists[i];while(li){if(li.nodeName.toLowerCase()=='li')break;li=li.parentNode}if(!li)continue;parUL=li;while(parUL){if(parUL.nodeName.toLowerCase()=='ul')break;parUL=parUL.parentNode}a=null;for(var j=0;j<li.childNodes.length;j++)if(li.childNodes[j].nodeName.toLowerCase()=='a')a=li.childNodes[j];if(!a)continue;var menuID=myName+'-id-'+count++;if(ul.id)menuID=ul.id;else ul.setAttribute('id',menuID);var sOC=(showOnClick==1&&li.parentNode==mRoot)||(showOnClick==2);var evtProp=navigator.userAgent.indexOf('Safari')>-1||isOp?'safRtnVal':'returnValue';var eShow=new Function('with('+myName+'){var m=menus["'+menuID+'"],pM=menus["'+parUL.id+'"];'+(sOC?'if((pM&&pM.child)||(m&&m.visible))':'')+' show("'+menuID+'",this)}');var eHide=new Function('e','if(e.'+evtProp+'!=false)'+myName+'.hide("'+menuID+'")');addEvent(a,'mouseover',eShow);addEvent(a,'focus',eShow);addEvent(a,'mouseout',eHide);addEvent(a,'blur',eHide);if(sOC)addEvent(a,'click',new Function('e',myName+'.show("'+menuID+'",this);if(e.cancelable&&e.preventDefault)e.preventDefault();e.'+evtProp+'=false;return false'));if(subInd)a.insertBefore(subInd.cloneNode(true),a.firstChild)}if(isIE&&!isOp){var aNodes=mRoot.getElementsByTagName('a');for(var i=0;i<aNodes.length;i++){addEvent(aNodes[i],'focus',new Function('e','var node=this.parentNode;while(node){if(node.onfocus)node.onfocus(e);node=node.parentNode}'));addEvent(aNodes[i],'blur',new Function('e','var node=this.parentNode;while(node){if(node.onblur)node.onblur(e);node=node.parentNode}'))}}if(hideOnClick)addEvent(mRoot,'click',new Function(myName+'.hideAll()'));menus[id]=new FSMenuNode(id,true,this)}};var page={win:self,minW:0,minH:0,MS:isIE&&!isOp,db:document.compatMode&&document.compatMode.indexOf('CSS')>-1?'documentElement':'body'};page.elmPos=function(e,p){var x=0,y=0,w=p?p:this.win;e=e?(e.substr?(isNS4?w.document.anchors[e]:getRef(e,w)):e):p;if(isNS4){if(e&&(e!=p)){x=e.x;y=e.y};if(p){x+=p.pageX;y+=p.pageY}}if(e&&this.MS&&navigator.platform.indexOf('Mac')>-1&&e.tagName=='A'){e.onfocus=new Function('with(event){self.tmpX=clientX-offsetX;self.tmpY=clientY-offsetY}');e.focus();x=tmpX;y=tmpY;e.blur()}else while(e){x+=e.offsetLeft;y+=e.offsetTop;e=e.offsetParent}return{x:x,y:y}};if(isNS4){var fsmMouseX,fsmMouseY,fsmOR=self.onresize,nsWinW=innerWidth,nsWinH=innerHeight;document.fsmMM=document.onmousemove;self.onresize=function(){if(fsmOR)fsmOR();if(nsWinW!=innerWidth||nsWinH!=innerHeight)location.reload()};document.captureEvents(Event.MOUSEMOVE);document.onmousemove=function(e){fsmMouseX=e.pageX;fsmMouseY=e.pageY;return document.fsmMM?document.fsmMM(e):document.routeEvent(e)};function isMouseIn(sty){with(sty)return((fsmMouseX>left)&&(fsmMouseX<left+clip.width)&&(fsmMouseY>top)&&(fsmMouseY<top+clip.height))}}


function chatpopup(nick) {
	day = new Date();
	id = day.getTime();
	var URL=mainurl+"/chat/index.php?n="+nick;
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=820,height=470');");

}

function UPLOAD() {
	day = new Date();
	id = day.getTime();
	var URL="http://www.hotnot.lt/upload.html";
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=1,menubar=0,resizable=0,width=520,height=140');");

}

function didintifoto(user, eile, nr, special){

	g=false;
	if(window.XMLHttpRequest){
		g=new XMLHttpRequest();
		if(g.overrideMimeType){
			g.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g){
		alert('Can not create XMLHTTP-instance');
		return false;
	}


	g.onreadystatechange=function(){ alinfo(eile, nr, special); };
	if(special == 'horo'){
		g.open('GET',mainurl+'/daugiauinfo.php?id='+user+'&special='+special,true);
	}else{
		g.open('GET',mainurl+'/daugiauinfo.php?id='+user,true);
	}
	g.send(null);
};

function alinfo(eil, n, special){
	if(g.readyState==4){
		if(g.status==200){

			if(g.responseText == '0'){
				alert('Atsiprašome, didesnės nuotraukos neradome');
				return false;
			}else{

				if(special == 'horo'){
					add = '_'+special;
				}else{
					add = '';
				}

				document.getElementById('rodyti_didesne_foto'+add).style.left = n;
				document.getElementById('rodyti_didesne_foto'+add).style.top = eil;
				document.getElementById('rodyti_didesne_foto'+add).style.display = '';
				document.getElementById('rodyti_didesne_foto'+add).innerHTML = g.responseText;

			}
		}
	else{
		alert('Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.');
	}
	}
};



function point_it(user, special){

	if(x_coord>600){
		x_coord = x_coord-560;
	}

	if(special == 'horo'){
		didintifoto(user, 0, 160, special);
	}else{
  	didintifoto(user, y_coord-290, x_coord-30);
	}
}



var defaultMenuWidth="150px"



////No need to edit beyond here

var ie5=document.all && !window.opera
var ns6=document.getElementById

if (ie5||ns6)
document.write('<div id="popitmenu" style="display: none;" onMouseover="clearhidemenu();" onMouseout="dynamichide(event)"></div>')

function iecompattest(){
return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body
}

function showmenu(e, which, optWidth, userid, username, match){
optWidth = '150px'
var linkset=new Array()

linkset[0]='<table border="0" cellspacing="0" cellpadding="0" width="100%">'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_aplankyti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'">Aplankyti anketą</a></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_laiskai_pop.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/greitas_atsakymas/id='+userid+'\', \'690\', \'390\');">Siųsti žinutę</a></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_susirasinejimas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="'+mainurl+'/procedura_laiskai.php?veiksmas=istorija&rodyti_id='+userid+'">Laiškų istorija</a></td></tr>'
linkset[0]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_kviesti_draugauti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/pakviesti_draugauti/id='+userid+'\', \'300\', \'130\');">Kviesti draugauti</a></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_kviesti_klubas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/pakviesti_klubas/id='+userid+'\', \'300\', \'130\');">Pakviesti į klubą</a></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_atsiliepimas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'/rodyti=atsiliepimai">Palikti atsiliepimą</a></td></tr>'
linkset[0]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_dovanok.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'\', \'810\', \'450\');">Nustebinti dovana</a></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_pokstas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'/pokstai=1\', \'810\', \'450\');">Iškrėsti pokštą</a></td></tr>'
linkset[0]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[0]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_pasalinti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" onClick="return confirm(\'Ar tikrai nori ištrinti šį žmogų iš savo Abipusių-TAIP sąrašo?\');" href="'+mainurl+'/procedura_mat.php?veiksmas=abipusiaitrinti&id='+match+'">Pašalinti</a></td></tr>'
linkset[0]+='</table>'

linkset[1]='<table border="0" cellspacing="0" cellpadding="0" width="100%">'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_aplankyti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'">Aplankyti anketą</a></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_laiskai_pop.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/greitas_atsakymas/id='+userid+'\', \'690\', \'390\');">Siųsti žinutę</a></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_susirasinejimas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="'+mainurl+'/procedura_laiskai.php?veiksmas=istorija&rodyti_id='+userid+'">Laiškų istorija</a></td></tr>'
linkset[1]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_kviesti_klubas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/pakviesti_klubas/id='+userid+'\', \'300\', \'130\');">Pakviesti į klubą</a></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_atsiliepimas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'/rodyti=atsiliepimai">Palikti atsiliepimą</a></td></tr>'
linkset[1]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_dovanok.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'\', \'810\', \'450\');">Nustebinti dovana</a></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_pokstas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'/pokstai=1\', \'810\', \'450\');">Iškrėsti pokštą</a></td></tr>'
linkset[1]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[1]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_pasalinti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" onClick="return confirm(\'Ar tikrai nori ištrinti šį žmogų iš savo draugų sąrašo?\');" href="'+mainurl+'/procedura_mat.php?veiksmas=draugaitrinti&id='+match+'">Pašalinti</a></td></tr>'
linkset[1]+='</table>'

linkset[2]='<table border="0" cellspacing="0" cellpadding="0" width="100%">'
linkset[2]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_aplankyti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'">Aplankyti anketą</a></td></tr>'
linkset[2]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_laiskai_pop.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/greitas_atsakymas/id='+userid+'\', \'690\', \'390\');">Siųsti žinutę</a></td></tr>'
linkset[2]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[2]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_kviesti_draugauti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/pakviesti_draugauti/id='+userid+'\', \'300\', \'130\');">Kviesti draugauti</a></td></tr>'
linkset[2]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_kviesti_klubas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/pakviesti_klubas/id='+userid+'\', \'300\', \'130\');">Pakviesti į klubą</a></td></tr>'
linkset[2]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[2]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_dovanok.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'\', \'810\', \'450\');">Nustebinti dovana</a></td></tr>'
linkset[2]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_pokstas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'/pokstai=1\', \'810\', \'450\');">Iškrėsti pokštą</a></td></tr>'
linkset[2]+='</table>'

linkset[3]='<table border="0" cellspacing="0" cellpadding="0" width="100%">'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_aplankyti.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'">Aplankyti anketą</a></td></tr>'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_laiskai_pop.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/greitas_atsakymas/id='+userid+'\', \'690\', \'390\');">Siųsti žinutę</a></td></tr>'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_susirasinejimas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="'+mainurl+'/procedura_laiskai.php?veiksmas=istorija&rodyti_id='+userid+'">Laiškų istorija</a></td></tr>'
linkset[3]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_kviesti_klubas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/pakviesti_klubas/id='+userid+'\', \'300\', \'130\');">Pakviesti į klubą</a></td></tr>'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_atsiliepimas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="http://sutik.hotnot.lt/'+username+'/rodyti=atsiliepimai">Palikti atsiliepimą</a></td></tr>'
linkset[3]+='<tr><td width="150" colspan="2" style="padding-top: 4px; padding-bottom: 4px;" align="center"><hr></td></tr>'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_dovanok.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'\', \'810\', \'450\');">Nustebinti dovana</a></td></tr>'
linkset[3]+='<tr><td width="30" style="padding-top: 4px; padding-bottom: 4px;" align="center"><img src="'+mainurl+'/templates/images/ico/ico_pokstas.gif"></td><td style="padding-top: 4px; padding-bottom: 4px;" align="left" width="120"><a class="a2" href="#" onClick="popUp(\''+mainurl+'/dovanos/id='+userid+'/pokstai=1\', \'810\', \'450\');">Iškrėsti pokštą</a></td></tr>'
linkset[3]+='</table>'

if (!document.all&&!document.getElementById)
return
clearhidemenu()
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu")
menuobj.innerHTML=linkset[which]
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : defaultMenuWidth
menuobj.contentwidth=menuobj.offsetWidth
menuobj.contentheight=menuobj.offsetHeight
eventX=ie5? event.clientX : e.clientX
eventY=ie5? event.clientY : e.clientY
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY
//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.contentwidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
//same concept with the vertical position
if (bottomedge<menuobj.contentheight)
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
else
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.display=""
return false
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu(){
if (window.menuobj)
menuobj.style.display="none"
}

function dynamichide(e){
if (ie5&&!menuobj.contains(e.toElement))
hidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
hidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500)
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide)
}

if (ie5||ns6)
document.onclick=hidemenu

window.onload = init;
				function init() {
				  if (window.Event) {
				    document.captureEvents(Event.MOUSEMOVE);
				  }
				  document.onmousemove = getXY;
				}

				function f_scrollTop() {
					return f_filterResults (
						window.pageYOffset ? window.pageYOffset : 0,
						document.documentElement ? document.documentElement.scrollTop : 0,
						document.body ? document.body.scrollTop : 0
					);
				}

				function f_filterResults(n_win, n_docel, n_body) {
					var n_result = n_win ? n_win : 0;
					if (n_docel && (!n_result || (n_result > n_docel)))
						n_result = n_docel;
					return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
				}

				function getXY(e) {
				  x = (window.Event) ? e.pageX : event.clientX;
				  y = (window.Event) ? e.pageY : event.clientY;

				  if(parseInt(x)+380 < screen.width){
				  	  document.getElementById('floating_desc').style.left = parseInt(x)-130;
				  }
					  if(navigator.appName == "Microsoft Internet Explorer"){
					  	if(parseInt(y)-f_scrollTop()+document.getElementById('floating_desc').offsetHeight+150 < screen.height){
					  		document.getElementById('floating_desc').style.top = parseInt(y)+f_scrollTop()+15;
					  	}

					  }else{

					  	if(parseInt(y)-f_scrollTop()+document.getElementById('floating_desc').offsetHeight+150 < screen.height){
					  		document.getElementById('floating_desc').style.top = parseInt(y)+15;
					  	}
					  }



				}


function change_feeds_filter(number){
	 if(number == 1){ document.getElementById('news_filter_1').className='news_filter_selected'; } else { document.getElementById('news_filter_1').className='news_filter'; }
	 if(number == 2){ document.getElementById('news_filter_2').className='news_filter_selected'; } else { document.getElementById('news_filter_2').className='news_filter'; }
	 if(number == 3){ document.getElementById('news_filter_3').className='news_filter_selected'; } else { document.getElementById('news_filter_3').className='news_filter'; }
	 if(number == 4){ document.getElementById('news_filter_4').className='news_filter_selected'; } else { document.getElementById('news_filter_4').className='news_filter'; }
	 if(number == 5){ document.getElementById('news_filter_5').className='news_filter_selected'; } else { document.getElementById('news_filter_5').className='news_filter'; }
	 if(number == 6){ document.getElementById('news_filter_6').className='news_filter_selected'; } else { document.getElementById('news_filter_6').className='news_filter'; }
	 if(number == 7){ document.getElementById('news_filter_7').className='news_filter_selected'; } else { document.getElementById('news_filter_7').className='news_filter'; }
	 if(number == 8){ document.getElementById('news_filter_8').className='news_filter_selected'; } else { document.getElementById('news_filter_8').className='news_filter'; }
}


function keistinuotaika(nuotaika){
	if(nuotaika =='0'){
		document.getElementById('my_mood').innerHTML = '';
		document.getElementById('my_mood').style.cursor = '';
	}

	g=false;
	if(window.XMLHttpRequest){
		g=new XMLHttpRequest();
		if(g.overrideMimeType){
			g.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g){
		alert('Can not create XMLHTTP-instance');
		return false;
	}


	g.onreadystatechange=function(){ nuotaika_action(); };
	g.open('GET',mainurl+'/mz_status.php?veiksmas=change_mood&mood='+nuotaika,true);
	g.send(null);
};

function nuotaika_action(){
	if(g.readyState==4){
		if(g.status==200){

			if(g.responseText == '0'){
				document.getElementById('my_mood').innerHTML = '';
				document.getElementById('my_mood').style.cursor = '';
			}else{

				document.getElementById('my_mood').innerHTML = '<img src="'+g.responseText+'">';
				document.getElementById('my_mood').style.cursor = 'pointer';


			}
		}
	else{
		alert('Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.');
	}
	}
};

function hide_notice(id){

		document.getElementById('notice_div').innerHTML = '';

	g=false;
	if(window.XMLHttpRequest){
		g=new XMLHttpRequest();
		if(g.overrideMimeType){
			g.overrideMimeType('text/xml');
		}
	}else if(window.ActiveXObject){
		try{
			g=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e){
			try{
				g=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e){}
		}
	}

	if(!g){
		alert('Can not create XMLHTTP-instance');
		return false;
	}

	g.open('GET',mainurl+'/mz_status.php?veiksmas=hide_notice&id='+id,true);
	g.send(null);
};

function LoadNearby(){
	var ajaxRequest;  // The variable that makes Ajax possible!

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('live_nearby_div');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;

		}
	}
	ajaxRequest.open("GET", "http://www.hotnot.lt/mz_live_nearby_ajax.php", true);
	ajaxRequest.send(null);

}

function LoadFriends(){
	var ajaxRequest;  // The variable that makes Ajax possible!

	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Įvyko naršyklės klaida! Greičiausiai kraunant puslapį nutrūko ryšys tarp naršyklės ir HotNot.lt serverio. Prašome pamėginti dar kartą.");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById('friends_load_div');
			ajaxDisplay.innerHTML = ajaxRequest.responseText;

		}
	}
	ajaxRequest.open("GET", 'http://www.hotnot.lt/mz_friends_ajax.php', true);
	ajaxRequest.send(null);

}


function load_manozona(){
	LoadNearby();
	LoadFriends();
}




var horizontal_offset="9px" //horizontal offset of hint box from anchor link

/////No further editting needed

var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change.
var ie=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)
}
else{
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight
}
return edgeoffset
}

function showhint(menucontents, obj, e, tipwidth){
if ((ie||ns6) && document.getElementById("hintbox")){
dropmenuobj=document.getElementById("hintbox")
dropmenuobj.innerHTML=menucontents
dropmenuobj.style.left=dropmenuobj.style.top=-500
dropmenuobj.style.left=dropmenuobj.style.zIndex='10000'
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
dropmenuobj.style.visibility="visible"
obj.onmouseout=hidetip
}
}

function hidetip(e){
dropmenuobj.style.visibility="hidden"
dropmenuobj.style.left="-500px"
}

function createhintbox(){
var divblock=document.createElement("div")
divblock.setAttribute("id", "hintbox")
document.body.appendChild(divblock)
}

if (window.addEventListener)
window.addEventListener("load", createhintbox, false)
else if (window.attachEvent)
window.attachEvent("onload", createhintbox)
else if (document.getElementById)
window.onload=createhintbox


