dor396

Untitled

May 15th, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  3. <html lang="he" dir="rtl">
  4. <head>
  5.     <title>תמונות וסרטונים</title>
  6.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7.     <link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
  8.     <link rel="shortcut icon" href="images/favicon.ico" />
  9. <script type="text/javascript">
  10. if (window.XMLHttpRequest)
  11.   {// code for IE7+, Firefox, Chrome, Opera, Safari
  12.   xmlhttp=new XMLHttpRequest();
  13.   }
  14. else
  15.   {// code for IE6, IE5
  16.   xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  17.   }
  18. xmlhttp.open("GET","gallery.xml",false);
  19. xmlhttp.send();
  20. xmlDoc=xmlhttp.responseXML;
  21. x=xmlDoc.getElementsByTagName("PHOTO");
  22. y=xmlDoc.getElementsByTagName("MOVIE");
  23. j=0;
  24. i=0;
  25. function displayPHOTO()
  26. {
  27. srcp=(x[i].getElementsByTagName("SRCP")[0].childNodes[0].nodeValue);
  28. titlep=(x[i].getElementsByTagName("TITLEP")[0].childNodes[0].nodeValue);
  29. widthp=(x[i].getElementsByTagName("WIDTHP")[0].childNodes[0].nodeValue);
  30. heightp=(x[i].getElementsByTagName("HEIGHTP")[0].childNodes[0].nodeValue);
  31. txtp="<img src='"+srcp+"'alt='"+titlep+"' width='"+widthp+"' height='"+heightp+"'/><br />תיאור:" + titlep;
  32. document.getElementById("showPHOTO").innerHTML=txtp;
  33. }
  34. function displayMOVIE()
  35. {
  36. srcm=(y[j].getElementsByTagName("SRCM")[0].childNodes[0].nodeValue);
  37. titlem=(y[j].getElementsByTagName("TITLEM")[0].childNodes[0].nodeValue);
  38. widthm=(y[j].getElementsByTagName("WIDTHM")[0].childNodes[0].nodeValue);
  39. heightm=(y[j].getElementsByTagName("HEIGHTM")[0].childNodes[0].nodeValue);
  40. txtm="<iframe width='"+widthm+"' height='"+heightm+"' src='"+srcm+"' frameborder='0' allowfullscreen/></iframe><br />תיאור:" + titlem;
  41. document.getElementById("showMOVIE").innerHTML=txtm;
  42. }
  43. function nextp()
  44. {
  45. if (i<x.length-1)
  46.  {
  47.  i++;
  48.  displayPHOTO();
  49.  }
  50. }
  51.  
  52. function previousp()
  53. {
  54. if (i>0)
  55.   {
  56.   i--;
  57.   displayPHOTO();
  58.   }
  59. }
  60. function nextm()
  61. {
  62. if (j<y.length-1)
  63.  {
  64.  j++;
  65.  displayMOVIE();
  66.  }
  67. }
  68.  
  69. function previousm()
  70. {
  71. if (j>0)
  72.   {
  73.   j--;
  74.   displayMOVIE();
  75.   }
  76. }
  77. </script>
  78.   </head>
  79. <body onload="displayPHOTO(); displayMOVIE();">
  80. <div id="container">
  81. <jsp:include page="navbar.jsp"></jsp:include>
  82. <h1><u>הגלרייה</u></h1>
  83. <h2><u>תמונות מהמשחק:</u></h2>
  84. <div id='showPHOTO'></div>
  85. <input type="button" onclick="previousp()" value="<<" />
  86. <input type="button" onclick="nextp()" value=">>" />
  87. <h2><u>סרטונים מהמשחק:</u></h2>
  88. <div id='showMOVIE'></div>
  89. <input type="button" onclick="previousm()" value="<<" />
  90. <input type="button" onclick="nextm()" value=">>" />
  91. </div>
  92. </body>
  93. </html>
Advertisement
Add Comment
Please, Sign In to add comment