function hideall(id)
{var Nodes=document.getElementsByTagName("div")
var max=Nodes.length
for(var i=0;i<max;i++){var nodeObj=Nodes.item(i)
var str=nodeObj.id
if(str.match(id)){nodeObj.style.display='none';}}}
function profilList(cur,start,owner,type,total,direction){if(!$("profilList-"+start)){var tempo='';if($('st'+direction+'-'+cur)){tempo=$('st'+direction+'-'+cur).innerHTML;$('st'+direction+'-'+cur).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';}
var req=mint.Request();req.AddParam("start",start);req.AddParam("owner",owner);req.AddParam("type",type);req.AddParam("total",total);setTimeout(function(){req.Send("profil/list.php");},200);req.OnSuccess=function(){if($('st'+direction+'-'+cur))$('st'+direction+'-'+cur).innerHTML=tempo;hideall('profilList-');$('profilList').innerHTML+=this.responseText;$("profilList-"+start).style.display='block';}}
else{hideall('profilList-');$("profilList-"+start).style.display='block';}}
function delCurrent(id,type){if(confirm("Czy napewno usunąć?")){var req=mint.Request();req.Set("method","post");req.AddParam("del",id);req.AddParam("type",type);req.Send("profil/list.php");req.OnSuccess=function(){$("ph"+id).style.display='none';}}}
function addTitle(start,desc,owner_id){if(start==4){$('titleeT').innerHTML='&nbsp;';$('titleT').style.display='';$('titlee').style.display='';}
else if(start==2){var desc=$("titleIn").value;if(desc=='')desc='a';$('titleeT').innerHTML='<img src="http://glitery.pl/pb.gif" border="0"/>';var req=mint.Request();req.Set("method","post");req.AddParam("description",desc);req.AddParam('owner_id',owner_id);setTimeout(function(){req.Send("profil/title.php");},400);req.OnSuccess=function(){if(this.responseText==''){$('titlee').innerHTML='<span></span>';$('titleT').innerHTML='<a class="editL" onclick="addTitle(3,\'\',\''+owner_id+'\')">Dodaj opis<img src="style/img/rarrowb.gif" width="8" height="8"></a>';}
else{$('titlee').innerHTML='<span>'+this.responseText+'</span>';$('titleT').innerHTML='<a class="editL" onclick="addTitle(3,\''+desc+'\',\''+owner_id+'\')">edytuj opis<img src="style/img/rarrowb.gif" width="8" height="8"></a>';}
$('titleeT').innerHTML='&nbsp;';$('titleT').style.display='';$('titlee').style.display='';}}
else{var add='';$('titleeT').innerHTML='<span><input type="text" id="titleIn" value="'+desc+'" maxlength="54"/><a onclick="addTitle(2,\'\',\''+owner_id+'\')" class="editL"> Zapisz<img src="style/img/rarrowb.gif" width="8" height="8"></a></span><span> <a onclick="addTitle(4,\'\',\''+owner_id+'\')" class="editL">anuluj<img src="style/img/rarrowb.gif" width="8" height="8"></a></span>';$('titleT').style.display='none';$('titlee').style.display='none';}}
function addDesc(id,start,desc){if(start==4){$('desccT').innerHTML='&nbsp;';$('descc').style.display='';}
else if(start==2){var desc=$("descIn").value;if(!desc)descS='a';else descS=desc;$('desccT').innerHTML='<img src="http://glitery.pl/pb.gif" border="0"/>';var req=mint.Request();req.Set("method","post");req.AddParam("photoId",id);req.AddParam("description",descS);setTimeout(function(){req.Send("profil/list.php");},400);req.OnSuccess=function(){$('tempDesc').innerHTML+='<input type="hidden"  id="t'+id+'" value="'+desc+'" maxlength="54" />';if(this.responseText)$('descc').innerHTML=this.responseText+'&nbsp; <a class="editL" onclick="addDesc('+id+',3,\''+desc+'\')"><br>edytuj opis<img src="style/img/rarrowb.gif" width="8" height="8"></a>';else $('descc').innerHTML='<a class="editL" onclick="addDesc('+id+',3,\'\')">Dodaj opis do fotki<img src="style/img/rarrowb.gif" width="8" height="8"></a>';$('desccT').innerHTML='&nbsp;';$('descc').style.display='';}}
else{var add='';$('desccT').innerHTML='<input type="text" id="descIn" value="'+desc+'" maxlength="54"/><a onclick="addDesc('+id+',2,\'\')" class="editL"> Zapisz<img src="style/img/rarrowb.gif" width="8" height="8"></a> <a onclick="addDesc('+id+',4,\'\')" class="editL">anuluj<img src="style/img/rarrowb.gif" width="8" height="8"></a><br/><br/>';$('descc').style.display='none';}}
function chCurrentImg(src,id,desc,ww,hh){if(ww>0&&hh>0){if($('megaPack'))$('megaPack').innerHTML="<img src='images/extra/g4.gif' border='0'/><a href='http://www.glitery.pl/profil,bonus,8' style='color: #800080; font-size: 13px; font-weight: bold;'>Zobacz jak możesz <u>generować większe fotki</u> takie jak ta:</a>";}
else{if($('megaPack'))$('megaPack').innerHTML='';}
if(id&&id.charAt(0)!='f')$('currentHref').href='image.php?type=1&id='+id;else id=id.substr(1);var ownerr=parseInt($("ownerr").value);$('timer').innerHTML='<img src="http://glitery.pl/pb.gif" border="0"/>';setTimeout(function(){var imgPreloader=new Image();imgPreloader.onload=(function(){$('currentImg').src=imgPreloader.src;if($('descc')){if($('descc').style.display=='none'){$('desccT').innerHTML='&nbsp;';$('descc').style.display='';}
if($('t'+id))desc=$('t'+id).value;if(desc=='1'&&ownerr==1)$('descc').innerHTML='<a class="editL" onclick="addDesc('+id+',1,\'\')">Dodaj opis do fotki<img src="style/img/rarrowb.gif" width="8" height="8"></a>';else if(desc!='1'){$('descc').innerHTML=desc;if(ownerr==1)$('descc').innerHTML+='<a class="editL" onclick="addDesc('+id+',1,\''+desc+'\')"><br>edytuj opis<img src="style/img/rarrowb.gif" width="8" height="8"></a>';}else{$('descc').innerHTML='';}}
$('timer').innerHTML='';imgPreloader=null;});imgPreloader.onerror=(function(){$('currentImg').src='http://www.glitery.pl/404.gif';$('timer').innerHTML='';imgPreloader=null;});imgPreloader.src=src;if(parseInt($('votingPlus').value)==1&&$("voteIm")){$('voteIm').innerHTML='<td>wczytuję...</td>';$('voteIm').innerHTML='';tmp='';tmp+='<table cellspacing="0" cellpadding="0" align="center" border="0" style="margin-top:8px;"><tr>';for(i=1;i<=10;i++){tmp+='<td align="center" width="25" height="24" id="im'+i+'" class="rankingstarOFF" onmouseover="highlightIm(\''+i+'\',false)" onmouseout="highlightIm(\''+i+'\',true)" onclick="voteIm(\''+i+'\',\''+id+'\');"/>'+i+'</td>';}
tmp+='</tr></table>';$('voteIm').innerHTML=tmp;}
setTimeout(function(){height("workspace","transparent0");},150);},700);}
function highlightIm(id,out){if(out==false){for(i=1;i<=id;i++){if($("im"+i).name!='on'){$("im"+i).name='on';$("im"+i).className='rankingstarON';}}}
else{for(i=1;i<=id;i++){if($("im"+i).name!='off'){$("im"+i).name='off';$("im"+i).className='rankingstarOFF';}}}}
function voteIm(vote,id,owner_id){if($("active").value==1&&$("voteIm")){$("voteIm").innerHTML='<td>proszę czekać...</td>';var req=mint.Request();req.Set("method","post");req.AddParam("vote",vote);req.AddParam('owner_id',$("oId").value);req.AddParam('id',id);req.Send("voteImg.php");req.OnSuccess=function(){$("voteIm").innerHTML='<td>'+this.responseText+'</td>';}}
else if($("voteIm"))$("voteIm").innerHTML="<td><img src='images/extra/g7.gif' border='0'/><a href='http://www.glitery.pl/profil,bonus,7' style='color: green; font-size: 13px; font-weight: bold;'>Chcesz głosować na glitery bedąc na profilu? Zobacz <u>tutaj</u> jak to zrobić</a></td>";}
function friends(cur,start,owner,type,total,direction){if(!$("znaj-"+start)){var tempo='';if($('st'+direction+'-'+cur)){tempo=$('st'+direction+'-'+cur).innerHTML;$('st'+direction+'-'+cur).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';}
var req=mint.Request();req.Set("evalScripts",true);req.AddParam("start",start);req.AddParam("owner",owner);req.AddParam("total",total);req.Send("profil/friends.php");req.OnSuccess=function(){if($('st'+direction+'-'+cur))$('st'+direction+'-'+cur).innerHTML=tempo;hideall('znaj-');$('znaj').innerHTML+=this.responseText;$("znaj-"+start).style.display='block';}}
else{hideall('znaj-');$("znaj-"+start).style.display='block';}}
function comments(cur,start,owner,type,total,direction){if(!$("comments-"+start)){var tempo='';if($('st'+direction+'-'+cur)){tempo=$('st'+direction+'-'+cur).innerHTML;$('st'+direction+'-'+cur).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';}
var req=mint.Request();req.AddParam("start",start);req.AddParam("owner",owner);req.AddParam("total",total);req.Send("profil/comments.php");req.OnSuccess=function(){if($('st'+direction+'-'+cur))$('st'+direction+'-'+cur).innerHTML=tempo;hideall('comments-');$('comments').innerHTML+=this.responseText;$("comments-"+start).style.display='block';}}
else{hideall('comments-');$("comments-"+start).style.display='block';}}
function changeColorComments(s){var color=s.options[s.selectedIndex].value;s.style.backgroundColor=color;$("colored").style.color=color;$("colorval").value=color;}
function extendAdd(){if($('addComment').style.display=='none'){$('addComment').style.display='';}
else{$('addComment').style.display='none';}}
function addComment(){if($("colored").value.length<5){alert('Komentarz jest za krótki by go dodac');return false;}
var req=mint.Request();req.Set("resetForm",true);req.OnSuccess=function(){comments(0,0,'');$("comments-0").innerHTML=this.responseText+$("comments-0").innerHTML;}
req.SendForm("commentForm");}
function delComment(id,owner){var req=mint.Request();req.Set("method","post");req.AddParam("del",id);req.Send("profil/comments.php");req.OnSuccess=function(){$("com"+id).style.display='none';}}
function block(id){if(confirm("Czy napewno zablokować?")){$("blockTop").innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';var req=mint.Request();req.Set("method","post");req.AddParam("blockId",id);req.OnSuccess=function(){$("blockTop").innerHTML=this.responseText;}
req.Send("profil/block.php");}}
function warn(id,start){if(start==1){if($("waren").style.display=='none'){$("waren").style.display='';}
else{$("waren").style.display='none';}}else{if($("type").value==''||$("descriptionn").value.length<15){alert('Wybierz typ zgłoszenia i opisz go w paru slowach');return false;}
$("warnLoad").innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';var req=mint.Request();req.Set("method","post");req.AddParam("guilty",id);req.AddParam("type",$("type").value);req.AddParam("text",$("descriptionn").value);req.OnSuccess=function(){$("warnTop").innerHTML=this.responseText;$("waren").style.display='none';}
req.Send("profil/warn.php");}}
function unblock(id,cc){var req=mint.Request();req.Set("method","post");req.AddParam("delId",id);req.OnSuccess=function(){$('unblock'+cc).style.display='none';}
req.Send("profil/block.php");}
function invite(login,cc,query){$("invite"+cc).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';var req=mint.Request();req.Set("method","post");req.AddParam("invite",login);if(cc=='Top'){req.AddParam("position",cc);}else{req.AddParam("position",$("pos"+cc).value);}
req.OnSuccess=function(){if(cc=='Top'){$("invite"+cc).innerHTML=this.responseText;}else{$("refresh").innerHTML=this.responseText;}}
req.Send("profil/inv.php?"+query);}
function uninvite(login,cc,type,query){type=parseInt(type);if(confirm('Czy napewno usunać osobę?')){if(type==1){$("invite"+cc).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';}else if(type==2){$("del"+cc).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';}
var req=mint.Request();req.Set("method","post");req.AddParam("del_id",login);req.AddParam("type",type);req.OnSuccess=function(){if(type==1){$("refresh").innerHTML=this.responseText;}
else if(type==2){$("del"+cc).style.display='none';}}
req.Send("profil/inv.php?"+query);}}
function highlight(id,out){if(out==false){for(i=1;i<=id;i++){if($("g"+i).name!='on'){$("g"+i).name='on';$("g"+i).className='rankingstarON';}}}
else{for(i=1;i<=id;i++){if($("g"+i).name!='off'){$("g"+i).name='off';$("g"+i).className='rankingstarOFF';}}}}
function vote(id,owner_id){$("vote").innerHTML='proszę czekać...';var req=mint.Request();req.Set("method","post");req.AddParam("vote",id);req.AddParam('owner_id',owner_id);req.Send("profil/vote.php");req.OnSuccess=function(){$("vote").innerHTML=this.responseText;}}
function updateNote(id){$("noteS-"+id).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';var req=mint.Request();req.Set("method","post");req.AddParam("noteId",id);req.AddParam("title",$("title-"+id).value);req.AddParam("position",$("position-"+id).value);req.AddParam("text",area.html);req.Send("profil/noteEdit.php");req.OnSuccess=function(){window.location.href='profil.php';}}
function removeNote(id){if(confirm("Czy napewno skasować tę notkę?")){$('delN'+id).innerHTML='<img src="http://glitery.pl/pb.gif" border="0"/>';var req=mint.Request();req.Set("method","post");req.AddParam("delId",id);req.OnSuccess=function(){if(this.responseText=='1')window.location.reload();else $('delN'+id).innerHTML='Wystąpił problem, prosimy spróbować ponownie';}
setTimeout(function(){req.Send("profil/noteEdit.php");},400);}}
function setcookie(name,value,expires,path,domain,secure){expires instanceof Date?expires=expires.toGMTString():typeof(expires)=='number'&&(expires=(new Date(+(new Date)+expires*1e3)).toGMTString());var r=[name+"="+escape(value)],s,i;for(i in s={expires:expires,path:path,domain:domain}){s[i]&&r.push(i+"="+s[i]);}
return secure&&r.push("secure"),document.cookie=r.join(";"),true;}
function switchCloud(type,id,refr){
	$("gen"+type).innerHTML='proszę czekać...';
	var req=mint.Request();
	req.Set("method","post");
	req.AddParam("type",type);
	req.AddParam("set",id);
	req.OnSuccess=function(){
		if(this.responseText=='1') window.location.href=refr;
		else $("gen"+type).innerHTML='Zaloguj się...';
	}
	req.Send("profil/settings.php");
}

function commentsPriv(cur,start,owner,type,total,direction){if(!$("comments-"+start)){var tempo='';if($('st'+direction+'-'+cur)){tempo=$('st'+direction+'-'+cur).innerHTML;$('st'+direction+'-'+cur).innerHTML='<img src="http://www.glitery.pl/pb.gif" border="0" />';}
var req=mint.Request();req.AddParam("start",start);req.AddParam("owner",owner);req.AddParam("total",total);req.Send("profil/commentsPriv.php");req.OnSuccess=function(){if($('st'+direction+'-'+cur))$('st'+direction+'-'+cur).innerHTML=tempo;hideall('comments-');$('comments').innerHTML+=this.responseText;$("comments-"+start).style.display='block';}}
else{hideall('comments-');$("comments-"+start).style.display='block';}}
function addCommentPriv(){if($("colored").value.length<5){alert('Komentarz jest za krótki by go dodac');return false;}
var req=mint.Request();req.Set("resetForm",true);req.OnSuccess=function(){comments(0,0,'');$("comments-0").innerHTML=this.responseText+$("comments-0").innerHTML;}
req.SendForm("commentForm");}
function delCommentPriv(id,owner){var req=mint.Request();req.Set("method","post");req.AddParam("del",id);req.Send("profil/commentsPriv.php");req.OnSuccess=function(){$("com"+id).style.display='none';}}
function eraseTitle(owner_id){
	var req=mint.Request();req.Set("method","post");req.AddParam("del",1);req.AddParam('owner_id',owner_id);setTimeout(function(){req.Send("profil/title.php");},50);req.OnSuccess=function(){if(this.responseText==''){$('titlee').innerHTML='<span></span>';$('titleT').innerHTML='<a class="editL" onclick="addTitle(3,\'\',\''+owner_id+'\')">Dodaj opis<img src="style/img/rarrowb.gif" width="8" height="8"></a>';}}}
	
function addBox(id){
	if($("textH").name == 'emptyBox'){
		$("textH").name = 'fullBox';
		$("textH").value = $("textAr").innerHTML;
		$("textAr").innerHTML = '<form action="profil/html.php" method="POST" id="htmlForm"><textarea style="width:300px; height:100px;" id="htmlCode" name="htmlCode">'+$("textAr").innerHTML+'</textarea><br/><a class="editL"  href="#" onclick="saveBox('+id+');return false;">Zapisz<img width="8" height="8" border="0" src="http://static1.glittery.pl/galeria/style/img/rarrowb.gif"/></a>&nbsp;<a class="editL"  href="#" onclick="exitBox();return false;">Cofnij<img width="8" height="8" border="0" src="http://static1.glittery.pl/galeria/style/img/rarrowb.gif"/></a></form>';
	}
}
function removeBox(id,refr) {
	if(confirm('Czy napewno usunąć?')){
		var req = mint.Request();
		req.Set("method",'POST');
		req.AddParam("usr", id);
		req.AddParam("empty", 1);
		
		req.OnSuccess = function() {
			if(this.responseText=='ok'){
				window.location.href=refr;
			}
		}
			
		req.Send("profil/html.php");
	}
}
function saveBox(id) {
		$("resultAr").innerHTML = '<img src="http://static1.glittery.pl/pb.gif" border="0" />';
		var req = mint.Request();
		req.AddParam("usr", id);
		
		req.OnSuccess = function() {
			if(this.responseText=='ok'){
				$("resultAr").innerHTML = '';
				$("textAr").innerHTML = $("htmlCode").value;
				$("textH").name = 'emptyBox';
			}else{
				$("resultAr").innerHTML = this.responseText;
			}
		}
			
		req.SendForm("htmlForm");
	}
function exitBox(){
	$("textAr").innerHTML = $("textH").value;
	$("textH").name = 'emptyBox';
	$("textH").value = '';
}