/* Copyright UAB "Plieninis Skydas" */

function switchOnRalToolTip(name) {
		document.getElementById(name).style.display='block';
		document.getElementById(name).style.color='#FFFFFF';
}

function switchOffRalToolTip(name) {
		document.getElementById(name).style.display='none';
		document.getElementById(name).style.color='#E5EEFE';
}

function setBackgroundColor(name,backgroundColor,name2,RalNumber) {
	document.getElementById(name2).style.display='none';
	j=1;
	for (i=0; i<140; i++) {
		idTmp="psDoorBigBoxTitleId"+i;
		if(j==88) {
			j=89;
		}		
		document.getElementById(idTmp).innerHTML="R"+j+" / RAL "+RalNumber;
		tmp2=document.getElementById(idTmp).innerHTML;
		tmp=name+i;
		document.getElementById(tmp).style.background=backgroundColor;
		j++;
	}
//window.alert(tmp2);
}

function switchOnRalToolTip2(name) {
		document.getElementById(name).style.display='block';
//		document.getElementById(name).style.color='#00FF00';
//document.getElementById('psRalForDoorContainer').innerHTML="RAL off";
}

function switchOffRalToolTip2(name) {
		document.getElementById(name).style.display='none';
//		document.getElementById(name).style.color='#E5EEFE';
//document.getElementById('psRalForDoorContainer').innerHTML="RAL on";
}

function setContentContainerSize(contentHeight,pseudoNavHeight) {
		document.getElementById('psContentContainer').style.height=contentHeight;
		document.getElementById('psPseudoNavContainer').style.height=pseudoNavHeight;
}


function switchOnImgBigBox(name) {
//window.alert(name);
		document.getElementById(name).style.display='block';
}

function switchOffImgBigBox(name) {
		document.getElementById(name).style.display='none';
}


function switchOnPartners(name,name2) {
//window.alert(name);
		document.getElementById(name).style.visibility='visible';
		document.getElementById(name2).style.background='#7096DC';
		document.getElementById(name2).style.color='#FFFFFF';
		
}

function switchOffPartners(name,name2) {
//window.alert(name);
		document.getElementById(name2).style.background='none';
		document.getElementById(name2).style.color='#7096DC';
		document.getElementById(name).style.visibility='hidden';
}


function switchOnOpenTimesBox(name,name2) {
//window.alert(name);
		document.getElementById(name).style.visibility='visible';
		document.getElementById(name2).style.background='#7096DC';
		document.getElementById(name2).style.color='#FFFFFF';
}
function switchOffOpenTimesBox(name,name2) {
//window.alert(name);
		document.getElementById(name).style.visibility='hidden';
		document.getElementById(name2).style.background='none';
		document.getElementById(name2).style.color='#7096DC';
}


function openInNewWindow(urlName,windowWidth,windowHeight,windowTop,windowLeft) { 
window.open(urlName,'','width='+windowWidth+',height='+windowHeight+',menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=yes,top='+windowTop+',left='+windowLeft+''); 
}

function switchOnLinkBox(nameId) {
//window.alert(name);
		document.getElementById(nameId).style.background='#7096DC';
}
function switchOutLinkBox(nameId) {
//window.alert(name);
		document.getElementById(nameId).style.background='none';
}


function setOpacity2(objId, opacity) {
	if(document.getElementById(objId)) {
  opacity = (opacity == 100)?99.999:opacity;
  objRef=document.getElementById(objId);
  // Internet Explorer
  objRef.style.filter = "alpha(opacity:"+opacity+")";
  // Safari<1.2, Konqueror
  objRef.style.KHTMLOpacity = opacity/100;
  // Older Mozilla and Firefox
  objRef.style.MozOpacity = opacity/100;
  // Safari >=1.2, newer Firefox and Mozilla, CSS3
  objRef.style.opacity = opacity/100;

  objRef.style.visibility= 'visible';
}
}

function switchOnBorder(nameId) {
//window.alert(name);
		document.getElementById(nameId).style.border='3px solid #7096DC';
}
function switchOffBorder(nameId) {
//window.alert(name);
		document.getElementById(nameId).style.border='none';
}


function setBackgroundImg(name,backgroundImg,colorId) {
	j=1;
	tmp2="";
	for (i=0; i<39; i++) {
		idTmp="psDoorBigBoxTitleId"+i;
		document.getElementById(idTmp).innerHTML="D"+j+" / "+colorId;
		tmp=name+i;
		tmp2="<img src="+backgroundImg+">";
		document.getElementById(tmp).innerHTML=tmp2;
		j++;
	}
//window.alert(backgroundImg);
}

function setOpacity3(objId, opacity) {
	if(document.getElementById(objId)) {  //nur wenn das Objekt existiert
  opacity = (opacity == 100)?99.999:opacity;
  objRef=document.getElementById(objId);
  // Internet Explorer
  objRef.style.filter = "alpha(opacity:"+opacity+")";
  // Safari<1.2, Konqueror
  objRef.style.KHTMLOpacity = opacity/100;
  // Older Mozilla and Firefox
  objRef.style.MozOpacity = opacity/100;
  // Safari >=1.2, newer Firefox and Mozilla, CSS3
  objRef.style.opacity = opacity/100;
  
  objRef.style.visibility= 'visible';
}
}

// Wegen IE Bug bei der Darstellung der Border, Anpassung der Breite und Hoehe
// Achtung: ein div ist im IE nur dann "onmouseover"-Sensitive, wenn es ein background hat!
function setOpacityOfImgBorders(siteId) {
if(siteId==9) {
	newWidth=0;
	newHeight=0;
  idTmpName="psLinkId";
  idTmpName2="psLinkId_";
	for (i=0; i<15; i++) {
  idTmp=idTmpName+i;
  idTmp2=idTmpName2+i;
  newWidth=parseInt(document.getElementById(idTmp2).style.width) + 4;
  newHeight=parseInt(document.getElementById(idTmp2).style.height) + 4;
		if (window.navigator.userAgent.indexOf("MSIE ")> -1) {
//			  window.alert(newWidth);

  		document.getElementById(idTmp2).style.width=newWidth;
  		document.getElementById(idTmp2).style.height=newHeight;
  		setOpacity2(idTmp,0);
		} else {
			setOpacity2(idTmp,0);	
		}
	}
}
}

function changeImg(imgId,imgSrc,contactRegionId){
//		window.alert(imgId);
		actualImgId="r"+contactRegionId+"Id";
		if(imgId!=actualImgId) {
  		document.getElementById(imgId).src = imgSrc; 
		}
}

function setActualRegionOnContactMap(contactRegionId) {
  if(contactRegionId!=999) {
		imgId="r"+contactRegionId+"Id";
		imgSrc="/img/contact_map/on/images/"+"r"+contactRegionId+"on"+".gif";
		changeImg2(imgId,imgSrc);
//		window.alert(contactRegionId);
  }
}



function changeImg2(imgId,imgSrc) {
//window.alert("Heute1");

  document.getElementById(imgId).src = imgSrc; 

}

function changeImg3(imgId,imgSrc,whatLangu) {

//window.alert("Heute1");

actualImgId="lang"+whatLangu+"Id";
if(imgId!=actualImgId) {
  document.getElementById(imgId).src = imgSrc; 

}
}

function setActualLanguageBar(whatLangu) {

	imgId="lang"+whatLangu+"Id";
	
	if(whatLangu==0) { currentLang="lt"; }
	if(whatLangu==1) { currentLang="ru"; }
	if(whatLangu==2) { currentLang="en"; }
	if(whatLangu==3) { currentLang="de"; }

	imgSrc="/img/lang_bar/on/images/"+currentLang+"_on"+".gif";
	changeImg3(imgId,imgSrc);

//window.alert("Heute2");
}



function fullScreenMP() 

{
//window.alert("Heute2");

//   document.getElementById("wmediap").fullScreen=true; 
	   document.getElementById("wmediap").DisplaySize=3; 

}



function setContentRightLine(contentHeight) {

//window.alert(contentHeight);

htmlSrc='<table border="0" height="'+contentHeight+'px" width="15px" style="background-image: url(/img/line.jpg); background-position: center; background-repeat: repeat-y;"><tr><td></td></tr></table>';


spanId="psContentRightLine";
  document.getElementById(spanId).innerHTML = htmlSrc; 

}


