Advertisement
academo

Untitled

May 12th, 2011
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. jQuery( function() {
  4. {foreach $datos as $d}
  5. {if $d.framebreaker!="Si"}
  6.  
  7. {/if}
  8. {/foreach}
  9. });
  10. function hide(id){
  11. if($('#' + id).css('display')=="none"){
  12. $('#' + id).css('display', 'inline');
  13. }else{
  14. $('#' + id).css('display', 'none');
  15. }
  16. }
  17. var popwin
  18. var serv
  19. function popup(url, id){
  20. serv=id;
  21. popwin = window.open('index.php?Votaciones.popup&url=' + url, 'Voto_WoW_Sulvus', 'scrollbars=1,resizable=1,width=900,height=500,left=150,top=150');
  22. if(popwin!=null){
  23. }else{
  24. alert("Tienes un bloqueador de ventanas emergentes, desactivalo");
  25. }
  26. intimer = setInterval("intervalo()", 1000);
  27. }
  28. function intervalo(){
  29. if(popwin!=null){
  30. if(!popwin.closed){
  31. if(popwin.frames.length!=3){
  32. clearInterval(intimer);
  33. intimer=null;
  34. cargar('mensaje', 'Votaciones.validarVoto&servidor='+serv);
  35. popwin.close();
  36. }else{
  37. return;
  38. }
  39. }else{
  40. clearInterval(intimer);
  41. intimer=null;
  42. //alert("No debes cerrar la ventana antes de votar");
  43. }
  44. }
  45. }
  46. $(function() {
  47. $('a.showPopup').click(function(e) {
  48. e.preventDefault();
  49. var $this = $(this);
  50. var horizontalPadding = 15;
  51. var verticalPadding = 15;
  52. $('<iframe id="' + this.rel + '" src="' + this.href + '" />').dialog({
  53. title: ($this.attr('title')) ? $this.attr('title') : 'Site',
  54. autoOpen: true,
  55. width: 900,
  56. height: 500,
  57. modal: true,
  58. resizable: false,
  59. autoResize: true,
  60. overlay: {
  61. opacity: 0.5,
  62. background: "black"
  63. }
  64. }).width(900 - horizontalPadding).height(500 - verticalPadding);
  65. var iframeopen=0;
  66. var servidor=this.rel;
  67. $('#'+ this.rel).load( function(){
  68. if(iframeopen==0){
  69. iframeopen=1;
  70. alert("Recuerda escribir correctamente el código de verificación");
  71. }else{
  72. cargar('mensaje', 'Votaciones.validarVoto&servidor=' + servidor);
  73. }
  74. });
  75. });
  76. });
  77.  
  78. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement