
/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function hide(which, bool) {
var hide = new Array();
hide = document.getElementsByName(which);
	for (i=0; i<hide.length; i++) {
		if (bool == 1 )
		{
		 hide[i].width = 0;
		 hide[i].height = 0;
		}
		else
		{
		 hide[i].width = 17;
		 hide[i].height = 17;
		} 
	}
}

var loadedobjects=""
var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

//ajaxpage('external1', 'bilder/muster2_r2_c2.gif', 'rightcolumn','bilder')
function ajaxpageMain(url, imageurl, titelurl, containerid, imageid, titelid){

/*if( url == "external7.htm" ) {
fenster1=window.open("formular/n4yk_Anfrageformular Seite 1.php",'KleinesFenster','height=900,width=700,resizable=yes,scrollbars=yes,status=yes');
	}*/

ajaxiframe(url, containerid)
ajaxpage(imageurl, imageid)
ajaxiframe(titelurl, titelid)
//Set Navis to red Color
    picN1 = new Image(); //11
    picN1_ = new Image(); //11	
    picN1.src = "images/Home_r2_c3.jpg";
	picN1_.src = "images/Home_ROT_r2_c3.jpg";
    picN2 = new Image(); //12
	picN2_ = new Image(); //12
    picN2.src = "images/Institut_r2_c5.jpg";
    picN2_.src = "images/Institut_ROT_r2_c5.jpg";
    picN3 = new Image(); //13
	picN3_ = new Image(); //13
    picN3.src = "images/Kunden_r3_c7.jpg";
    picN3_.src = "images/Kunden_ROT_r3_c7.jpg";
    picN4 = new Image(); //14
	picN4_ = new Image(); //14
    picN4.src = "images/Potenzialanalyse_r3_c9.jpg";
    picN4_.src = "images/Potenzialanalyse_ROT_r3_c9.jpg";
    picN5 = new Image(); //15
	picN5_ = new Image(); //15
    picN5.src = "images/Coaching_r3_c15.jpg";
    picN5_.src = "images/Coaching_ROT_r3_c15.jpg";
    picN6 = new Image(); //16
	picN6_ = new Image(); //16
    picN6.src = "images/Feedback_r3_c17.jpg";
	picN6_.src = "images/Feedback_ROT_r3_c17.jpg";
    picN7 = new Image(); //17
	picN7_ = new Image(); //17
    picN7.src = "images/Presse_r3_c19.jpg";
	picN7_.src = "images/Presse_ROT_r3_c19.jpg";
	
  switch (url) {
//S1
    case "external1.htm":  	
	//Set Navi to RED COLOR
	document['S1'].src = picN1_.src; 
	//Set the rest to GREY
	document['S6'].src = picN6.src; 
	document['S2'].src = picN2.src; 
	document['S3'].src = picN3.src; 
	document['S4'].src = picN4.src; 
	document['S5'].src = picN5.src; 
	document['S7'].src = picN7.src; 
	break;

//S6
    case "external6.htm":  	
	//Set Navi to RED COLOR
	document['S6'].src = picN6_.src; 
	//Set the rest to GREY
	document['S1'].src = picN1.src; 
	document['S2'].src = picN2.src; 
	document['S3'].src = picN3.src; 
	document['S4'].src = picN4.src; 
	document['S5'].src = picN5.src; 
	document['S7'].src = picN7.src; 
	break;
//S7
    case "external7.htm":  	
	//Set Navi to RED COLOR
	document['S7'].src = picN7_.src; 
	//Set the rest to GREY
	document['S1'].src = picN1.src; 
	document['S2'].src = picN2.src; 
	document['S3'].src = picN3.src; 
	document['S4'].src = picN4.src; 
	document['S5'].src = picN5.src; 
	document['S6'].src = picN6.src; 
	break;	
}

}

function ajaxiframe(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpageiframe(page_request, containerid, url)
}
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpageiframe(page_request, containerid, url){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).src=url;
}

function NeuesFenster(URL)
{
fenster1=window.open(URL,'KleinesFenster','height=400,width=350,resizable=yes,scrollbars=yes');
}

/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/**********************************************************************************   
ScrollText 
*   Copyright (C) 2001 Thomas Brattli
*   This script was released at DHTMLCentral.com
*   Visit for more great scripts!
*   This may be used and changed freely as long as this msg is intact!
*   We will also appreciate any links you could give us.
*
*   Made by Thomas Brattli
*
*   Script date: 09/23/2001 (keep this date to check versions) 
*********************************************************************************/










function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=(navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=lib_bwcheck()



//If you want it to move faster you can set this lower, it's the timeout:
var speed = 20

//Sets variables to keep track of what's happening
var loop, timer

//Object constructor
function makeObj(obj,nest){
    nest=(!nest) ? "":'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=goUp;this.down=goDown;
	this.moveIt=moveIt; this.x=0; this.y=0;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function moveIt(x,y){
	this.x = x
	this.y = y
	this.css.left = this.x+px
	this.css.top = this.y+px
}

//Makes the object go up
function goDown(move){
	if (this.y>-this.scrollHeight+(oCont.clipHeight)){
		this.moveIt(0,this.y-move)
			if (loop) setTimeout(this.obj+".down("+move+")",speed)
	}
}
//Makes the object go down
function goUp(move){
	if (this.y<0){
		this.moveIt(0,this.y-move)
		if (loop) setTimeout(this.obj+".up("+move+")",speed)
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
	if (scrolltextLoaded){
		loop = true;
		if (speed>0) {
			oScroll.down(speed);
			//oScroll2.down(speed);
		}
		else {
			oScroll.up(speed);
			//oScroll2.up(speed);
		}
	}
}

//Stops the scrolling (called on mouseout)
function noScroll(){
	loop = false
	if (timer) clearTimeout(timer)
}
//Makes the object
var scrolltextLoaded = false
function scrolltextInit(){
	oCont = new makeObj('divScrollTextCont')
	oScroll = new makeObj('divText','divScrollTextCont')
	oScroll.moveIt(0,0)
	oCont.css.visibility = "visible"
alert(oCont);
/*	oCont2 = new makeObj('divScrollBildCont')
	oScroll2 = new makeObj('divBild','divScrollBildCont')
	oScroll2.moveIt(0,0)
	oCont2.css.visibility = "visible"
*/

	scrolltextLoaded = true
}
//Call the init on page load if the browser is ok...
if (bw.bw) onload = scrolltextInit




