function callout(prod,prodname,x,y)
{
document.write
("<span style='color:blue;text-decoration:underline;' id='"+prod+"' onmouseover=xstooltip_show('tooltip_"+prod+"','"+prod+"',"+x+","+y+");xstooltip_hide('slideshow') onmouseout=xstooltip_hide('tooltip_"+prod+"');xstooltip_show('slideshow',"+160+","+350+")>"+prodname+"</span>")
}

function callout2(prod,prodname,x,y)
{
document.write
("<span style='color:blue;text-decoration:underline;' id='"+prod+"' onmouseover=xstooltip_show('tooltip_"+prod+"','"+prod+"',"+x+","+y+") onmouseout=xstooltip_hide('tooltip_"+prod+"')>"+prodname+"</span>")
}


function create_tooltip() 
{
   entries=arguments.length-2;
   if (entries<6)
   {
		col1=entries;
		col2=0;
		col3=0;
	}
   if (entries>5 && entries<15)
   {
		col1=Math.floor((entries+1)/2);
		col2=entries;
		col3=0;		
   }
   if (entries>14)
   {
	   col1=Math.floor((entries+2)/3);
	   col2=Math.floor((entries+1-col1)/2)+col1;
	   col3=entries;
   }

   document.write("<div  id='tooltip_"+arguments[0]+"' class='xstooltip' >")
   document.write("<h3>"+arguments[1]+"</h3>")
   /*document.write(arguments[2])*/
   document.write("<table width='450px' cellpadding=10px>")
   document.write("<tr style='vertical-align:top;'>")
  
   document.write("<td><ul>")
	   
   for (var i = 3, j = col1+2; i < j; i++)
	{
        document.write("<li>"+arguments[i]+'</li>');
	//	alert(arguments[i]);
    }
    document.write('</ul></td>');

   if (col2>0)
   {
	 document.write("<td><ul>")
	   
   for (var i = col1+2, j = col2+2; i < j; i++)
	{
        document.write("<li>"+arguments[i]+'</li>');
	//	alert(arguments[i]);
    }
    document.write('</ul></td>');
    }

   if (col3>0)
   {
	 document.write("<td><ul>")
	   
   for (var i = col2+2, j = col3+2; i < j; i++)
	{
        document.write("<li>"+arguments[i]+'</li>');
	//	alert(arguments[i]);
    }
    document.write('</ul></td>');
    }


    document.write('</tr>');
    document.write('</table>');
    document.write('</div>');
}


function create_text_tooltip() 
{
   document.write("<div  id='tooltip_"+arguments[0]+"' class='xstooltip' >")
   document.write("<b>"+arguments[1]+"</b><br /><br />")
   document.write(arguments[2])
   document.write('</div>');
}



function maps(msg)
	{
		status=msg; return true;
	
	 }

function redir()
{
	if(typeof parent.frames[0] == 'undefined') location = 'index.html';
}
function redir1(targetpage)
{
	if (!targetpage) targetpage='index.html';
	if(typeof parent.frames[0] == 'undefined') location = targetpage;
}

function xstooltip_findPosX(obj) 
{
  var curleft = 0;
  if (obj.offsetParent) 
  {
    while (obj.offsetParent) 
        {
            curleft += obj.offsetLeft
            obj = obj.offsetParent;
        }
    }
    else if (obj.x)
        curleft += obj.x;
  // alert (curleft);
    return curleft;
}


function xstooltip_findPosY(obj) 
{
    var curtop = 0;
    if (obj.offsetParent) 
    {
        while (obj.offsetParent) 
        {
            curtop += obj.offsetTop
            obj = obj.offsetParent;
        }
    }
    else if (obj.y)
        curtop += obj.y;
	//alert (curtop);
	return curtop;
}


function xstooltip_show(tooltipId, parentId, posX, posY)
{
    it = document.getElementById(tooltipId);
    
    if ((it.style.top == '' || it.style.top == 0) 
        && (it.style.left == '' || it.style.left == 0))
    {
        // need to fixate default size (MSIE problem)
        //it.style.width = it.offsetWidth + 'px';
        //it.style.height = it.offsetHeight + 'px';
        
        img = document.getElementById(parentId); 
    
        // if tooltip is too wide, shift left to be within parent 
        //if (posX + it.offsetWidth > img.offsetWidth) posX = img.offsetWidth - it.offsetWidth;
        //if (posX < 0 ) posX = 0; 
        
        x = xstooltip_findPosX(img) + posX ;
        y = xstooltip_findPosY(img) + posY ;
       
	   // x =  posX ;
       // y =  posY ;

       
        it.style.top = y + 'px';
        it.style.left = x + 'px';


		//alert(it.style.top);
       // alert(it.style.left);

        
    }
    
    it.style.visibility = 'visible'; 
}


function xstooltip_hide(id)
{
	it = document.getElementById(id); 
	it.style.visibility = 'hidden';
	/*var t=setTimeout("it.style.visibility = 'hidden'",5000);*/
}

function pic_show(id,par,x,y)
{
	posX= xstooltip_findPosX(par) + x ;
    posY = xstooltip_findPosY(par) + y ;
	pic = document.getElementById(id); 
	pic.style.top = posY + 'px';
    pic.style.left = posX + 'px';
	pic.style.visibility = 'visible';
}

function pic_hide(id)
{
	pic = document.getElementById(id); 
	pic.style.visibility = 'hidden';
}



function retMonth()
{
	var time = new Date();
	var month = time.getMonth();
	switch (month) 
{
case 0:
monthName = "January";
orgMonth = "National Volunteer Blood Donor Month";
linkMonth = "http://www.aabb.org/Content/Donate_Blood/Donate_Blood_Public_Education_Initiatives/National_Blood_Donor_Month/";
break;
case 1:
monthName = "February";
orgMonth = "National Heart Month";
linkMonth = "http://www.americanheart.org ";
break;
case 2:
monthName = "March";
orgMonth = "National Colorectal Cancer Awareness Month";
linkMonth = "http://www.preventcancer.org/colorectal";
break;
case 3:
monthName = "April";
orgMonth = "National Donate Life Month";
linkMonth = "http://organdonor.gov/get_involved/donatelifemonth.htm";
break;
case 4:
monthName = "May";
orgMonth = "Asthma and Allergy Awareness Month";
linkMonth = "http://www.aafa.org";
break;
case 5:
monthName = "June";
orgMonth = "National Headache Awareness Month";
linkMonth = "http://www.headaches.org";
break;
case 6:
monthName = "July";
orgMonth = "UV Safety Month";
linkMonth = "http://familydoctor.org/online/famdocen/home/tools/reviews/0706.html";
break;
case 7:
monthName = "August";
orgMonth = "National Immunization Awareness Month";
linkMonth = "http://www.cdc.gov/vaccines/events/niam/default.htm";
break;
case 8:
monthName = "September";
orgMonth = "National Cholesterol Education Month";
linkMonth = "http://www.americanheart.org/presenter.jhtml?identifier=3033059";
break;
case 9:
monthName = "October";
orgMonth = "National Breast Cancer Awareness Month";
linkMonth = "http://www.nbcam.org/about_nbcam.cfm";
break;
case 10:
monthName = "November";
orgMonth = "Lung Cancer Awareness Month";
linkMonth = "http://www.lungcanceralliance.org";
break;
case 11:
monthName = "December";
orgMonth = "National Drunk and Drugged Driving Prevention Month  ";
linkMonth = "http://www.cdc.gov/ncipc/duip/spotlite/3d.htm";
break
}

	return("<a href='"+linkMonth+"' target='_blank'><img src='images/months/"+ monthName +".jpg'><br /><i>"+orgMonth+"</i>.<br /> Click Here</a>.");
}
		


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=500');");
}



function validate_passwords(thisform)
{
	if (thisform.pass.value.length == 0 || thisform.pass2.value.length == 0)
	{
		alert ("You must enter your new password in both boxes.");
		return false;
	}
	
		if (thisform.pass.value == "hbdrugs")
	{
		alert ("Invalid Password. Please choose another value.");
		return false;
	}


	if (thisform.pass.value != thisform.pass2.value)
	{
		alert ("Passwords do not match.  Please try again.");
		return false;
	}
}

function validate_profile(thisform)
{

if (thisform.full_name.value.length==0 && thisform.email.value.length==0)
	{
	alert ("Name is required.")
	return false;
	}

var agree=confirm("Continue with udpate?");
	if (agree)
		return true ;
	else
		thisform.newvalue.value=oldvalue;
		return false ;
		
		}


function validate_allfields(thisform)
{

if (thisform.phone.value.length==0 && thisform.email.value.length==0)
	{
	alert ("Either Phone number or Email is required.")
	return false;
	}

for (j=0; j<thisform.elements.length; j++)
	{
		var fld = thisform.elements[j].value;
		var nme = thisform.elements[j].name;

	
		
		while (fld.indexOf("'") >-1) 
			{
			var fld = fld.replace("'","");
			}

		while (fld.indexOf('"') >-1) 
			{
			var fld = fld.replace('"','');
			}

		thisform.elements[j].value=fld;

		if (thisform.elements[j].title=="Required Field")
			{
			if (fld.length==0)
				{	
				alert( nme + " is a required field");
				thisform.elements[j].focus();
				return false;
				}
			}
		
		 
		if (nme=="phone")
			{	
			 
			if (fld.length>0)
				{
				phonehold=fld
				}
			}

		if (nme=="website")
			{	
			 
			if (fld.length>0)
				{
				if (validateWWW(fld)=='invalid')
					{
					thisform.elements[j].focus();
					return false;
					}
				}
			}

		if (nme=="email")
			{	
			if (fld.length>0)
				{
					emailhold=fld
					if (validateEmail(fld)=='invalid')
						{
					thisform.elements[j].focus();
					return false;
					}
				}
			}
	}
}

// Email Validation Javascript
// copyright 23rd March 2003, by Stephen Chapman, Felgall Pty Ltd

// You have permission to copy and use this javascript provided that
// the content of the script is not changed in any way.

function validateEmail(addr)
{
	var invalidChars = '\/\'\\ ";:?!()[]\{\}^|';
	for (i=0; i<invalidChars.length; i++)
	{
	   if (addr.indexOf(invalidChars.charAt(i),0) > -1)
	   {
		  alert('Email address contains invalid character(s).');
		  return "invalid";
	   }
	}
	for (i=0; i<addr.length; i++) 
	{
	   if (addr.charCodeAt(i)>127) 
	   {
		  alert("Email address contains invalid character(s).");
		  return "invalid";
	   }
	}

	var atPos = addr.indexOf('@',0);
	if (atPos == -1) 
	{
	   alert('Email address must contain an @');
	   return "invalid";
	}
	if (atPos == 0) 
	{
	   alert('Email address must not start with @');
	   return "invalid";
	}
	if (addr.indexOf('@', atPos + 1) > - 1) 
	{
	   alert('Email address must contain only one @');
	   return "invalid";
	}
	if (addr.indexOf('.', atPos) == -1) 
	{
	   alert('Email address must contain a period in the domain name');
	   return "invalid";
	}
	if (addr.indexOf('@.',0) != -1) 
	{
	   alert('Period must not immediately follow @ in email address');
	   return "invalid";
	}
	if (addr.indexOf('.@',0) != -1)
	{
	   alert('Period must not immediately precede @ in email address');
	   return "invalid";
	}
	if (addr.indexOf('..',0) != -1) 
	{
	   alert('Two periods must not be adjacent in email address');
	   return "invalid";
	}

}

function validateWWW(addr) 
{	
	 
	var pieces=addr.split('.');
	if (pieces[0]!="www")
	{
		alert("Website address must start with www");
		return "invalid";
	}
	if (pieces.length<3)
	{
		alert("Website address must be in the format - www.xxxxx.yyy");
		return "invalid";
	}

}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function getBgn() {


pdy = new Date();        // today
pmo = pdy.getMonth();    // present month
pyr = pdy.getYear();     // present year
if (pyr < 2000)    // Y2K Fix, Isaac Powell
pyr = pyr + 1900; // http://onyx.idbsu.edu/~ipowell
yr = yr1 = (pmo==0?pyr-1:pyr); // last month's year
mo = (pmo==0?11:pmo-1);  // last month
bgn = new Date(M[mo]+" 1,"+yr1); // assign to date
document.write('<TABLE BORDER=0 cellpadding=5><TR><TD VALIGN=TOP>');
//Calendar();           // Send last month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = pyr;                // present year
mo = pmo;                // present month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(evd,evm,evy);           // Send this month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = (pmo==11?pyr+1:pyr); // next month's year
mo = (pmo==11?0:pmo+1);   // next month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(evd,evm,evy);           // Send this month to screen
document.write('</TD><TD VALIGN=TOP>');
yr = (pmo==11?pyr+2:pyr); // next month's year
mo = (pmo==11?0:pmo+2);   // next month
bgn = new Date(M[mo]+" 1,"+yr); // assign to date
Calendar(evd,evm,evy);           // Send this month to screen
document.write('</TD></TR></TABLE>'); // Finish up
}

function Calendar(evd,evm,evy)
{
dy = bgn.getDay();
yr = eval(yr);
d = "312831303130313130313031";

if (yr / 4 == Math.floor(yr / 4)) {
d = d.substring(0, 2) + "29" + d.substring(4, d.length);
}

pos = (mo * 2);
ld = eval(d.substring(pos, pos + 2));

document.write("<TABLE BORDER=1"
+ " BGCOLOR='" + bg
+ "'><TR><TD ALIGN=CENTER COLSPAN=7  class=cal_head>"
+ M[mo] + " " + yr 
+ "</TD></TR><TR><TR>");

for (var i = 0;i < 7;i ++) 
{
	document.write("<TD ALIGN=CENTER>"
	+"<FONT SIZE="+fs+">" + D[i] + "</FONT></TD>");
}

document.write("</TR><TR>");

ctr = 0;
for (var i = 0;i < 7; i++)
{
	if (i < dy)
	{
		document.write("<TD ALIGN=CENTER>"
		+"<FONT SIZE=" + fs + "> &nbsp;</FONT>"
		+"</TD>");
	}
	else 
	{
		ctr++;
		typ="";
		bgc="white";
		titl="";
		hropen="";
		hrclose="";

		if (i==2222)
		{
			titl=" Free Blood Pressure Screening";
			bgc="#00FFFF";
			hropen="<a href='flyers/bloodpressure.pdf'" +
			" onmouseover=xstooltip_show('tooltip_bloodpressure','bloodpressure',300,200);change_color('bloodpressure','red');"+
			" onmouseout=xstooltip_hide('tooltip_bloodpressure');change_color('bloodpressure','black');" +
			" target=_blank id=bloodpressure>" ;
			hrclose="</a>";
		}
		for (j=0;j<evd.length;j++)
		{
			if (yr==evy[j] && mo==(evm[j]-1) && ctr==evd[j]) 
					{
					titl=evdesc[j];
					bgc="#FFCCFF";
					hropen="<a href='flyers/"+evflyer[j]+".pdf'"+
					" onmouseover=xstooltip_show('tooltip_"+evflyer[j]+"','"+evflyer[j]+"',300,200);"+
					" onmouseout=xstooltip_hide('tooltip_"+evflyer[j]+"');" +
					" target=_blank id="+evflyer[j]+">";
					hrclose="</a>";

					}
		  }
	

		
		
		
		
		document.write("<TD  class=cal_day title='"+titl+" - click for more information.'   style=background-color:"+bgc+";>" 
		+ hropen +  ctr + hrclose 
		+ "</TD>");
	 }
}
document.write("</TR><TR>");

while (ctr < ld) 
{
	for (var i = 0;i < 7; i++)
	{
		ctr++;
		if (ctr > ld)
		{
			document.write("<TD ALIGN=CENTER>"
			+ " </TD>");
		}

		else 
		{
		hropen="";
		hrclose="";
		bgc="white";
		titl="";
		if (i==2222)
				{
				titl="Free Blood Pressure Screening";
				bgc="#00FFFF";
				hropen="<a href='flyers/bloodpressure.pdf'" +
				" onmouseover=xstooltip_show('tooltip_bloodpressure','bloodpressure',300,200);change_color('bloodpressure','red');"+
				" onmouseout=xstooltip_hide('tooltip_bloodpressure');change_color('bloodpressure','black');" +
				" target=_blank id=bloodpressure>" ;
				hrclose="</a>";

				}
		if (i==4 && (ctr>14 && ctr<22))
				{
				bgc="yellow";
				titl=" Free Cholesterol Screening";
				hropen="<a href='flyers/cholesterol.pdf'"+
				" onmouseover=xstooltip_show('tooltip_cholesterol','cholesterol',300,200);change_color('cholesterol','red');"+
				" onmouseout=xstooltip_hide('tooltip_cholesterol');change_color('cholesterol','black');" +
				" target=_blank id=cholesterol>" ;
				hrclose="</a>";
				}
		for (j=0;j<evd.length;j++)
		{
			if (yr==evy[j] && mo==(evm[j]-1) && ctr==evd[j]) 
					{
					titl=evdesc[j];
					bgc="#FFCCFF";
					hropen="<a href='flyers/"+evlink[j]+"'"+
					" onmouseover=xstooltip_show('tooltip_"+evflyer[j]+"','"+evflyer[j]+"',300,200);change_color('"+evflyer[j]+"','red');"+
					" onmouseout=xstooltip_hide('tooltip_"+evflyer[j]+"');change_color('"+evflyer[j]+"','black');" +
					" target=_blank id="+evflyer[j]+">";
					hrclose="</a>";
					}					
		  }
	
		document.write("<TD class=cal_day title='"+titl+" - click for more information.'  style=background-color:"+bgc+";>" 
		+ hropen + ctr + hrclose +  "</TD>");
	}
}
document.write("</TR><TR>");
}
document.write("</TR></TABLE>");
}


function change_color(id,cl)
{
	var label_id=id+"_text";
	//alert (label_id);
    labelx = document.getElementById(label_id);
	labelx.style.color=cl;
	//it.style.border="1px solid #f00";
}

function chgImg()
{
		ImgNum1 = ImgNum1 + 1;
		ImgNum2 = ImgNum2 + 1;
		ImgNum3 = ImgNum3 + 1;
		ImgNum4 = ImgNum4 + 1;
		ImgNum5 = ImgNum5 + 1;
		ImgNum6 = ImgNum6 + 1;
		ImgNum7 = ImgNum7 + 1;
		ImgNum8 = ImgNum8 + 1;
		ImgNum9 = ImgNum9 + 1;
		if (ImgNum1 > ImgLength) {ImgNum1 = 0;}
		if (ImgNum2 > ImgLength) {ImgNum2 = 0;}
		if (ImgNum3 > ImgLength) {ImgNum3 = 0;}
		if (ImgNum4 > ImgLength) {ImgNum4 = 0;}
		if (ImgNum5 > ImgLength) {ImgNum5 = 0;}
		if (ImgNum6 > ImgLength) {ImgNum6 = 0;}
		if (ImgNum7 > ImgLength) {ImgNum7 = 0;}
		if (ImgNum8 > ImgLength) {ImgNum8 = 0;}
		if (ImgNum9 > ImgLength) {ImgNum9 = 0;}
		document.img1.src = NewImg[ImgNum1];
		document.img2.src = NewImg[ImgNum2];
		document.img3.src = NewImg[ImgNum3];
		document.img4.src = NewImg[ImgNum4];
		document.img5.src = NewImg[ImgNum5];
		document.img6.src = NewImg[ImgNum6];
		document.img7.src = NewImg[ImgNum7];
		document.img8.src = NewImg[ImgNum8];
		document.img9.src = NewImg[ImgNum9];
		document.getElementById('link1').href=urlLink[ImgNum1];
		document.getElementById('link2').href=urlLink[ImgNum2];
		document.getElementById('link3').href=urlLink[ImgNum3];
		document.getElementById('link4').href=urlLink[ImgNum4];
		document.getElementById('link5').href=urlLink[ImgNum5];
		document.getElementById('link6').href=urlLink[ImgNum6];
		document.getElementById('link7').href=urlLink[ImgNum7];
		document.getElementById('link8').href=urlLink[ImgNum8];
		document.getElementById('link9').href=urlLink[ImgNum9];
		}

function chgImg6()
{
		ImgNum1 = ImgNum1 + 1;
		ImgNum2 = ImgNum2 + 1;
		ImgNum3 = ImgNum3 + 1;
		ImgNum4 = ImgNum4 + 1;
		ImgNum5 = ImgNum5 + 1;
		ImgNum6 = ImgNum6 + 1;
		if (ImgNum1 > ImgLength) {ImgNum1 = 0;}
		if (ImgNum2 > ImgLength) {ImgNum2 = 0;}
		if (ImgNum3 > ImgLength) {ImgNum3 = 0;}
		if (ImgNum4 > ImgLength) {ImgNum4 = 0;}
		if (ImgNum5 > ImgLength) {ImgNum5 = 0;}
		if (ImgNum6 > ImgLength) {ImgNum6 = 0;}
		document.img1.src = NewImg[ImgNum1];
		document.img2.src = NewImg[ImgNum2];
		document.img3.src = NewImg[ImgNum3];
		document.img4.src = NewImg[ImgNum4];
		document.img5.src = NewImg[ImgNum5];
		document.img6.src = NewImg[ImgNum6];
		document.getElementById('link1').href=urlLink[ImgNum1];
		document.getElementById('link2').href=urlLink[ImgNum2];
		document.getElementById('link3').href=urlLink[ImgNum3];
		document.getElementById('link4').href=urlLink[ImgNum4];
		document.getElementById('link5').href=urlLink[ImgNum5];
		document.getElementById('link6').href=urlLink[ImgNum6];
		}

function chgBanner()
{
		bannerNum = bannerNum + 1;
		if (bannerNum > 2) {bannerNum = 0;}
		
		document.banner.src = newBanner[bannerNum];

		document.getElementById('bannerLink').href=bannerLinks[bannerNum];
}



function autoBanner()
{
chgBanner();
setInterval ( "chgBanner()", 3500 );
}

function autoHome()
{
chgHomepic();
setInterval ( "chgHomepic()", 3000 );
}

function chgHomepic()
{
		document.homePic.src = newHomepic[picNum];
		picNum = picNum + 1;
		if (picNum > 9) {picNum = 0;}
		

		
}




function auto()
{
chgImg();
setInterval ( "chgImg()", 2000 );
}

function auto6()
{
chgImg6();
setInterval ( "chgImg6()", 2000 );
}

function redir(page){
    window.location = page;
}





