function bookmark(bookmarkurl, bookmarktitle){
                if (document.all) 
                    window.external.AddFavorite(bookmarkurl, bookmarktitle)
                else 
                    if (window.sidebar) // firefox
                        window.sidebar.addPanel(bookmarktitle, bookmarkurl, "");
            }
            
function ukryjlogowanie()
  {
  		var okno="";
		var obj = document.getElementById("oknologowania");
  obj.innerHTML=okno;
  }
  function	pokazlogowanie()
  {
//    window.onresize = adultWarning_resizer;
//    window.onscroll = adultWarning_resizer;
 
	// okno sms
	var obj = document.getElementById("adminhaslo");
	if (obj == null) {
		var okno = '<div id="loginform">' ;
		okno += '<div style="font-weight:bold;margin:5px 0 10px 0;">Opcje administratora</div>';
		okno += '<form name="adminlogin" action="" enctype="text/html" method="post">';
		okno += '<div style="clear:both;margin:5px;" class="inp"><div style="float:left;width:70px;">Login:</div><input type="text" name="adminlogin" style="float:left;" /></div>';
		okno += '<div style="clear:both;margin:5px;" class="inp"><div style="float:left;width:70px;">Haslo:</div><input type="password" name="adminhaslo" style="float:left;" /></div>';
		okno += '<div style="clear:both;text-align:center;margin:5px;" class="inp"><input type="submit" value="zaloguj" /></div>';
		okno += '</form>';
		okno += '</div>';
		var obj = document.getElementById("oknologowania");
		if (obj!="") obj.innerHTML=okno;
	} else ukryjlogowanie();
  }
  /*                     EDYCJA TITLE            */
  function ukryjtitle()
  {
  		var okno="";
		var obj = document.getElementById("oknoedycji");
  obj.innerHTML=okno;
  }
  function	edytujtitle(vid)
  {
//    window.onresize = adultWarning_resizer;
//    window.onscroll = adultWarning_resizer;
 
	// okno sms
	var obj = document.getElementById("titleedit");
	if (obj == null) {
		var zaw= document.getElementById("zaw").innerHTML;
		var okno = '<div id="titleedit">' ;
		okno += '<div style="font-weight:bold;margin:5px 0 10px 0;">Edycja tytułu filmu:</div>';
		okno += '<form name="titledit" action="" enctype="text/html" method="post">';
		okno += '<div style="margin:5px;" class="inp"><input type="text" id="foc" name="ntitle" class="inp" value="' +zaw +'"/><input type="hidden" name="vid" value="' + vid +'"/></div>';
		okno += '<div style="clear:both;text-align:center;margin:5px;" class="inp"><input type="submit" value="zmień" /></div>';
		okno += '</form>';
		okno += '</div>';
		var obj = document.getElementById("oknoedycji");
		obj.innerHTML=okno;
		document.titledit.ntitle.focus();


	} else ukryjtitle();
}
    /*            KONIEC         EDYCJA TITLE            */
  
/*                glosowanie gwaiazdki            */

//Rate a scheme obslugA gwiazdek

function czeck()
	{
		var test = false;
    if (window.XMLHttpRequest) {
        test = new XMLHttpRequest();
        if (test.overrideMimeType) {
            test.overrideMimeType('text/html');
        }
    }
    else 
        if (window.ActiveXObject) {
            try {
                test = new ActiveXObject("Msxml2.XMLHTTP");
            } 
            catch (e) {
                try {
                    test = new ActiveXObject("Microsoft.XMLHTTP");
                } 
                catch (e) {
                }
            }
        }
        return test;
	}
	
function sortuj(jak)
{
	var khr = false;
	khr=czeck();
	if (khr) {
		var klik = "/sortowanie.php?orderby=" + jak;
		khr.open("POST", klik, true);
        khr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		khr.send(null);
	}
}

function klikStats(type,url,file)
{

	var khr = false;
	
	khr=check();
		if (khr) {
			var klik = "/klik.php?typ=" + type + "&strona=" + url + "&plik=" +file;
			khr.open("GET", klik, true);
           	khr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
			khr.send(null);
		}
}

function rateScheme(id, rating, divID){
    var xhr = false;
    if (window.XMLHttpRequest) {
        xhr = new XMLHttpRequest();
        if (xhr.overrideMimeType) {
            xhr.overrideMimeType('text/html');
        }
    }
    else 
        if (window.ActiveXObject) {
            try {
                xhr = new ActiveXObject("Msxml2.XMLHTTP");
            } 
            catch (e) {
                try {
                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
                } 
                catch (e) {
                }
            }
        }
    
    var obj = document.getElementById(divID);
    
    if (xhr) {
        var qs = "/rate.php?id=" + id + "&rating=" + rating;
        
        xhr.open("GET", qs, true);
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xhr.onreadystatechange = function(){
            if (xhr.readyState == 4 && xhr.status == 200) {
                obj.innerHTML = xhr.responseText;
            }
        }
        xhr.send(null);
    }
}
            
/*         KONIEC    glosowanie gwaiazdki         */