//begin intro astonisher!
var currentChar = 1;
var typeText = "the critically acclaimed<br>intimate portrait of survival<br>in the underground world of graffiti";
function typeIt(){
	if (document.getElementById) {
		var dest = document.getElementById("intro");
		//var textNode=document.createTextNode(typeText.substr(0, currentChar));
		if (dest) {
			dest.innerHTML=typeText.substr(0, currentChar);
			//dest.replaceChild(textNode, dest.childNodes[0]);
			currentChar++;
			if (currentChar > typeText.length) {
				currentChar = 1;
				setTimeout("fadeOut()", 900);
			} else {
				setTimeout("typeIt()", 80);
			}
		}
	}
}

/*function fadeOut() {
	if (document.getElementById) {
		var dest = document.getElementById("intro");
		var closeMe = document.getElementById("introBack");
		if (closeMe) {
			closeMe.style.visibility='hidden';
			dest.style.visibility='hidden';
		}
	}
}*/

function fadeOut() {
	imageId = 'introBack';
	image = document.getElementById(imageId);
	setOpacity(image, 100);
	image.style.visibility = 'visible';
	fadeIn(imageId,100);
}

function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objId);
		if (opacity > 0) {
			setOpacity(obj, opacity);
			opacity -= 8;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 100);
		} else {
			if (document.getElementById) {
				var dest = document.getElementById("intro");
				var closeMe = document.getElementById("introBack");
				if (closeMe) {
					closeMe.style.visibility='hidden';
					dest.style.visibility='hidden';
					//document.soundClip.hidden=false;
				}
			}
		}
	}
}










function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}
function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}
var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		title_over = newImage("images/title-over.gif");
		trailer_over = newImage("images/trailer-over.gif");
		gallery_over = newImage("images/gallery-over.gif");
		downloads_over = newImage("images/downloads-over.gif");
		signup_over = newImage("images/signup-over.gif");
		email_over = newImage("images/email-over.gif");
		press_over = newImage("images/press-over.gif");
		castcrew_over = newImage("images/castcrew-over.gif");
		screenings_over = newImage("images/screenings-over.gif");
		links_over = newImage("images/links-over.gif");
		preloadFlag = true;
	}
}
<!--//window-->
var Nav4 = ((navigator.appName == "Netscape") &&
 (parseInt(navigator.appVersion) >= 4))
 function getAttr(height,width){
 if (Nav4) {
		   // Center on the main window.
		   dialogleft = window.screenX + ((window.outerWidth - width) / 2)
		   dialogtop = window.screenY + ((window.outerHeight - height) / 2)
		   var attr = "screenX=" + dialogleft + ",screenY=" + dialogtop + ",width=" + width + ",height=" + height
		} else {
		   // The best we can do is center in screen.
		   dialogleft = (screen.width - width) / 2
		   dialogtop = (screen.height - height) / 2
		   var attr = "left=" + dialogleft + ",top=" + dialogtop + ",width=" + width + ",height=" + height
		}
		return (attr);
 }


function openWin1() {
				 attr = getAttr(695,700);
				 newwin = window.open('store.html','store','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,' + attr);
				 newwin.opener = this;
		 }
function openImageWin(sizew,sizeh,loc) {
				 attr = getAttr(sizeh,sizew);
				 newwin = window.open(loc,'viewer','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1,' + attr);
				 newwin.opener = this;
		 }

// code to fade the quotes on homepage.
var bgcolor = "#000000"; // background color, must be valid browser hex color (not color names)
var fcolor = "#dcdcdc";  // foreground or font color
var steps = 15; // number of steps to fade
var show = 5000; // milliseconds to display message
var sleep = 30; // milliseconds to pause inbetween messages
var loop = true; // true = continue to display messages, false = stop at last message

// Do Not Edit Below This Line
var colors = new Array(steps);
getFadeColors(bgcolor,fcolor,colors);
var color = 0;
var text = 0;
var step = 1;

// fade: magic fader function
function fade() {

// insert fader color into message
var text_out = texts[text]; //.replace("{COLOR}", colors[color]); // texts should be defined in user script, e.g.: var texts = new Array("<font color='{COLOR}' sized='+3' face='Arial'>howdy</font>");

// actually write message to document
if (document.all) fader.innerHTML = text_out; // document.all = IE only
if (document.all) fader.style.color=colors[color]; // = text_out; // document.all = IE only
if (document.layers) { document.fader.document.open(); document.fader.document.write(text_out); document.fader.document.close(); } // document.layers = Netscape only
if (document.layers) { document.fader.style.color=colors[color]; } // document.layers = Netscape only

// select next fader color
color += step; 

// completely faded in?
if (color >= colors.length-1) {
step = -1; // traverse colors array backward to fade out

// stop at last message if loop=false
if (!loop && text >= texts.length-1) return; // loop should be defined in user script, e.g.: var loop=true;
}

// completely faded out?
if (color == 0) {
step = 1; // traverse colors array forward to fade in again

// select next message
text += 1;
if (text == texts.length) text = 0; // loop back to first message
}

// subtle timing logic...
setTimeout("fade()", (color == colors.length-2 && step == -1) ? show : ((color == 1 && step == 1) ? sleep : 50)); // sleep and show should be defined in user script, e.g.: var sleep=30; var show=500;
}
// getFadeColors: fills Colors (predefined Array)
// with color hex strings fading from ColorA to ColorB

// note: Colors.length equals the number of steps to fade
function getFadeColors(ColorA, ColorB, Colors) {
len = Colors.length; 

// strip '#' signs if present 
if (ColorA.charAt(0)=='#') ColorA = ColorA.substring(1);
if (ColorB.charAt(0)=='#') ColorB = ColorB.substring(1);

// substract rgb compents from hex string 
var r = HexToInt(ColorA.substring(0,2));
var g = HexToInt(ColorA.substring(2,4));
var b = HexToInt(ColorA.substring(4,6));
var r2 = HexToInt(ColorB.substring(0,2));
var g2 = HexToInt(ColorB.substring(2,4));
var b2 = HexToInt(ColorB.substring(4,6));

// calculate size of step for each color component
var rStep = Math.round((r2 - r) / len);
var gStep = Math.round((g2 - g) / len);
var bStep = Math.round((b2 - b) / len);

// fill Colors array with fader colors
for (i = 0; i < len-1; i++) {
Colors[i] = "#" + IntToHex(r) + IntToHex(g) + IntToHex(b);
r += rStep;
g += gStep;
b += bStep;
}
Colors[len-1] = ColorB; // make sure we finish exactly at ColorB
}

// IntToHex: converts integers between 0-255 into a two digit hex string.
function IntToHex(n) {
var result = n.toString(16);
if (result.length==1) result = "0"+result;
return result;
}

// HexToInt: converts two digit hex strings into integer.
function HexToInt(hex) {
return parseInt(hex, 16);
}

// body tag must include: onload="fade()" bgcolor="#000000"  where bgcolor equals bgcolor in javascript above

