/////////////////////////////////////////////////////////////////////////
////Funktionen zum scalieren der scrollboxen /////

function getwindowheight(){
    var y;
    if (self.innerHeight){ // all except Explorer
    //	x = self.innerWidth;
    	y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight){
    	// Explorer 6 Strict Mode
    //	x = document.documentElement.clientWidth;
    	y = document.documentElement.clientHeight;
    }
    else if (document.body){ // other Explorers
    //	x = document.body.clientWidth;
    	y = document.body.clientHeight;
    }
    return y;
}

function getwindowwidth(){
    var x;
    if (self.innerHeight){ // all except Explorer
    	x = self.innerWidth;
    //	y = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight){
    	// Explorer 6 Strict Mode
    	x = document.documentElement.clientWidth;
    //	y = document.documentElement.clientHeight;
    }
    else if (document.body){ // other Explorers    
    	x = document.body.clientWidth;
    //	y = document.body.clientHeight;
    }
    return x;
}

function getattributval(sdiv,attrib){
     l=sdiv.attributes.length;
     for(i=0;i<l;i++){ // alert(sdiv.attributes[i].name);
        if(sdiv.attributes[i].name==attrib){
           return sdiv.attributes[i].value;
        } 
     }  
     return '45_170'; 
}

function showimg(img,pfad)
{
   var wert = 'showimg.php?img='+img+'&fld='+pfad;
   popup = window.open('http://www.fini-online.com/bf/php/phpimage/'+wert, 'Image_Zoom', 'width=800, height=600,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1');
   popup.focus();
}

var frameWidth = 420, frameHeight = 280;

function getW()
{
    if (self.innerWidth){
    	frameWidth = self.innerWidth;
    	frameHeight = self.innerHeight;
    }
    else if (document.body){
    	frameWidth = document.body.clientWidth;
    	frameHeight = document.body.clientHeight;
    } else 
    try{
       if (document.documentElement && document.documentElement.clientWidth) {
       	frameWidth = document.documentElement.clientWidth;
      	frameHeight = document.documentElement.clientHeight;
      }
    }catch(e){};
}

function setW(W,H,wDec,hDec)
{
    if(document.getElementById("sl")){
    
        getW();
        frameWidth=frameWidth-wDec;
        frameHeight=frameHeight-hDec;
        if((W<frameWidth) || (H<frameHeight))
        {
    		   if((frameWidth/W) > (frameHeight/H))
    		   { try{ 
    			    document.getElementById("sl").height=frameHeight;   
    			   }catch(r){}; 
    			 }
    			 else
    			 {  try{ 
    			    document.getElementById("sl").width=frameWidth;
    			    }catch(r){}; 
    			 }
    		}
    		
    		if((W>frameWidth) || (H>frameWidth))
    		{
    		   if((frameWidth/W) > (frameHeight/H))
    		   {  try{ 
              document.getElementById("sl").height=frameHeight;           			    
              }catch(r){}; 
    		   }
    		   else
    		   {  try{ 
    		      document.getElementById("sl").width=frameWidth;
    		      }catch(r){}; 
    		   }
    		}
    }		
}

function doresize(){  
       var sdiv = document.getElementById("scrollbox");
       if(sdiv){
          fnheight=getwindowheight();
          fnwidth=getwindowwidth();  
			 tmpval = getattributval(sdiv,"class");
			 a_tmpval = tmpval.split('_'); 
			 minWidth = a_tmpval[0]; 			 
			 minHeight = a_tmpval[1]; 			 			 
			 //alert(minHeight + "-" + minWidth);
			 //alert(fnHeight + "-" + fnWidth);
 	     h = fnheight - minHeight;
 	     w = fnwidth - minWidth; 	
		//alert(h+'#'+w);
			 h = h + "px";
			 w = w + "px";
			 if(h != sdiv.style.height){
 	       sdiv.style.height = h;
			 }
			 if(w != sdiv.style.width){
 	       sdiv.style.width = w;
 	     }
  }   
}    	

/*      
				 thanx to joe where I did a copy & paste of the following giving me the
				 chance of beeing lazy instead of doing the little script on my own ... ;-)
         http://www.joe-ks.com
*/

var statement=""

function process(){
     statement = mission();
     alert(statement);
     return false;
}

function randomarray(a) {
     var i;
     for (i=a.length;i--;) {
       var j = Math.floor((i+1)*Math.random());
       var temp = a[i];
       a[i] = a[j];
       a[j] = temp;
     }
  return a;
}       

function mission() {

var openers = new Array (
   'It is our business to', 'It is our job to', 'It is our mission to',
   'It\'s our responsibility to', 'Our challenge is to', 'Our first priority is to',
   'Our goal is to', 'Our mission is to', 'Our mission is to continue to',
   'The customer can count on us to', 'We', 'We build trust and teamwork to',
   'We envision to', 'We exist to', 'We have committed to',
   'We strive to', 'We will'
);

var adverbs = new Array (
   'appropriately', 'assertively', 'authoritatively', 'collaboratively',
   'competently', 'completely', 'continually', 'conveniently', 'credibly',
   'distinctively', 'dramatically', 'dynamically', 'efficiently',
   'enthusiastically', 'globally', 'holisticly', 'interactively',
   'intrinsicly', 'objectively', 'proactively', 'professionally',
   'progressively', 'quickly', 'seamlessly', 'synergistically'
);

var verbs = new Array (
   'actualize', 'administrate', 'build', 'communicate', 'conceptualize',
   'coordinate', 'create', 'customize', 'develop', 'disseminate', 'empower',
   'engineer', 'enhance', 'facilitate', 'fashion', 'foster', 'impact',
   'initiate', 'integrate', 'leverage existing', 'leverage other\'s',
   'maintain', 'negotiate', 'network', 'parallel task', 'promote',
   'provide access to', 'pursue', 're-engineer', 're-invent', 'restore',
   'revolutionize', 'simplify', 'streamline', 'supply', 'utilize'
);

var adjectives = new Array (
   'accurate', 'adaptive', 'alternative', 'an expanded array of',
   'backward-compatible', 'best of breed', 'business', 'client-based',
   'client-centered', 'client-centric', 'client-focused', 'collaborative',
   'competitive', 'cooperative', 'corporate', 'cost effective',
   'cross functional', 'cross-unit', 'customer directed', 'cutting edge',
   'distinctive', 'diverse', 'economically sound', 'effective', 'emerging', 
   'empowered', 'enabled', 'enterprise-wide', 'equity invested', 'error-free',
   'ethical', 'excellent', 'exceptional', 'flexible', 'fully researched',
   'fully tested', 'functional', 'functionalized', 'future-proof', 'global',
   'go forward', 'goal-oriented', 'high standards in', 'high-payoff',
   'high-quality', 'highly efficient', 'inexpensive', 'innovative',
   'installed base', 'integrated', 'interactive', 'interdependent',
   'interoperable', 'just in time', 'leading-edge', 'leveraged',
   'long-term high-impact', 'low-risk high-yield', 'maintainable',
   'market positioning', 'market-driven', 'mission-critical',
   'multidisciplinary', 'multifunctional', 'multimedia based', 'optimal',
   'orthogonal', 'parallel', 'performance based', 'premier', 'premium',
   'principle-centered', 'proactive', 'process-centric', 'professional',
   'progressive', 'prospective', 'quality', 'reliable',
   'resource maximizing', 'resource-leveling', 'scalable', 'stand-alone',
   'standards compliant', 'state of the art', 'strategic', 'superior',
   'sustainable', 'tactical', 'team building', 'team driven',
   'technically sound', 'timely', 'top-line', 'turnkey', 'unique',
   'user friendly', 'value-added', 'virtual', 'world-class', 'worldwide'
);

var nouns = new Array (
   '"outside the box" thinking', 'action items', 'alignments', 'benefits',
   'best practices', 'catalysts for change', 'collaboration and idea-sharing',
   'content', 'core competencies', 'customer service', 'data', 'deliverables',
   'e-business', 'expertise', 'growth strategies', 'human capital', 'ideas',
   'imperatives', 'information', 'infrastructures', 'initiatives', 'innovation',
   'intellectual capital', 'internal or "organic" sources', 'leadership',
   'leadership skills', 'manufactured products', 'materials', 'meta-services',
   'methods of empowerment', 'metrics', 'niche markets', 'opportunities',
   'paradigms', 'potentialities', 'process improvements', 'processes',
   'products', 'quality vectors', 'resources', 'results', 'scenarios',
   'services', 'solutions', 'sources', 'strategic theme areas', 'supply chains',
   'synergy', 'technology', 'testing procedures', 'total linkage', 'value'
);

var conjunctions = new Array (
   'and', 'and also', 'and continue to', 'as well as to', 'in order that we may',
   'in order to', 'so that we may', 'so that we may endeavor to', 
   'such that we may continue to', 'to allow us to', 'while continuing to'
);

var closers = new Array (
   'and approach our jobs with passion an commitment',
   'because that is what the customer expects',
   'for 100% customer satisfaction', 'in order to solve business problems',
   'so that we can deliver the kind of results on the bottom line that our investors expect and deserve',
   'through continuous improvement', 'to be the best in the world',
   'to delight the customer', 'to exceed customer expectations',
   'to meet our customer\'s needs', 'to satisfy our internal and external customers',
   'to set us apart from the competition', 'to stay competitive in tomorrow\'s world',
   'while maintaining the highest standards', 'while promoting personal employee growth',
 'while striving for technical leadership', 'with 100% on-time delivery', 'with zero defects'
);

        openers = randomarray(openers);
        adjectives = randomarray(adjectives);
        nouns = randomarray(nouns);
        adverbs = randomarray(adverbs);
        verbs = randomarray(verbs);
        conjunctions = randomarray(conjunctions);
        closers = randomarray(closers);

        var x;
        var statement = openers[openers.length-1];
        openers.length -= 1;
        
        statement = statement + " " + adverbs[adverbs.length-1];
        adverbs.length -= 1;
        statement = statement + " " + verbs[verbs.length-1];
        verbs.length -= 1;
        statement = statement + " " + adjectives[adjectives.length-1];
        adjectives.length -= 1;
        statement = statement + " " + nouns[nouns.length-1];
        nouns.length -= 1;
        for (x=0;x<2;x++) {
                if (Math.random() > .5) {
                        statement = statement + " " + conjunctions[conjunctions.length-1];
                        conjunctions.length -= 1;
                        statement = statement + " " + adverbs[adverbs.length-1];
                        adverbs.length -= 1;
                        statement = statement + " " + verbs[verbs.length-1];
                        verbs.length -= 1;
                        statement = statement + " " + adjectives[adjectives.length-1];
                        adjectives.length -= 1;
                        statement = statement + " " + nouns[nouns.length-1];
                        nouns.length -= 1;
                }
        }
 
        statement = statement + " " + closers[closers.length-1];
        closers.length -= 1;
        statement = statement + ".";
        
        return statement;
}
		   

////////////////////////////////////////////////////////////////