var baseUrl;
var base = document.getElementsByTagName("base");
if (base != null && base.length > 0)
	baseUrl = base[0].href;
else
	base = "http://cikrf.ru/";
function makePage(rus,eng) {
	this.rus = rus;
	this.eng = eng;
}


pages = new Array();
pages[pages.length] = new makePage("","eng/");

function doPrint() {
	var winWidth=(typeof(window.outerWidth) == "undefined")? window.document.body.clientWidth:window.outerWidth;
	var winHeight=(typeof(window.innerHeight) == "undefined")? window.document.body.clientHeight:window.innerHeight;
	var w = window.open("","_blank","height="+winHeight+",width="+winWidth+",status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes, channelmode=no");
	var contentStr = document.body.innerHTML;
	var printHeader = "<html><head><title> Центральная избирательная комиссия Российской Федерации </title><meta http-equiv=Content-Type content=\"text/html; charset=utf-8\"></head><body><a href=\"javascript:window.print();\">распечатать</a> <span style=\"margin-left: 30px;\"><a href=\"javascript:void(0);\" onclick=\"window.close();\">закрыть окно</a><br/><br/>";
	var printFooter = "</body></html>";
	var beginContentIndex = contentStr.indexOf("<!-- Begin Content -->");
	var endContentIndex = contentStr.indexOf("<!-- End Content -->");
	if ((beginContentIndex > -1)&&(endContentIndex > -1))
		w.document.write(printHeader + contentStr.substring(beginContentIndex, endContentIndex) + printFooter);
	w.focus();	
}

function switchPage(lang) {
	window.location.href="http://www.cikrf.ru/eng";
}

function elemInArray(arr, el, d) {

	if (arr==null) return false;
	if (el==null) return false;
	if (d==null || d=="") d=0;
	var find=false;
	for (var i=0; i<arr.length; i++ ) {
		if (d==0){
			if (arr[i].rus==el) {
				find=i;
				break;
			}
		}
		else {
			if (arr[i].eng==el) {
				find=i;
				break;
			}
		}
	}
	return find;
}

function look_d(){
	var name_map="";
	var selector =(document.getElementById) ? document.getElementById("Sub"):Sel.Sub;
	name_map=selector.options[selector.selectedIndex].value;
	window.open(name_map,'aaa',"scrollbars=yes,resizable=yes,toolbar=yes,location=yes,menubar=yes");
}

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-26139106-1']);
  _gaq.push(['_setDomainName', 'cikrf.ru']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

var params = "&l=" + encodeURI(window.location.href);
$.ajax({
	url: "/dynservices/clickStats/count?id=1" + params,
	cache: false,
	success: function(html){;}
});	
