﻿// Zufallsauswahl von Kundenbildern und Meinungen (englisch)
// Sonderanwendung für Swissvault Webauftritt
// By MHM & Partner AG 2009
// Sascha Lorenz


    var num  = null;
    var ScriptStartup = (
        function () {
                    var doml = new Array(); // dom loaded
                    var winl = new Array(); // window loaded
                    var doml_scripts_ready = true;
                    var window_ready       = false;
                               
                    var browser = {
                        safari:/WebKit/i.test(navigator.userAgent),
                        ie:/MSIE/i.test(navigator.userAgent),
                        ff:/Firefox/i.test(navigator.userAgent),
                        opera:/Opera/i.test(navigator.userAgent)
                    }
                                
        function initLoadingUntilDomReady () {
                        doml_scripts_ready = false;
						
							// Wenn Internet Explorer
                            if(browser.ie) {
                               document.onreadystatechange = function () {
                                //var strCompare = (Number(navigator.appVersion.split(";")[1].substr(6)) >= 7)? "interactive" : "complete";
								
								if(document.readyState == "complete")
                                     window.setTimeout(startUpDomLoaded,1); 
							}
							
							// Wenn FireFox oder Opera
							
                        } else if (browser.ff || browser.opera) {
                            if(document.addEventListener)
                                document.addEventListener('DOMContentLoaded',startUpDomLoaded,false);
                        }
                    }
                                
                    function initLoadingUntilWindowReady () {
                        window.onload = function () {
                            window_ready = true;
                            for(var i = 0 ; i < winl.length;i++) winl[i]();
                        }
                    }
                                
                    function startUpDomLoaded() {
					
                        for(var i = 0 ; i < doml.length;i++) doml[i]();
                        doml_scripts_ready = true;                        
                        if(window_ready) startUpWindowLoaded();
                        else             
						initLoadingUntilWindowReady();
                    }
                                
                    function startUpWindowLoaded () {
                        if(!doml_script_ready) return;
                        for(var i = 0 ; i < winl.length;i++) winl[i]();
                    }
                                
                    return {
                        /**
                        * Ladevorgang fuer script starten 
                        * @access public
                        * @params Object func                // function
                        * @params boolean DOMLoaded          // start Script Function if DOMLoaded
                        * @return void
                        */
						
                        addLoad:function(func,DOMLoaded){                            
                            if(DOMLoaded && (browser.ie || browser.ff || browser.opera) ) {
                                doml.push(func);
                            } else {
                                winl.push(func);
                            }
                        },
                        initLoad:function () {
                            if(doml.length > 0) initLoadingUntilDomReady() ;
                            else                initLoadingUntilWindowReady() 
                        }
                    }
                }
            )();
            
            /*
            * Hauptprogramm
            */
			
			
			// Bildarray
            var images = new Array();
                images.push('/Data/Sites/1/images/kunden/dhausherr.gif');   	//1
                images.push('/Data/Sites/1/images/kunden/kirin.jpg');       	//2  
                images.push('/Data/Sites/1/images/kunden/weilenmann.gif');	//3 
		images.push('/Data/Sites/1/images/kunden/ruettimann.gif');	//4 
		images.push('/Data/Sites/1/images/kunden/schneider.gif');	//5
		images.push('/Data/Sites/1/images/kunden/imholz.gif');		//6
		images.push('/Data/Sites/1/images/kunden/claassen.gif');	//7 
		images.push('/Data/Sites/1/images/kunden/furrer.gif');		//8 
		images.push('/Data/Sites/1/images/kunden/faessler.gif');	//9 
		images.push('/Data/Sites/1/images/kunden/kuenz.gif');		//10 
		images.push('/Data/Sites/1/images/kunden/ellyvandijk.gif');	//11 
		images.push('/Data/Sites/1/images/kunden/kaeppeli.gif');	//12 
		images.push('/Data/Sites/1/images/kunden/walser.jpg');		//13 
		images.push('/Data/Sites/1/images/kunden/scherz.gif');		//14 
		images.push('/Data/Sites/1/images/kunden/wandfluh.jpg');	//15 
		images.push('/Data/Sites/1/images/kunden/naville.jpg');		//17
		images.push('/Data/Sites/1/images/kunden/madoerin.jpg');	//18 
		images.push('/Data/Sites/1/images/kunden/chapi.jpg');		//19
		images.push('/Data/Sites/1/images/kunden/erwinbauer.jpg');	//20
		images.push('/Data/Sites/1/images/kunden/parzner.jpg');		//21
		images.push('/Data/Sites/1/images/kunden/amstutz.jpg');		//22 
		images.push('/Data/Sites/1/images/kunden/bretscher.jpg');	//23 
		images.push('/Data/Sites/1/images/kunden/Cosandey.jpg');	//24 
		images.push('/Data/Sites/1/images/kunden/stahl.jpg');		//25 
		images.push('/Data/Sites/1/images/kunden/patak.jpg');		//26 
		images.push('/Data/Sites/1/images/kunden/baumann.jpg');		//27 
		images.push('/Data/Sites/1/images/kunden/bigler.jpg');		//28 
		images.push('/Data/Sites/1/images/kunden/gehrig.jpg');		//29 
		images.push('/Data/Sites/1/images/kunden/walti.jpg');		//30 
		images.push('/Data/Sites/1/images/kunden/saurer.jpg');		//32 
		images.push('/Data/Sites/1/images/kunden/anna.jpg');		//33 
		images.push('/Data/Sites/1/images/kunden/schneeberger.jpg');	//34 
		images.push('/Data/Sites/1/images/kunden/bbretscher.jpg');	//35 
		images.push('/Data/Sites/1/images/kunden/hampe.jpg');		//36 
		images.push('/Data/Sites/1/images/kunden/legler.jpg');		//37 
		images.push('/Data/Sites/1/images/kunden/jaeck.jpg');		//38 
		images.push('/Data/Sites/1/images/kunden/serret.jpg');		//39 
		images.push('/Data/Sites/1/images/kunden/meyerstein.jpg');	//40 
		images.push('/Data/Sites/1/images/kunden/kuhn.jpg');		//41 
		images.push('/Data/Sites/1/images/kunden/Albisser.jpg');	//42 
		images.push('/Data/Sites/1/images/kunden/wehrli.gif');	        //43 
		images.push('/Data/Sites/1/images/kunden/psidler.gif');		//44 
		images.push('/Data/Sites/1/images/kunden/angehrn.gif');		//45 
		images.push('/Data/Sites/1/images/kunden/schweizer.gif');	//46 
		images.push('/Data/Sites/1/images/kunden/hagenbuch.gif');	//47 
		images.push('/Data/Sites/1/images/kunden/stahl.gif');		//48 
		images.push('/Data/Sites/1/images/kunden/borelli.gif');		//49 
		images.push('/Data/Sites/1/images/kunden/Stebo.gif');		//50
		images.push('/Data/Sites/1/images/kunden/koeppel.gif');		//51
		images.push('/Data/Sites/1/images/kunden/paullipp.gif');  	//52
		images.push('/Data/Sites/1/images/kunden/mhaack.gif');  	//53
		images.push('/Data/Sites/1/images/kunden/rotzetter.gif');  	//54
		images.push('/Data/Sites/1/images/kunden/lazar.gif');  	//55
		images.push('/Data/Sites/1/images/kunden/kuettel.gif');  	//56
		images.push('/Data/Sites/1/images/kunden/Birri.gif');  	//57
		images.push('/Data/Sites/1/images/kunden/ryffel.gif');  	//58
				
				
			
			
				
             // Textarray fuer Meinungen auf Englisch
			var opinions = new Array();
                opinions.push("SWISSVAULT highlights our data on a daily basis for changes");					//1 
                opinions.push("Improvement in efficiency with the SWISSVAULT butler");											//2 
                opinions.push("Thanks to SWISSVAULT, our backup does not put up a fuss");								//3 
				opinions.push("Our backup butler has received a full time employment right from the start");					//4 
				opinions.push("Thanks to SWISSVAULT changing the annoying tapes is no longer required");									//5 
				opinions.push("SWISSVAULT reduces our daily administrative burden");						//6 
				opinions.push("Der Backup Butler protects us from a disaster in our IT environment");					//7 
				opinions.push("A data loss on our Mac would be very annoying!");							//8 
				opinions.push("Because we simply can't afford a data loss");						//9 
				opinions.push("The backup butler ideally takes car of our tournament data");					//10 
				opinions.push("Daily monitoring through SWISSVAULT AG");								//11 
				opinions.push("SWISSVAULT is an integral component of the Inspirion Datacenter");							//12 
				opinions.push("Highest security for diverse operating systems");						//13 
				opinions.push("A data loss would be devastating for us - our backup butler potects us");				//14 
				opinions.push("Secure, fast and expandable - all our expecations were fulfilled!");					//15 
				opinions.push("The valuable contacts of AMCHAM belong inside the SWISS FORT KNOX!");									//17 
				opinions.push("A fully automatic data backup service - the dream of every SME organization");			//18 
				opinions.push("Passport and credit card gone - SWISSVAULT will help!");								//19 
				opinions.push("SWISSVAULT is my international butler for data");									//20 
				opinions.push("To protect my personal computer data I accept only the most secure solution");										//21 
				opinions.push("Nowadays I safe data in-between office and federal parliament");									//22 
				opinions.push("I do not improvise with data!");														//23 
				opinions.push("Automatic, fast and secure - that's what I appreciate!");									//24 
				opinions.push("Secure without my involvement - that's the main thing!");										//25 
				opinions.push("To have a backup is a legal obligation for every company!");											//26 
				opinions.push("SWISSVAULT Solo = Confidentialityt + Security + Mobility");							//27 
				opinions.push("The Pharao would have liked a backup butler as well!");								//28 
				opinions.push("The Backup Butler secures me and my clients!");										//29 
				opinions.push("Data security is part of corporate governance!");										//30 
				opinions.push("My data insurance is the backup butler!");											//32 
				opinions.push("The backup butler is also a cat fan");														//33 
				opinions.push("Stop with Russian roulette!");															//34 
				opinions.push("The data loss bogy is now thretening with overtime unavailingly");			//35 
				opinions.push("I hate backups!");																	//36 
				opinions.push("Living in the airplane but still having all my data secured");											//37 
				opinions.push("Never again losing any data !");																//38 
				opinions.push("I love my backup butler!");														//39 
				opinions.push("I won't give away the butler anymore - my data specialist!");								//40 
				opinions.push("I don't have any time for backups - that's what I have a butler for!");									//41 
				opinions.push("Wherever I land - thanks to SWISSVAULT Solo my personal data follows me everywhere.");//42
				opinions.push("SWISSVAULT - our efficient data backup");//43
				opinions.push("SWISSVAULT - our data insurance");//44
				opinions.push("SWISSVAULT luckily doesn't know a busy signal");//45
				opinions.push("Thanks to SWISSVAULT we wouldn't loose everything in case of a complete desaster");//46
				opinions.push("...because there is no protective clothing for computers");//47
				opinions.push("The backup butler became instantly a full member of our association");//48
				opinions.push("Thanks to SWISSVAULT our data will never receive a reminder");//49
				opinions.push("SWISSVAULT Combo - daily monitoring via console");//50
				opinions.push("Fully automatic backup, thanks to SWISSVAULT");//51
				opinions.push("Thanks to SWISSVAULT we will never face a data rescue mission"); 		//52
				opinions.push("With SWISSVAULT our data is no mine field!"); 		//53
				opinions.push("Luckily, we don't need to care for our data!"); 		//54
				opinions.push("We don't play Roulette with our data!"); 		//55
				opinions.push("Ideally parked in the Mountain!"); 		//56
				opinions.push("So that our data will also never crumble!"); 		//57
				opinions.push("SWISSVAULT - at the speed of a marathon!"); 		//58
				
				
				
				
			// Textarray fuer Name und Firma auf English
			var stats = new Array();
                stats.push("Dominik Hausherr, Leiter Rechnungswesen RIBAG");												//1 
                stats.push("Vjeko Kirin, IT Projektleiter Implenia");														//2 
                stats.push("Juerg Weilenmann, Office Manager Salto Natale");												//3 
				stats.push("David Ruettimann, Leiter IT Joker");															//4 
				stats.push("Beat Schneider, Gemeindeverwalter Gemeinde Wimmis");											//5 
				stats.push("Daniela Imholz-Sieber, Geschaeftsleiterin Konzerthaus Schuur");								    //6 
				stats.push("Willy Claassen, Geschaeftsleitung Atrium - design ag");											//7 
				stats.push("Xaver Furrer, Gruender Zehnt Lenhof");															//8 
				stats.push("Lukas Faessler, lic.iur. Rechtsanwalt & Informatikexperte e-comTRUST");							//9 
				stats.push("Ruedi Kunz, Turnierdirektor SWATCH FIVB Beach Volley World Tour");								//10 
				stats.push("Elly van Dijk, IT-Manager Plast Working AG");															//11 
				stats.push("Pius Kaeppeli, Geschaeftsleitung inspirion");													//12 
				stats.push("Marco G. Walser, Saeckelmeister Gemeinde Freienbach");											//13 
				stats.push("Andrea Scherz, General Manager Gstaad Palace ");												//14 
				stats.push("Hansruedi Wandfluh, CEO Wandfluh AG ");															//15 
				stats.push("Martin Naville, CEO Swiss-American Chamber of Commerce, 8001 Zuerich");							//17 
				stats.push("Dr. iur. Bernhard Madoerin, CEO Artax Fide Consult, 4002 Basel");								//18 
				stats.push("Stephane Chapuisat, Fussballprofi, 3280 Murten");												//19 
				stats.push("Prof. Dr. med. Erwin Bauer, Herzchirurg und Verwaltungsrat, 8008 Zuerich");						//20 
				stats.push("Peter Arzner, Inhaber Arzner Software, 4164 Hochwald");											//21 
				stats.push("Adrian Amstutz, Unternehmer und Nationalrat, 3655 Sigriswil");									//22 
				stats.push("Max F. Bretscher,  lic. oec. publ. / CISA, CISM, Informatikrevisor, 8135 Langnau a.A.");		//23 
				stats.push("Peter Cosandey,  lic. iur. / Peter Cosandey Management Consulting, 6340 Baar");					//24 
				stats.push("Juerg Stahl,  Geschaeftsleitung Groupe Mutuel und Nationalrat, 8406 Winterthur");				//25 
				stats.push("Dr. iur. Sascha Patak, Rechtsanwalt, 8700 Kuesnacht");											//26 
				stats.push("Hans-Joerg Baumann lic. oec. publ. Unternehmer im Finanzbereich, 8000 Zuerich");				//27 
				stats.push("Dr. Robert R. Bigler Asian & Egyptian Art, 8000 Zuerich");										//28 
				stats.push("Gregor Gehrig,  Inhaber BSC Business Solution Center, 5408 Ennetbaden");						//29 
				stats.push("Dr. iur. Peter R. Walti, MBA (IMD) CMC Management Consultant und Verwaltungsrat, 8000 Zuerich");//30 
				stats.push("Thomas Saurer, Versicherungsagent und Event Manager, 3655 Sigriswil");							//32 
				stats.push("Anna Steyer, Inhaberin www.chatara.com Zuerich und Mooslargue, Schweiz und Frankreich");		//33
				stats.push("Hannes Schneeberger, Niederlassungsleiter CTA AG, 3110 Muensingen");							//34 
				stats.push("Brigitta G. Bretscher, Primarlehrerin, 8800 Thalwil");											//35 
				stats.push("Hampe Wuethrich, Werber und Gastgeber Mooslargue, Frankreich");									//36
				stats.push("Hans-Peter Legler, President Sales & Marketing Reichle & De-Massari AG, 8620 Wetzikon");		//37 
				stats.push("Dr. med. Werner Jaeck,  Chirurg Traumazentrum Hirslanden, 8029 Zuerich");						//38 
				stats.push("Andrea Serret,  Verkauf Creation d'Ambiance Interieur, 3780 Gstaad");							//39 
				stats.push("Beat Meyerstein,  Unternehmer, Autop AG, 5610 Wohlen");											//40 
				stats.push("Reto Kuhn, Unternehmer, QN Gastro AG, 8307 Effretikon");										//41 
				stats.push("Marcello Albisser, Linienpilot ,6596 Gordola");												//42
				stats.push("Thomas Wehrli, IT Manager Eisenbahner-Baugenossenschaft Bern");												//43
				stats.push("Peter Sidler, Director Hotel Plattenhof");												//44
				stats.push("Richard Angehrn, Sales & Marketing Telcoma");												//45
				stats.push("Martin Schweizer, IT Manager Acutronic");												//46
				stats.push("Doris Hagenbuch, Accounting & IT Manager Protex AG");												//47
				stats.push("Axel Stahl, IT Manager Gewerbeverband Basel-Stadt");												//48
				stats.push("Giovanni Borrelli, President of the board CashYourself.ch");												//49
				stats.push("Stephan Boss, CEO boss bern");												//50
				stats.push("Margit Köppel, Chairwoman Autism help east Switzerland");												//51
				stats.push("Paul Lipp, Commercial Manager Air Grischa AG");							//52
				stats.push("Mirjam Haack, Marketing Stiftung Welt ohne Minen");							//53                                  
				stats.push("Andre Rotzetter, CEO VAOF");							//54
				stats.push("Dan Lazar, IT-Manager, Casino Crans-Montana SA");							//55
				stats.push("Roman Küttel, Technical Director Parking Zürich AG");							//56
				stats.push("Martin Birri, Head of Finance and Accounting, Granol Ltd");							//57
				stats.push("Markus Ryffel, Owner and Managing Director Ryffel Running");							//58
                              
            
			// Holt Cookie
			function holeKeks () {
                if(document.cookie) {
                    return /lastImageNumber=([0-9]+)/i.exec(document.cookie);
                } 
                return false;
            }
            

			// Setzt Cookie
            function setzekeks(wert) {
                if(!wert && wert != 0) return;
                var date = new Date();
                var ablauf = new Date(date.getTime()+1000*3600*24);
                document.cookie = 'lastImageNumber='+wert+
                                  ';expires='+ablauf.toGMTString()+';';
            }
            
			
			// Setzt Bild und Text, ueberprueft durch Cookie ob Kundenmeinung schonmal gezeigt wurde
            function loadImage () {
                var kekswert = null;
                //var num      = null;
				var text = null;
                
                var img = document.getElementById('headerimage');
				
                    img.src = '';
				
					
                
                if( (kekswert = holeKeks()) ) {
                    //cookie war bereits gesetzt
                    do {
                        num = Math.round(Math.random()*(images.length-1));
                    } while (num == parseInt(kekswert[1]));                    
                } else {
                    num = Math.round(Math.random()*(images.length-1));
                }            
                setzekeks(num);
                
                //Bild wird eingebunden
                
				img.src = images[num];
				
				// Meinung wird eingebunden
				var opinionText = document.createTextNode(opinions[num]);
				document.getElementById("Meinung").innerHTML = "";
				document.getElementById("Meinung").appendChild(opinionText);
				
				// Stats werden eingebunden 
				var statsText = document.createTextNode(stats[num]);
				document.getElementById("Stats").innerHTML = "";
				document.getElementById("Stats").appendChild(statsText);
            }   

			
ScriptStartup.addLoad(loadImage,true);
ScriptStartup.initLoad();




