Advertisement
Doubt

Adsense code - ©2011 Doubt

Nov 19th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.27 KB | None | 0 0
  1. <script type="text/javascript">
  2. function toggle(div_id) {
  3.     var el = document.getElementById(div_id);
  4.     if ( el.style.display == 'none' ) { el.style.display = 'block';}
  5.     else {el.style.display = 'none';}
  6. }
  7. function blanket_size(popUpDivVar) {
  8.     if (typeof window.innerWidth != 'undefined') {
  9.         viewportheight = window.innerHeight;
  10.     } else {
  11.         viewportheight = document.documentElement.clientHeight;
  12.     }
  13.     if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
  14.         blanket_height = viewportheight;
  15.     } else {
  16.         if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
  17.             blanket_height = document.body.parentNode.clientHeight;
  18.         } else {
  19.             blanket_height = document.body.parentNode.scrollHeight;
  20.         }
  21.     }
  22.     var blanket = document.getElementById('blanket');
  23.     blanket.style.height = blanket_height + 'px';
  24.     var popUpDiv = document.getElementById(popUpDivVar);
  25.     popUpDiv_height=blanket_height/2-600;//150 is half popup's height
  26.     popUpDiv.style.top = popUpDiv_height + 'px';
  27. }
  28. function window_pos(popUpDivVar) {
  29.     if (typeof window.innerWidth != 'undefined') {
  30.         viewportwidth = window.innerHeight;
  31.     } else {
  32.         viewportwidth = document.documentElement.clientHeight;
  33.     }
  34.     if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
  35.         window_width = viewportwidth;
  36.     } else {
  37.         if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
  38.             window_width = document.body.parentNode.clientWidth;
  39.         } else {
  40.             window_width = document.body.parentNode.scrollWidth;
  41.         }
  42.     }
  43.     var popUpDiv = document.getElementById(popUpDivVar);
  44.     window_width=window_width/2-300;//150 is half popup's width
  45.     popUpDiv.style.left = window_width + 'px';
  46. }
  47. function popup(windowname) {
  48.     blanket_size(windowname);
  49.     window_pos(windowname);
  50.     toggle('blanket');
  51.     toggle(windowname);    
  52. }
  53. </script>
  54.  
  55.  
  56.  
  57. <!-- START HTML CODE -->
  58.  
  59. <div id="blanket" style="display:none;"></div>
  60. <div id="popUpDiv" style="display:none;" align="right">
  61. <a href="#" onclick="popup('popUpDiv')">
  62. <font size=2>Close</font></a>
  63. <br />
  64.  
  65. <!-- AD CODE HERE -->
  66.  
  67. <br />
  68. <font size=2>Please click the ad. Thanks.
  69. <a href=PAGETOGOTO.php>Done</a>
  70. </font>
  71. </div>
  72.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement