function CreateBookmarkLink() {
title="«Парацельс 2001», клиника пластической хирургии";
url="http://lazmed.ru";


	//Gecko
	if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
	//IE4+
	else if (typeof window.external == "object") window.external.AddFavorite(url, title);
	//Opera7+
	else if (window.opera && document.createElement)
	{
		var a = document.createElement('A');
		if (!a) return false; //IF Opera 6
		a.setAttribute('rel','sidebar');
		a.setAttribute('href',url);
		a.setAttribute('title',title);
		a.click();
	}
	else return false;

	return true;
}

function OpenPic(node, width, height) {
	ur = node.href;
	node_img = node.firstChild;
	str = '';
	title = node.title;
	if (!title)
		title = node.firstChild.title;

	if (width == -1 && height > 0) {
		width = parseInt(height / node_img.clientHeight * node_img.clientWidth);
	} else if (height == -1 && width > 0) {
		height = parseInt(width / node_img.clientWidth * node_img.clientHeight);
	}

	if (width) {
		str += ',width=' + (width + 53);
		str += ',left=' + parseInt((screen.availWidth - (width + 53)) / 2)
	}
	if (height) {
		str += ',height=' + (height + 66);
		str += ',top=' + parseInt((screen.availHeight - (height + 66)) / 2)
	}

	resWidth = 61;
	resHeight = 115;
	if (navigator.userAgent.toLowerCase().indexOf("msie 6.") != -1) {
		resWidth = 65;
		resHeight = 117;
	} else if (navigator.userAgent.toLowerCase().indexOf("msie 7.") != -1) {
		resWidth = 66;
		resHeight = 130;
	}

	opts = 'resizable=yes,location=no,menubar=no,titlebar=no,scrollbars=yes,status=no,toolbar=no,fullscreen=no,dependent=yes'+str;
	var a = window.open('about:blank','imagDetail',opts);
	var html = "<html><head><link type='text/css' rel='stylesheet' href='/css/main.css' /><\/head>";
	html += "<body style='margin:0; padding:0; text-align: center; vertical-align: middle'><div style='padding: 10px'>";
	html += "<img onclick='window.close()' ";
	html += "onload=\"window.resizeTo(Math.min(screen.availWidth+"+resWidth+",this.width+"+resWidth+"),Math.min(screen.availHeight+"+resHeight+",this.height+"+resHeight+"))\" ";
	html += "style='cursor:pointer; padding-bottom:10px' src='"+ur+"' alt='Закрыть' title='Закрыть' \/>";
	html += "<div>"+title+"<\/div>";
	html += "<\/div><\/body><\/html>";
	a.document.write(html);
	a.document.close();
	return false;
}


function pr_changepic(node, id, type) {

	if (!pr_changepic.img) {
		pr_changepic.mini_photos = document.getElementById('mini_photos');

		pr_changepic.prev = document.getElementById('show_prev');
		pr_changepic.next = document.getElementById('show_next');
		pr_changepic.podpis = document.getElementById('podpis');

		pr_changepic.img = document.getElementById('foto');
		if (type)
			pr_changepic.number = 0;
		else
			pr_changepic.number = id;
	}
	if (id != -1) pr_changepic.number = id;

	if (type && !node) {
		if (type == 2)
			id = pr_changepic.number + 1;
		else if (type == 1)
			id = pr_changepic.number - 1;

		if (id > -1) node = pr_changepic.mini_photos.childNodes[id];
		if (node)
			pr_changepic.number = id;
		else
			return false;
	}
	if (node == pr_changepic.mini_photos.firstChild)
		pr_changepic.prev.className += ' span';
	else
		pr_changepic.prev.className = pr_changepic.prev.className.replace(/\s?span/, '');

	if (node == pr_changepic.mini_photos.lastChild)
		pr_changepic.next.className += ' span';
	else
		pr_changepic.next.className = pr_changepic.next.className.replace(/\s?span/, '');

	//alert (id);

	m = node.href.match(/(\d+)\.j/);

	pr_changepic.img.src = '/preob/' + m[1] + '.jpg';
	pr_changepic.img.parentNode.href = '/preob/full_' + m[1] + '.jpg';

	tmp = node.firstChild.title;

	if (m[1] == 79)
		tmp = 'Накануне операции: консультация <a href="/vrachi/milanov.html">хирурга</a>';
	else if (m[1] == 90)
		tmp = '<a href="/vrachi/milanov.html">Николай Олегович</a> наносит предоперационную разметку';

	pr_changepic.podpis.innerHTML = tmp;
	pr_changepic.img.title = node.firstChild.title;

	return false;
}

//alert('');

	$(window).ready(function(){

    /*if ($('#topFlash').length) {
       htmlOptions = { src: "images/autumn/autumn2.swf", width: '800', height: '107', wmode: 'transparent', replace: '<a href="offer.html" title="Акции осени!"><img src="images/autumn-zagl.jpg" width="800" height="107" alt="" /></a>' };
       $('#topFlash').flash(htmlOptions, pluginOptions);
    }*/

      $('#main_news > .news > div[class!="topic"] > a')
    .click(function(){
      if (!$(this).siblings('div.magic_block').length){

          var href = $(this).attr('href');

      		var request = $.ajax({
      				type: "GET",
      				async: false,
      				url: href
      		});

  			  $(this).before('<div class="magic_block" style="margin-bottom:2em;cursor:pointer;display:none">' + request.responseText + '</div>');


          $(this)
          .siblings('div.magic_block')
          //.fadeIn()
          .show()
          ;


  			  $('#main_news > .news div.magic_block').click(function(){
  			      $(this)
  			      .siblings('a')
  			      .show()
              ;

              $(this)
  			      .remove()
  			      ;

  			      return false;
          });

  		   $(this).hide();

      }
			return false;
		});

		$('#main_news > .news > div[class="topic"] > a.body')
    .click(function(){

      var x = $(this).parent().siblings('div').children('a').siblings('div.magic_block').length;

      if (x){
  		$(this).parent()
  			     .siblings('div')
  		       .children('a')
  			     .siblings('div.magic_block')
  			     .click()
  			     ;
			} else {
      $(this).parent()
			  	   .siblings('div')
				     .children('a')
				     .click()
				     ;
			}
			return false;
		});

		$('#main_news > .news > a')
    .click(function(){

      var x = $(this).siblings('div[class!="topic"]').children('a').siblings('div.magic_block').length;

      if (x){
  		$(this).siblings('div[class!="topic"]')
  			     .children('a')
  			     .siblings('div.magic_block')
  		       .click()
  			     ;
      } else {
  		$(this).siblings('div[class!="topic"]')
  			     .children('a')
  			     .click()
  			     ;
			}
			return false;
		});

	});


var sbt=1;

function sobit()
{
	++sbt;

	if (sbt > 2) { // > 10
		sbt = 1;
		//$(".bann1").css({ display: "none" })
	}
	if(sbt == 1) {
		$("#sob_2").css({ display: "block", opacity: "0"})
		$("#sob_2").animate({ opacity: "1"}, "fast");
	} else {
		$("#sob_2").css({ display: "block", opacity: "1"})
		$("#sob_2").animate({ opacity: "0"}, "fast");
	}

	window.setTimeout( "sobit()", 2000);
}



/*
function sobit2()
{
	var num = $("#main_banner_img").attr('src');
	num = num.substr(num.length - 6,2);
	num = parseInt(num);
	num = num + 1;

	if(num > 56) { num = 54; }
	$("#main_banner_img").fadeOut("slow", function(){
		$("#main_banner_img").attr({'src':"/images/banner-" + num + ".jpg", function(){
				$("#main_banner_img").fadeIn("slow");
			});
		});
	});

}
window.setInterval( "sobit2()", 2000);
*/


// EOF
