  
var posit=150;
var speed = 5;
function next() {

    if (posit > 150) {
	speed = -speed;
	if (document.layers) {
  	   document.layers[0].visibility='show'; 
           document.layers[1].visibility='show';  
        }
        else {
	   document.all["ball"].style.visibility='visible';
	   document.all["ball2"].style.visibility='visible';	
        }
    }
    if (posit < 0) {
	speed = -speed;
	if (document.layers) {
  	   document.layers[0].visibility='show'; 
           document.layers[1].visibility='show';  
        }
        else {
	   document.all["ball"].style.visibility='visible';
	   document.all["ball2"].style.visibility='visible';	
        }
    }
    posit +=speed;

    if (document.layers) {
       document.layers[0].left = posit;
       document.layers[1].left = posit;
    }
    else {
       ball.style.left = posit;
       ball2.style.left = posit;
    }
    window.setTimeout("next();",10);
 } 

 
 
function playSound()
{
	if (navigator.appName == "Netscape")
	{
	document.write("this page has a sound not supported by your Netscape browser. Microsoft Internet Explorer is recommended");
	}
	else
	{
	function startSound() 
		{
		if (document.mySound != null && document.mySound.IsReady())
			{
				document.mySound.play(false);
			}
		}
	}
}

if (document.images)
{	Home_off = new Image
	Home_on = new Image
	Divisions_off = new Image
	Divisions_on = new Image
	Products_off = new Image 
	Products_on = new Image  	 
	Contact_off = new Image 
	Contact_on = new Image 

	Home_off.src = "images/photos/Home_off.jpg"
	Home_on.src = "images/photos/Home_on.jpg"
	Divisions_off.src = "images/photos/Divisions_off.jpg"
	Divisions_on.src = "images/photos/Divisions_on.jpg"
	Products_off.src = "images/photos/Products_off.jpg"
	Products_on.src = "images/photos/Products_on.jpg"  
	Contact_off.src = "images/photos/Contact_off.jpg" 
	Contact_on.src = "images/photos/Contact_on.jpg" 
}
function chgImg(imgField,newImg)
{	if (document.images)
	{	document[imgField].src=eval(newImg+".src")
	}
}
 

today = new Date();
CurDay = new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")	

CurMonth = new Array ("January","February","March","April","May","June", "July","August","September","October","November","December")
 
CurYear = today.getYear();
if (CurYear <= 1000) {CurYear = CurYear + 1900};


 
function myvalidate() {
	if (document.myrequest.ContactName.value == "")
	{
		alert("please enter your name in NAME field!!!");
		document.myrequest.ContactName.focus();
		return false;
	}
	if (document.myrequest.ContactName.value.length < 3)
	{
		alert("please enter your name with more than 3 characters in NAME field!!!");
		document.myrequest.ContactName.focus();
		return false;
	}
	if (document.myrequest.ContactPhone.value == "")
	{
		alert("please enter your phone number in the PHONE field!!!");
		document.myrequest.ContactPhone.focus();
		return false;
	}
	if (document.myrequest.ContactEmail.value == "")
	{
		alert("please enter your electronic mail in the E-MAIL field!!!");
		document.myrequest.ContactEmail.focus();
		return false;
	}
	return true;
}

  

function show_products()
{
	document.all.products.style.display="";
	document.all.alarm.style.display="none";
	document.all.cctv.style.display="none";
	document.all.telephone.style.display="none";
	document.all.audio.style.display="none";
	document.all.video.style.display="none";
	document.all.vacuum.style.display="none";
	document.all.network.style.display="none";
	document.all.webdesign.style.display="none";
}

 


adImages1= new Array("images/photos/fingerprint.gif",
		     "images/photos/keypad.jpg",
		     "images/photos/P4computer.jpg",
		     "images/photos/cam2000.gif",
		     "images/photos/wireless.jpg")
thisAd1=0
imgCt1=adImages1.length

function rotate()
{	if (document.images)
	{	if (document.Banner1.complete)
		{	thisAd1++
			if (thisAd1 == imgCt1)
			{	thisAd1=0
			}
			document.Banner1.src=adImages1[thisAd1]
		}
		setTimeout("rotate()",3*1000)
	}
}


var message = " The compilation, dissemination or\n other use of this data is expressly\n prohibited without consent of\n            CASOFTCO";
function click(e)
{
	if (document.all)
	{	
		if (event.button == 2)
		{	alert(message);
			return false;
		}
	}
	if (document.layers)
	{
		if (e.which == 3)
		{	alert(message);
			return false;
		}
	}
}
if (document.layers)
{
	document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown = click;

	
function MM_preloadImages()
{
	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];
			}
	}
}
		
