//$(document).ready(resize);
$(window).resize(resize);

function resize()
{
  var w = getClientWidth();  
  var h = document.getElementById("container").offsetHeight;
  document.getElementById("header").style.left = (w-1260)/2+'px';
  document.getElementById("footer").style.left = (w-1260)/2+'px';
  document.getElementById("footer").style.top = h+130+'px';
  
  document.getElementById("logo").style.left = (w-1260)/2+260+'px';
  document.getElementById("icons").style.left = (w-1260)/2+830+'px';
}

function clearform() 
{
  var s = document.getElementById("searchtext").value;
  if (s=='Что будем искать?') {document.getElementById("searchtext").value=''; }
}

function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}


function loadheader()
{ 
  $.get("cash/header.txt", function(data){
   $("#header-include").append(data); 
});
}

function loadtopmenu()
{ 
  $.get("cash/top-menu.txt", function(data){
   $("#menu").append(data); 
});
}

function loadleftmenu()
{ 
  $.get("cash/left-menu.txt", function(data){
   $("#left-menu").append(data); 
});
}

function loadmainproducts()
{
  $.get("cash/main-products.txt", function(data){
   $("#main-products").append(data); 
});
}


function loadnews()
{ 
  $.get("cash/news.txt", function(data){
   $("#news").append(data); 
});
}


function loadkorz()
{ 
  $.get("templates/basket.php", function(data){
   $("#korzina").append(data); 
});
}

function loadhouses()
{ 
  $.get("cash/houses.txt", function(data){
   $("#houses").append(data); 
   resize(); // чтобы футер не уплывал, т.к. иначе его положение высчитывается до подгрузки торговых домов
});
}

function loadlist2()
{ 
  $.get("cash/list2.txt", function(data){
   $("#list2").append(data); 
   resize();
});
}
function loadzakaz() 
{
  $.get("cash/zakaz-include.txt", function(data){
   $("#zakaz-include").append(data); 
   resize();
});
}



