//------------------ // Copyright 2007 - PollMonkey.com // Publish Date: 11/19/2008 7:38:00 AM //------------------ //--------- Poll Header Functions ------------------------- var cancelSubmit54004 = false; var cancelAlert54004 = false; var secondaryAlert54004 = false; var primaryAlertText54004 = ''; var secondaryAlertText54004 = ''; var col54004 = 1; var NS54004 = (navigator.appName.toLowerCase() == "netscape" && navigator.appVersion.charAt(0)<5) ? true : false; var bUseCaptcha54004 = false; var useDHTML54004 = true; function di2054004(id, newSrc) { document.images[id].src = newSrc; } function preloadImages54004() { if (document.images) { if (typeof(document.WM) == 'undefined'){ document.WM = new Object(); } document.WM.overImages = new Array(); var argLength = preloadImages.arguments.length; for(var arg=0;arg','%3E'); } //-------- END - Poll Header Functions ------------------------------------ //---------- COOKIES FUNCTIONS ------------ function SetCookie54004(name, value, time) { // 1000 milliseconds in a sec var millisecond; millisecond = 1000; time = time * millisecond; // Set expiration of cookie var expDate = new Date(); expDate.setTime(expDate.getTime() + time); document.cookie = name + "=" + escape(value) + ( (expDate) ? ";expires=" + expDate.toGMTString() : ""); } function GetCookie54004(name) { var result = null; var myCookie = " " + document.cookie + ";"; var srchName = " " + name + "="; var start = myCookie.indexOf(srchName); var end; if (start != -1) { start += srchName.length; end = myCookie.indexOf(";", start); result = unescape (myCookie.substring(start, end)); } return result; } function CheckForCookie54004() { check = false; if(GetCookie54004('cookietest') != null) { check = true; } return check; } function CheckCookieExpiration54004() { check = GetCookie54004('54004_VoteFrequency'); if(check != null && check != 99999999) { SetCookie54004('54004_VoteFrequency', '99999999', '99999999'); } } SetCookie54004('cookietest','true', '30'); //---------- END COOKIES FUNCTIONS ------------ //--------- Poll Option Functions ----------------- var a = new Array(); function CheckSelected_53725(useButtons, selectedOptionID, optionID) {if (selectedOptionID == optionID) return " checked "; else return ""; } function SCB54004(i, radioVal, optionID, labelText) {return "" + labelText + ""; } a[0] = SCB54004(0,'657863','657863','Good idea, parents and teens should be more open about sex and others can learn from the show. '); a[1] = SCB54004(1,'657864','657864','Ridiculous, MTV is not the proper forum to have those discussions.'); a[2] = SCB54004(2,'657865','657865','Don\'t care. '); function ClearText_53725() { if (document.Form54004.input_53725_0_1_0_2) document.Form54004.input_53725_0_1_0_2.value = ''; if (document.Form54004.input_53725_0_1_Text_2) document.Form54004.input_53725_0_1_Text_2.value = ''; } function CheckText_53725() { if (document.Form54004.input_53725_0_1_0_2) if (document.Form54004.input_53725_0_1_0_2.value == '') { secondaryAlert54004 = true; secondaryAlertText54004 ='Please enter a response for\nthe choice \'\''; cancelAlert54004 = true; cancelSubmit54004 = true; document.Form54004.input_53725_0_1_0_2.focus(); } if (document.Form54004.input_53725_0_1_Text_2) if (document.Form54004.input_53725_0_1_Text_2.value == '') { secondaryAlert54004 = true; secondaryAlertText54004 ='Please enter a response for\nthe choice \'\''; cancelAlert54004 = true; cancelSubmit54004 = true; document.Form54004.input_53725_0_1_Text_2.focus(); } } function AlertFunction54004(){ cancelSubmit54004 = true; primaryAlertText54004 = "To vote you must select a choice from the poll."; if (document.Form54004.input_53725_0_0_0_2[0].checked) cancelSubmit54004 = false; if (document.Form54004.input_53725_0_0_0_2[1].checked) cancelSubmit54004 = false; if (document.Form54004.input_53725_0_0_0_2[2].checked) cancelSubmit54004 = false; if (cancelSubmit54004 == true || secondaryAlert54004 == true) { alert(primaryAlertText54004 ); return false; } } function GetPollOptions54004(){ var optionselected = ''; if (document.Form54004.input_53725_0_0_0_2[0].checked) optionselected = optionselected + '&input_53725_0_0_0_2=' + document.Form54004.input_53725_0_0_0_2[0].value; if (document.Form54004.input_53725_0_0_0_2[1].checked) optionselected = optionselected + '&input_53725_0_0_0_2=' + document.Form54004.input_53725_0_0_0_2[1].value; if (document.Form54004.input_53725_0_0_0_2[2].checked) optionselected = optionselected + '&input_53725_0_0_0_2=' + document.Form54004.input_53725_0_0_0_2[2].value; return optionselected; } //--------- END - Poll Option Functions ----------------- //--------- Voting Functions ----------------- var browserType54004 = navigator.appName.toLowerCase(); var bDhtml54004 = true; var sVisRes54004 = ' '; function DisplayVote54004() { document.write('
'); CheckCookieExpiration54004(); useDHTML54004 = true; voteFrequency54004 = GetCookie54004('54004_VoteFrequency'); if(voteFrequency54004 == null) { DisplayPoll54004(); } else { PollResponses54004(); } } function Vote54004() { var queryParam; // Check to see if user has selected something if(DoneFunction54004()==false) { return false; } else { SetCookie54004('54004_VoteFrequency', '99999999', '99999999'); //--DYNAMIC SUBMISSION CHECK---- if(bUseCaptcha54004 ==false && bDhtml54004 && totalresponses > 0 && useDHTML54004 ==true) { queryParam = GetPollOptions54004(); queryParam = queryParam + "&returnurl=" + getCurrentURL54004(); queryParam = queryParam + "&qtype_53725=2"; document.getElementById('imgVoteInfo54004').src ='http://www.pollmonkey.com/Pollite/vote.aspx?U=7815054004&UD=39106FAE7A&query=1' + queryParam; PollResponses54004(); } else { document.Form54004.action="http://www.pollmonkey.com/Pollite/vote.aspx?U=7815054004&UD=39106FAE7A"; document.Form54004.submit(); } } } //--------- END - Voting Functions ----------------- function DisplayHeader54004(){ var sHTML = ''; return sHTML; } function DisplayFooter54004(){ var sHTML = ''; sHTML += '
'; return sHTML; } //--------- Begin Writing Display Poll ----------------- function DisplayPoll54004() { var sHTML = ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
'; sHTML += DisplayHeader54004(); //------Begin Poll Section---- sHTML += '
'; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
'; sHTML += '
'; sHTML += ''; sHTML += 'What do you think about MTV\'s reality show where teens tell all to parents about their sex lives? '; sHTML += ''; sHTML += ''; sHTML += '
'; // -------Write out the question options------------ sHTML += ''; for (var i = 0; i < a.length; i++) { if(i%col54004==0) { if(i==0) sHTML += ''; else if(i==(a.length-1)) { sHTML += ''; sHTML += ''; } else { sHTML += ''; sHTML += ''; sHTML += ''; } } sHTML += a[i]; } sHTML += '
'; //-------End Poll Questions ------------ sHTML += '
'; if(CheckForCookie54004()) { sHTML += ''; } else { sHTML += 'You must have cookies enabled to vote'; } sHTML += '
'; sHTML += '
'; sHTML += '
'; //------ End Poll Section ---------------------------------- sHTML += DisplayFooter54004(); sHTML += '
'; document.getElementById('pDisp54004').innerHTML = sHTML; } //--------- Begin Writing Poll Responses----------------- function PollResponses54004() { var sHTML = ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
'; sHTML += DisplayHeader54004(); //-----------Begin Poll Results - RenderPollResults --------- sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
'; sHTML += '
'; sHTML += ''; sHTML += 'What do you think about MTV\'s reality show where teens tell all to parents about their sex lives? '; sHTML += ''; sHTML += ''; sHTML += '
'; //----------------------------------- Begin Display Poll Results ------------------------------------- sHTML += ''; var graphcolor = new Array(); graphcolor[0] = new Array('ccccff'); graphcolor[1] = new Array('9999cc'); graphcolor[2] = new Array('666666'); var graphcount=0; for(var i=0; i < options54004.length; i++) { if(graphcount>=graphcolor.length) graphcount=0; if(i%col54004==0) { if(i==0) { sHTML += ''; } else if(i==(options54004.length-1)) { sHTML += ''; } else { sHTML += ''; sHTML += ''; } } sHTML += ''; graphcount++; } sHTML += '
'; sHTML += '' + options54004[i][0] + ''; sHTML += '
'; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += ''; sHTML += '
'; sHTML += '
'; sHTML += '
'; sHTML += '' + options54004[i][1] + '%'; sHTML += '
'; sHTML += '
'; //-------------------------------------- End Display Poll Results ----' //----------------------------------- End Poll Questions ---------------------------------- sHTML += ''; sHTML += '
'; sHTML += 'Total Votes: '+ totalresponses +''; sHTML += '
'; sHTML += ''; sHTML += '
'; //------------- End Poll Section --------------- sHTML += DisplayFooter54004(); sHTML += '
'; document.getElementById('pDisp54004').innerHTML = sHTML; var dResult = document.getElementById('pDisp54004'); dResult.innerHTML = sHTML; var scripts = dResult.getElementsByTagName('script'); for(var i = 0; i < scripts.length; i++) { if(scripts[i].type == 'text/javascript') { eval(scripts[i].innerHTML); } } }