function getpositions(){
	if (document.getElementById("ss").offsetWidth > 1260) {
  	document.getElementById("tabl").style.width = "1260px"; // фиксируем ширину страницы
  	
  } 
	if (document.body.clientHeight > document.getElementById("ss").offsetHeight){
		document.getElementById("fixheight").style.height = document.body.clientHeight - document.getElementById("ss").offsetHeight + 30;
	}
}

$(document).ready(function(){
	getpositions();
  });

$(window).resize(function() {
  getpositions();
});

function getFull(pictureId, catId){
	allcount = parseInt(document.getElementById("d"+catId).value);
	picId = document. getElementById("picturesid").value;
	document.getElementById("pichere").style.display ="";
	document.getElementById("tablepic").style.display ="";
	document.getElementById("pichere").style.height = document.getElementById("ss").offsetHeight;
	document.getElementById("bigpic").src = "/"+document.getElementById("big_"+catId+"_"+pictureId).value;
	document. getElementById("picturesid").value = pictureId;
	document. getElementById("categoriesid").value = catId;
	//alert(document.getElementById("big_"+catId+"_"+pictureId).value);
/*
		if(allcount = picId){
		alert(allcount);
		alert(picId);
	}
*/
}
function closeFull(){
	document.getElementById("pichere").style.display ="none";
	document.getElementById("tablepic").style.display ="none";
}
function move(dur){
	catId = document. getElementById("categoriesid").value;
	pictureId = document. getElementById("picturesid").value;
	allcount = parseInt(document.getElementById("d"+catId).value);
	if (dur == "right"){
		if (allcount > pictureId){
			pictureId++;
			document. getElementById("picturesid").value = pictureId;
			document.getElementById("bigpic").src = "/"+document.getElementById("big_"+catId+"_"+pictureId).value;
		}
		
	}
	if (dur == "left"){
		if (1 < pictureId){
			pictureId--;
			document. getElementById("picturesid").value = pictureId;
			document.getElementById("bigpic").src = "/"+document.getElementById("big_"+catId+"_"+pictureId).value;
		}
	}
}
function getwidth() {
	document.getElementById("lefta").style.marginRight = document.getElementById("bigpic").offsetWidth/2-9;
	document.getElementById("righta").style.marginLeft = document.getElementById("bigpic").offsetWidth/2-9;
}
