//***********************************************//
//												 //
//  Mariupol and Priazovie JavaScript Document   //
//												 //
//  created 28.02.2008                           //
//                                               //
//  copyright 2008 Emotion                       //
//                 studio of breathtaking        //
//                 www.emotionstyle.com          //
//                                               //
//                 Mariupol, Ukraine             //
//                                               //
//***********************************************//


/*

 функция toggleView()
 
 
 принимает id:
  id2on -- что показать
  id2off -- что скрыть

*/

function toggleView(id2on, id2off)
{
	
	document.getElementById(id2off).style.display='none';
    document.getElementById(id2on).style.display='';
	
}

function getWidth()
{
	send = document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
	if(send<=1000)
	{	
		document.getElementById('ptvz').style.width="1000px";
	}else{
		document.getElementById('ptvz').style.width="100%";
	}
}

function switchDisplay(cid)
{
	if(document.getElementById(cid).style.display=='')
	{
	document.getElementById(cid).style.display='none';
	}
	else
	{
	document.getElementById(cid).style.display='';
	}
	
}

function switchDisplayz(cid,seccid)
{
	if(document.getElementById(cid).style.display=='')
	{
	document.getElementById(cid).style.display='none';
	document.getElementById(seccid).style.display='';
	}
	else
	{
	document.getElementById(cid).style.display='';
	document.getElementById(seccid).style.display='none';
	}
	
}

function lightElement(obj, isLight)
{
	obj.style.color = (isLight=='true') ? "#A8A8A8" : "#F1F1F1";
}


function set_cat(cid)
{
	document.getElementById("cat_value").value=cid;
	document.getElementById('opsub').disabled = false;
}


function swith_type_cat(th,did)
{
	if(th=='0')
	{
		document.getElementById(did).disabled=false;
		document.getElementById(did).focus();
	}
	else
	{
		document.getElementById(did).disabled=true;
		document.getElementById(did).value='';
	}

}