//MouseOver
var restoreArray = new Array();
var restoreCount = 0;
var restoreTimer = 0;

function  preloadImages  () {
	if  (preloadArray == null)  return;
	var imageObject;
	var fileName;
	count = preloadArray.length;
	for (index=0; index < count; index++) {
		fileName = preloadArray [index];
		imageObject = new Image();
		imageObject.src = fileName;
		preloadArray [index] = imageObject;
	}
}

function  replaceImage  (ImageName, FileName) {
	imageObject = eval ('document.' + ImageName);
	if  ((imageObject == null) || (FileName == null) || (FileName == ''))  return;
	if  (restoreArray != null) {
		restoreArray [restoreCount++] = imageObject.src;
		restoreArray [restoreCount++] = imageObject;
	}
	imageObject.src = FileName;
}

function  clearRestoreList  () {
	restoreCount = 0;
}

function  restoreImages  (DelaySeconds) {
	if  (restoreTimer > 0) {
		clearTimeout (restoreTimer);
		restoreTimer = 0;
	}
	if  ((restoreArray == null) || (restoreCount < 1))  return;
	if  (DelaySeconds > 0) {
		restoreTimer = window.setTimeout ('restoreImages ();', DelaySeconds * 1000);
		return;
	}
	while (restoreCount > 0) {
		imageObject = restoreArray [--restoreCount];
		fileName = restoreArray [--restoreCount];
		if  ((imageObject != null) && (fileName != null) && (fileName != ''))  imageObject.src = fileName;
	}
}

//Last Update
function ladate () {
	var year, month, day;
	var date = new Date();
	
	var year = date.getYear();
	var month = date.getMonth() + 1;
	var day = date.getDay();
	if (day==1) {
		day=day-2;
	}
	if (day==0) {
		day=day-2;
	}
	else {
		day=day-1
	}
	if (year<=200) year+= 1900;
	if (year<=1999) year+= 100;
	
	day= (day< 10 ? "0" : "") + day;
	month= (month< 10 ? "0" : 0) + month;
	return (day+ "." + month+ "." + year);
}

//New Window
var win= null;
function NewWindow(url,name,w,h,scroll,menu,rezi,tool,stat,direct) {
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ='height='+h+',';
	settings +='width='+w+',';
	settings +='top='+wint+',';
	settings +='left='+winl+',';
	settings +='scrollbars='+scroll+',';
	settings +='menubar='+menu+',';
	settings +='resizable='+rezi+',';
	settings +='toolbar='+tool+',';
	settings +='status='+stat+',';
	settings +='directories='+direct+',';
	  
	win = window.open(url,name,settings);
	if(parseInt(navigator.appVersion) >= 4) {
		win.focus()
		//win.window.focus();
	}
}

function confirmNewLocation(url) {
	if (confirm("\nYou are leaving the Indian Roche Diagnostics site. Click OK to continue.\n")) {
		//NewWindow(url,"win1","","","Y","Y","Y","","")
		document.location.href = url;
	}
}
