// JavaScript Document
function changeimage (a,b) {
		document.getElementById(a).src='images/' + b
}
function changeimage2 (a,b) {
		document.getElementById(a).src='../images/' + b
}
function changeimage3 (a,b) {
		document.getElementById(a).src= b
}
function openindex() {
	
OpenWindow=window.open("", "newwin", "height=250, width=250,toolbar=no,scrollbars="+scroll+",menubar=no");
OpenWindow.document.write("<TITLE>test window</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR=pink>")
OpenWindow.document.write("<h1>Hello!</h1>")
OpenWindow.document.write("This text will appear in the window!")
OpenWindow.document.write("</BODY>")
OpenWindow.document.write("</HTML>")

OpenWindow.document.close()
self.name="main"
}
function toggleAmount() {
	
	var dropdownIndex = document.getElementById('amount').selectedIndex;
	var dropdownValue = document.getElementById('amount')[dropdownIndex].value;

	if (dropdownValue =='other') {
		document.getElementById('other_amount').style.display='block';		  
	} else {
		document.getElementById('other_amount').style.display='none';
	}
}


var i = 1;
var pic1= new Image(616,345); 
	pic1.src="images/contentpic1.jpg";
if(typeof pic1.style.opacity == "string") {
		pic1.style.opacity = .1;
	} 
	
var pic2= new Image(616,345); 
	pic2.src="images/contentpic2.jpg";
if(typeof pic2.style.opacity == "string") {
		pic2.style.opacity = .1;
	} 
	
var pic3= new Image(616,345); 
	pic3.src="images/contentpic3.jpg";
if(typeof pic3.style.opacity == "string") {
		pic3.style.opacity = .1;
	} 
	
var pic4= new Image(616,345); 
	pic4.src="images/contentpic4.jpg";
if(typeof pic4.style.opacity == "string") {
		pic4.style.opacity = .1;
	} 


function rotateImage() {

	var image = document.getElementById('contentpic');
	image.src='images/contentpic' + i + '.jpg';
	if(typeof image.style.opacity == "string") {
		image.style.opacity = .1;
	} else {
		image.filters.alpha.opacity  = 10;
	}
	revealImage();
	i++;
	if (i > 4) {
		i = 1;
	}
	
	rotateTimeout = setTimeout("rotateImage()",5000);
}
function revealImage() {
	var image = document.getElementById('contentpic');
	if(typeof image.style.opacity == "string") {
	image.style.opacity = parseFloat(image.style.opacity)+.005;
	fadein = setTimeout("revealImage()",1);
	 } else {
	image.filters.alpha.opacity = parseInt(image.filters.alpha.opacity) + 1;
	fadein = setTimeout("revealImage()",50);
	}
	
}
function resetCounter(a) {
	
	image = document.getElementById('contentpic');
	i = a;
	if(typeof image.style.opacity == "string") {
		image.style.opacity = .1;
	} else {
		image.filters.alpha.opacity  = 10;
	}
	
	
}
