function openPic(url,winName,winParams)	{
	var theWindow = window.open("/"+url,winName,winParams);
	if (theWindow)	{theWindow.focus();}
}



  // decrypt helper function
function decryptCharcode(n,start,end,offset) {
	n = n + offset;
	if (offset > 0 && n > end)	{
		n = start + (n - end - 1);
	} else if (offset < 0 && n < start)	{
		n = end - (start - n - 1);
	}
	return String.fromCharCode(n);
}
  // decrypt string
function decryptString(enc,offset) {
	var dec = "";
	var len = enc.length;
	for(var i=0; i < len; i++)	{
		var n = enc.charCodeAt(i);
		if (n >= 0x2B && n <= 0x39)	{
			dec += decryptCharcode(n,0x2B,0x3A,offset);	// 0-9 . , - + / :
		} else if (n >= 0x40 && n <= 0x5A)	{
			dec += decryptCharcode(n,0x40,0x5A,offset);	// A-Z @
		} else if (n >= 0x61 && n <= 0x7A)	{
			dec += decryptCharcode(n,0x61,0x7A,offset);	// a-z
		} else {
			dec += enc.charAt(i);
		}
	}
	return dec;
}
  // decrypt spam-protected emails
function linkTo_UnCryptMailto(s)	{
	location.href = decryptString(s,-4);
}


/*
function UnCryptMailto(s) {	//
	var n=0;
	var r="";
	for(var i=0; i < s.length; i++) {
		n=s.charCodeAt(i);
		if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-(1));
	}
	return r;
}


function linkTo_UnCryptMailto(s)	{	//
	location.href=UnCryptMailto(s);
}
*/


    function change_screen_trailer(pfad, breite, hoehe, scroll, windowName){
        if (screen.width <= 800){
            if((breite + 10) >  screen.availWidth){breite = screen.availWidth - 10;};
            if((hoehe + 29) >  screen.availHeight){hoehe = screen.availHeight - 29;};
            screen_width = (screen.availWidth - breite - 10) / 2;
            screen_height = (screen.availHeight - hoehe - 29) / 2;
            screen_trailer = window.open(pfad, windowName, "width=" + breite + ", height=" + hoehe + ", top=" + screen_height + ", left=" + screen_width + ", scrollbars=" + scroll);
            screen_trailer.focus();
        }
        if (screen.width > 800){
            screen_width = (screen.availWidth - breite - 10) / 2;
            screen_height = (screen.availHeight - hoehe - 29) / 2;
            screen_trailer = window.open(pfad, windowName, "width=" + breite + ", height=" + hoehe + ", top=" + screen_height + ", left=" + screen_width + ", scrollbars=" + scroll);
            screen_trailer.focus();
        }
    }
    
    function change_screen_trainerintro(pfad, breite, hoehe, scroll, windowName){
        screen_width = (screen.availWidth - breite - 10) / 2;
        screen_height = (screen.availHeight - hoehe - 29) / 2;
        screen_trailer = window.open(pfad, windowName, "width=" + breite + ", height=" + hoehe + ", top=" + screen_height + ", left=" + screen_width + ", scrollbars=" + scroll);
        screen_trailer.focus();
    }

function printPage() {
if (window.print) {
jetztdrucken = confirm('Seite drucken ?');
if (jetztdrucken) window.print();
   }
}





function verifyCompatibleBrowser(){ 
    this.ver=navigator.appVersion 
    this.dom=document.getElementById?1:0 
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
    this.ie4=(document.all && !this.dom)?1:0; 
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
 
    this.ns4=(document.layers && !this.dom)?1:0; 
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
    return this 
} 
bw=new verifyCompatibleBrowser() 
 
 
var speed=50 
 
var loop, timer 
 
function ConstructObject(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=MoveAreaUp;this.down=MoveAreaDown; 
    this.MoveArea=MoveArea; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function MoveArea(x,y){ 
    this.x=x;this.y=y 
    this.css.left=this.x 
    this.css.top=this.y 
} 
 
function MoveAreaDown(move){ 
	if(this.y>-this.scrollHeight+objContainer.clipHeight){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".down("+move+")",speed) 
	} 
} 
function MoveAreaUp(move){ 
	if(this.y<0){ 
    this.MoveArea(0,this.y-move) 
    if(loop) setTimeout(this.obj+".up("+move+")",speed) 
	} 
} 
 
function PerformScroll(speed){ 
	if(initialised){ 
		loop=true; 
		if(speed>0) objScroller.down(speed) 
		else objScroller.up(speed) 
	} 
} 
 
function CeaseScroll(){ 
    loop=false 
    if(timer) clearTimeout(timer) 
} 
var initialised; 
function InitialiseScrollableArea(){ 
    objContainer=new ConstructObject('divContainer') 
    objScroller=new ConstructObject('divContent','divContainer') 
    objScroller.MoveArea(0,0) 
    objContainer.css.visibility='visible' 
    initialised=true; 
} 

function screencheck() {
	var hohe = screen.availHeight;

	if (hohe < 750) {
		document.getElementById("balken").style.marginTop = "-250px";
		document.getElementById("balken").style.top = "-250px";
	}
}

function detect() {
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
		var words = navigator.plugins["Shockwave Flash"].description.split(" ");
	    for (var i = 0; i < words.length; ++i)
	    {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
				if ( MM_FlashCanPlay ) {

						var gesamt = window.location.pathname;
						var pos = gesamt.lastIndexOf("/");
						var datei = gesamt.substring(pos + 1, gesamt.length);

						switch (datei) {
							case "wir.html":
							document.write("Automatische Weiterleitung zur Flash-Version");
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/wir/");
							break;
							case "mission.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/mission/");
							break;		
						}
				} 
				
				var hohe = screen.availHeight;
				
					if (hohe < 750) {
		document.getElementById("balken").style.marginTop = "-250px";
		document.getElementById("balken").style.top = "0px";
	}
				
}


function flashdetect() {


            function flash_detection(required, max)
            {
                var required_version = required;
                var max_version = max;
                var available_version = 0;

                if(typeof(navigator.plugins["Shockwave Flash"]) == "object")
                {
                    var description = navigator.plugins["Shockwave Flash"].description;
                    available_version = description.substr(16, (description.indexOf(".", 16) - 16));
                }
                 else if(typeof(ActiveXObject) == "function")
                {
                    for(var i = 2; i < (max_version + 1); i ++)
                    {
                        try
                        {
                            if(typeof(new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i)) == "object")
                            {
                                available_version = i;
                            }
                       }
                       catch(error)
                       {
                       }
                    }
                }
                return [available_version, required_version];
            }


            var result = flash_detection(7, 7);
            if(!result[0])
            {
                //alert("kein flash plugin installiert");
            }
             else if(result[0] < result[1])
            {
                //alert("installierte version zu niedrig");
            }
             else
            {

						var gesamt = window.location.pathname;
						var pos = gesamt.lastIndexOf("/");
						var projekte = gesamt.indexOf("projekte");
						var portfolio = gesamt.indexOf("portfolio");
						var netzwerk = gesamt.indexOf("netzwerk");
						var news = gesamt.indexOf("news");
						var datei = gesamt.substring(pos + 1, gesamt.length);
						switch (datei) {
							case "":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;
							case "wir.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/wir/");
							break;
							case "mission.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/mission/");
							break;	
							case "credo.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/credo/");
							break;
							case "team.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;
							case "florian-hospach.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;	
							case "jannis-klepper.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;	
							case "petar-bidlingmaier.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;								
							case "jannis-klepper.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;	
							case "corinne-marczynski.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;							
							case "sandra-hahn.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;							
							case "tobias-jaeger.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;							
							case "nina-junghans.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;							
							case "christian-list.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/team/");
							break;							
							case "news.html":
							//window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/news/");
							window.location.replace("http://www.sitibi.de/");
							break;	
							case "imprint.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/imprint/");
							break;	
							case "formular.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/formular/");
							break;	
							case "newsletter.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/newsletter/");
							break;	
							case "kunden.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/kunden/");
							break;	
							case "zielgruppen.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/zielgruppen/");
							break;	
							case "design-agentur-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;
							case "eventmarketing-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "incentive-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "eventagentur-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "promotionagentur-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "werbeagentur-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;		
							case "messehostessen-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "eventmanagement-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "jugendmarketing-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
							case "promotion-stuttgart.html":
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/");
							break;	
						}

						if  (projekte > -1) {
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/projekte/");
						}
						if  (portfolio > -1) {
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/portfolio/");
						}
						if  (netzwerk > -1) {
							window.location.replace("http://www.sitibi.de/www.sitibi.de_typo3/CMS/fileadmin/sitibi2008new/#/netzwerk/");
						}
						/*if  (news > -1) {
							window.location.replace("http://www.sitibi.de/");
						}*/
            }
          //-->


}

