// URL Targets (PMAR,PORG usw.)
var urlPmar = "http://new.agon-net.de/content/view/17/16/lang,de/";
var urlPan = "http://new.agon-net.de/content/view/20/10/lang,de/";
var urlPpla = "http://new.agon-net.de/content/view/18/13/lang,de/";
var urlPent = "http://new.agon-net.de/content/view/19/12/lang,de/";
var urlPbes = "http://new.agon-net.de/content/view/15/11/lang,de/";
var urlPin = "http://new.agon-net.de/content/view/21/15/lang,de/";
var urlPorg = "http://new.agon-net.de/content/view/16/14/lang,de/";



// Images Preload

var PMarImg = new Image();
var PAnImg = new Image();
var PPlaImg = new Image();
var PEnImg = new Image();
var PBesImg = new Image();
var POrgImg = new Image();
var PInImg = new Image();

PMarImg.src = "images/stories/agonnet/pentagramm/pmar.gif";
PAnImg.src = "images/stories/agonnet/pentagramm/pan.gif";
PPlaImg.src = "images/stories/agonnet/pentagramm/ppla.gif";
PEnImg.src = "images/stories/agonnet/pentagramm/pen.gif";
PBesImg.src = "images/stories/agonnet/pentagramm/pbes.gif";
POrgImg.src = "images/stories/agonnet/pentagramm/porg.gif";
PInImg.src = "images/stories/agonnet/pentagramm/pin.gif";



function activeObj(){
   this.name="";
}

var active = new activeObj();

function show(left, top){
   var htmlElement = document.getElementById("hidden");
   htmlElement.style.position = "absolute";
   htmlElement.style.left = left+"px";
   htmlElement.style.top = top+"px";
   htmlElement.style.display="";
}

function hideImg(  ){
   var htmlElement = document.getElementById("hidden");
   //ZoomOut();
   htmlElement.style.display = "none";
   active.name="";
   
}

function PMar(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PMAR";
   this.left = 490;
   this.currentLeft=this.left;
   this.top = 130;
   this.currentTop=this.top;
   document.hidden.src= PMarImg.src;
   this.show=show;
   active.name = this.name;
   this.width = PMarImg.width;
   this.currentWidth = this.width;
   this.height = PMarImg.height;
   this.currentHeight = this.height;
   
	
}


function PAn(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PAN";
   this.left = 368;
   this.currentLeft=this.left;
   this.top = 218;
   this.currentTop=this.top;
   document.hidden.src= PAnImg.src;
   this.show=show;
   active.name = this.name;
   this.width = PAnImg.width;
   this.currentWidth = this.width;
   this.height = PAnImg.height;
   this.currentHeight = this.height;
   
	
}

function PPla(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PPLA";
   this.left = 305;
   this.currentLeft=this.left;
   this.top = 338;
   this.currentTop=this.top;
   document.hidden.src= PPlaImg.src;
   this.show=show;
   active.name = this.name;
   this.width = PPlaImg.width;
   this.currentWidth = this.width;
   this.height = PPlaImg.height;
   this.currentHeight = this.height;
   
	
}


function PEn(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PEN";
   this.left = 143;
   this.currentLeft=this.left;
   this.top = 338;
   this.currentTop=this.top;
   document.hidden.src= PEnImg.src;
   this.show=show;
   active.name = this.name;
   this.width = PEnImg.width;
   this.currentWidth = this.width;
   this.height = PEnImg.height;
   this.currentHeight = this.height;
   
	
}

function PBes(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PBES";
   this.left = 42;
   this.currentLeft=this.left;
   this.top = 218;
   this.currentTop=this.top;
   document.hidden.src= PBesImg.src;
   this.show=show;
   active.name = this.name;
   this.width = PBesImg.width;
   this.currentWidth = this.width;
   this.height = PBesImg.height;
   this.currentHeight = this.height;
   
	
}

function POrg(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PORG";
   this.left = 206;
   this.currentLeft=this.left;
   this.top = 218;
   this.currentTop=this.top;
   document.hidden.src= POrgImg.src;
   this.show=show;
   active.name = this.name;
   this.width = POrgImg.width;
   this.currentWidth = this.width;
   this.height = POrgImg.height;
   this.currentHeight = this.height;
   
	
}

function PIn(){
   var htmlElement = document.getElementById("hidden");
   this.name = "PIN";
   this.left = 145;
   this.currentLeft=this.left;
   this.top = 415;
   this.currentTop=this.top;
   document.hidden.src= PInImg.src;
   this.show=show;
   active.name = this.name;
   this.width = PInImg.width;
   this.currentWidth = this.width;
   this.height = PInImg.height;
   this.currentHeight = this.height;
   
	
}

function setImg( obj ){
   obj.show(obj.left, obj.top);
   setZoomValues(obj);
   //ZoomIn();
}


/* Zoom Values */

var factor = 1.2;
var orgx;
var orgy;
var maxx;
var maxy;
var eName = "hidden";
var orgleft;
var currentLeft;
var currentTop;
var orgtop;

var currentWidth;
var width;
var currentHeight;
var heigth;


function setZoomValues(obj){
   orgx = obj.width;
   orgy = obj.height;
   currentx = obj.width;
   currenty = obj.height;

   maxx = orgx * factor;
   maxy = orgy * factor;

   currentLeft = obj.currentLeft;
   orgleft = obj.left;
   currentTop = obj.currentTop;
   orgtop = obj.top;
}


function ZoomIn(){


//eval("document.hidden.width=num");
eval("document."+eName+".width=currentx")
//document.getElementById("hidden").style.left = currentLeft;
eval("document."+eName+".height=currenty")
//document.getElementById("hidden").style.top = currentTop;


if(currentx < maxx) { 
 currentx = currentx + 1; 
 currentLeft = currentLeft - 0.5;

}

if(currenty < maxy) { 
 currenty = currenty + 1; 
 currentTop = currentTop - 0.5;

}


setTimeout("ZoomIn(), 10");
}


function ZoomOut(){


//eval("document.hidden.width=num");
eval("document."+eName+".width=currentx")
document.getElementById("hidden").style.left = currentLeft;
eval("document."+eName+".height=currenty")
document.getElementById("hidden").style.top = currentTop;


if(currentx > orgx) { 
 currentx = currentx - 10; 
 currentLeft = currentLeft + 5;

}

if(currenty > orgy) { 
 currenty = currenty - 10; 
 currentTop = currentTop + 5;

}


setTimeout("ZoomOut(), 10");
}


function showContent(){

   if(active.name == "PMAR")
	location.href=urlPmar;
   if(active.name == "PAN")
	location.href=urlPan;
   if(active.name == "PPLA")
	location.href=urlPpla;
   if(active.name == "PENT")
	location.href=urlPent;
   if(active.name == "PBES")
	location.href=urlPbes;
   if(active.name == "PPIN")
	location.href=urlPpin;
   if(active.name == "PORG")
	location.href=urlPorg;
}

