$(document).ready(function() { // Display run Text start_ticking(); // Display Clock updateClock(); setInterval('updateClock()',1000); $('#asd').click(function (e) { e.preventDefault(); $('#win_login').modal({ overlayId:'simplelogin-overlay', containerId:'simplelogin-container' }); }); $('#b_login').click(function (e) { $.get('st_ref.php?set=login', function(data){ // create a modal dialog with the data $(data).modal({ // position: ["15%",], overlayId: 'simplelogin-overlay', containerId: 'simplelogin-container' }); }); return false; }); }); // RunText var tickdelay = 3000; //delay btw messages var highlightspeed = 10; //10 pixels at a time. var currentmessage = 0; var clipwidth = 0; function changetickercontent() { crosstick.style.clip="rect(0px 0px auto 0px)"; crosstick.innerHTML=tickercontents[currentmessage]; highlightmsg(); } function highlightmsg() { var msgwidth = crosstick.offsetWidth; if (clipwidth0) crosstickParent.style.height = crosstick.offsetHeight+'px'; else setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100); changetickercontent(); } // Clock function updateClock ( ) { var currentTime = new Date ( ); var currentHours = currentTime.getHours ( ); var currentMinutes = currentTime.getMinutes ( ); var currentSeconds = currentTime.getSeconds ( ); var currentDate = currentTime.getDate ( ); var currentMonthNum = currentTime.getMonth( ); var currentDayNum = currentTime.getDay( ); // Pad the minutes and seconds with leading zeros, if required currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes; currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds; // Choose either "AM" or "PM" as appropriate // var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM"; // Convert the hours component to 12-hour format if needed // currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours; // Convert an hours component of "0" to "12" currentHours = ( currentHours == 0 ) ? 12 : currentHours; // Compose the string for display // + " " + timeOfDay var currentTimeString = Dayarray[currentDayNum] + ", " + currentDate + langdot + Month_array[currentMonthNum] + " " + currentHours + ":" + currentMinutes ; // Update the time display document.getElementById("clock").firstChild.nodeValue = currentTimeString; }