// Created by iWeb 3.0.3 local-build-20110629

var isiPad=(navigator.userAgent.toLowerCase().indexOf("ipad")!=-1);
var isChrome=(navigator.userAgent.toLowerCase().indexOf("chrome")!=-1);

function writeFlash2()
	{detectBrowser();if(isiPhone || isiPad)
		{document.write('<div id="instructors_hype_container" style="position:relative;overflow:hidden;width:220px;height:150px;margin-left: -100px; margin-top: -5px; "><script type="text/javascript" charset="utf-8" src="Media/Instructors/Instructors_Resources/instructors_hype_generated_script.js?98149"></script></div>');}
	else if(isSafari && !isChrome)
		{document.write('<video height="135" width="105" title="Instructors" autoplay="autoplay" loop="loop" ><source src="All_American_Karate_files/Instructors.mov" type="video/mp4"/></video>');}
	else
		{document.write('<object id="id0" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0" width="105" height="135"><param name="movie" value="All_American_Karate_files/Instructors.swf" /><param name="play" value="true"/><param name="loop" value="true"/><param name="quality" value="high"/><param name="wmode" value="transparent"/><embed src="All_American_Karate_files/Instructors.swf" width="105" height="135" play="true" loop="true" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>');}
	}

function writeMovie1()
  {detectBrowser();if(isiPhone || isiPad)
		{document.write('<a class="iframe" id="ChadVsChance" title="Chad vs. Chance — The Thrilla in Vanilla" href="chadvschance.html"><img src="All_American_Karate_files/chad_vs_chance.jpg" alt="Chad vs. Chance" style="border: none; height: 124px; width: 165px; " /></a>');}
	else
		{document.write('<a class="iframe" id="ChadVsChance" title="Chad vs. Chance — The Thrilla in Vanilla" href="http://www.youtube.com/v/u7gi8ZKhqmU&autoplay=1&fs=1"><img src="All_American_Karate_files/chad_vs_chance.jpg" alt="Chad vs. Chance" style="border: none; height: 124px; width: 165px; " /></a>');}
	}

var overlayOpacity = "100";
var overlayTimer = "800";

function removeOverlay() {
	opacity('overlay', overlayOpacity, 0, overlayTimer);
	setTimeout("removeObjectID('overlay')",overlayTimer);
}

function removeObjectID(id) {
	var objBody = document.getElementsByTagName('body').item(0);
	var objID = document.getElementById(id);
	objBody.removeChild(objID);
}

function opacity(id, opacStart, opacEnd, millisec) {
	//speed for each frame
	var speed = Math.round(millisec / 100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
			timer++;
		}
	}
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
	var obj = document.getElementById(id).style; 
	obj.opacity = (opacity / 100);
	obj.MozOpacity = (opacity / 100);
	obj.KhtmlOpacity = (opacity / 100);
	obj.filter = "alpha(opacity=" + opacity + ")";
}

function removeLoading() {
	setTimeout("removeObjectID('loading')",375);
}

function hostedOnDM()
{return false;}
function onPageLoad()
{loadMozillaCSS('All_American_Karate_files/All_American_KarateMoz.css')
adjustLineHeightIfTooBig('id1');adjustFontSizeIfTooBig('id1');adjustLineHeightIfTooBig('id2');adjustFontSizeIfTooBig('id2');adjustLineHeightIfTooBig('id3');adjustFontSizeIfTooBig('id3');adjustLineHeightIfTooBig('id4');adjustFontSizeIfTooBig('id4');adjustLineHeightIfTooBig('id5');adjustFontSizeIfTooBig('id5');adjustLineHeightIfTooBig('id6');adjustFontSizeIfTooBig('id6');adjustLineHeightIfTooBig('id7');adjustFontSizeIfTooBig('id7');adjustLineHeightIfTooBig('id8');adjustFontSizeIfTooBig('id8');adjustLineHeightIfTooBig('id9');adjustFontSizeIfTooBig('id9');adjustLineHeightIfTooBig('id10');adjustFontSizeIfTooBig('id10');adjustLineHeightIfTooBig('id11');adjustFontSizeIfTooBig('id11');adjustLineHeightIfTooBig('id12');adjustFontSizeIfTooBig('id12');adjustLineHeightIfTooBig('id13');adjustFontSizeIfTooBig('id13');adjustLineHeightIfTooBig('id14');adjustFontSizeIfTooBig('id14');adjustLineHeightIfTooBig('id15');adjustFontSizeIfTooBig('id15');adjustLineHeightIfTooBig('id17');adjustFontSizeIfTooBig('id17');adjustLineHeightIfTooBig('id18');adjustFontSizeIfTooBig('id18');fixupIECSS3Opacity('id16');if(isiPhone || isiPad){} else{removeLoading();setTimeout('removeOverlay()',400);} }

// Preload images
if (document.images)
{
	preload_image_object = new Image();
	// set image url
	image_url = new Array();
	image_url[0] = "http://www.allamericankarate.net/Kenpo/Media/Instructors/Instructors_Resources/Don_DeVries.jpg";
	image_url[1] = "http://www.allamericankarate.net/Kenpo/Media/Instructors/Instructors_Resources/Bill_Piper.jpg";
	image_url[2] = "http://www.allamericankarate.net/Kenpo/Media/Instructors/Instructors_Resources/Marvin_Williams.jpg";
	image_url[3] = "http://www.allamericankarate.net/Kenpo/Media/Instructors/Instructors_Resources/James_DeCore.jpg";
	image_url[4] = "http://www.allamericankarate.net/Kenpo/Media/Instructors/Instructors_Resources/Jennifer_DeVries.jpg";
	image_url[5] = "http://www.allamericankarate.net/Kenpo/Media/Instructors/Instructors_Resources/Nick_DeVries.jpg";

	 var i = 0;
	 for(i=0; i<=5; i++) 
		 preload_image_object.src = image_url[i];
}


