...

View Full Version : calling a .js file wont load



barkermn01
06-17-2008, 04:59 PM
I have main.js


var n_year;
var oldobj;
var days = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

function isLeap(now_year){
var lyear = 2008;
while(lyear < now_year)
{
lyear + 4;
}
if(now_year == lyear)
{
days[2] = 29;
}

}

var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

function set_active(id){
var obj=document.getElementById(id);
if (!obj.saveclass){
obj.saveclass=obj.className;
}
if (oldobj&&oldobj!=obj)
{
oldobj.className=oldobj.saveclass;
}
oldobj=obj;
oldobj.className = 'style3';
}

function pre_year(){
year--;
document.getElementById("year").innerHTML = year;
isLeap(year);
if(month < 1) month = 12;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="cal1c(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
}

function nxt_year(){
year++;
isLeap(year);
document.getElementById("year").innerHTML = year;
if(month < 1) month = 12;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="cal1c(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
}

function pre_month(){
month--;
isLeap(year);
if(month < 1) month = 12;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="cal1c(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
}

function nxt_month(){
month++;
isLeap(year);
if(month > 12) month = 1;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}

}


var Sday;

function calc(dd){
if(dd&&dd != ''){
Sday = dd;
}
else{
dd = Sday;
}
document.getElementById("date").value = dd+'/'+month+'/'+year;
}

function booked(Tid){
document.getElementById(Tid).className = 'style5';
document.getElementById(Tid).innerHTML = '1';
}

function body_onload(){
<?=$locked?>
}
var old_style
function on_hover(id){
old_style = id.className;
id.className = 'style1';
}
function on_hover_off(id){
id.className = old_style;
}

// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = '1.jpg'
Pic[1] = '2.jpg'
Pic[2] = '3.jpg'


// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}


And this is loaded into the HTML page with code


<script language="javascript" type="text/javascript" src="main.js"></script>


but for some reason the called function just wont work get the object exspected error

Philip M
06-17-2008, 05:11 PM
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}

missing } after this to terminate function

barkermn01
06-17-2008, 05:19 PM
that still dident work
http://img187.imageshack.us/img187/7673/tempes7.th.png

If some one can get hte code to work using less memory i can drop it into script tags on the page just IE started complaining about running slow

http://theriverside-york.evolve-ebusiness.co.uk/index-7-booking.php

Philip M
06-17-2008, 05:26 PM
lyear += 4;

barkermn01
06-17-2008, 05:33 PM
thanks that stoped the IE Error

But for some reason my script For the Leap Year wont work *function isLeap()*

if you could help me pls



var year = '<?=date("Y")?>';
var month = '<?=date("m")?>';
var n_year;
var oldobj;
var days = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

function isLeap(now_year){
var lyear = 2008;
while(lyear < now_year)
{
lyear += 4;
}
if(now_year != lyear)
{
days[2] = 29;
}

}

var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

function set_active(id){
var obj=document.getElementById(id);
if (!obj.saveclass){
obj.saveclass=obj.className;
}
if (oldobj&&oldobj!=obj)
{
oldobj.className=oldobj.saveclass;
}
oldobj=obj;
oldobj.className = 'style3';
}

function pre_year(){
year--;
document.getElementById("year").innerHTML = year;
isLeap(year);
if(month < 1) month = 12;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="cal1c(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
}

function nxt_year(){
year++;
isLeap(year);
document.getElementById("year").innerHTML = year;
if(month < 1) month = 12;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="cal1c(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
}

function pre_month(){
month--;
isLeap(year);
if(month < 1) month = 12;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="cal1c(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';

document.getElementById("31").innerHTML = '';
}
}

function nxt_month(){
month++;
isLeap(year);
if(month > 12) month = 1;
document.getElementById("month").innerHTML = months[month];
if(days[month] == 31){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '<a href="javascript:;" onclick="calc(31);">31</a>';
}
if(days[month] == 30){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '<a href="javascript:;" onclick="calc(30);">30</a>';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 29){
document.getElementById("29").innerHTML = '<a href="javascript:;" onclick="calc(29);">29</a>';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}
if(days[month] == 28){
document.getElementById("29").innerHTML = '';
document.getElementById("30").innerHTML = '';
document.getElementById("31").innerHTML = '';
}

}


var Sday;

function calc(dd){
if(dd&&dd != ''){
Sday = dd;
}
else{
dd = Sday;
}
document.getElementById("date").value = dd+'/'+month+'/'+year;
}

function booked(Tid){
document.getElementById(Tid).className = 'style5';
document.getElementById(Tid).innerHTML = '1';
}

function body_onload(){
<?=$locked?>
}
var old_style
function on_hover(id){
old_style = id.className;
id.className = 'style1';
}
function on_hover_off(id){
id.className = old_style;
}

var slideShowSpeed = 3000

var crossFadeDuration = 3

var Pic = new Array()

Pic[0] = '1.jpg'
Pic[1] = '2.jpg'
Pic[2] = '3.jpg'

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1))j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}
</script>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FE6215}
-->
</style>
</head>
<body onLoad="runSlideShow(); pre_month();">
<table class="first" align="center">
<tr>
<td><img alt="" src="images/w1.gif"></td>
<td>
<table class="w" style="background:url(images/w3.gif);">
<tr><td><img alt="" src="images/w2.gif"></td>
<td class="w"></td>
<td><img alt="" src="images/w4.gif"></td></tr>
</table> </td>
<td><img alt="" src="images/w5.gif"></td>
</tr>
<tr>
<td>
<table class="h" style="background:url(images/w6_.gif);">
<tr><td><img alt="" src="images/w6.gif"></td></tr>
<tr><td class="h"></td></tr>
<tr><td><img alt="" src="images/w8.gif"></td></tr>
</table> </td>
<td class="w h">
<table class="block">
<tr><td>
<table class="w">
<tr>
<td class="hed"><a href="index.html"><img src="images/log.gif" alt="" width="218" height="82"></a></td>
<td><img src="1.jpg" name='SlideShow' width=382 height=218></td>
</tr>
</table>
</td></tr>
<tr>
<td class="menu"><a href="index-1-home.html">Home</a><img alt="" src="images/bull.gif"><a href="index-2-about-us.html">About Us</a><img alt="" src="images/bull.gif"><a href="index-3-accomodation.html">Accommodation</a><img alt="" src="images/bull.gif"><a href="index-3-services.html">Services</a><img alt="" src="images/bull.gif"><a href="index-7-booking.html">Booking</a><img alt="" src="images/bull.gif"><a href="index-6-contacts.html">Contacts</a> </td>
</tr>
<tr><td class="h">
<table class="cont">
<tr><td><span class="h1"><img src="images/7t-booking.gif" alt="" width="159" height="18"></span></td>
</tr>
<tr>
<td style="padding:0px 0px 0px 58px">
<script type="text/javascript" src="http://www.rsolunas.de/javascripts/thickbox/jquery.js"></script> <script type="text/javascript" src="http://www.rsolunas.de/javascripts/thickbox/thickbox.js"></script> <link rel="stylesheet" href="http://www.rsolunas.de/javascripts/thickbox/thickbox.css" type="text/css" media="screen" /> <a href="http://rsolunas.de/public/show_form?user_id=4231&TB_iframe=true&height=600&width=800" class="thickbox style1" ><br>
</a><link href="master.css" rel="stylesheet" type="text/css" />
<body onLoad="body_onload();">
<table width="350" height="245" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<tr height="35px">
<td height="35" colspan="2" align="center" bordercolor="#3C413C" class="style5" id=""><a href="javascript:;" onclick="pre_year(); calc();"><strong>&lt;</strong>&lt;</a></td>
<td colspan="3" align="center" bordercolor="#3C413C" class="style5" id=""><span id="year"><?=date("Y")?></span></td>
<td colspan="2" align="center" bordercolor="#3C413C" class="style5" id=""><a href="javascript:;" onclick="nxt_year(); calc();">&gt;<strong>&gt;</strong></a></td>
</tr>
<tr height="35px">
<td colspan="2" align="center" bordercolor="#D5EDFA" class="style4" id=""><a href="javascript:;" onclick="pre_month(); calc();"><strong>&lt;</strong>&lt;</a></td>
<td height="35" colspan="3" align="center" bordercolor="#D5EDFA" class="style4" id=""><span id="month"></span></td>
<td colspan="2" align="center" bordercolor="#D5EDFA" class="style4" id=""><a href="javascript:;" onclick="nxt_month(); calc();">&gt;<strong>&gt;</strong></a></td>
</tr>
<tr height="35px">
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="1.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('1.1'); calc(01);">1</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="2.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('2.1'); calc(02);">2</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="3.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('3.1'); calc(03);">3</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="4.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('4.1'); calc(04);">4</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="5.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('5.1'); calc(05);">5</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="6.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('6.1'); calc(06);">6</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="7.1" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('7.1'); calc(07);">7</a></td>
</tr>
<tr height="35px">
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="1.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('1.2'); calc(08);">8</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="2.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('2.2'); calc(09);">9</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="3.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('3.2'); calc(10);">10</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="4.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('4.2'); calc(11);">11</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="5.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('5.2'); calc(12);">12</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="6.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('6.2'); calc(13);">13</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="7.2" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('7.2'); calc(14);">14</a></td>
</tr>
<tr height="35px">
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="1.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('1.3'); calc(15);">15</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="2.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('2.3'); calc(16);">16</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="3.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('3.3'); calc(17);">17</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="4.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('4.3'); calc(18);">18</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="5.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('5.3'); calc(19);">19</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="6.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('6.3'); calc(20);">20</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="7.3" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('7.3'); calc(21);">21</a></td>
</tr>
<tr height="35px">
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="1.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('1.4'); calc(22);">22</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="2.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('2.4'); calc(23);">23</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="3.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('3.4'); calc(24);">24</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="4.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('4.4'); calc(25);">25</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="5.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('5.4'); calc(26);">26</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="6.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('6.4'); calc(27);">27</a></td>
<td width="47" height="35" align="center" bordercolor="#FFFFFF" class="style1" id="7.4" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><a href="javascript:;" class="style1" onclick="set_active('7.4'); calc(28);">28</a></td>
</tr>
<tr height="35px">
<td width="47" height="35" align="center" class="style1" id="1.5" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><span id="29"><a href="javascript:;" onclick="set_active('1.5'); calc(29);"">29</a></span></td>
<td width="47" height="35" align="center" class="style1" id="2.5" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><span id="30"><a href="javascript:;" onclick="set_active('2.5'); calc(30);"">30</a></span></td>
<td width="47" height="35" align="center" class="style1" id="3.5" onmouseover="on_hover(this);" onmouseout="on_hover_off(this);"><span id="31"><a href="javascript:;" onclick="set_active('3.5'); calc(31);"">31</a></span></td>
<td colspan="4" align="center" class="" id="4.5"><input style="color: #000000;" type="text" name="date" /></td>
</tr>
</table>
<div><br style="line-height:16px">
<span><a href="javascript:history.go(-1);">&lt;&lt; Back</a></span> </td>
</tr>
</table>
</td></tr>
</table> </td>
<td>
<table class="h" style="background:url(images/w7_.gif);">
<tr><td><img alt="" src="images/w7.gif"></td></tr>
<tr><td class="h"></td></tr>
<tr><td><img alt="" src="images/ww7.gif"></td></tr>
</table> </td>
</tr>
<tr>
<td><img alt="" src="images/w9.gif"></td>
<td>
<table class="w" style="background:url(images/w11.gif);">
<tr>
<td><img alt="" src="images/w10.gif"></td>
<td class="w"></td>
<td><img alt="" src="images/w12.gif"></td>
</tr>
</table> </td>
<td><img alt="" src="images/w13.gif"></td>
</tr>
<tr>
<td colspan="3" class="foot">The Riverside - York&nbsp;<span>&copy; </span>2008 web solution by <a href="http://www.evolve-ebusiness.com" target="_blank">Evolve eBusiness</a><br>
<a href="index-7-privacy.html">privacy policy</a>&nbsp;| <a href="index-7-terms.html">terms of use</a> | <a href="index-7-site-map.html">site map</a> | <a href="index.html">home</a></td>
</tr>
</table>
</body>
</html>

Philip M
06-17-2008, 06:24 PM
var lyear = 2008;

Javascript variables may contain a digit but may not begin with a digit.

If this is in fact letter l and not the digit 1 then that is OK, but is is not a good idea to use l and o in variable names in this way. Too easy to type the wrong one.



function
isLeap(now_year){
var lpyear = 1994;
while(lpyear < now_year)
{
lpyear += 4;
}
if(now_year == lpyear) // i.e the current year is a leap year

{
days[2] = 29;
}
}


But why not simply divide the year by 4, and if no remainder then it is a leap year (except 2000)


i raed a wlihe ago taht as lnog as the frsit and lsat lttesrs in a wrod are in the cerroct pcale msot of us wulod siltl be albe to raed bceause our barnis jsut looks at the frsit and lsat lttesrs.

barkermn01
06-18-2008, 09:38 AM
so what do some thing like


isLeap(now_year){
while(now_year > 4)
{
now_year - 4;
}
if(now_year == 0)
{
days[3] = 29;
}else{
days[3] = 28;
}
}


i got a loops problem

http://theriverside-york.evolve-ebusiness.co.uk/index-7-booking.php

IE is running slow

so i now have a dividing but how the hell do i check for a remender i hav used google and allwasy see


var a = 2;
var b = 3;

remainder = a%b

Philip M
06-18-2008, 01:33 PM
so i now have a dividing but how the hell do i check for a remender i hav used google and allwasy see


var a = 2;
var b = 3;

remainder = a%b


a%b has a remainder of 2, as 3 goes into 2 zero times with 2 over.

You perhaps mean b%a which gives a remainder of 1.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum