$(document).ready(
	function(){
		//вызов комопнента fancybox
		$("a[rel='photo']").fancybox({
			'zoomSpeedIn': 300,
			'zoomSpeedOut': 300, 
			'overlayShow': true,
			'overlayColor': '#000',
			'overlayOpacity': 0.7,
			'hideOnContentClick': true,
			'hideOnOverlayClick': true
		});
	}
);



function subForm(n)
{
var action;
var m = n-1;
action = "search.php?p="+m;
document.hidf.setAttribute("action",action);
document.hidf.submit();
}
//---------------------------------
function showBigImage(obj)
{
var path;
path = obj.src.replace(".jpg","_big.jpg");
window.open(path,"_blank","location=no,menubar=no,status=no,toolbar=no,resizeable=yes");
return false;
}
//-------------------------------------
function check()
{

 if (document.predv.city.value=="")
   {
    alert("Необходимо заполнить поле Город");
    return false;
   }

 if (document.predv.phone.value=="")
   {
    alert("Необходимо заполнить поле Контактный телефон");
    return false;
   }

 if (document.predv.fio.value=="")
   {
    alert("Необходимо заполнить поле Контактное лицо");
    return false;
   }


 if (document.predv.order.value=="")
   {
    alert("Необходимо заполнить поле Заказываемая продукция");
    return false;
   }
 return true;
}
//-------------------------------------------------------------------------------
var xmlHttp = createXmlHttpRequest();


function createXmlHttpRequest()
{
var xmlHttp = false;
 if(window.ActiveXObject)
   {
      xmlHttp = new ActiveXObject("MSXML2.XMLHTTP");
   }
 else xmlHttp = new XMLHttpRequest();

 if (!xmlHttp)  alert("No");
 else return xmlHttp;
}
//---------------------------------------------------------


function addStat()
{

if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
   {
     xmlHttp.open("GET","stat.php",true);
     xmlHttp.onreadystatechange = handleServerResponse;
     xmlHttp.send(null);
   }

}
//----------------------------------------

function handleServerResponse()
{
   if (xmlHttp.readyState == 4)
    {
      if (xmlHttp.status==200)
        {
        xmlResponse = xmlHttp.responseXML;
 //       xmlDocumentElement = xmlResponse.documentElement;
         }
      else alert("Not 200"+xmlHttp.statusText);
    }

}

