﻿$(document).ready(function () {
	if (window.navigator.userAgent.indexOf ("Opera") >= 0)
  {
   ua = 'Opera';
  }
else
if (window.navigator.userAgent.indexOf ("Gecko") >= 0) // (Mozilla, Netscape, FireFox)
  { 
   ua = 'Mozilla';
}
else
if (window.navigator.userAgent.indexOf ("MSIE") >= 0)
  {
   ua = 'Explorer';
   
}
else
   ua = window.navigator.appName;

switch (ua){
	case 'Explorer':
	 $("#logo").css("padding", "-10px 0 0 0");
	 $("#take-priem").css("margin", "0");
	break;
}


  $("#content #wrapper p img").each(function () {
	
	 if ($(this).css("float") == 'left')
	   $(this).css("padding", "10px 10px 10px 0");
	 else
	   $(this).css("padding", "10px 0 10px 10px");	  
	    
  });
  

 $("a.read-info").each(function () {
   $(this).click(function () {

	   if ($(this).parent().children("#doc-content").is(":hidden")){
		 
		 $(this).parent("#doctors-block").css("background", "#faedf3  url(assets/images/line_doctors.jpg) repeat-x bottom left");   
		 $(this).children("img").attr("src", "assets/images/arrow_up.png");
		 $(this).parent("#doctors-block").children("#doc-content").slideDown("slow");
		 
		  }
      else{
		  
		 $(this).parent("#doctors-block").children("#doc-content").fadeOut("slow"); 		 		 		 
		 $(this).children("img").attr("src", "assets/images/arrow_down.png");
		 $(this).parent("#doctors-block").css("background", "#fff url(assets/images/line_doctors.jpg) repeat-x bottom left");
		  }
	   return false;
	   }); 	 
 });
/*	  
 $("#gallery-clinic img").each(function () {
	     
    var mass_src = new Array($(this).attr("src"));        
    $(this).wrap('<a href="'+mass_src+'" rel="lytebox"><img src="'+mass_src+'" width="220" height="147"></a>');	  
	 
 });
*/
 
  $("a.resp-title").click(function () {
	  /* 
	 $("#resp-block, .resp-author").fadeOut("slow");	 
	 $("#resp-block, .resp-author").fadeOut("slow");
	 $("#resp-block, .resp-author").fadeIn(3500);
	 */
	 $("#resp-block, .resp-author").fadeOut("slow");	 
	 $("#resp-block, .resp-author").fadeOut("slow");
	 $.ajax({
	     url: "assets/snippets/getData.php",
	     data: {dat: "doGet"},
	     dataType: "html",
	     type: "post",
	     success: function(data){
		   $("#responds-main").append(data); 
		   $("#resp-block, .resp-author").fadeIn("slow");	 
	       $("#resp-block, .resp-author").fadeIn("slow");
	    }	 
	 });
	});
	

        var url = window.location.href;
		var getvar = url.substr(url.lastIndexOf('/')+1);
		
		$("#select-language").children("a").each(function(){
		 if($(this).attr("href") == getvar){
			 $(this).addClass("active");
			 }	else{
				$(this).removeClass(); 
				 }
			});
			
	
$("#images-gall .all-images img.cl-images").each(function () {
 $(this).click(function(){        
    $("#images-gall .img-container").empty();
    $("#images-gall .img-container").append($(this).clone());    
 });	
});

 $(".table-recomend tr td img").each(function() {
    
    var elem_a = '<a href="'+$(this).attr('src')+'" rel="lytebox"><img src="'+$(this).attr('src')+'" style="width: '+($(this).attr("width")/1.5)+'" height="'+($(this).attr("height")/1.5)+'"></a>';
    $(this).replaceWith(elem_a);
     
 });

$("#openwind").click(function(){

myWin= open("", "displayWindow", "width=750,height=500,status=yes,toolbar=yes,menubar=yes,scrollbars=yes");

  // открыть объект document для последующей печати
  myWin.document.open();

  // генерировать новый документ
  myWin.document.write("<html><head><title>Схема проезда к Американской стоматологической клинике  ARDC");
  myWin.document.write("</title>");
  myWin.document.write('<meta http-equiv="content-type" content="text/html; charset=cp1251" />');
  myWin.document.write('<link rel="stylesheet" href="assets/templates/ardc_main/style.css" media="screen">');
  myWin.document.write("</head><body onload='window.print();'>");
  myWin.document.write("<center>");
  myWin.document.write('<img src="assets/images/map_dent.png" alt="" />');
  myWin.document.write("</center>");
  myWin.document.write("<h4>Наш адрес: </h4>");
  myWin.document.write("<p><strong>Стоматология ARDC</strong><br /><strong>г. Москва, улица Садовая-Кудринская, 21 а&nbsp;&nbsp; &nbsp;</strong><br />Метро &laquo;Маяковская&raquo; и &laquo;Баррикадная&raquo; </p>");
  myWin.document.write("<p><strong>(495) 797-97-59 </strong></p>");
  myWin.document.write('<p><strong><a href="mailto:dentist@ardc.ru">dentist@ardc.ru</a></strong></p>');
  myWin.document.write("</body></html>");

  myWin.document.close();

});

$("#openwinden").click(function(){
  myWin= open("", "displayWindow", "width=750,height=500,status=yes,toolbar=yes,menubar=yes,scrollbars=yes");
  // открыть объект document для последующей печати
  myWin.document.open();
  // генерировать новый документ
  myWin.document.write("<html><head><title>Directions to the American dental clinic ARDC");
  myWin.document.write("</title>");
  myWin.document.write('<meta http-equiv="content-type" content="text/html; charset=cp1251" />');
  myWin.document.write('<link rel="stylesheet" href="assets/templates/ardc_main/style.css" media="screen">');
  myWin.document.write("</head><body onload='window.print();'>");
  myWin.document.write("<center>");
  myWin.document.write('<img src="assets/images/shema_eng.jpg" alt="Schema" width="100%"  />');
  myWin.document.write("</center>");
  myWin.document.write("<h4 style='margin-left:15px'>Our address: </h4>");
  //myWin.document.write("<p><strong>Стоматология ARDC</strong><br /><strong>г. Москва, улица Садовая-Кудринская, 21 а&nbsp;&nbsp; &nbsp;</strong><br />Метро &laquo;Маяковская&raquo; и &laquo;Баррикадная&raquo; </p>");
  myWin.document.write("<p style='margin-left:15px'>21a, Sadovo-Kudrinskaya St., Moscow Metro stations: Mayakovskaya, Barrikadnaya </p>");
  myWin.document.write("<p style='margin-left:15px'><strong>(495) 797-97-59 </strong></p>");
  myWin.document.write("<p style='margin-left:15px'><strong><a href='mailto:dentist@ardc.ru'>dentist@ardc.ru</a></strong></p>");
  myWin.document.write("</body></html>");

  myWin.document.close();

});


$("#printAction").click(function() {
myAct = open("", "displayWindow", "width=500,height=500,status=yes,toolbar=yes,menubar=yes,scrollbars=yes");

myAct.document.open();
    myAct.document.write("<html><head><title>Купон на скидку");
    myAct.document.write("</title>");
    myAct.document.write('<link rel="stylesheet" href="assets/templates/ardc_main/style.css" media="screen">');
    myAct.document.write("</head><body onload='window.print();'>");    
    myAct.document.write("<ul>");
    myAct.document.write('<li>При предъявлении купона Вы получаете скидку<strong> 10% на первичное посещение нашего Центра </strong><strong>ARDC</strong><strong>. </strong>(Скидка действует на консультацию, ортопантомограмму, профилактическую чистку зубов)</li>');
    myAct.document.write("</ul>");
    myAct.document.write('<p><img style="display: block; margin-left: auto; margin-right: auto;" src="assets/images/cards.png" alt="" width="160" height="125" /></p>');
    myAct.document.write('<p style="padding-left: 30px;"><em><strong><span style="font-size: 90%;">*Скидка не распространяется на консультацию врача-ортодонта</span></strong></em></p>');
    myAct.document.write("<p>О других специальных условиях, дисконтных программах и семейных скидках Вы можете уточнить у администрации Клиники ARDC по телефону.</p>");
    myAct.document.write("<p>&nbsp;</p>");
    myAct.document.write("</body></html>");

myAct.document.close();
});

$("#printActionEn").click(function() {
myAct = open("", "displayWindow", "width=500,height=500,status=yes,toolbar=yes,menubar=yes,scrollbars=yes");

myAct.document.open();
    myAct.document.write("<html><head><title>Discount Coupon");
    myAct.document.write("</title>");
    myAct.document.write('<link rel="stylesheet" href="assets/templates/ardc_main/style.css" media="screen">');
    myAct.document.write("</head><body onload='window.print();'>");    
    /*
    myAct.document.write("<ul>");
    myAct.document.write('<li>When presenting the coupon you get a discount of <strong>10% for initial visit to our Center </strong> <strong> ARDC .</strong> (Discount is valid for a consultation, ortopantomogrammu, prophylactic cleaning of teeth)</li>');
    myAct.document.write("</ul>");
    myAct.document.write('<p><img style="display: block; margin-left: auto; margin-right: auto;" src="assets/images/cards.png" alt="" width="160" height="125" /></p>');
    myAct.document.write('<p style="padding-left: 30px;"><em><strong><span style="font-size: 90%;">* Discount does not apply to consulting orthodontist</span></strong></em></p>');
    myAct.document.write("<p>On the other special conditions, discount programs, and family discounts you can check with the administration of the Clinic ARDC by telephone.</p>");
    myAct.document.write("<p>&nbsp;</p>");
    */
    myAct.document.write("<p>In this section we will publish the most actual special offers, discounts, offers by the newest techniques of preventive maintenance and treatment of teeth. For today the action operates. At a coupon presentation – you can receive a discount of 10 % for visiting of our Center ARDC.</p>");
    myAct.document.write('<p><img style="display: block; margin-left: auto; margin-right: auto;" src="assets/images/cards.png" alt="" width="160" height="125" /></p>');
    myAct.document.write("</body></html>");

myAct.document.close();
});


$("#printActionScheme").click(function() {
myAct = open("", "displayWindow", "width=500,height=500,status=yes,toolbar=yes,menubar=yes,scrollbars=yes");

myAct.document.open();
    myAct.document.write("<html><head><title>Схема проезда к Американской стоматологической клинике  ARDC");
    myAct.document.write("</title>");
    myAct.document.write('<link rel="stylesheet" href="assets/templates/ardc_main/style.css" media="screen">');
    myAct.document.write("</head><body onload='window.print();'>");    
    myAct.document.write("<center>");
    myAct.document.write('<img src="assets/images/map_dent.png" alt="" />');
    myAct.document.write("</center>");
    myAct.document.write("<h4>Наш адрес: </h4>");
    myAct.document.write("<p><strong>Стоматология ARDC</strong><br /><strong>г. Москва, улица Садовая-Кудринская, 21 а&nbsp;&nbsp; &nbsp;</strong><br />Метро &laquo;Маяковская&raquo; и &laquo;Баррикадная&raquo; </p>");
    myAct.document.write("<p><strong>(495) 797-97-59 </strong></p>");
    myAct.document.write('<p><strong><a href="mailto:dentist@ardc.ru">dentist@ardc.ru</a></strong></p>');
    myAct.document.write("</body></html>");

myAct.document.close();
});

// Fancy Box
$("a[rel=example_group]").fancybox({ 'transitionIn' : 'none', 'transitionOut' : 'none', 'titlePosition' : 'over', 'titleFormat' : function(title, currentArray, currentIndex, currentOpts) { return '<span id="fancybox-title-over">Фотография ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>'; } });

	
});

