/*
 * Laufhaus-Rachel nötige Funktionen
 * Scripts
 * Copyright (c) 2009 Ömer Capan - capanonline@hotmail.com
 * Datum 25.02.2009
 */





function clickIE() {
	if (document.all){
	    return false;
 	}
}


function clickNS(e) {

	if (document.layers||(document.getElementById&&!document.all)){
		
		if (e.which==2||e.which==3) {
		return false;
		}
	}
}


if (document.all){
document.onselectstart = document.ondragstart = document.ondrag = document.oncontextmenu =  function () {
return false;
};}else{
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS;
document.onmouseup=clickNS;
document.onclick=clickNS;
}

function showImpressum(){
if( window.innerHeight && window.scrollMaxY ) {
pageWidth = window.innerWidth + window.scrollMaxX;
pageHeight = window.innerHeight + window.scrollMaxY;
}else if( document.body.scrollHeight > document.body.offsetHeight ) {
pageWidth = document.body.scrollWidth;
pageHeight = document.body.scrollHeight;
}else{ 
pageWidth = document.body.offsetWidth + document.body.offsetLeft; pageHeight = document.body.offsetHeight + document.body.offsetTop; }
document.getElementById("impressum").style.position="relative";
document.getElementById("impressum").style.display="block";
impressumsHeight = document.getElementById("impressum").offsetHeight;
impressumsHeight = impressumsHeight+ 300;
startPos = pageHeight-impressumsHeight;
 for (I=startPos; I<=pageHeight; I=I+8){
   scroll(0,I);
  }
}

function hideImpressum(){
document.getElementById("impressum").style.position="absolute";
document.getElementById("impressum").style.display="none";
}



function abfrage(){

 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent('codebase', 

'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '700','height', '500','src', 'media/swf/altersabfrage','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle',
'play', 'true',	'loop', 'true',	'scale', 'wmode','wmode', 'window','devicefont', 'false','menu', 'false','id', 'media/swf/altersabfrage',	'bgcolor','#0f0f0f','name', 

'media/swf/altersabfrage',
'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/altersabfrage','salign', ''); 
 }
}

function altersAbfrage(sprache){
islem.location.replace("eingang.asp?lang="+sprache+"");
}

function altersAbfrage2(sprache){

if(sprache=="de") {
top.location.replace("default.asp?lang=de");
}else{top.location.replace("default.asp?lang=en");}
}


function getTopSwf(sprache){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '1000','height', '245','src', 'media/swf/top_'+sprache+'','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle',
'play', 'true',	'loop', 'true',	'scale', 'wmode','wmode', 'opaque','devicefont', 'false','menu', 'false','id', 'media/swf/top_'+sprache+'',	'bgcolor','#000000','name', 'media/swf/top_'+sprache+'',
'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/top_'+sprache+'','salign', ''); 
 }
}

function getGirls_de(name,alter,id,status,lang,num){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '193','height', '250','src', 'media/swf/girl_de?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle','play', 'true','loop', 'true','scale', 'wmode','wmode', 'window',
'devicefont', 'false',	'menu', 'false','id', 'media/swf/girl_de?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'',	'bgcolor','#000000','name', 'media/swf/girl_de?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'',			'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/girl_de?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'','salign', ''); 
 }
}

function getGirls_en(name,alter,id,status,lang,num){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '193','height', '250','src', 'media/swf/girl_en?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle','play', 'true','loop', 'true','scale', 'wmode','wmode', 'window',
'devicefont', 'false',	'menu', 'false','id', 'media/swf/girl_en?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'',	'bgcolor','#000000','name', 'media/swf/girl_en?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'',			'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/girl_en?num='+num+'&girlId='+id+'&girlName='+name+'&girlAlter='+alter+'&lang='+lang+'&girlStatus='+status+'','salign', ''); 
 }
}

function getGirlDerWoche(sprache){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent('codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '367','height', '280','src', 'media/swf/girlderwoche_'+sprache+'','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle',
'play', 'true',	'loop', 'true',	'scale', 'wmode','wmode', 'window','devicefont', 'false','menu', 'false','id', 'media/swf/girlderwoche_'+sprache+'',
'bgcolor','#000000','name', 'media/swf/girlderwoche_'+sprache+'','allowFullScreen', 'false','allowScriptAccess','sameDomain',	'movie', 'media/swf/girlderwoche_'+sprache+'',
'salign', ''); 
 }
}

function getNewGirls_de(){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '554','height', '280','src', 'media/swf/neuegirls_de','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true',
'loop', 'true',	'scale', 'showall','wmode', 'window',	'devicefont', 'false','id', 'media/swf/neuegirls_de','bgcolor', '#000000',
'name', 'media/swf/neuegirls_de','menu', 'false','allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/neuegirls_de',
'salign', ''); 
 }
}


function getNewGirls_en(){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {
AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '554','height', '280','src', 'media/swf/neuegirls_en','quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true',
'loop', 'true',	'scale', 'showall','wmode', 'window',	'devicefont', 'false','id', 'media/swf/neuegirls_en','bgcolor', '#000000',
'name', 'media/swf/neuegirls_en','menu', 'true','allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/neuegirls_en',
'salign', ''); 
 }
}




function getNewsletter(number,sprache){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',	'width', '367',	'height', '280','src', 'media/swf/newsletter_'+sprache+'?s='+number+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle',	'play', 'true',	'loop', 'true',
'scale', 'wmode','wmode', 'window','devicefont', 'false','menu', 'false','id', 'media/swf/newsletter_'+sprache+'?s='+number+'','bgcolor','#000000',
'name', 'media/swf/newsletter_'+sprache+'?s='+number+'','allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/newsletter_'+sprache+'?s='+number+'',
'salign', ''); 
 }
}

function ergebnisseFiltern_de(){
sVal = document.getElementById("kategorie").selectedIndex;
sVal = ((sVal));
if (sVal>0) location.href='girls.asp?lang=de&kat='+sVal+'';
}

function ergebnisseFiltern_en(){
sVal = document.getElementById("kategorie").selectedIndex;
sVal = ((sVal));
if (sVal>0) location.href='girls.asp?lang=en&kat='+sVal+'';
}

function zumAnfahrt() {
 for (I=1; I<=320; I=I+3)
  scroll(1,I);
}

function getAnfahrt_de(){
if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '1000','height', '680','src', 'media/swf/anfahrt_de',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true','loop', 'true',	'scale', 'wmode','wmode', 'window',
'devicefont', 'false','menu', 'false','id', 'media/swf/anfahrt_de','bgcolor','#000000','name', 'media/swf/anfahrt_de','allowFullScreen', 'false',
'allowScriptAccess','sameDomain','movie', 'media/swf/anfahrt_de','salign', ''); 
 }
}


function getAnfahrt_en(){
if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '1000','height', '680','src', 'media/swf/anfahrt_en',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true','loop', 'true',	'scale', 'wmode','wmode', 'window',
'devicefont', 'false','menu', 'false','id', 'media/swf/anfahrt_en','bgcolor','#000000','name', 'media/swf/anfahrt_en','allowFullScreen', 'false',
'allowScriptAccess','sameDomain','movie', 'media/swf/anfahrt_en','salign', ''); 
 }
}



function getJob(){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '1000','height', '584','src', 'media/swf/job',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer','align', 'middle','play', 'true','loop', 'true',	'scale', 'wmode',
'wmode', 'window','devicefont', 'false','menu', 'false','id', 'media/swf/job','bgcolor','#000000','name', 'media/swf/job',
'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/job','salign', ''); 
 }
}

function showHaus(bild,img){
var bilder = new Array();
bilder[0] = new Image(); bilder[0].src = "/upload/laufhaus/1.jpg";
bilder[1] = new Image(); bilder[1].src = "/upload/laufhaus/2.jpg";
bilder[2] = new Image(); bilder[2].src = "/upload/laufhaus/3.jpg";
bilder[3] = new Image(); bilder[3].src = "/upload/laufhaus/4.jpg";
bilder[4] = new Image(); bilder[4].src = "/upload/laufhaus/5.jpg";
bilder[5] = new Image(); bilder[5].src = "/upload/laufhaus/6.jpg";
bilder[6] = new Image(); bilder[6].src = "/upload/laufhaus/7.jpg";
bilder[7] = new Image(); bilder[7].src = "/upload/laufhaus/8.jpg";
bilder[8] = new Image(); bilder[8].src = "/upload/laufhaus/9.jpg";
bilder[9] = new Image(); bilder[9].src = "/upload/laufhaus/10.jpg";
bilder[10] = new Image(); bilder[10].src = "/upload/laufhaus/11.jpg";
bilder[11] = new Image(); bilder[11].src = "/upload/laufhaus/12.jpg";
bilder[12] = new Image(); bilder[12].src = "/upload/laufhaus/13.jpg";
bilder[13] = new Image(); bilder[13].src = "/upload/laufhaus/14.jpg";
bilder[14] = new Image(); bilder[14].src = "/upload/laufhaus/15.jpg";
bilder[15] = new Image(); bilder[15].src = "/upload/laufhaus/16.jpg";
bilder[16] = new Image(); bilder[16].src = "/upload/laufhaus/17.jpg";

thumb1.style.borderColor="#58564F";
thumb2.style.borderColor="#58564F";
thumb3.style.borderColor="#58564F";
thumb4.style.borderColor="#58564F";
thumb5.style.borderColor="#58564F";
thumb6.style.borderColor="#58564F";
thumb7.style.borderColor="#58564F";
thumb8.style.borderColor="#58564F";
thumb9.style.borderColor="#58564F";
thumb10.style.borderColor="#58564F";
thumb11.style.borderColor="#58564F";
thumb12.style.borderColor="#58564F";
thumb13.style.borderColor="#58564F";
thumb14.style.borderColor="#58564F";
thumb15.style.borderColor="#58564F";
thumb16.style.borderColor="#58564F";
thumb17.style.borderColor="#58564F";

img.style.borderColor="white";
document.galerie.src=bilder[bild-1].src;
}

function checkKontaktForm_de(){
if (document.kontakt.kontaktName.value==""){
alert("Bitte geben Sie ihren Namen ein!");
}else{
if (document.kontakt.kontaktMail.value=="" && document.kontakt.kontaktTel.value==""){
alert("Sie müssen entweder Ihre E-Mail adresse oder Telefonnummer eingeben!");
}else{
if (document.kontakt.kontaktNachricht.value==""){
alert("Bitte geben Sie Ihre Nachricht ein!");
}else{
document.getElementById("sendButton").value='Bitte warten';
document.getElementById("sendButton").disabled=true;
document.getElementById("senden").innerHTML="<img src=media/images/loading.gif>";
document.kontakt.submit();}}}
}

function checkKontaktForm_en(){
if (document.kontakt.kontaktName.value==""){
alert("Please enter your name!");
}else{
if (document.kontakt.kontaktMail.value=="" && document.kontakt.kontaktTel.value==""){
alert("You have to enter your name or phone number!");
}else{
if (document.kontakt.kontaktNachricht.value==""){
alert("Please enter your message");
}else{
document.getElementById("sendButton").value='Please Wait';
document.getElementById("sendButton").disabled=true;
document.getElementById("senden").innerHTML="<img src=media/images/loading.gif>";
document.kontakt.submit();}}}
}

 function zurGallerie() {
  for (I=1; I<=320; I=I+3){
   scroll(1,I)
  }
 }

 function zumGaesteBuch() {
   scroll(1,903);
 }


function getDetails_de(number){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '490','height', '507','src', 'media/swf/details_de?girlId='+number+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle','play', 'true','loop', 'true','scale', 'wmode','wmode', 'window',
'devicefont', 'false',	'menu', 'false','id', 'media/swf/details_de?girlId='+number+'','bgcolor','#000000','name', 'media/swf/details_de?girlId='+number+'',			'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/details_de?girlId='+number+'','salign', ''); 
 }
}


function getDetails_en(number){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '490','height', '507','src', 'media/swf/details_en?girlId='+number+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle','play', 'true','loop', 'true','scale', 'wmode','wmode', 'window',
'devicefont', 'false',	'menu', 'false','id', 'media/swf/details_en?girlId='+number+'','bgcolor','#000000','name', 'media/swf/details_en?girlId='+number+'',			'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/details_en?girlId='+number+'','salign', ''); 
 }
}


function setMusic(){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '50','height', '20','src', 'media/swf/music_top?music='+status+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle','play', 'true','loop', 'true','scale', 'wmode','wmode', 'window',
'devicefont', 'false',	'menu', 'false','id', 'media/swf/music_top?music='+status+'','bgcolor','#353431','name', 'media/swf/music_top?music='+status+'',			'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/music_top?music='+status+'','salign', ''); 
 }
}


function ClipBoard(obj)
{
Copied = obj.createTextRange();
Copied.execCommand("RemoveFormat");
Copied.execCommand("Copy");
}



function getService_de(number,number2){
 if (AC_FL_RunContent == 0) {alert("This page requires AC_RunActiveContent.js.");} else {AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0','width', '970','height', '400','src', 'media/swf/service_de?girlId='+number+'&randNr='+number2+'',
'quality', 'high','pluginspage', 'http://www.macromedia.com/go/getflashplayer',	'align', 'middle','play', 'true','loop', 'true','scale', 'wmode','wmode', 'window',
'devicefont', 'false',	'menu', 'false','id', 'media/swf/service_de?girlId='+number+'','bgcolor','#000000','name', 'media/swf/service_de?girlId='+number+'&randNr='+number2+'',			'allowFullScreen', 'false','allowScriptAccess','sameDomain','movie', 'media/swf/service_de?girlId='+number+'&randNr='+number2+'','salign', ''); 
 }
}



function bannerTausch(){
var status = document.getElementById("bannertausch").style;

if (status.display=="none"){ status.display="block";}else{status.display="none";}
}


function Delegate() {}
Delegate.create = function (o, f) {
	var a = new Array() ;
	var l = arguments.length ;
	for(var i = 2 ; i < l ; i++) a[i - 2] = arguments[i] ;
	return function() {
		var aP = [].concat(arguments, a) ;
		f.apply(o, aP);
	}
}

Tween = function(obj, prop, func, begin, finish, duration, suffixe){
	this.init(obj, prop, func, begin, finish, duration, suffixe)
}
var t = Tween.prototype;

t.obj = new Object();
t.prop='';
t.func = function (t, b, c, d) { return c*t/d + b; };
t.begin = 0;
t.change = 0;
t.prevTime = 0;
t.prevPos = 0;
t.looping = false;
t._duration = 0;
t._time = 0;
t._pos = 0;
t._position = 0;
t._startTime = 0;
t._finish = 0;
t.name = '';
t.suffixe = '';
t._listeners = new Array();	
t.setTime = function(t){
	this.prevTime = this._time;
	if (t > this.getDuration()) {
		if (this.looping) {
			this.rewind (t - this._duration);
			this.update();
			this.broadcastMessage('onMotionLooped',{target:this,type:'onMotionLooped'});
		} else {
			this._time = this._duration;
			this.update();
			this.stop();
			this.broadcastMessage('onMotionFinished',{target:this,type:'onMotionFinished'});
		}
	} else if (t < 0) {
		this.rewind();
		this.update();
	} else {
		this._time = t;
		this.update();
	}
}
t.getTime = function(){
	return this._time;
}
t.setDuration = function(d){
	this._duration = (d == null || d <= 0) ? 100000 : d;
}
t.getDuration = function(){
	return this._duration;
}
t.setPosition = function(p){
	this.prevPos = this._pos;
	var a = this.suffixe != '' ? this.suffixe : '';
	this.obj[this.prop] = Math.round(p) + a;
	this._pos = p;
	this.broadcastMessage('onMotionChanged',{target:this,type:'onMotionChanged'});
}
t.getPosition = function(t){
	if (t == undefined) t = this._time;
	return this.func(t, this.begin, this.change, this._duration);
};
t.setFinish = function(f){
	this.change = f - this.begin;
};
t.geFinish = function(){
	return this.begin + this.change;
};
t.init = function(obj, prop, func, begin, finish, duration, suffixe){
	if (!arguments.length) return;
	this._listeners = new Array();
	this.addListener(this);
	if(suffixe) this.suffixe = suffixe;
	this.obj = obj;
	this.prop = prop;
	this.begin = begin;
	this._pos = begin;
	this.setDuration(duration);
	if (func!=null && func!='') {
		this.func = func;
	}
	this.setFinish(finish);
}
t.start = function(){
	this.rewind();
	this.startEnterFrame();
	this.broadcastMessage('onMotionStarted',{target:this,type:'onMotionStarted'});
	//alert('in');
}
t.rewind = function(t){
	this.stop();
	this._time = (t == undefined) ? 0 : t;
	this.fixTime();
	this.update();
}
t.fforward = function(){
	this._time = this._duration;
	this.fixTime();
	this.update();
}
t.update = function(){
	this.setPosition(this.getPosition(this._time));
	}
t.startEnterFrame = function(){
	this.stopEnterFrame();
	this.isPlaying = true;
	this.onEnterFrame();
}
t.onEnterFrame = function(){
	if(this.isPlaying) {
		this.nextFrame();
		setTimeout(Delegate.create(this, this.onEnterFrame), 0);
	}
}
t.nextFrame = function(){
	this.setTime((this.getTimer() - this._startTime) / 1000);
	}
t.stop = function(){
	this.stopEnterFrame();
	this.broadcastMessage('onMotionStopped',{target:this,type:'onMotionStopped'});
}
t.stopEnterFrame = function(){
	this.isPlaying = false;
}

t.continueTo = function(finish, duration){
	this.begin = this._pos;
	this.setFinish(finish);
	if (this._duration != undefined)
		this.setDuration(duration);
	this.start();
}
t.resume = function(){
	this.fixTime();
	this.startEnterFrame();
	this.broadcastMessage('onMotionResumed',{target:this,type:'onMotionResumed'});
}
t.yoyo = function (){
	this.continueTo(this.begin,this._time);
}

t.addListener = function(o){
	this.removeListener (o);
	return this._listeners.push(o);
}
t.removeListener = function(o){
	var a = this._listeners;	
	var i = a.length;
	while (i--) {
		if (a[i] == o) {
			a.splice (i, 1);
			return true;
		}
	}
	return false;
}
t.broadcastMessage = function(){
	var arr = new Array();
	for(var i = 0; i < arguments.length; i++){
		arr.push(arguments[i])
	}
	var e = arr.shift();
	var a = this._listeners;
	var l = a.length;
	for (var i=0; i<l; i++){
		if(a[i][e])
		a[i][e].apply(a[i], arr);
	}
}
t.fixTime = function(){
	this._startTime = this.getTimer() - this._time * 1000;
}
t.getTimer = function(){
	return new Date().getTime() - this._time;
}
Tween.backEaseIn = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*(t/=d)*t*((s+1)*t - s) + b;
}
Tween.backEaseOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158;
	return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
}
Tween.backEaseInOut = function(t,b,c,d,a,p){
	if (s == undefined) var s = 1.70158; 
	if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
	return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
}
Tween.elasticEaseIn = function(t,b,c,d,a,p){
		if (t==0) return b;  
		if ((t/=d)==1) return b+c;  
		if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) {
			a=c; var s=p/4;
		}
		else 
			var s = p/(2*Math.PI) * Math.asin (c/a);
		
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	
}
Tween.elasticEaseOut = function (t,b,c,d,a,p){
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
	}
Tween.elasticEaseInOut = function (t,b,c,d,a,p){
	if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) var p=d*(.3*1.5);
	if (!a || a < Math.abs(c)) {var a=c; var s=p/4; }
	else var s = p/(2*Math.PI) * Math.asin (c/a);
	if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
}

Tween.bounceEaseOut = function(t,b,c,d){
	if ((t/=d) < (1/2.75)) {
		return c*(7.5625*t*t) + b;
	} else if (t < (2/2.75)) {
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	} else if (t < (2.5/2.75)) {
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	} else {
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}
Tween.bounceEaseIn = function(t,b,c,d){
	return c - Tween.bounceEaseOut (d-t, 0, c, d) + b;
	}
Tween.bounceEaseInOut = function(t,b,c,d){
	if (t < d/2) return Tween.bounceEaseIn (t*2, 0, c, d) * .5 + b;
	else return Tween.bounceEaseOut (t*2-d, 0, c, d) * .5 + c*.5 + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}

Tween.regularEaseIn = function(t,b,c,d){
	return c*(t/=d)*t + b;
	}
Tween.regularEaseOut = function(t,b,c,d){
	return -c *(t/=d)*(t-2) + b;
	}

Tween.regularEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
	}
Tween.strongEaseIn = function(t,b,c,d){
	return c*(t/=d)*t*t*t*t + b;
	}
Tween.strongEaseOut = function(t,b,c,d){
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
	}

Tween.strongEaseInOut = function(t,b,c,d){
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
	}