function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore,other){
	id='lng';
	if (document.getElementById)
	{
		x = document.getElementById(id);
		z=x.value;
	}
	else if (document.all)
	{
		x = document.all[id];
		z=x.value;
	}
	if(selObj.name=="changeLng")
		eval(targ+".location='/index.php/"+selObj.options[selObj.selectedIndex].value+'/'+z+other+"'");
	if (restore) selObj.selectedIndex=0;
}
function check(frm, komunikat)
	{
		var bfr="";
		if(frm.tekst.value==""){
			bfr+="pusto";
		}
		if(bfr!=""){
			alert(komunikat);
			return false;
		}
		return true;
}
function checkNews(frm, komunikat,setmail) {
    var bfr="";
    if(frm.mail_news.value=="") {
        bfr+=setmail;
    }
    else if(frm.mail_news.value!="") {
        if(!frm.mail_news.value.match(/^([a-z0-9_.-]+)@[a-z0-9-_]+([.][a-z0-9-_]+)+$/i)) {
            bfr+=komunikat;
        }
    }
    if(bfr!="") {
        alert(bfr);
        return false;
    }
    return true;
}
function checkKontakt(frm, komunikat, setmail, komunikat2) {
    var bfr="";
    if(frm.email.value=="") {
        bfr+=setmail+'\n';
    }
    else if(frm.email.value!="") {
        if(!frm.email.value.match(/^([a-z0-9_.-]+)@[a-z0-9-_]+([.][a-z0-9-_]+)+$/i)) {
            bfr+=komunikat+'\n';
        }
    }
    if(frm.tresc.value=="") {
        bfr+=komunikat2;
    }
    if(bfr!="") {
        alert(bfr);
        return false;
    }
    return true;
}
function writit(text,id)
{
//	alert('dupa');
	if (document.getElementById)
	{	
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
}

function setPopup(id, href )

        {
                if(document.getElementById(id)){
                   document.getElementById(id).onclick = function()
                   {
                      show(href, 'Peggy Sage - '+this.title, this.title );
                      return false;
                   }
                }
        }

        

        function show(href1,title,alt)

          {

            
//            alert('dupa 3 '+href1+' : '+title+' : '+alt);
            //open("","DisplayWindow","toolbar=no,directories=no,menubar=no");

//            pic= new Image();

//            pic.src = href;

//            w = pic.width;

//            h = pic.height;

            
            var LeftPosition = (screen.width) ? (screen.width)/2 : 0;

            var TopPosition = (screen.height) ? (screen.height)/2 : 0;

            

            var winopts = 'resizable=1,width=200,height=200';


           /* do the boogie! */

            var win = window.open('','_blank',winopts);

            if (win && win.opener)

            {

               var doc = win.document;

                doc.open('text/html;charset=UTf-8');

                doc.write(

               '<html>' +

                '<head><title>' + title + '</title>' +

                 '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' +
                     
                     '  <script language="javascript">'+

                           'var NS = (navigator.appName=="Netscape")?true:false;'+

                             'function FitPic() {'+
                               'iWidth = (NS)?window.innerWidth:document.body.clientWidth;'+
                               'iHeight = (NS)?window.innerHeight:document.body.clientHeight;'+
                               'iWidth = document.images[0].width - iWidth;'+
                               'iHeight = document.images[0].height - iHeight;'+
                               'self.resizeBy(iWidth, iHeight);'+
                               'self.focus();'+
                                 'var x = (screen.width) ? (screen.width-document.images[0].width)/2 : 0;'+
                                 'var y = (screen.height) ? (screen.height-document.images[0].height)/2 : 0;'+
                                 'moveTo(x,y);'+
                             '};'+
                         '</script>'+
                     
                '</head><body onclick="window.close();" onload="FitPic();" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" bgcolor="#ffffff" >' +
                       '<script language="javascript">'+
                         'document.write( \'<img src="' + href1 + '" alt="'+alt+'" border=0>\' );'+    
                     '</script>'+
                '</body></html>'

                );

                doc.close();

                return false;

            }

            



          }