
var interval = 11; // delay between rotating images (in seconds)
var random_display = 0; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++] = new imageItem("images/top1.jpg");
image_list[image_index++] = new imageItem("images/top2.jpg");
image_list[image_index++] = new imageItem("images/top3.jpg");
image_list[image_index++] = new imageItem("images/top4.jpg");
image_list[image_index++] = new imageItem("images/top5.jpg");
image_list[image_index++] = new imageItem("images/top6.jpg");
image_list[image_index++] = new imageItem("images/top7.jpg");
image_list[image_index++] = new imageItem("images/top8.jpg");
image_list[image_index++] = new imageItem("images/top9.jpg");

var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}

		function toggle(sInfoID) {
			var oContainer = document.getElementById(sInfoID);
			if (oContainer.style.display=="block")
				oContainer.style.display="none";
			else	
				oContainer.style.display="block";
		}



if (document.images){
img1on = new Image();
img1on.src="images/buttonon.jpg";

img1off = new Image();
img1off.src="images/button.jpg"
}

function imgOn (imgName){
  if(document.images){
        document[imgName].src=eval(imgName + "on.src");
        }
}
function imgOff (imgName){
  if(document.images){
        document[imgName].src=eval(imgName +"off.src");
        }
}

function store_show( loc ) {
try {
        var frame = document.getElementById('storeframe');
        if ( typeof(frame)=='undefined' ) { return; }
        frame.src = frame.src.replace(/#.*$/,loc);
} catch(e) { }
}

function _recalc(arrWizard){
	var bSubmit = false;
	
	if(2 == arrWizard.length){
	// нужно сравнить с карзиной и удостовериться
	// вывести сообщение		
		//alert('OK');
		Q1 = arrWizard[0];
		Q2 = arrWizard[1];
		Prod2q = document.forms['mainform'].elements['qty[2]'].value;
		Prod2d = document.forms['mainform'].elements['del[2]'].checked;
		Prod4q = document.forms['mainform'].elements['qty[4]'].value;
		Prod4d = document.forms['mainform'].elements['del[4]'].checked;
		
		bSubmit = true;
		if( Prod2q<Q1 || Prod2d || Prod4q<Q2 || Prod4d ){
			bSubmit = confirm('Reducing the number or type of test kits may allow dangerous levels of radon to go undetected. Dr. Don advises that you do not change this. Are you sure?');
		}
	}else{
		//alert('NO');
		bSubmit = true;
	}
	
	if( bSubmit ){
		document.forms['mainform'].submit();
		
	}	
}

defaultStatus="Home Radon Test";




PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 525;
defaultHeight = 625;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

