function shT(obj) { $("#"+obj).fadeIn("normal"); }
function hideall() { $(".thumbmag").fadeOut("normal"); }
function loadNode(nid,type) {
	$("#innercontent").empty();
	$("#innercontent").append("<div  style='margin-top: 160px; margin-left: 115px;'><img src='images/ajax-loader.gif'/></div>");
	$("#innercontent").load("ajax.nodes.php?nodeId="+nid+(type=="f"?"&f=1":"")+"&rnd="+Math.random());
}
function loadVolumes(mId) {
	//alert("mid: "+mId);
	$("#volumescontent").empty();
	$("#volumescontent").load("periodicals.php?getVolumes="+mId+"&rnd="+Math.random());
}
function checkform(i) {
	var o;
	o = document.getElementById("ffrow"+i);
	for( var x = 0; o.childNodes[x]; x++ ) {
		for( var y = 0;o.childNodes[x].childNodes[y]; y++){
			if(o.childNodes[x].childNodes[y].id!=undefined && o.childNodes[x].childNodes[y].id.substr(0,3)=="chk" && o.childNodes[x].childNodes[y].checked==true) {
				if (document.getElementById('val'+i).value=="" || document.getElementById('val'+i).value!=parseInt(document.getElementById('val'+i).value)) document.getElementById('val'+i).value=1;
				document.getElementById('sum'+i).value = (document.getElementById('price'+i).value * document.getElementById('val'+i).value);
				updateTotalSum();
			}
			else if (o.childNodes[x].childNodes[y].id!=undefined && o.childNodes[x].childNodes[y].id.substr(0,3)=="chk" && o.childNodes[x].childNodes[y].checked==false)
			{
				document.getElementById('val'+i).value="";
				document.getElementById('sum'+i).value ="";
				updateTotalSum();
			}
		}
	}

}
function updateTotalSum() {
  var maxi = document.getElementById("maxi").value;
  var totsum=new Number;
  for (i=0;i<maxi;i++)
  {
	if (parseFloat(document.getElementById('sum'+i).value)>0)
	totsum+=parseFloat(document.getElementById('sum'+i).value);
  }
  document.getElementById('totalsum').value=parseFloat(totsum).toFixed(2);
  if (parseFloat(totsum).toFixed(2)>0)
  {
	  document.getElementById("send").disabled=false;
  }
  else {
	document.getElementById("send").disabled=true;
  }
  return true;
}

function pleaseReg() {
	alert("Моля регистрирайте се в сайта, за да имате достъп до целите статии.");
	return false;
}

function pleaseSubscr() {
	alert("Моля абонирайте се за списанието, за да имате достъп до най-новите статии.");
	return false;
}
function sc(ob) {
	if (ob.value=="търсене")
	{
		ob.value="";
		ob.style.color = "#000";
	}
}