//------cpFbTw---------------------------
cpFbTw = function(name){
	this.name=name;
	this.width=Array(62,62);
	this.ypos=0;
	this.xpos=20;
	this.xmlNext='';
	this.xmlResult='';
	this.xmlNextParams=null;
	this.click=null;
	this.div=Array();
	this.ypos;
	this.timeoutX=Array();

	this.xmlHttp = null;
	if (typeof XMLHttpRequest != 'undefined') { try  {this.xmlHttp = new XMLHttpRequest(); } catch(e) {} }
	if (!this.xmlHttp) { try { this.xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { this.xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { this.xmlHttp  = null;} } }

	this.init=function(){
		var self=this;
		if(document.getElementsByTagName('body').length>0) this.create();
		else setTimeout('cpFbTwItem[\''+this.name+'\'].init();',200);
	}

	this.create=function(){
		this.div[0]=document.createElement("a");
		this.div[1]=document.createElement("a");
		this.div[0].href='http://www.facebook.com/pages/Coach-Charter-Germany/276102822412198?sk=app_274878342534072';
		this.div[1].href='http://www.twitter.com/irroreisen';
		this.div[0].target=this.div[1].target='_blank';
		this.div[0].id=this.div[0].name=this.name+'_cpFbDiv';
		this.div[1].id=this.div[1].name=this.name+'_cpTwDiv';
		this.div[0].style.width=this.div[1].style.width='62px';
		this.div[0].style.height=this.div[1].style.height='65px';
		this.div[0].style.position=this.div[1].style.position='absolute';
		this.div[0].style.right=this.div[1].style.right='0px';
		this.ypos=Math.max(document.documentElement.scrollTop,document.body.scrollTop)+(document.documentElement.clientHeight-130)/2;
		this.div[0].style.top=this.ypos+'px';
		this.div[1].style.top=this.ypos+65+'px';
		this.div[0].style.zIndex=this.div[1].style.zIndex='104';
		this.div[0].style.display=this.div[1].style.display='block';
		this.div[0].style.cursor=this.div[1].style.cursor='pointer';
		this.div[0].style.background='url(\'pics/facebook.png\')';
		this.div[1].style.background='url(\'pics/twitter.png\')';
		document.getElementsByTagName('body')[0].appendChild(this.div[0]);
		document.getElementsByTagName('body')[0].appendChild(this.div[1]);
		var self=this;
		if (document.addEventListener) {
			window.addEventListener("scroll", function(e) { clearTimeout(self.TimeoutY); self.TimeoutY=setTimeout('cpFbTwItem[\''+self.name+'\'].scroll()',30); }, true);
			this.div[0].addEventListener("mouseover", function(e) { clearTimeout(self.timeoutX[0]); self.timeoutX[0]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollIn(0)',30); }, true );
			this.div[1].addEventListener("mouseover", function(e) { clearTimeout(self.timeoutX[1]); self.timeoutX[1]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollIn(1)',30); }, true );
			this.div[0].addEventListener("mouseout", function(e) { clearTimeout(self.timeoutX[0]); self.timeoutX[0]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollOut(0)',30); }, true );
			this.div[1].addEventListener("mouseout", function(e) { clearTimeout(self.timeoutX[1]); self.timeoutX[1]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollOut(1)',30); }, true );
		} else {
			window.attachEvent("onscroll", function(e) { self.scroll(e); }, true);
			this.div[0].attachEvent("onmouseover", function(e) { clearTimeout(self.timeoutX[0]); self.timeoutX[0]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollIn(0)',30); }, true );
			this.div[1].attachEvent("onmouseover", function(e) { clearTimeout(self.timeoutX[1]); self.timeoutX[1]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollIn(1)',30); }, true );
			this.div[0].attachEvent("onmouseout", function(e) { clearTimeout(self.timeoutX[0]); self.timeoutX[0]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollOut(0)',30); }, true );
			this.div[1].attachEvent("onmouseout", function(e) { clearTimeout(self.timeoutX[1]); self.timeoutX[1]=setTimeout('cpFbTwItem[\''+self.name+'\'].scrollOut(1)',30); }, true );
		}
	}

	this.scroll=function(){
		this.ypos=(((Math.max(document.documentElement.scrollTop,document.body.scrollTop)+(document.documentElement.clientHeight-130)/2)*0.2)+(this.ypos*0.8));
		this.div[0].style.top=this.ypos+'px';
		this.div[1].style.top=this.ypos+65+'px';
		if(Math.abs(this.ypos-(Math.max(document.documentElement.scrollTop,document.body.scrollTop)+(document.documentElement.clientHeight-413)/2))>10) {
			this.TimeoutY=setTimeout('cpFbTwItem[\''+this.name+'\'].scroll()',30);
		}
	}

	this.scrollIn=function(i){
		this.width[i]=Math.min(this.width[i]+25,199);
		this.div[i].style.width=this.width[i]+'px';
		if(this.width[i]<199) {
			clearTimeout(this.timeoutX[i]);
			this.timeoutX[i]=setTimeout('cpFbTwItem[\''+this.name+'\'].scrollIn('+i+')',30);
		}
	}

	this.scrollOut=function(i){
		this.width[i]=Math.max(this.width[i]-25,62);
		this.div[i].style.width=this.width[i]+'px';
		if(this.width[i]>62) {
			clearTimeout(this.timeoutX[i]);
			this.timeoutX[i]=setTimeout('cpFbTwItem[\''+this.name+'\'].scrollOut('+i+')',30);
		}
	}
	this.init();
}

var cpFbTwItem=Array();

function addcpFbTw(id){
	if(cpFbTwItem[id]==null) {
		cpFbTwItem[id]=new cpFbTw(id);
	}
}

