///////////////////////////////////////////////////////////////
// Intro Animation
///////////////////////////////////////////////////////////////
// (c) 2007 by Dominik Scholz, go4u.de Webdesign
// visit: http://www.go4u.de
///////////////////////////////////////////////////////////////

// Settings //
var p1_end_x = 100;
var p1_end_y = -50;
var p2_end_x = -350;
var p2_end_y = -100;

var p1_x = 0;
var p1_y = 0;
var p2_x = 0;
var p2_y = 0;

function introani()
{
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;

	var l1 = document.getElementById('layer1').style;
	var l2 = document.getElementById('layer2').style;


	p1_x = -500;
	p1_y = h-50;
	p2_x = -200;
	p2_y = -200;

	window.setTimeout('introani_loop();', 20);
}

function introani_loop()
{
	var de = document.documentElement;
	var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;

	var l1 = document.getElementById('layer1').style;
	var l2 = document.getElementById('layer2').style;

	p1_x += ( (w/2) + p1_end_x - p1_x ) / 30;
	p1_y += ( (h/2) + p1_end_y - p1_y ) / 30;
	
	p2_x += ( (w/2) + p2_end_x - p2_x ) / 30;
	p2_y += ( (h/2) + p2_end_y - p2_y ) / 30;

	l1.left = parseInt(p1_x) + 'px';
	l1.top  = parseInt(p1_y) + 'px';
	l2.left = parseInt(p2_x) + 'px';
	l2.top  = parseInt(p2_y) + 'px';

    window.setTimeout('introani_loop();', 30);
}
