function getDocumentHeight()
{
	return (document.body.scrollHeight > document.body.offsetHeight)?document.body.scrollHeight:document.body.offsetHeight;
}

function view_window(id,sel_id)
{

	makeRequest(index_url+'/ajax/'+sel_id,id);
	document.getElementById(id).style.marginTop  =  (document.body.scrollTop-100)  + 'px';
	document.getElementById(id).style.display = "block";
	lock_screen(true);
}

function hide_window(id)
{
  	document.getElementById(id).style.display = "none";
  	lock_screen(false);
}  

function lock_screen(value)
 {
    if(value)
    {
     document.getElementById('lock').style.height = getDocumentHeight()+'px';
     document.getElementById('lock').style.display = "block";     
    }
    else
    {
     document.getElementById('lock').style.display = "none";
    }
}  

function add_good(param)
{
var count = document.getElementById('count_prod').innerHTML;
count++;
document.getElementById('count_prod').innerHTML = count;


hide_window('msg_dlg');
width=600; height=300;
var left = screen.availWidth/2  - width/2;
var top  = screen.availHeight/2 - height/2;
galWin = open(index_url+"/basket/"+param+"/"+Uniq(), "displayWindow", "width="+width+",height="+height+",status=no,toolbar=no,menubar=no,top="+top+",left="+left);
galWin.focus();
}

function view_basket()
{
width=600; height=300;
var left = screen.availWidth/2  - width/2;
var top  = screen.availHeight/2 - height/2;
galWin = open(index_url+"/basket/", "displayWindow", "width="+width+",height="+height+",status=no,toolbar=no,menubar=no,top="+top+",left="+left);
galWin.focus();
}

function Uniq()
{
uniq = Math.random();
uniq2 = uniq + ' ';
uniq2 = uniq2.split(".");
return uniq2[1];
}