<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
/* <![CDATA[ */
function checkTime(){
var months = {
'Jan': 0,
'Feb': 1,
'Mar': 2,
'Apr': 3,
'May': 4,
'Jun': 5,
'Jul': 6,
'Aug': 7,
'Sep': 8,
'Oct': 9,
'Nov': 10,
'Dec': 11
};
// Parse posted date
var posted = document.getElementById('Label1').innerHTML.split(/\s/g);
var pmonth = eval('months.' + posted[1]);
var pday = posted[2].replace(',','');
// Today's date pieces
var d = new Date();
var utc = d.getTime() + (d.getTimezoneOffset() * 60000);
var d2 = new Date(utc + (3600000*(-4)));
var month = d.getMonth();
var day = d.getDate();
var hour = d2.getHours();
alert(month + ' ' + pmonth + ':' + day + ' ' + pday);
if(pmonth == month && day >= pday){
if(hour > 21){
hideComments();
}
}else{
alert('second');
hideComments();
}
}
function hideComments(){
var elems = document.getElementsByTagName('*');
for(i = 0; i < elems.length; i++){
if(elems[i].className == 'js-LeaveComment'){
elems[i].style.display = 'none';
}
}
}
/* ]]> */
</script>
</head>
<body onload="checkTime();">
<h2 align="center"><big><span id="screen_name">The Afternoon Club</span> - <span id="Label1">Wednesday, Jun 23, 2010</span></big></h2>
<div class="js-LeaveComment">Leave a comment (Should hide)</div>
<div class="y">Leave a comment (Should show)</div>
<div class="js-LeaveComment">Leave a comment (Should hide)</div>
<div class="y">Leave a comment (Should show)</div>
<div class="js-LeaveComment">Leave a comment (Should hide)</div>
</body>
</html>
|