function changeCl(id,newClass){
document.getElementById(id).className=newClass;
}
function abm(id){
document.getElementById(id).style.backgroundImage='url(css/images/menu/'+id+'_1.png)';
}
function nbm(id){
document.getElementById(id).style.backgroundImage='url(css/images/menu/'+id+'.png)';
}
function changeBgImgl(id,pic){
document.getElementById(id).style.backgroundImage='url(css/'+pic+')';
}
function showid(id){
document.getElementById(id).style.display="block";
}
function hideid(id){
document.getElementById(id).style.display="none";
}

function showButton(){var n = document.frm.name;
var p = document.frm.phone;
var d = document.frm.desc;
if(n.value!='' && p.value!='' && d.value!='' && d.value!='Цели, функциональность, стоимость или что-то ещё...'){document.getElementById("sbut").style.display="block";
} else{document.getElementById("sbut").style.display="none";
}
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}


function getBodyScrollTop()
{
	return self.pageYOffset || (document.documentElement && document.documentElement.scrollTop) || (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
	return self.pageXOffset || (document.documentElement && document.documentElement.scrollLeft) || (document.body && document.body.scrollLeft);
}



function getClientCenterX()
{
	return parseInt(getClientWidth()/2)+getBodyScrollLeft();
}

function getClientCenterY()
{
	return parseInt(getClientHeight()/2)+getBodyScrollTop();
}
function centr(id){
elem = document.getElementById(id);

var halfHeight = elem.offsetHeight/2;
var halfWidth = elem.offsetWidth/2

elem.style.position='absolute';
elem.style.top=getClientCenterY()-halfHeight+"px";
elem.style.left=getClientCenterX()-halfWidth+"px";
}
var open = 0;
function opener(idShow,idCl,newClass,st){if(open==0)
	{

		      $("#"+idShow).show();
		open = 1;
	}else{
		      $("#"+idShow).hide();

		open = 0;
	}



}
var wW= getClientWidth();
var hH= getClientHeight();
function overlay(){

document.getElementById('overlay').style.width = wW+"px";
document.getElementById('overlay').style.height = hH+"px";
}

function  flicker(col,fid,id){for(i=1;i<=col;i++){
document.getElementById("c" + fid + "_" + i).className="flick";
}document.getElementById("c" + fid + "_" + id).className="flick2";
}


