function MM(theURL,w,h)
{	r='width='+w+', height='+h ;
	if (self.screen) {  width = screen.width; height = screen.height;  }
					else {  var jkit = java.awt.Toolkit.getDefaultToolkit();  var scrsize = jkit.getScreenSize();
								 width = scrsize.width; height = scrsize.height; }
						width =  width-20; 		height =  height -60;
					var scb='noscrollbars';
					var w1=w; 	if(w1>width) {w1=width; scb='scrollbars';}
					var h1=h; 	if(h1>height) {h1=height; scb='scrollbars';}
					t='width='+w1+', height='+h1 ;
	mWin = window.open("","",t+','+scb);
	    mWin.document.open();
        mWin.document.write('<html><body leftmargin=0 topmargin=0 MARGINWIDTH=0 MARGINHEIGHT=0 onload="window.focus();">');
        mWin.document.write('<center><img src=' + theURL + ' '+ r+' border=0></center></body></html>');
        mWin.document.close();
}

function printit()
{
	var browser_name = navigator.appName;
  if (browser_name == "Netscape") window.print();
else 
	{
	var WebBrowser = '<object id="WebBrowser1" width=0 height=0 classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';
	document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	WebBrowser1.ExecWB(6, 2);
	WebBrowser1.outerHTML = "";
	}
}

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") +
         ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") +  ((secure) ? "; secure" : "")
        if ((name + "=" + escape(value)).length <= 4000)   document.cookie = curCookie
        else   if (confirm("Cookie exceeds 4KB and will be cut!")) document.cookie = curCookie
}

function getCookie(name) {
        var prefix = name + "="
        var cookieStartIndex = document.cookie.indexOf(prefix)
        if (cookieStartIndex == -1) return null
        var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
        if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length
        return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
}

function fixDate(date)
{var base = new Date(0); var skew = base.getTime(); if (skew > 0) date.setTime(date.getTime() - skew)}


function  golos_pos(n,m)
{var now = new Date(); fixDate(now);  now.setTime(now.getTime() + 20*24*60*60* 1000);
  var  gls='ov_konk'+n+m;
  var b=getCookie(gls);
   if (!b) {b = 1; document.golos.submit(); setCookie(gls, b, now);}
      else {alert ('За этого претендента  Вы уже голосовали') ;}
 }
