/*

	HitLine COLOR FADE ASSISTANT
	created 21.07.08
	
	copyright 2008  Emotion studio
					of breathtaking ideas
					www.emotionstyle.com
	
*/

function hrf_in (id)
{
	colorFade(id,'text','35D3EA','FFFFFF',15,20);
}

function hrf_out (id)
{
	colorFade(id,'text','FFFFFF','35D3EA',15,20);
}

function mmf_in (id)
{
	colorFade(id,'text','83C30F','5FECE6',15,20);
}

function mmf_out (id)
{
	colorFade(id,'text','5FECE6','83C30F',15,20);
}

function bg_in (id)
{
	colorFade(id,'background','','5FECE6',15,20);
}


/* 

		IMAGE FADER 

*/

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 object = document.getElementById(id).style; 
	object.opacity = (opacity / 100);
	object.MozOpacity = (opacity / 100);
	object.KhtmlOpacity = (opacity / 100);
	object.filter = "alpha(opacity=" + opacity + ")";
}

function shiftOpacity(id, millisec) {
	//if an element is invisible, make it visible, else make it ivisible
	if(document.getElementById(id).style.opacity == 0) {
		opacity(id, 0, 100, millisec);
	} else {
		opacity(id, 100, 0, millisec);
	}
}

function blendimage(divid, imageid, imagefile, millisec) {
	var speed = Math.round(millisec / 100);
	var timer = 0;
	
	//set the current image as background
	document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
	
	//make image transparent
	changeOpac(0, imageid);
	
	//make new image
	document.getElementById(imageid).src = imagefile;

	//fade in image
	for(i = 0; i <= 100; i++) {
		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		timer++;
	}
}

function currentOpac(id, opacEnd, millisec) {
	//standard opacity is 100
	var currentOpac = 100;
	
	//if the element has an opacity set, get it
	if(document.getElementById(id).style.opacity < 100) {
		currentOpac = document.getElementById(id).style.opacity * 100;
	}

	//call for the function that changes the opacity
	opacity(id, currentOpac, opacEnd, millisec)
}


/*

	PASSPORT ANIMATION SCRIPT v0.1
	created 22.07.08
	
	copyright 2008  Emotion studio
					of breathtaking ideas
					www.emotionstyle.com
	
*/

function popShift(to)
{
		if (to == 1)
		{
				document.getElementById('trans').style.display=''; 
				document.getElementById('passport_pop-up').style.display='';
				document.getElementById('passport_ico').style.backgroundImage='url(images/spacer.gif)';
				PlayFlashMovie();
		}
		
		if (to == 2)
		{
				document.getElementById('trans').style.display='none'; 
				document.getElementById('passport_pop-up').style.display='none';
				document.getElementById('passport_ico').style.backgroundImage='url(images/passport_ico.gif)';
		}
		
		if (to == 3)
		{
				document.getElementById('presentation').style.display=''; 
		}
		
		if (to == 4)
		{
				//document.getElementById('presentation').style.display='none'; 
				location.reload(true);
		}

}



/*


	Flash And JS Functions
		

*/

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
    return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function PlayFlashMovie()
{
	var flashMovie=getFlashMovieObject("demo_xml");
	flashMovie.Play();
	//embed.nativeProperty.anotherNativeMethod();
}

