// JavaScript Document

  
var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


$(document).ready(function(){
 
 $("#vote_container .votelink").click(function () {										
$("#window").slideToggle("normal"); ; 

    });


 	
	$("#close_vote").click(function () {
      $("#window").slideUp("normal");
    });
	
  });



$(document).ready(function(){

$("a.answer").click(function(){
$(this).next().slideToggle("normal"); 
return false;
 });

});


$(document).ready(function(){

$("a.add_opinion").click(function(){
$(this).next().slideToggle("normal"); 
return false;
 });

});



function ShowHide(id) {

    var backreg = document.getElementById('backreg');
    if (backreg.style.display == 'none') { backreg.style.display = 'block'; }
    else { backreg.style.display = 'none'; }

    var popup = document.getElementById('popup');
    if (popup.style.display == 'none') { popup.style.display = 'block'; }
    else { popup.style.display = 'none'; }

    var clrbox = document.getElementById(id);
    if (clrbox.style.display == 'none') { clrbox.style.display = 'block'; }
    else { clrbox.style.display = 'none'; }
}

function SwitchForms(on, off) {
    
    var clrboxOff = document.getElementById(off);
    if (clrboxOff.style.display == 'none') { clrboxOff.style.display = 'block'; }
    else { clrboxOff.style.display = 'none'; }
    
    var clrboxOn = document.getElementById(on);
    if (clrboxOn.style.display == 'none') { clrboxOn.style.display = 'block'; }
    else { clrboxOn.style.display = 'none'; }
}
