function displayPage(url, name, width, height, scrollvalue) {
	w = window.open(url, name, 'width='+width+', height='+height+', scrollbars='+scrollvalue+', menubar=no, resizable=0');
	w.moveTo(screen.width/2-width/2, screen.height/2-height/2);
}

function showImg( img_src, img_w, img_h, img_name ) {
	img_w_n = img_w+20;
	img_h_n = img_h+20;
	img_w_o = img_w;
   var popup = window.open('','','width=' + img_w_n + ',height=' + img_h_n + ',resizable=0,scrollbars=no,menubar=no');
   popup.document.open();
   popup.document.write('<html><head><title>'+img_name+'<\/title><\/head>');
   popup.document.write('<body style="margin: 0;padding: 0; position: relative;">');
   popup.document.write('<a href="javascript:window.close();" style="margin: 0 ;border: none; padding: 0;"><img style="margin: 0;border: 10px solid #eeeeee;padding: 0;" src=' + img_src + ' /></a>');
   popup.document.write('<br /><div style="position: absolute; top:10; left: 10; background-color: #ffffff; filter:alpha(opacity=75); opacity:.75; width: '+img_w_o+'; padding: 5px 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"><p style="margin: 0 5px; padding: 0;">'+img_name+'<\/p><\/div>');
   popup.document.write('<\/body><\/html>');
//   popup.document.focus();
   popup.document.close();
}

function form_cl(id) {
	var to = document.getElementById(id);
	if(to) {
		if(to.value == '') {
		} else {
			to.value = '';
		}
	}
}

function change_form_action(url) {
    var form = document.getElementById('search-toolbar');
    form.action = url;
}

function changeTextSize(change) {

    var classes =  new Array('fontSmall', 'fontNormal', 'fontBig');

    var content = document.getElementById('font_size');
    var className = content.className;
    
    //alert(className);
    
    
    if (className == undefined || className == '') {
        className = new Array('fontNormal');
    }
    
    if (className.constructor != Array) {
        className = new Array(className);
    }

    var marker = 0;
    var kkey = 0;
    
    for (i=0; i < className.length; i++) {
        for (j=0; j < classes.length; j++) {
	        if (classes[j]==(className[i])) {
		        marker = i;
		        key = j;
		        break;
        	}
        }
        if (marker > 0) {
        	break;
        }
    }

    if (change == '+') {
        if (key < classes.length - 1) {
            key++;
        }
    } else {
        if (key > 0) {
            key--;
        }
    }

    className[marker] = classes[key];

    var _class = '';
    for (i=0 ; i < className.length; i++) {
        _class += className[i];
    }
    //alert(_class);
    content.className = _class;
}

function new_window(win_url, win_name, win_width, win_height)
{
   var odstepwysokosc=(screen.height-win_height)/2
   var odstepszerokosc=(screen.width-win_width)/2
   winprops = 'scrollbars=1,width='+win_width+', height='+win_height+',resizable=0,toolbar=0,location=0,directories=0,menubar=0,screenX='+odstepszerokosc+'+,screenY='+odstepwysokosc+',left='+odstepszerokosc+'+,top='+odstepwysokosc;
   win = window.open(win_url, win_name, winprops)
   if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
   return win;
}

function confirmBookmarks(text) {
   win = new_window('', 'Bookmarks', 200, 50);
   win.document.write('<html><head><title>Bookmarks</title></head>');
   win.document.write('<body style="margin: 0;padding: 0; color: #E94726; text-align: center; font-family:arial;">');
   win.document.write('<h2 style="margin: 10px 0; padding:0; font-size: 15px;">');
   win.document.write(text);
   win.document.write('</h2>');
   win.document.write('<a style="color: #8F7847;" href="javascript:window.close();">Zamknij</a>');
   win.document.write('</body>');
   win.document.write('</html>'); 
   win.document.close();
}
