var IE = document.all?true:false

function SWFDelegate(url,width,height,caption) {
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   objLink.setAttribute('title',caption);
   if(typeof width != 'undefined') {
      objLink.setAttribute('width',width);
   }
   if(typeof height != 'undefined') {
      objLink.setAttribute('height',height);
   }
   Lightbox.prototype.start(objLink);
}

function SwitchMenu(obj,ile)
{
	
	var el = document.getElementById('sub'+obj);
	var el2 = document.getElementById('head'+obj);
   
  for (var i=1; i<=ile; i++)
  {
   var el3 = document.getElementById('sub'+i);
   var el4 = document.getElementById('head'+i);
	 el3.style.display = "none";
	 el4.style.fontWeight= "normal";
	}
	
  if(el.style.display != "block")
  {
   el.style.display = "block";
  }
  else
  {
		el.style.display = "none";
	}
  

	
}


function Movie(source) {


document.getElementById('movieArea').innerHTML = '<EMBED type="application/x-mplayer2" pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" id="mediaPlayer" name="mediaPlayer" displaysize="4" autosize="-1" bgcolor="darkblue" showcontrols="true" showtracker="-1" showdisplay="0" showstatusbar="-1" videoborder3d="-1" width="470" height="350" src="'+source+'" autostart="true" designtimesp="5311" loop="true"></EMBED>'; 


//document.getElementById('mediaPlayer').src = source;
}



function ShowAskExpert() {
pageS = new Array();
pages = getPageSize();
pollX = (pages[0]/2)-260+'px';
document.getElementById('askExpert').style.display = "block";
document.getElementById('askExpert').style.left = pollX;
if(IE)
document.getElementById('askExpert').style.top = document.documentElement.scrollTop + 50 + 'px';
else 
document.getElementById('askExpert').style.top = window.pageYOffset + 50 + 'px';
}
function HideAskExpert() {
document.getElementById('askExpert').style.display = "none";
}

function ShowNewsletterBox() {
pageS = new Array();
pages = getPageSize();
pollX = (pages[0]/2)-260+'px';
document.getElementById('newsletterBox').style.display = "block";
document.getElementById('newsletterBox').style.left = pollX;
if(IE)
document.getElementById('newsletterBox').style.top = document.documentElement.scrollTop + 50 + 'px';
else 
document.getElementById('newsletterBox').style.top = window.pageYOffset + 50 + 'px';
}
function HideNewsletterBox() {
document.getElementById('newsletterBox').style.display = "none";
}




function ShowIndexPopup() {
pageS = new Array();
pages = getPageSize();
pollX = (pages[0]/2)-247+'px';
document.getElementById('Popup').style.display = "block";
document.getElementById('Popup').style.left = pollX;	
if(IE)
document.getElementById('Popup').style.top = document.documentElement.scrollTop + 110 + 'px';
else 
document.getElementById('Popup').style.top = window.pageYOffset + 110 + 'px';
}
function CloseIndexPopup() {
document.getElementById('Popup').style.display = "none";	
}

function getPageSize(){
  var xScroll, yScroll;
  if (window.innerHeight && window.scrollMaxY) {
     xScroll = document.body.scrollWidth;
     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;
  if (self.innerHeight) {   // all except Explorer
     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;
  }
  // for small pages with total width less then width of the viewport
  if(xScroll < windowWidth){
     pageWidth = windowWidth;
  } else {
     pageWidth = xScroll;
  }
  arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
  return arrayPageSize;
}

