<!--
//<![CDATA[

		function openIM(basePath) {
			window.open(basePath + 'send-to-aim.html?from='+document.location, 'SendToFriend','width=400,height=330,status=0');
		}

        function highlighTD_MV(obj, mode) {

            if (mode) {
                obj.style.cursor='pointer';
                obj.style.backgroundImage = "url(img/myvizu-bg-sel.gif)";
                childLink = obj.getElementsByTagName("a");
                var sel_obj = document.getElementById("current_sub_sec");
                if (sel_obj != obj) {
                     sel_obj.style.backgroundImage = "";
                }
                for (var i=0;i<childLink.length;i++) {
                    if (childLink[i].className == "myvizu-menu-norm") {
                        childLink[i].style.fontWeight = "bold";
                    }
                }
            } else {
                obj.style.cursor='auto';
                childLink = obj.getElementsByTagName("a");
                var sel_obj = document.getElementById("current_sub_sec");
                sel_obj.style.backgroundImage = "url(img/myvizu-bg-sel.gif)";

                for (var i=0;i<childLink.length;i++) {
                    if (childLink[i].className == "myvizu-menu-norm") {
                        childLink[i].style.fontWeight = "normal";
                        obj.style.backgroundImage = "";
                    }
                }
            }
        }

        function highlightRow(row, mode) {
            rw = document.getElementById("rw_"+row+"_2");
            if (rw != null) {
                inputs = rw.getElementsByTagName("input");
                for (var i=0; i<inputs.length; i++) {
                    if ((inputs[i].name == "answer" || inputs[i].name == "answersIds") && inputs[i].checked) {
                        mode = 1;
                        break;
                    }
                }
            }

            rw.style.cursor = 'pointer';
            if (mode) {
                rw = document.getElementById("rw_"+row+"_1");
                if (rw != null) rw.style.backgroundColor = "#E5E5CC";
                rw = document.getElementById("rw_"+row+"_2");
                if (rw != null) rw.style.backgroundColor = "#E5E5CC";
                rw = document.getElementById("rw_"+row+"_3");
                if (rw != null) rw.style.backgroundColor = "#E5E5CC";
            } else {
                rw = document.getElementById("rw_"+row+"_1");
                if (rw != null) rw.style.backgroundColor = "#F2F2E5";
                rw = document.getElementById("rw_"+row+"_2");
                if (rw != null) rw.style.backgroundColor = "#F2F2E5";
                rw = document.getElementById("rw_"+row+"_3");
                if (rw != null) rw.style.backgroundColor = "#F2F2E5";
            }
        }

        function clickRow(row) {
             rw = document.getElementById("rw_"+row+"_2");
             if (rw != null) {
                inputs = rw.getElementsByTagName("input");
                for (var i=0; i<inputs.length; i++) {
                    if (inputs[i].name == "answer" || inputs[i].name == "answersIds") {
                        var ans_input = inputs[i];
                        if (ans_input.type == "radio") {
                            ans_input.checked = 1;
                        } else if (ans_input.type == "checkbox") {
                            if (ans_input.checked) {
                                ans_input.checked = 0;
                            } else {
                                ans_input.checked = 1;
                            }
                        }
                        handleUnchecked(row);
                        break;
                    }
                }
             }
             //color unchecked
        }

        function handleUnchecked(row) {
            var nRow = 1;
            rw = document.getElementById("rw_"+nRow+"_2");
            while (rw != null) {
                if (row != nRow) {
                    inputs = rw.getElementsByTagName("input");
                    if (rw != null) {
                        inputs = rw.getElementsByTagName("input");
                        for (var i=0; i<inputs.length; i++) {
                            if ((inputs[i].name == "answer" || inputs[i].name == "answersIds") && !inputs[i].checked) {
                                rw = document.getElementById("rw_"+nRow+"_1");
                                if (rw != null) rw.style.backgroundColor = "#F2F2E5";
                                rw = document.getElementById("rw_"+nRow+"_2");
                                if (rw != null) rw.style.backgroundColor = "#F2F2E5";
                                rw = document.getElementById("rw_"+nRow+"_3");
                                if (rw != null) rw.style.backgroundColor = "#F2F2E5";
                                break;
                            }
                        }
                    }
                }
                nRow++;
                rw = document.getElementById("rw_"+nRow+"_2");
            }
        }

        var W3CDOM = (document.createElement && document.getElementsByTagName);

        function initFileUploads(type)
        {
            if (window.navigator.userAgent.indexOf("Safari") < 0 ) {
            if (!W3CDOM) return;
            var fakeFileUpload = document.createElement('div');
            fakeFileUpload.className = 'fakefile';
            var file = document.createElement('input');
            var input = document.createElement('input');
            var fakeFileInput = document.createElement('div');
            fakeFileInput.className = 'fakeinput';
            if(type == 'step3'){
                  file.size = '46';
                  input.size = '46';
            } else if(type == 'step5') {
                file.size = '35';
                input.size = '35'
            }
            fakeFileUpload.appendChild(file);
            fakeFileInput.appendChild(input);
            var image = document.createElement('img');
            image.src='img/browse.gif';
            image.className = "browse";
            fakeFileUpload.appendChild(image);
            var x = document.getElementsByTagName('input');
            var countOfFakeElem = 0;
              for (var i=0;i<x.length;i++)
            {
                if (x[i].type != 'file') continue;
                if (x[i].parentNode.className != 'fileinputs') continue;
                if (x[i].className == 'file hidden') continue;
                x[i].className = 'file hidden';

                var children = fakeFileInput.childNodes;
                var field = children[0];
                var children2 = fakeFileUpload.childNodes;
                var field2 = children2[0];

                if(type == 'step3') {
                    if (countOfFakeElem == 0) {
                        if (document.all == null) {
                            field.setAttribute("onmouseover","changeTip(myTips[0])");
                            field.setAttribute("onfocus","changeTip(myTips[0]); lockTips()");
                            field.setAttribute("onmouseout","changeTip('default')");
                            field.setAttribute("onblur","unlockTips();changeTip('default')");
    
                            field2.setAttribute("onmouseover","changeTip(myTips[0])");
                            field2.setAttribute("onfocus","changeTip(myTips[0]); lockTips()");
                            field2.setAttribute("onmouseout","changeTip('default')");
                            field2.setAttribute("onblur","unlockTips();changeTip('default')");
                        } else {
                             field.attachEvent("onmouseover",setTip0);
                            field.attachEvent("onfocus",setTip0Lock);
                            field.attachEvent("onmouseout",setDefaultTip);
                            field.attachEvent("onblur",setDefaultTipUnlock);
    
                            field2.attachEvent("onmouseover",setTip0);
                            field2.attachEvent("onfocus",setTip0Lock);
                            field2.attachEvent("onmouseout",setDefaultTip);
                            field2.attachEvent("onblur",setDefaultTipUnlock);
                        }
                        countOfFakeElem++;
                    } else {
                        if (document.all == null) {
                            field.setAttribute("onmouseover","changeTip(myTips[1])");
                            field.setAttribute("onfocus","changeTip(myTips[1]); lockTips()");
                            field.setAttribute("onmouseout","changeTip('default')");
                            field.setAttribute("onblur","unlockTips(); changeTip('default');");
    
                            field2.setAttribute("onmouseover","changeTip(myTips[1])");
                            field2.setAttribute("onfocus","changeTip(myTips[1]); lockTips()");
                            field2.setAttribute("onmouseout","changeTip('default')");
                            field2.setAttribute("onblur","unlockTips(); changeTip('default')");
                        } else {
                            field.detachEvent("onmouseover",setTip0);
                            field.detachEvent("onfocus",setTip0Lock);
    
                            field.attachEvent("onmouseover",setTip1);
                            field.attachEvent("onfocus",setTip1Lock);
    
                            field2.detachEvent("onmouseover",setTip0);
                            field2.detachEvent("onfocus",setTip0Lock);
    
                            field2.attachEvent("onmouseover",setTip1);
                            field2.attachEvent("onfocus",setTip1Lock);
                        }
                    }
                }
                var clone = fakeFileUpload.cloneNode(true);
                var cloneInput = fakeFileInput.cloneNode(true);
                x[i].parentNode.appendChild(clone);
                x[i].parentNode.appendChild(cloneInput);
                x[i].relatedElement = cloneInput.getElementsByTagName('input')[0];
                x[i].onchange = function () {
                    this.relatedElement.value = this.value;

                }
                x[i].onkeydown = function () {
                    this.relatedElement.focus();
                }
            }
           } else {
                var x = document.getElementsByTagName('input');
                for (var i=0;i<x.length;i++)
                {
                    if (x[i].type != 'file') continue;
                    if (x[i].parentNode.className != 'fileinputs') continue;
                    if (x[i].className == 'file hidden') continue;
                    x[i].style.opacity = 1;
                }
            }
        }

        function setTip0()
        {
            changeTip(myTips[0]);
        }
        function setTip0Lock()
        {
            setTip0();
            lockTips();
        }

        function setTip1()
        {
            changeTip(myTips[1]);
        }
        function setTip1Lock()
        {
            setTip1();
            lockTips();
        }

        function setDefaultTip()
        {
            changeTip('default');
        }
        function setDefaultTipUnlock()
        {
            setDefaultTip();
            unlockTips();
        }

        function showRegAlert() {
            if (confirm("In order to enjoy an email subscription to Vizu's What's Hot polls, please register with Vizu. ")) {
                document.location.href="registration.html";
            }
        }
        function showRegAlertLeaderboard() {
            if (confirm("In order to enjoy an email subscription to Vizu's Leader Board, please register with Vizu. ")) {
                document.location.href="registration.html";
            }
        }

        var tipsLock = false;
        function changeTip(tip) {
            if (tipsLock == true) return;
            if (tip == "default") { tip = "If you have any questions as you create a poll, look here. This area will display tips and information relevant to any field in which you place your cursor.";}
            if ((typeof tip) == "string") document.getElementById("tip_td").innerHTML = tip;
        }

        function lockTips() {
            tipsLock = true;
        }

        function unlockTips() {
            tipsLock = false;
        }

        function trim(strText) {
            // this will get rid of leading spaces
            while (strText.substring(0,1) == ' ')
                strText = strText.substring(1, strText.length);

            // this will get rid of trailing spaces
            while (strText.substring(strText.length-1,strText.length) == ' ')
                strText = strText.substring(0, strText.length-1);

           return strText;
        }

        function validateMsg(isUserLogged) {
    		var comment = trim(document.comment_form.comment.value);

   		    if (comment.length == 0 || comment == "Type your comment here..."){
   			    return;
   			} else if (isUserLogged == "true"){
   			        while (comment.indexOf("\n") != -1) {
     			           var index = comment.indexOf("\n");
       			           var firstStr = comment.substring(0,index);
       			           comment = firstStr + "{br /}"+comment.substring(index+1,comment.length);
   			        }
                    document.comment_form.hidden_comment.value = document.comment_form.hidden_comment.value + comment;
   		            document.comment_form.submit();
    	    }
   		}


        function nonSignMsg(isUserLogged,eId,commentId,basePath) {
			if(!basePath)
				basePath = "";
            var comment_form = document.getElementById("comment_form");            
            var comment = comment_form["comment"];
            var hidden_comment = comment_form["hidden_comment"];
            var textValue = trim(comment.value);
            if (isUserLogged == "true") {
                if (commentId == 0 && textValue.indexOf("Type your comment here...") != -1)
                    comment.value="";
                if (commentId == -1) {
                    comment.value="";
                    hidden_comment.value="";
                }
                comment.style.color= 'black';
                if (commentId > 0 ) {
                    comment.value="";
                    hidden_comment.value="{i}in reply to Comment #"+commentId+":{/i}{br /}";
                }
                comment.focus();
            }
             else {
                comment.blur();
                if (document.URL.indexOf("poll-vote") != -1)
                    document.location.href = basePath + "alert.html?error=poll-comment&referrer=poll-vote.html?n=" + eId;
                else
                    document.location.href = basePath + "alert.html?error=poll-comment&referrer=poll-results.html?n=" + eId;
            }
       }

       function getDefaultMessage(isUserLogged) {
           var comment = trim(document.comment_form.comment.value);
           var msgLogout = "Sign In and type your comment here...";
           var msgLogin = "Type your comment here...";
           var bool = false;
           var count;

           if (comment.length == 0)
               bool = true;
           else {
               count = 0;
               for (var i=0;i<comment.length;i++)
                   if (comment.charAt(i) == ' ')
                       count++;
                   else
                       if (comment.charAt(i) == '\n') {
                           if (window.navigator.userAgent.indexOf("MSIE") != -1)
                               count+=2;
                           else
                               count++;
                       }

                if (comment.length == count)
                    bool = true;
           }

           if (bool) {
               document.comment_form.comment.style.color= '#CCCCCC';
               if (isUserLogged == "true")
                   document.comment_form.comment.value=msgLogin;
               else
                   document.comment_form.comment.value=msgLogout;
           }
       }
       
       function resetAnalysisForm(form) {
            for (i=0; i<form.elements.length; i++) {
                if (form.elements[i].name != "chartType") {
                    form.elements[i].options[0].selected = true;
                }
            }
            form.submit();
        }

        function SetFilters(form) {
            if(form.voterStatus.options[form.voterStatus.selectedIndex].value == '2') {
                form.ageInterval.options[0].selected = true;
                form.gender.options[0].selected = true;
                form.geography.options[0].selected = true;
                form.usRegion.options[0].selected = true;
                for(var i=0; i<=10; i++) {
                    if(form["analytics["+i+"]"]) form["analytics["+i+"]"].options[0].selected = true;
                }
            }
            form.submit();
        }
    

//]]>
-->