// JavaScript Document



function load_thumbs(gal_id)
{
var randomnumber=Math.floor(Math.random()*1000000);
updatepage('galerijas_vieta','<img src="/wheel1.gif"/>');
//alert ("gallery");
new Ajax.Request(
'/modules/gallery_cli/list_thumbs.php',
  {
	method: 'post',
	postBody: gal_id+'&q='+randomnumber,
	evalScripts: true,
    onSuccess: function(req) { updatepage('galerijas_vieta',req.responseText);}
  }
);
//add_history(gal_id+'q'+randomnumber,'reg');
}
function load_gal_img(param)
{
var randomnumber=Math.floor(Math.random()*1000000);
updatepage('galerijas_vieta','<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('galerijas_vieta',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)
{
new Ajax.Request(
'/modules/pub_ajax/copes_zinas.php',
  {
	method: 'post',
	parameters: Form.serialize(theform),
    onSuccess: function(req) { 
	updatepage('vidus',req.responseText) 
	}
  }
);
updatepage('vidus','<img src="/wheel1.gif"/>');	

}
