//(c) Artur StempieĹ„ virtualmedia.pl
function pokazele(nazwa) {
if (document.getElementById(nazwa).style.display=='block'){
document.getElementById(nazwa).style.display='none';
}
else{ 
document.getElementById(nazwa).style.display='block';
}
}
function keyup(what,where,maxKeys) 
{
 var str = new String(what.value);
var len = str.length;
var showstr ="wpisałeś "+ len + " znaków na " + maxKeys + " dostępnych";
if (len > maxKeys) showstr += '<br>Dane powyżej '+maxKeys+' znaku zostaną utracone';
txtshow(showstr,where);
}
function MM_swapImgRestore() { 
 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
} 
function PopupPic(sPicURL) { 
 window.open( "popup.htm?"+sPicURL, "", 
 "resizable=1,HEIGHT=200,WIDTH=200"); 
} 
function odznaczwszystkie(id,id1){
zapis="";
ilepro=0;
ilezostalo=0;
for(var i=id;i<id1;i++) 
{ 
window.parent.document.clientpanel.elements["message"+i+"c"].checked='';
}
}
function usunmess(id,boxik,userek){

var iRnd = Math.random(); 
loadpagesimple('account_messages.php?ajax=1&usun='+id+'&rand='+iRnd+'&box='+boxik+'&user='+userek,'loader8');
}
function MM_preloadImages() { 
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
 if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { 
 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
 d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}
function loadpagesimpler(url,id) {
var iRnd = Math.random();
url=url+"&rand="+iRnd;
 
 if (document.getElementById) {
 var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
x.onreadystatechange = function() {
 if (x.readyState == 4 && x.status == 200) {
 el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
function flip(rid)
{
current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
document.getElementById(rid).style.display = current;
}
function videodelete(id,numero) {
window.document.clientpanel.elements["prvideos"+numero].value=0;
window.document.getElementById("prvideo"+numero).style.display='none';
window.document.clientpanel.elements["videoacceptg"+numero].value=0;
window.document.clientpanel.ilevideo.value--;
var pare = document;
if (pare.getElementById) {
 var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
 x.onreadystatechange = function() {
 if (x.readyState == 4 && x.status == 200) {
 el = pare.getElementById(id);
el.innerHTML = x.responseText;
}
}
var iRnd = Math.random(); 
 
}
}

function videodeletez(id,numero) {
window.document.clientpanel.elements["prvideosz"+numero].value=0;
window.document.getElementById("prvideoz"+numero).style.display='none';
window.document.clientpanel.elements["videoacceptgz"+numero].value=0;
window.document.clientpanel.ilevideoz.value--;
var pare = document;
if (pare.getElementById) {
 var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x) {
 x.onreadystatechange = function() {
 if (x.readyState == 4 && x.status == 200) {
 el = pare.getElementById(id);
el.innerHTML = x.responseText;
}
}
var iRnd = Math.random(); 
 }
}

function zdjecie(theURL,szerokosc,wysokosc)
{window.open(theURL,'','height='+wysokosc+',width='+szerokosc+',menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,right=0,bottom=0');}
function zaznaczwszystkie(id,id1){
zapis="";
ilepro=0;
ilezostalo=0;
for(var i=id;i<id1;i++) 
{ 
window.parent.document.clientpanel.elements["message"+i+"c"].checked='true';
}
}

function zaznaczwszystkie1(id,id1){
zapis="";
ilepro=0;
ilezostalo=0;
for(var i=id;i<id1;i++) 
{ 
window.parent.document.clientpanel.elements["note"+i+"c"].checked='true';
}
}
function usunzaznaczone(id,id1,boxik,userek){
zapis="";
ilepro=0;
ilezostalo=0;
for(var i=id;i<id1;i++) 
{ 
if (window.parent.document.clientpanel.elements["message"+i+"c"].checked){
zapis=zapis+window.parent.document.clientpanel.elements["message"+i+"n"].value+"|";
window.parent.document.getElementById("message"+i).style.display='none';
}
}
var iRnd = Math.random(); 

loadpagesimple('account_messages.php?ajax=1&usun='+zapis+'&rand='+iRnd+'&box='+boxik+'&user='+userek,'loader8');
}
function usunzaznaczone1(id,id1,boxik,userek){
zapis="";
ilepro=0;
ilezostalo=0;
for(var i=id;i<id1;i++) 
{ 
if (window.parent.document.clientpanel.elements["note"+i+"c"].checked){
zapis=zapis+window.parent.document.clientpanel.elements["note"+i+"n"].value+"|";
window.parent.document.getElementById("note"+i).style.display='none';
}
}
var iRnd = Math.random(); 

loadpagesimple('account_notepad.php?usun='+zapis+'&rand='+iRnd+'&box='+boxik+'&user='+userek,'loader11');
}
function loadpagesimple(url,id) {

  //parentNode.innerHTML="&nbsp;- JuĹĽ zanotowane";
  if (document.getElementById) {
    var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
  }
  if (x) {
    x.onreadystatechange = function() {
      if (x.readyState == 4 && x.status == 200) {
        el = document.getElementById(id);
        el.innerHTML = x.responseText;
      }
    }
    x.open("GET", url, true);
    x.send(null);
  }
//alert('dasdas');

}
