	function fixHeight(){
		var obj = document.getElementById('BodyBl');
		if (/MSIE (5\.5|6|7).+Win/.test(navigator.userAgent) && navigator.userAgent.search("Opera") < 0){
			obj.className = 'BodyBlock_fix';
		}
		else{
			obj.className = 'BodyBlock';
		}
		
	}
	
	function viewParagraph(ptable, link){
		var obj = document.getElementById(ptable);
		obj.className = obj.className == 'none' ? 'visible' : 'none';
		link.className = link.className == 'cur' ? '' : 'cur';
	}
	
	function viewParagraph2(ptable, link){
		var obj = document.getElementById(ptable);
		var link_obj = document.getElementById(link);

		if(obj.style.display == 'none'){
			Effect.BlindDown(ptable, {duration:0.4});
		} else {
			Effect.BlindUp(ptable, {duration:0.4});			
		}
	}

/*
	function viewParagraph2(ptable, link){
		var obj = document.getElementById(ptable);
		var link_obj = document.getElementById(link);
		var oncl = link_obj.getAttributeNode("onclick").value;

		link_obj.getAttributeNode("onclick").value = '';

		//link_obj.removeAttribute("onclick");

			if(obj.style.display == 'none'){
				Effect.BlindDown(ptable, {duration:0.4});
			} else {
				Effect.BlindUp(ptable, {duration:0.4});			
			}

		//link_obj.setAttributeNode(oncl);


		//link_obj.style.visibility = 'hidden';
		setTimeout("block_link_paragraph("+link+","+oncl+")",400);

	}

	function block_link_paragraph(link, oncl){
		alert(oncl);
		//link.setAttributeNode(oncl);
		link.style.visibility = 'visible';
	}
*/

	function LoadFirstModific(){
		var link_obj = $('LinkPar');
		var block_obj = $('BlockMod');

		if(link_obj != null && block_obj != null){
			var link_cur = link_obj.getElementsByTagName("li");
			link_cur[0].className = 'cur';

			var par_objects = block_obj.getElementsByTagName("table");
			par_objects[0].className = 'visible';
		}
	}

	function viewModific(linkID, parID){

		var link_obj = $('LinkPar');
		var link_cur = link_obj.getElementsByTagName("li");
		var curLink = $(linkID);
		
		var block_obj = $('BlockMod');
		var par_objects = block_obj.getElementsByTagName("table");
		var par_obj = $(parID);

		for(var i = 0; i< par_objects.length; i++){
			if(par_objects[i].className == 'visible')
				par_objects[i].className = 'none';
		}

		for (var j = 0; j< link_cur.length; j++){
			link_cur[j].className = 'normal_link';
		}

		curLink.className = curLink.className == 'normal_link' ? 'cur' : 'normal_link';
		par_obj.className = par_obj.className == 'none' ? 'visible' : 'none';
	}

/*
	function viewModific(parID, linkID){
		var par_obj = $('ParagraphBlock');
		var myChildDivs = par_obj.childNodes;
		var curPar = $(parID);

		var link_obj = $('modif_block');
		var link_cur = link_obj.getElementsByTagName("a");
		var curLink = $(linkID);
	
		for (var i = 0; i< myChildDivs.length; i++){
			myChildDivs.item(i).className = 'none';
		}

		for (var j = 0; j< link_cur.length; j++){
			link_cur[j].className = 'normal_link';
		}

		curLink.className = curLink.className == 'normal_link' ? 'cur' : 'normal_link';
		curPar.className = curPar.className == 'none' ? 'visible' : 'none';
	}
*/

	



	function closePreview(){
		preview_bg.className = 'none';
	}
	
	function openPreview(img, w, h){
		preview_bg.className = 'visible';
		preview_bg.style.height = document.getElementById('siteBlock').offsetHeight;
		image_preview.src = img;
		image_preview.width = w;
		image_preview.height = h;
		
		preview_block.style.left = (document.body.offsetWidth/2) - (preview_block.offsetWidth/2);
		toppos =  (document.body.offsetHeight/2) + document.body.scrollTop - (preview_block.offsetHeight/2);
		
		if(toppos < 0)
			preview_block.style.top = 0;
		else
			preview_block.style.top = toppos;
		document.onkeydown = escapePreview;
	}

	function fixPng(){
		if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent) && navigator.userAgent.search("Opera") < 0){
			preview_bg.id = 'imagePreviewBgFix';
			preview_bg = document.getElementById('imagePreviewBgFix');
		}
	}
	
	function escapePreview (event)
		{
			if (window.event) event = window.event;
			var code = event.keyCode ? event.keyCode : event.which ? event.which : null;
			if (code == 27)
			{
				preview_bg.className = 'none';
		
				document.onclick = null;
				document.onkeydown = null;
			}
		}

	function mosMap(punktId, status){
	var punkt = document.getElementById( punktId );
	
	//arrow.className = arrow.className == arrow_blue ? arrow_cur : arrow_blue;

	if(status)
		punkt.className = 'punkt';
	else
		punkt.className = 'none';
	}

	function mosMapNew(punktId, status){
	var punkt = document.getElementById( punktId );
	
	if(status)
		punkt.className = 'officeView';
	else
		punkt.className = 'office';
	}

	function BlockNewWidth(blockId, carId, status){

	var block = document.getElementById( blockId );
	var car = document.getElementById( carId );
		
		if(status){
			for (var i=0;i<=2;i++) 
				setTimeout(setNewWidth(block,i),5000); 
		}
	}

	function setNewWidth(obj, value){

		obj.style.width = value;
		alert(value);
	}

function checkForm(f)
{
	var descr = document.getElementById('descr');
	var company = document.getElementById('company');
	var fio = document.getElementById('fio');
	var city = document.getElementById('city');
	var phone = document.getElementById('phone');
	var email = document.getElementById('email');
	
	var warning = true;
	
	descr.className = "normal";
	company.className = "normal";
	fio.className = "normal";
	city.className = "normal";
	phone.className = "normal";
	email.className = "normal";
	
	if(!f.descr.value){
		descr.className = 'alert';
		warning = false;
	}
	if(!f.company.value){
		company.className = 'alert';
		warning = false;
	}
	if(!f.fio.value){
		fio.className = 'alert';
		warning = false;
	}
	if(!f.city.value){
		city.className = 'alert';
		warning = false;
	}
	if(!f.phone.value){
		phone.className = 'alert';
		warning = false;
	}
	if(!f.email.value){
		email.className = 'alert';
		warning = false;
	}
	
	if(warning)
		f.submit();
	else
		return warning;
}
