// !!!!!!! RATING PROCESS function fxRate(vkey,rate,idToHide,idToShow,vid){ cp.call(baseurl+'ajax/myajaxphp.php','process_data',return_data,rate,vid); hideMe(idToHide); showMe(idToShow); } function return_data(restul){ // Collect the number of BLUE star var cnt=restul.getElementsByTagName('trate').item(0).firstChild.data; hideMe('idViewVoteResult'); if(cnt!='exist') { // # Show the vote var x=document.getElementById('idVoteView').rows[0].cells; x[1].innerHTML=restul.getElementsByTagName('tvote').item(0).firstChild.data; if(cnt>6) { cnt=6; } else if (cnt<0) { cnt=0; } blank_star=6-cnt; var x=document.getElementById('tblViewResult').rows[0].cells; for (i=0;i'; } for (j=cnt;j<5;j++ ) { x[j].innerHTML=''; } } else { var x=document.getElementById('voteProcessthank').innerHTML="You already vote this video"; } return false; } // RATING PROCESS END // !!!!!!! My voting process function fxVote(voteId) { voteAnswer=document.getElementById('opAns').value; if(voteAnswer=='') { alert('Select any one'); } else { cp.call(baseurl+'/ajax/myajaxphp.php','process_Vote',return_vote_result,voteId,voteAnswer); } } function return_vote_result(result) { var xx=result.getElementsByTagName('result').item(0).firstChild.data; if (xx=='1'){ count=result.getElementsByTagName('count').item(0).firstChild.data; for (var ii=0; ii1) { insertInToTable('tblPResult', 0,0,'Sorry you already voted..'); viewVote(xx); // # Hide the previous table //showMe('divviewvresult'); hideMe('tblVote'); } } // END // VIEW VOTE function viewVote(pollId) { cp.call(baseurl+'/ajax/myajaxphp.php','view_vote',return_view_vote,pollId); } function return_view_vote(result){ var xx; if (1){ count=result.getElementsByTagName('count').item(0).firstChild.data; for (var ii=0; ii'; } } } // ## Delete row of a Tabile function delteRow(){ var x=document.getElementById('tblViweAnsBox').rows.length-1; for (var i=x;i>=0;i--){ document.getElementById('tblViweAnsBox').deleteRow(i); } } function fxvalidation(){ var flag=true; var x=document.getElementById('tblViweAnsBox').rows.length-1; // ## Question text flag=txtBoxValidation('txtQtn','#EAEAEA','#FF0033'); // ## Questin qty flag=txtBoxValidation('txtPollAnsQty','#EAEAEA','#FF0033'); for ( i=x; i>=0; i-- ) { targetID='voteAnsBox'+i; if (document.getElementById(targetID).value==""){ txtBoxValidation(targetID,'#EAEAEA','#FF0033'); flag=false; break; } } return flag; } function fxShowAccInfo(a,b){ showMe(a); hideMe(b); } function fxReportVideo(hidediv, uid, vid ) { if ( uid == '0' ) { hideMe(hidediv); showMe('reportVideoLogin'); } else { showMe('reportVideoBox'); } } function fxFeatureVideo( uid, vid ) { if ( uid == '0' ) { hideMe('featureVideoSuccess'); hideMe('featureVideoFailed'); showMe('featureVideoLogin'); } else { cp.call(baseurl+'/ajax/myajaxphp.php','featureVideo', featureVideoResponse, uid, vid); } } function featureVideoResponse( feature_result ) { var feature_response_id=feature_result.getElementsByTagName('featureVideoMessage').item(0).firstChild.data; if ( feature_response_id == '0' ) { hideMe('featureVideoFailed'); hideMe('featureVideoLogin'); showMe('featureVideoSuccess'); } else { hideMe('featureVideoSuccess'); hideMe('featureVideoLogin'); showMe('featureVideoFailed'); } } function fxReportVideo( uid, vid ) { if ( uid == '0' ) { hideMe('reportVideoSuccess'); hideMe('reportVideoFailed'); showMe('reportVideoLogin'); } else { cp.call(baseurl+'/ajax/myajaxphp.php','reportVideo', reportVideoResponse, uid, vid); } } function reportVideoResponse( report_result ) { var report_response_id=report_result.getElementsByTagName('reportVideoMessage').item(0).firstChild.data; if ( report_response_id == '0' ) { hideMe('reportVideoFailed'); hideMe('reportVideoLogin'); showMe('reportVideoSuccess'); } else { hideMe('reportVideoSuccess'); hideMe('reportVideoLogin'); showMe('reportVideoFailed'); } } function fxAddFavorite( hidediv, uid, vid, vuid ) { hideMe(hidediv); if ( uid == '0' ) { hideMe('addToFavLink'); hideMe('addToFavSuccess'); hideMe('addToFavFailed'); hideMe('addToFavAlready'); hideMe('addToFavOwner'); showMe('addToFavLogin'); } else if ( uid == vuid ) { hideMe('addToFavLink'); hideMe('addToFavSuccess'); hideMe('addToFavFailed'); hideMe('addToFavAlready'); hideMe('addToFavLogin'); showMe('addToFavOwner'); } else { cp.call(baseurl+'/ajax/myajaxphp.php','addToFavorites', addToFavoritesResponse, uid, vid, vuid); } } function addToFavoritesResponse( fav_result ) { var fav_response_id=fav_result.getElementsByTagName('addFavMessage').item(0).firstChild.data; if( fav_response_id == '2' ) { hideMe('addToFavLink'); hideMe('addToFavSuccess'); hideMe('addToFavFailed'); hideMe('addToFavLogin'); hideMe('addToFavOwner'); showMe('addToFavAlready'); } else if( fav_response_id == '0' ) { hideMe('addToFavLink'); hideMe('addToFavFailed'); hideMe('addToFavAlready'); hideMe('addToFavLogin'); hideMe('addToFavOwner'); showMe('addToFavSuccess'); } else { hideMe('addToFavLink'); hideMe('addToFavSuccess'); hideMe('addToFavAlready'); hideMe('addToFavLogin'); hideMe('addToFavOwner'); showMe('addToFavFailed'); } } function pollAnsBox($num){ alert($num); } function showRelatedVideos() { var tabRelatedVideos = document.getElementById('tabRelatedVideos'); var tabUservideos = document.getElementById('tabUserVideos'); tabUservideos.className = ""; tabRelatedVideos.className = "tabactive"; hideMe('userVideos'); showMe('relatedVideos'); } function showUserVideos() { var tabRelatedVideos = document.getElementById('tabRelatedVideos'); var tabUservideos = document.getElementById('tabUserVideos'); tabRelatedVideos.className = ""; tabUservideos.className = "tabactive"; hideMe('relatedVideos'); showMe('userVideos'); }