// JavaScript Document



function load_thumbs(gal_id)
{
var randomnumber=Math.floor(Math.random()*1000000);
updatepage('publ','<img src="/wheel1.gif"/>');
//alert ("joh");
new Ajax.Request(
'/modules/gallery_cli/list_thumbs.php',
  { //lily3_wheel('publ');
	method: 'post',
	postBody: gal_id+'&q='+randomnumber,
	evalScripts: true,
    onSuccess: function(req) { updatepage('publ',req.responseText);}
  }
);
//add_history(gal_id+'q'+randomnumber,'reg');
}




function load_gal_img(param)
{
var randomnumber=Math.floor(Math.random()*1000000);
//updatepage('publ','<img src="/wheel1.gif"/>');	
new Ajax.Request(
'/modules/gallery_cli/list_images.php',
  {
	method: 'post',
	postBody: param+'&q='+randomnumber,
	evalScripts: true,
    onSuccess: function(req) { updatepage('publ',req.responseText);}
  }
);
//add_history(gal_id+'q'+randomnumber,'reg');
}


//galeria

function pic_change(name, path) {
    if (document.images) {
        document.images[name].src = path;
    }
}

function pop_up(url, w, h) {
    var date = new Date();
    var name = date.getTime();
    var top  = Math.ceil((screen.height-h)/2);
    var left = Math.ceil((screen.width-w)/4);
	var w_pop  = Math.ceil(w + 30);
	var h_pop  = Math.ceil(h + 30);
    var features = "width="+w_pop+",height="+h_pop+",top="+top+",left="+left+",location=no,status=no,resizable=no,toolbar=no,menubar=no,scrollbars=no";
    window.open(url, name, features);
}
//galeria end
// komenti

function sb_rA(theform)
{ //alert("kas ir!");
new Ajax.Request(
'/modules/pub_ajax/zinas.php',
  {
	method: 'post',
	parameters: Form.serialize(theform),
    onSuccess: function(req) { 
	updatepage('main',req.responseText) 
	}
  }
);
updatepage('main','<img src="/wheel1.gif"/>');	

}

//galerijas comm
function sb_rAgal(theform)
{ //alert("kas ir!");
new Ajax.Request(
'/modules/gallery_cli/list_images.php',
  {
	method: 'post',
	parameters: Form.serialize(theform),
    onSuccess: function(req) { 
	updatepage('publ',req.responseText) 
	}
  }
);
updatepage('publ','<img src="/wheel1.gif"/>');	

}
