
//<![CDATA[

         
	$(".PDS_Poll").ready(function(){
	    $(".PDS_Poll").each(function(){
            $(this).find('.pds-question-top').before("<h4>" + poll_type + "</h4><h3>" + title + "</h3>"); 
			$(this).find('.pds-question-top').wrapInner("<div class='poll-question'></div>");
            //hide PollDaddy version
            $(this).find(".pds-answer").css("display", "none");
                        
            //grab poll values
            $radios = $(this).find("input.pds-radiobutton");
            $images = $(this).find("div a img");
            $image_links = $(this).find("div a");
            
            //insert choice list
            $choices_list = "<ul id='poll-choices'>";
            $radios.each(function(index, value){
                $choices_list = $choices_list
                      +  "<li class='choice_monkeypatch clearfix' id='id_" + this.id + "'>"
                      +  "<table border='0' cellspacing='0' cellpadding='0'><tr><td valign='top'><div class='poll_img'>" 
                      +  "<a class='larger' id='lar_" + this.id + "' href='" + $($image_links[index]).attr('href') + "'><img src='" + $($images[index]).attr('src') + "' class='choice_img' width='94' alt='' /></a></div></td><td valign='middle'>"
                      +  "<span class='choice'><em>" + $('label[for="' + this.id + '"]').text() + "</em></span></td></tr></table></li>";
            });
            $choices_list += "</ul>";
            $(this).find(".pds-question").after($choices_list);
            
            $('.choice_monkeypatch').hover(function(){
               $('.choice_monkeypatch').removeClass('hover');
               $(this).addClass('hover'); 
            }, function(){
                $(this).removeClass('hover');                 
            });
            
            //select appropriate radio button            
            $('.choice_monkeypatch').click(function(){
                $('.choice_monkeypatch').each(function(){$(this).removeClass('active');});
                $(this).addClass('active');
                $("input[type=radio]#" + this.id.substring(3)).attr('checked', true);
                return false;
            });
            
            $('.larger').click(function(){
            	newwindow=window.open(this.href,'name','height=640,width=884, location=no, resizable=1, status=no, scrollbars=1');
            	if (window.focus) {newwindow.focus()}
            	return false;                
            });
            $(this).css('display', 'block');
            
        
            
        });
	});
	
	function vert_align(item) {
	    alert(item);
	}
//]]>
