function sayHello(){alert("Hello from feedback.js")}function getFeedbackOld(b,d,e,c){d=escape(d);c=escape(c);e=escape(e);var a="http://talks.sahajayogaonline.com/cgi-bin/feedback.pl?id="+b+"&event="+d+"&date="+c+"&place="+e;var f=window.open(a,"MediaProjectFeedback");f.focus()}function closeFeedbackBox(){$("#popup10").html("").fadeOut("slow");$("#opback").fadeTo(1,0).hide().unbind("click")}function getFeedback(m,b,c,a){var g='"';var d;var l="";var k="";var j="";var i="";var f="";var e="";var s=3;var r=3;var q=3;var p=3;var o=3;var n=5;log("Opening feedback form...");switch(m){case"1":d="General feedback";k="Your feedback about the Sahaja Yoga Media Project and any improvements we could make:";s=10;n=1;break;case"2":d="New Event/Recording Details";l="Please tick the box if you have a recording of a event not yet listed here:";k="Short summary of the event, e.g. 'Programme Prague 1 Aug 1994'";j="If you do not have the recording, do you know who might?";i="Information about the medium (audio, video, cassette, tape, mp3, etc.), duration, and sound and picture quality:";f="Any information on the date, location, or type of event:";e="Anything else you would like to tell us about the recording:";s=1;break;case"3":d="I would like to join!";k="Please tell us how you would like to contribute to the Media Project.";j="Please tell us about any IT skills you might have such as web site development, perl, ruby, MySQL, eCommerce.";i="Please tell us about any experience you have with editing and cleaning up audio and video tapes.";s=6;r=6;q=6;n=3;break;case"4":d="General questions";k="Please let us know your questions:";s=10;n=1;break;case"5":d="Change Request";k="Summary / title of change request:";j="Please describe in detail what you want changed and why:";s=1;r=10;n=2;break;default:d="Feedback - "+b+", "+c+", "+a;l="Please tick the box if you have the recording:";k="If you do not have the recording, do you know who might?";j="Information about the medium (audio, video, cassette, tape, mp3, etc.), duration, and sound and picture quality:";i="Any information on the date, location, or type of event:";f="Anything else you would like to tell us about the recording:"}var t="<DIV class=feedbackBox><DIV class=drag-handle>"+d+"</DIV>";t+="<form method='post' id='feedForm'>";t+="<input type=hidden name=event_id id=event_id value='"+m+"'>";t+="<input type=hidden id=feedcount value='"+n+"'>";if(l!=""){t+="<P  id = 'header1'>"+l+" <INPUT TYPE='CHECKBOX' ID='Audio'> Audio  <INPUT TYPE='CHECKBOX' ID='Video'> Video</P>"}if(k!=""){t+="<P class='question'>"+k+"</P><TEXTAREA id='feed1' name='feed1' cols=90 rows="+s+"></TEXTAREA>"}if(j!=""){t+="<P class='question'>"+j+"</P><TEXTAREA id='feed2' name='feed2' cols=90 rows="+r+"></TEXTAREA>"}if(i!=""){t+="<P class='question'>"+i+"</P><TEXTAREA id='feed3' name='feed3' cols=90 rows="+q+"></TEXTAREA>"}if(f!=""){t+="<P class='question'>"+f+"</P><TEXTAREA id='feed4' name='feed4' cols=90 rows="+p+"></TEXTAREA>"}if(e!=""){t+="<P class='question'>"+e+"</P><TEXTAREA id='feed4' name='feed4' cols=90 rows="+o+"></TEXTAREA>"}if(m!=5){t+="<P class='question'>Please let us know your name and email address so that we can contact you:";t+="<table class=feedbackBottom><tr><td><label for='email' class=question>My email address:</label><input name='email' autocomplete=on id='email' STYLE='width: 270px;' onChange='javascript:checkEmail(this)'></td>";t+="<td><label for='who' class=question>My name:</label><input name='who' autocomplete=on id='who' STYLE='width: 270px;'></td></tr></table>"}t+="<P><INPUT type=button value='Submit' onClick='javascript:submitFeedback()' onmouseover="+g+"Tip('Click here to send your feedback to the Media Project.', WIDTH, 300, CLICKCLOSE, true)"+g+">";t+="<INPUT type=button onclick='showSize();' value='Reset' onmouseover="+g+"Tip('Undo the entries you have made.', WIDTH, 300, CLICKCLOSE, true)"+g+">";t+="<INPUT type=button value='Cancel' onClick='closeFeedbackBox()' onmouseover="+g+"Tip('Close this window without sending any feedback.', WIDTH, 300, CLICKCLOSE, true)"+g+">";t+="</form>";log("Opaquing display");$("#opback").fadeTo(1,0.7).show();log("Showing feedback DIV");$("#popup10").html(t).fadeIn("slow").draggable({handle:"div"}).center()}function submitFeedback(){var k;var b;var f;var e;var d="";var c;var j;var m=$("#event_id").val();$("#feedForm input[type='checkbox']:checked").each(function(){if(d!=""){d+="<br>"}d+="<b>Has "+$(this).attr("id")+"</b>"});$("#feedForm > textarea").each(function(){if($(this).val()!=""){if(d!=""){d+="<br>"}b=$(this).prev().text();d+="<b>"+b+"</b><br>"+$(this).val()}});if(d==""){return false}var g=hformat(d);var l;var i;if(m==5){l=$("#userID").attr("user");log("User is "+l);i=l}else{if($("#who").val()==""){alert("Please tell us your name.");fieldFocus(k);return false}l=escape($("#who").val());if($("#email")==""){alert("Please enter your email address.");fieldFocus(k);return false}i=escape($("#email").val())}var a="http://talks.sahajayogaonline.com/cgi-bin/addFeedback.pl";var h="w="+m+"~~~"+l+"~~~"+g+"~~~"+i;a=a+"?"+h;log(a);var k=$.get(a,function(o){alert("Thank you very much for your feedback!");closeFeedbackBox();if(a.indexOf("SimpleForm")>0){a=location.href;var n=a.indexOf("SimpleForm.pl");a=a.substring(0,n)+"SimpleFormLoad.pl";h="objId="+m+"&user=guest&session=none";xmlHttpPost(a,h)}return});return}function hformat(a){a=escape(a);var b=/%0D%0A/g;a=a.replace(b,"<BR>");b=/%0A/g;a=a.replace(b,"<BR>");b=/%22/g;a=a.replace(b,"&#34;");b=/\'/g;a=a.replace(b,"&#39;");b=/\+/g;a=a.replace(b,"&#43;");b=/&#/g;a=a.replace(b,"QamphashQ");b=/;/g;a=a.replace(b,"QsemicolonQ");return a}function dispFeedback(a){a="<DIV class=blogStyle>"+a+"</DIV>";$("#opback").fadeTo(1,0.7).show();$("#popup10").html(unescape(a)).removeClass("video");var b=$(window).width()-$("#popup10").width();$("#popup10").css({left:b/2+"px",right:b/2+"px",right:"",width:"auto",height:"auto"}).show().center();$("#opback").click(function(){closeFeedbackBox()})};
