function more_or_less( node ){ if( node ) { var cn = node.className; if( cn.indexOf("less") > -1 ) { node.className = cn.replace("less", "more"); } else if( cn.indexOf("more") > -1 ) { node.className = cn.replace("more", "less"); } } return false;// used in onclick handlers. } var vp_current_item; var vp_current_detail; function video_update( id ){ id = escape(id).replace("%0A","");// temporary until I figure out why flash is doing that. try{ vp_current_item.className = "vp_entry"; vp_current_detail.style.display = "none"; }catch(e){} if( id != "stopped" ){ try{ vp_current_item = document.getElementById( "vp_entry_"+id ); vp_current_detail = document.getElementById( "vp_detail_"+id ); vp_current_item.className = "vp_entry_current"; vp_current_detail.style.display = "block"; var list = document.getElementById( "vp_videos" ); list.scrollTop = vp_current_item.offsetTop; }catch(e){} } } function play_video( id ){ try{ document.getElementById( "video_player" ).vp_play( id ); //reload_comments(id); }catch(e){ try{ console.error( "Error playing video: "+e ); }catch(e){} } return false; } function reload_comments(videoId) { var url = 'http://southpark.comedycentral-d.mtvi.com/mini_site_files/blog/blog_droplet.jhtml'; var pars = 'c=vc&videoId='+videoId; var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onComplete: show_comment_Response,'timeout':2000,'onTimeout':function(req){ alert('Timed Out!'); }} ); var text_field = false; } function show_comment_Response (originalRequest) { var newData = originalRequest.responseText; $('comment_box').innerHTML = newData; } function clear_comment_Default(el) { if (el.defaultValue==el.value) el.value = ""; } EmailerEvent = { WAITING: "waiting", ERROR: "error", INVALID: "invalid", SUCCESS: "success" }; EmailerManager = { _instances: {}, _page_params: "", find_instance: function( id ) { return this._instances[id]; }, submit: function( form ){ var fm = this._instances[form.id]; if( fm == null ) { fm = new Emailer( form ); EmailerManager._instances[form.id] = fm; } fm.send_email(); return false; }, set_page_params: function( params ){ this._page_params = params; }, get_page_params: function(){ return this._page_params; } }; Emailer = function( form ){ try { this._form = form; this._id = form.id; this._status = document.getElementById( this._id+"_status" ); this._waiting = false; this._url = this._form.action; var node, name; var len = form.childNodes.length; for( var i=0 ; i= 5; var format_ok = dot_i > at_i; var at_ok = at_i > 1; if( l_ok && format_ok && at_ok ) { return true; } return false; }, _show_error: function( field ){ if( field.className.indexOf("error") == -1 ) { field.className += " error"; } }, _unshow_error: function( field ){ field.className = field.className.replace( "error", "" ); }, _submit_form: function(){ try { this._waiting = true; var params = "fromemail="+this._from_email.value; params += "&toemail="+this._to_email.value; params += "&message="+this._message.value; params += "&"+EmailerManager.get_page_params(); ccHttpRequest( this._url, params, "EmailerManager.find_instance('"+this._id+"')._form_returned()" ); } catch(e) { this._waiting = false; this._update_status( EmailerEvent.ERROR ); } }, _form_returned: function(){ try { var d = cc_http_request.responseText ? cc_http_request.responseText : cc_http_request.responseXML; var ok = d.indexOf("sent='true'") > -1; if( ok ) { this._update_status( EmailerEvent.SUCCESS ); this._form.reset(); } else { this._update_status( EmailerEvent.ERROR ); } } catch(e) { this._update_status( EmailerEvent.ERROR ); } } }