function showShema() {
YMaps.jQuery(function () {
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID")[0]);
        map.setCenter(new YMaps.GeoPoint(52.423272,55.716895), 13, YMaps.MapType.PMAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });


        YMaps.Styles.add("constructor#00339Ac85Polyline", {
            lineStyle : {
                strokeColor : "00339Ac8",
                strokeWidth : 5
            }
        });

        YMaps.Styles.add("constructor#FF3732c85Polyline", {
            lineStyle : {
                strokeColor : "FF3732c8",
                strokeWidth : 5
            }
        });

        YMaps.Styles.add("constructor#006CFFc85Polyline", {
            lineStyle : {
                strokeColor : "006CFFc8",
                strokeWidth : 5
            }
        });


var placemark=new YMaps.Placemark(new YMaps.GeoPoint(52.441578,55.712385));placemark.setIconContent('<b>ОАО «КИП «Мастер»</b>');placemark.description = '<div style="text-align:center"><b>ОАО «КИП «Мастер»</b><br>423800, Российская Федерация,<br>Республика Татарстан,<br>г. Набережные Челны,<br>Промышленно-коммунальная зона,<br>Промзона,<br>Производственный проезд, 45</div>';map.addOverlay(placemark);

       map.addOverlay(createObject("Polyline", [new YMaps.GeoPoint(52.441224,55.713578),new YMaps.GeoPoint(52.450483,55.718636),new YMaps.GeoPoint(52.437909,55.726127),new YMaps.GeoPoint(52.424863,55.733675)], "constructor#00339Ac85Polyline", ""));
       map.addOverlay(createObject("Polyline", [new YMaps.GeoPoint(52.422556,55.725008),new YMaps.GeoPoint(52.427797,55.727859),new YMaps.GeoPoint(52.428618,55.728114),new YMaps.GeoPoint(52.429369,55.728253),new YMaps.GeoPoint(52.433274,55.72818),new YMaps.GeoPoint(52.433939,55.728144),new YMaps.GeoPoint(52.434776,55.727962)], "constructor#00339Ac85Polyline", ""));
       map.addOverlay(createObject("Polyline", [new YMaps.GeoPoint(52.436076,55.732566),new YMaps.GeoPoint(52.432718,55.730786),new YMaps.GeoPoint(52.430937,55.729824),new YMaps.GeoPoint(52.430545,55.729636),new YMaps.GeoPoint(52.430057,55.729563),new YMaps.GeoPoint(52.429676,55.729603),new YMaps.GeoPoint(52.429306,55.729715),new YMaps.GeoPoint(52.429134,55.729945),new YMaps.GeoPoint(52.429124,55.730193),new YMaps.GeoPoint(52.429263,55.730317),new YMaps.GeoPoint(52.429531,55.730381),new YMaps.GeoPoint(52.429955,55.730459),new YMaps.GeoPoint(52.430301,55.730414),new YMaps.GeoPoint(52.430819,55.730235)], "constructor#00339Ac85Polyline", ""));
       map.addOverlay(createObject("Polyline", [], "constructor#FF3732c85Polyline", ""));
       map.addOverlay(createObject("Polyline", [new YMaps.GeoPoint(52.411134,55.697035),new YMaps.GeoPoint(52.411069,55.697181),new YMaps.GeoPoint(52.411209,55.697387),new YMaps.GeoPoint(52.413183,55.698453),new YMaps.GeoPoint(52.417024,55.700556),new YMaps.GeoPoint(52.422356,55.703434),new YMaps.GeoPoint(52.427721,55.70636),new YMaps.GeoPoint(52.431926,55.708631),new YMaps.GeoPoint(52.433267,55.709329),new YMaps.GeoPoint(52.434201,55.709795),new YMaps.GeoPoint(52.436432,55.711007),new YMaps.GeoPoint(52.440005,55.712951),new YMaps.GeoPoint(52.441014,55.713484)], "constructor#006CFFc85Polyline", ""));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
    });
}


function showShema2() {
   $("#YMapsID").html('<iframe width="600" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?mpa=0&amp;ctz=-240&amp;mpf=0&amp;ie=UTF8&amp;msa=0&amp;msid=213124338937055530233.0004b011a009da0199327&amp;t=h&amp;vpsrc=6&amp;ll=55.715798,52.439289&amp;spn=0.043513,0.102825&amp;z=13&amp;output=embed"></iframe>');
}


function loadban() {
  var curban = $("div.cright .ban").attr('rel');
  $("div.cright .ban2").load('/index/partners/?isNaked=1&curban='+curban);
}


/*
var wowSlider=new WowSlider({effect:"basic",prev:"",next:"",duration:10*100,delay:20*100,outWidth:960,outHeight:360,width:960,height:360,autoPlay:true,stopOnHover:true,loop:false,bullets:true,caption:true,controls:true});
*/


function addsubm() {
  $('#nc_moderate_form').prepend("<input name='posting' type='hidden' value='1'>")
  $('input[type=submit],input[type=reset],button').addClass('but');
  $('input[type=text]').addClass('inp');
}


function showTen() {
  var docheight = $(document).height();
  $('#shadow').css({'height':docheight,'opacity':'0.7'}).fadeIn();
  okno = $('.dialog:visible');
  okno.css({'margin-left':'-'+Math.ceil(okno.width()/2)+'px','margin-top':'-'+Math.ceil(okno.height()/2)+'px'});

}

function oknopos() {
 if ($.browser.msie && $.browser.version < 8) {
   scrltop = $(window).scrollTop();
   okno = $('.dialog:visible');
   okno.css({'position':'absolute','top':Math.ceil(scrltop+$(window).height()/2)+'px'});
 }
}


$(document).ready(function() { // start ready 
addsubm();
$('body').append('<div id=shadow></div>');
$('.dialog').prepend("<a title='закрыть' class='hand close'>&times;</a>");

$("a[rel^='prettyPhoto']").prettyPhoto({
allow_resize: true,
show_title: false,
theme: 'facebook',
social_tools: false
});

$("a[rel='hideshow']").addClass('punkt');
$("a[rel='hideshow']").click(function(){
  $(this).toggleClass('slideact');
  $(this).parent().next().slideToggle();
  return false;
});


$("input[type=submit]").live("click", function(){
  var form = $(this).parents('form:first');
if (form.hasClass('ajax')) {
  $.post(form.attr("action"), form.serialize(), function(data){
   form.find('.result').html(data);
  });
 return false;
}
});


$('#shadow, .dialog .close').click(function(){
   $('#shadow, .dialog').fadeOut(); return false;
});

$('a[rel=pop]').click(function() {
   pop = $(this).attr('okno');
   $('#'+pop).fadeIn(400, function() {
         showShema2();
      });
   showTen(); oknopos();
   return false;
});


$("a.partner").click(function(){
  loadban();
  return false;
});

loadban();

}); // end ready
