/*  
 * sotarPANEL
 *
 * The sotarPANEL is an accessible web content management system.
 *
 * @copyright  sotarsoft 2008
 * @author     sotarsoft <info@sotarsoft.pl>
 * @package    Javascript
 * @filesource $Source: /root/grasmakow/js/frontend.js,v $
 * @version    $Revision: 1.4 $
 *--------------------------------------------------------------------------*/

function flash(w, h, path)
{
  
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">'
+'<param name="movie" value="'+path+'" />'
+'<param name="quality" value="high" />'
+'<param name="menu" value="0" />'
+'<embed src="'+path+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="0" wmode="transparent"></embed>'
+'</object>');
 
}

function change_show_hide()
{
    var btn = $('btn_show_hide');
    var type = false;
    if (btn) {
        type = btn.readAttribute('my_type');
        if (type == null) {
            type = 'hide';
        }
        
        if (type == 'show') {
            
            var it_h = $$('#central_col .forums .frm_comment .blog_intro').find(function(s) {
               s.hide(); 
            });

            var it_s = $$('#central_col .forums .frm_comment .blog_content').find(function(s) {
               s.show(); 
            });
            
            btn.firstChild.nodeValue = "Zwiń wszystkie wpisy";
            btn.writeAttribute('my_type', 'hide');
        } else if (type == 'hide') {
            
            var it_h = $$('#central_col .forums .frm_comment .blog_content').find(function(s) {
               s.hide(); 
            });

            var it_s = $$('#central_col .forums .frm_comment .blog_intro').find(function(s) {
               s.show(); 
            });
            
            btn.firstChild.nodeValue = "Rozwiń wszystkie wpisy";
            btn.writeAttribute('my_type', 'show');
        }
    } else {
        alert('No way!');
    }
}

function pop(plik,w,h) {
    var aw=800;
    var ah=600;
    var okno = null;
    if(window.screen) {
       var aw = screen.availWidth;
       var ah = screen.availHeight;
    }
    var dane="width="+w+",height="+h+",left="+(aw-w)/2+",top="+(ah-h)/2+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no";
    okno = window.open(plik,'pop',dane);
}

function check_length(elem) {
    if (elem.value.length>600) {
        alert('Uwaga przekroczyłeś maksymalną ilość znaków. Twój komentarz ma '+elem.value.length+' znaków (w tym spacji). Maksymalnie możesz wprowadzić tylko 600 znaków.');
    }
}
function zarejestruj_facebook(){
	Modalbox.show($('fb_rejestracja'), {title: 'Zarejestruj się przez Facebook',width:650});
}
