var win_w;
var table_w = 770;
var margin = 10; 

function fix_position(d){
  win_w = document.body.clientWidth;
  document.getElementById(d).style.left = win_w/2 + table_w/2 + margin;
}

function showVote(r) {
  var win_height = 350;
  var win_width = 550;

  if (r == 0) {
  	if (document.vote.answerValue != null)
  	    window.open('voting.php?choise[]=' + document.vote.answerValue, '', 'scrollbars=yes, menubar=no,location=no,directories=no,status=no,resizable=yes,top=0,left=0,width='+win_width+',height='+win_height);
    else  {
		alert('Не выбрано значение');
		return false;
	}
  }
  else window.open('voting.php', '', 'scrollbars=yes, menubar=no,location=no,directories=no,status=no,resizable=yes,top=0,left=0,width='+win_width+',height='+win_height);
}

function previewIt(href, wW, wH)
{
	var wW = (!wW)? 100 : wW;
	var wH = (!wH)? 100 : wH;
	var winl = (screen.width - wW) / 2;
	var wint = (screen.height - wH) / 2;
	var winprops = navigator.appName == "Netscape" ? 'height='+wH+',width='+wW+',top='+wint+',left='+winl+',toolbar=no,'+'location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes' : 'height='+wH+',width='+wW+',top='+wint+',left='+winl+',toolbar=no,'+'location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=yes';
	var win = window.open(href, 'popup', winprops);
	 win.window.focus();
}


function AddBookmark(mark_href, mark_title)  { window.external.addFavorite(mark_href, mark_title); }

function openWin(url,width_w,height_w) {
if (OkWin != null)  if (typeof(OkWin) == "object") OkWin.close();
 OkWin=window.open(url,'send','width='+width_w+',height='+height_w+', help=0, status=0, resizable=no, scrollbars=no');
 OkWin.focus();
}

function openWinRes(url,width_w,height_w) { // изменяемое поразмерам окно
// if (OkWinRes != null) if (typeof(OkWinRes) == "object") OkWinRes.close();
 OkWinRes=window.open(url,'send','width='+width_w+',height='+height_w+', help=0, status=0, resizable=yes, scrollbars=yes');
 OkWinRes.focus();
}

function HideShow(node) {	
 with (document.all[node].style) 
   if (display == 'none') { display = ''; return 1} else { display = 'none'; return 0; }
 
}

function HideShowID(id) {
      if (id.style.display=='none') { id.style.display='';  return 1;}
      else { id.style.display='none'; return 0;}
    }

function openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
  }
  
function MM_openBrWindow(theURL,winName,features) { //v2.0
   window.open(theURL,winName,features);
  }  
