function showbig(picname){
    window.open('/includes/foto.php5?pic='+picname,'_blank','scrollbars=yes,taskbar=no,resizeable=no,status=no,menubar=no,top=30,left=30,width=30,height=30');
  }
  
  function PreLoad(source){
    var NewImage = new Image();
    NewImage.src = source;
  }
  
  function prepareSubmit(frm){
    var len = frm.all("editbox").length; if (!len) len = 1;
    for (var i=0; i<len; i++)
      frm.all("codebox", i).innerText = frm.all("codebox", i).style.display ? borderOn(frm.all("codebox", i).innerText) : borderOn(frm.all("editbox", i).innerHTML);
  }
   
 function menuProcess(menuId){
 	 if(menuId.style.display == 'none'){
     menuId.style.display = 'block';
   }else{
   	 menuId.style.display = 'none';
   }
 }
 
 function btShowFunctionArguments(name){
	 btChangeFunctionArgumentsBlock(name,'none','block','block');
 }
 
 function btHideFunctionArguments(name){
	 btChangeFunctionArgumentsBlock(name,'block','none','none');
 }
 
 function btChangeFunctionArgumentsBlock(name,plus,minus,arguments){
 	 document.getElementById('backtrace_img_plus_'+name).style.display = plus;
 	 document.getElementById('backtrace_img_minus_'+name).style.display = minus;
 	 document.getElementById('backtrace_arguments_'+name).style.display = arguments;
 }
 
  function processTree(elementId,isTop){
 	 tbl = document.getElementById('dir_'+elementId);
 	 img = document.getElementById('img_'+elementId);
 	 
 	 if(tbl.style.display != 'none'){
 	 	 tbl.style.display = 'none';
 	 	 img.alt = '��������';
 	 	 if(isTop)
 	 	   img.src = '/images/design/tree_plus.gif';
 	 	 else
 	 	   img.src = '/images/design/tree_sub_plus.gif';
 	 }else{
 	 	 tbl.style.display = 'block';
 	 	 img.alt = '�������';
 	 	 if(isTop)
 	 	   img.src = '/images/design/tree_minus.gif';
 	 	 else
 	 	   img.src = '/images/design/tree_sub_minus.gif';
 	 }
 }
 
 /** 
 * ����������� ����������� ������ ������ � ��������� �������������
 */
 function Dump(d,l) {
    if (l == null) l = 1;
    var s = '';
    if (typeof(d) == "object") {
        s += typeof(d) + " {\n";
        for (var k in d) {
            for (var i=0; i<l; i++) s += "    ";
            s += k+": " + Dump(d[k],l+1);
        }
        for (var i=0; i<l-1; i++) s += "  ";
        s += "}\n"
    } else {
        s += "" + d + "\n";
    }
    return s;
 }
 function  print_r(arr){
	alert(Dump(arr));
 }
 
 /** 
 * ������ ����� ������� (��� �������� �� �� ������)
 */
 function clone(d) {
	var s = new Array();
	if(typeof(d) == "object"){
		for (var k in d)
			s[k] = clone(d[k]);  
	}else
		s = d;
	return s;
 }
 
 /** v 1.1
 * ����� ���������
 *
 * @param int $count - ���������� ���������
 * @param str $word - �������� �������� � ��. �����
 * @return str - �������� � ��������� ����������
 */
function rus_case(count, word){
	var sp_count = (1 * count % 100 - 1 * count % 10) == 10;
	var count = 1 * count % 10;
	var mod = word.substr(word.length-1, 1);
	if(count == 1 && !sp_count)
		return word;
	switch (mod){
		case '�' :
			if((count==2 || count==3 || count==4) && !sp_count)
				return word.substr(0, word.length-1) + '�';
			else
				return word.substr(0, word.length-1);
		case '�' :
			if((count==2 || count==3 || count==4) && !sp_count)
				return word.substr(0, word.length-1) + '�';
			else
				return word.substr(0, word.length-1) + '��';
		case '�' :
			if((count==2 || count==3 || count==4) && !sp_count)
				return word.substr(0, word.length-1) + '�';
			else
				return word.substr(0, word.length-1) + '�';
		default:
			if((count==2 || count==3 || count==4) && !sp_count)
				return word + '�';
			else
				return word + '��';
	}
 }
 
 
function showSpetsOffersRight(page){
 (function($) {
     $(document).ready(function() {
  if($('#right_banners_for_change')){


    $('#right_banners_for_change').html('<div>asd</div>');

    $('#right_banners_for_change').html('<img src="/images/design/loader.gif" class="loader">');

    height = $('#center').height();

    loc = location.href;
    pathes = new Array();
    pathes = loc.split('&');
    go = 0;
    for(i = 0; i < pathes.length; i++ ){
      
      if(pathes[i].indexOf('go=') != -1){
        //alert(pathes[i].substring(pathes[i].indexOf('go=') + 3));
        go = pathes[i].substring(pathes[i].indexOf('go=') + 3);//pathes[i].substring(3);
      }
    } 
    //alert(page);
    JsHttpRequest.query(
          '/index.php5?module=other&class=showRightOffers&height=' + height + '&go=' + go + '&pageId=' + page,
          '',
          function(result, errors) {
            //alert(result['counts']);
            $('#right_banners_for_change').html(result['rezult_text']);
          },
          false  // do not disable caching
      );
  }
     });
  })(jQuery);
}

(function($) {



$(document).ready(function() {
  setTimeout("showSpetsOffersRight(1);",1000);
  //showSpetsOffersRight(1);
  JsHttpRequest.query(
          '/index.php5?module=other&class=rss',
          '',
          function(result, errors) {
            //alert(result['sended']);
          },
          false  // do not disable caching
      );  
});
$(document).ready(function() {

   $('#open_menu-1').click(function(){
     $('#open_menu_element-1').show();
     $('#open_menu_element-2').hide();
	 $('#open_menu_element-3').hide();
     return false;
   });

     $('#open_menu-2').click(function(){
     $('#open_menu_element-2').show();
     $('#open_menu_element-1').hide();
	 $('#open_menu_element-3').hide();
return false;

     });
	 $('#open_menu-3').click(function(){
     $('#open_menu_element-3').show();
	 $('#open_menu_element-2').hide();
     $('#open_menu_element-1').hide();
return false;

     });
});


$('#articles_news_small_text___Frame').keyup(function(){
  alert('tyt');
});


var d = document;
var winIE = (navigator.userAgent.indexOf("Opera")==-1 && (d.getElementById && d.documentElement.behaviorUrns)) ? true : false;

function bodySize(){
  //alert(d.documentElement.clientWidth);
  if(winIE) {
    //sObj = d.getElementsByTagName("body")[0].style;
    
    //sObj = document.getElementById("site");
    /*document.getElementById("site").width = (document.documentElement.clientWidth < 1024) 
                      ? "1024px" 
                      : ( (document.documentElement.clientWidth > 1253) ? "1253" : "100%");
    */
    //alert($('body').width());
    //$('#site').width( ( $('body').width() < 1024 ? 1024 : ( $('body').width() > 1280 ? 1280 : '100%') ) );
  }
}

function init(){
  
  if(winIE) { bodySize(); }
}
onload = init;
if(winIE) { 
  onresize = bodySize; 
}
})(jQuery);
