
function get_screen_availW()
	{
	var win;
		if(!win) win = window;
		screen_width=win.innerWidth;
		 if(document.all){ //IE
			screen_width="900";
          
             //screen_width = parseInt(window.document.body.clientWidth);               
           }
        // alert(screen_width); 
		return (screen_width);		
	}
	


  function get_img_size(mypic)
  {   
     	var browserWidth=window.innerWidth;
			if(document.all){
				screen_width = parseInt(window.document.body.clientWidth); 
				browserWidth=screen_width;
			}
	        if(browserWidth > 1040){                            
	           var bild = document.getElementById(mypic); 
	           bild.style.width  = 10+browserWidth+"px"; 
	         }	     
 }

function return_img_size(mypic)
	{
	 var bild = document.getElementById(mypic); 
	 return bild.style.width;
	}

function get_screen_availH()
	{
		screen_height=window.innerHeight;
		
		 if(document.all){ //IE
			 screen_height = "700";
		
			// screen_height=parseInt(window.document.body.clientHeight);         
		}
		return (screen_height);
		
	}
function scroll_to()
{
window.scroll(0, 0);
}

function GetRandom( min, max ) 
	{
        if( min > max ) {
                return( -1 );
        }
        if( min == max ) {
                return( min );
        }
 
        return( min + parseInt( Math.random() * ( max-min+1 ) ) );
	}

var screen_W=get_screen_availW();
var screen_H=get_screen_availH();
//alert(screen_W);
var x = GetRandom(200,300); //Starting Location - left
var y = GetRandom(60, 200); //Starting Location - top

var x1 = GetRandom(400,600); //Starting Location - left
var y1 = GetRandom(300, 600); //Starting Location - top

var dest_x = GetRandom(200,screen_W);  //Ending Location - left
var dest_y = GetRandom(100,screen_H);  //Ending Location - top
var	dest_x1 = GetRandom(100,screen_W);  //Ending Location - left
var	dest_y1= GetRandom(200,screen_H);  //Ending Location - top
var interval = 4; //Move 10px every initialization

var interval1=6;
var counter=1;
var counter1=1;


function moveImage1() {

if(counter>10)
{ 
	interval=GetRandom(0,10);
	counter=0;
	dest_x = GetRandom(200,screen_W);  //Ending Location - left
	dest_y = GetRandom(0,screen_H);  //Ending Location - top
	//alert(parseInt(window.document.body.clientHeight));
}
	counter+=1;		
	if(x< dest_x){
	 x = x + interval; 
	 	}
	 else
	 	{
	  x = x - interval; 
		}
	 
	if(y<dest_y) {
		y = y + interval;
	}
	else
	{
		y = y - interval;
	}
	if(document.getElementById){
	document.getElementById("ufo").style.top  = y+'px';
	document.getElementById("ufo").style.left = x+'px';
	document.getElementById("ufotxt").style.top  = y+'px';
	document.getElementById("ufotxt").style.left = x+'px';
	}
	else if (document.all){
	document.all.ufo.style.posTop  = y+'px';
	document.all.ufo.style.posLeft = x+'px';
	document.all.ufotxt.style.posTop   = y+'px';
	document.all.ufotxt.style.posLeft = x+'px';

	}
	
	window.setTimeout('moveImage1()',80);

}

function moveImage2() {

if(counter1>10)
{ 
	interval1=GetRandom(0,10);
	counter1=0;
	dest_x1 = GetRandom(100,screen_W);  //Ending Location - left
	dest_y1 = GetRandom(0,screen_H);  //Ending Location - top
}
	counter1+=1;	
	
	if(x1< dest_x1){
	 x1 = x1 + interval1; 
	 	}
	 else
	 	{
	  x1 = x1 - interval1; 
		}
	 
	if(y1<dest_y1) {
		y1 = y1 + interval1;
	}
	else
	{
		y1 = y1 - interval1;
	}
	if(document.getElementById){
	document.getElementById("ufo2").style.top  = y1+'px';
	document.getElementById("ufo2").style.left = x1+'px';
	document.getElementById("ufotxt2").style.top  = y1+'px';
	document.getElementById("ufotxt2").style.left = x1+'px';	
	}
	else if (document.all){
	document.all.ufo2.style.posTop  = y1+'px';
	document.all.ufo2.style.posLeft = x1+'px';
	document.all.ufotxt2.style.posTop   = y1+'px';
	document.all.ufotxt2.style.posLeft = x1+'px';

	
	
	
	}
	window.setTimeout('moveImage2()',80);

}

function show(div)
{
	document.getElementById(div).style.visibility  = "visible";
}

function hide(div)
{
	document.getElementById(div).style.visibility  = "hidden";
}



function switch_vis(div)
{
if(document.getElementById(div).style.visibility  == "visible")
	{
	document.getElementById(div).style.visibility  = "hidden";
	}
	else
	{
	document.getElementById(div).style.visibility  = "visible";
	}
}

function alertSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
      
  myWidth=document.body.clientWidth;   
  myHeight=document.body.clientHeight;
  
    
  }
  return myWidth;
}

//Diashow

var bild = new Image;
var dia= new Array("asset/logos/aws.gif", "asset/logos/bene.jpg","asset/logos/bombay.jpg", "asset/logos/df.jpg","asset/logos/evolve.gif", "asset/logos/franco.jpg","asset/logos/graz.gif", "asset/logos/graz_wirtschaft.gif", "asset/logos/humanic.gif", "asset/logos/impulse.gif", "asset/logos/iv.gif", "asset/logos/murauer.jpg", "asset/logos/mfg.gif", "asset/logos/moodley.gif", "asset/logos/orf_st.gif",  "asset/logos/sfg.gif", "asset/logos/steiermark.gif", "asset/logos/VespaPrimavera_Logo.jpg", "asset/logos/weekend.jpg","asset/logos/weitzer.gif",  "asset/logos/wko_consulting.gif","asset/logos/wko_kreativ.gif", "asset/logos/wko_st.gif","asset/logos/zueco.jpg");



//var a=-1;
var a = (Math.floor(Math.random() * dia.length));


function diashow()
	{
	if (a==dia.length)
	{
	a=0;
	}
	window.document.images['ticker'].src=dia[a];
	a++;

	window.setTimeout ('diashow()', 2000);
	}



//kalender balken popup

		var theleft, theleftnew, thediv, adiv, actdiv;
		//var actdiv='Ebene'+<?php echo strip_tags($_GET['d']); ?>;
		
	
		
		function show_date(div)
		{	
		
		theleft=document.getElementById(div).style.left;
		theleft=theleft.replace(/px/,'');
		var thepos=div.replace(/Ebene/,'');
		var theposno=parseInt(thepos);
		var theposem=(theposno*20);
		var theleftnew=parseInt(theposem)+16;
		
			document.getElementById(div).style.visibility  = "visible";
			document.getElementById(div).style.width="30px";
			document.getElementById(div).style.height="40px";
			document.getElementById(div).style.color = "#FFFFFF";
			document.getElementById(div).style.left=(theleftnew)+"px";
			document.getElementById(div).style.fontSize="12pt";
			document.getElementById(div).style.backgroundColor = "#000000";
			document.getElementById(div).style.zIndex = 36;
		}
		
		
			function hide_date(div)
		{
			if(actdiv!=div)
			{
		
			var thepos=div.replace(/Ebene/,'');
			var theposno=parseInt(thepos);
			
			var theposem=(theposno*20)+20;
		
			document.getElementById(div).style.visibility  = "visible";
			document.getElementById(div).style.width="20px";
			document.getElementById(div).style.height="25px";
			document.getElementById(div).style.color="000000";
			document.getElementById(div).style.left=(theposem)+"px";
			document.getElementById(div).style.fontSize="0.6em";
			//alert(document.getElementById(div).style.left);
			document.getElementById(div).style.backgroundColor = "transparent";
			document.getElementById(div).style.zIndex = 35;
			document.getElementById(div).style.border = "1px";
			}
		}
			
			
			function get_div(actdiv)
		{			
			
		
			for (var z = 0; z <= 29; z++)
			{
			adiv='Ebene'+z;	
			 hide_date(adiv);

			}
			show_date(actdiv);	
		}
		
