function change_search(searchstring)
{
	search_string = document.getElementById('search_string');
	search_string.value = searchstring;
}

function check_search()
{
	search_textbox = document.getElementById('search_string');
	if(search_textbox.value == '') {
		search_textbox.style.backgroundColor = '#9a000f';
	} else {
		document.search.submit();
	}
}

function check_search_video()
{
	search_textbox = document.getElementById('search_string');
	if(search_textbox.value == '') {
		search_textbox.style.backgroundColor = '#9a000f';
	} else {
		document.search.submit();
	}
}

function show_infolayer(id)
{
	
	object_spacer = 'spacer' + id;

	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = '';
		document.getElementById(object_spacer).style.display = '';
	} else {
		document.getElementById(id).style.display = 'none';
		document.getElementById(object_spacer).style.display = 'none';
	}
}

function set_ad() 
{
  if (window.innerHeight) {
    var y = window.pageYOffset;
  } else if (document.documentElement && document.documentElement.scrollTop) {
    var y = document.documentElement.scrollTop;
  } else if (document.body) {
    var y = document.body.scrollTop;
  }
  var stop = document.getElementById('content').offsetHeight + 50;
  if((stop - y) < 600) {
    document.getElementById('ad').style.position = 'absolute';
	document.getElementById('ad').style.top = ''+(stop - 50 - 600)+'px';		
  } else {
    if(y == 0 || y < 50) {
	  document.getElementById('ad').style.position = 'absolute';
	  document.getElementById('ad').style.top = '50px';
	} else {
	  document.getElementById('ad').style.position = 'absolute';
	  document.getElementById('ad').style.top = ''+(y)+'px';	
	}	
  }
  setTimeout('set_ad();', 10);
}