var ie=false;
try {
 var oldonload = window.onload;

 if (typeof window.onload != 'function') { 
  window.onload = myOnload; 
 }
 else { 
  window.onload = function() {oldonload(); myOnload(); }
 }

 ie = (document.all && !window.opera);
}
catch(e) {}


function myOnload() {
// reduce image flicker in IE6
 if (ie) {
   try {
     document.execCommand('BackgroundImageCache', false, true);
   } 
   catch(e) {}; // ignore it
 }
}

var xDiv = document.createElement('DIV');
xDiv.className = 'logo_box';
var firstModel='', firstLoading=false;
var maxIdx=6;

function shiftLeftRight(idList, dirLeftRight){
 var list = document.getElementById(idList);
 if(!list) return; 


 if(!firstLoading) {
  for(i=0; i<list.childNodes.length; i++){
   if(list.childNodes[i].nodeName!='DIV' || list.childNodes[i].style.display=='none') { list.removeChild(list.childNodes[i]); i--;}
  } 
  try { firstLoading=true; firstModel=list.childNodes[0].getElementsByTagName('span')[0].id;}
  catch(e) {}
 }

try {

 var N =list.childNodes.length-1;
 if(N<maxIdx) return; // scroll need only for 6..N models

 if(dirLeftRight){ // left = true

  if(list.childNodes[0].getElementsByTagName('span')[0].id==firstModel) return;

  xDiv.innerHTML = list.childNodes[N].innerHTML; 

  for(i =N; i>0; i--){
   list.childNodes[i].innerHTML = list.childNodes[i-1].innerHTML;
  }
  list.childNodes[0].innerHTML = xDiv.innerHTML; 

 } else {

  if(list.childNodes[maxIdx].getElementsByTagName('span')[0].id==firstModel) return;

 xDiv.innerHTML = list.childNodes[0].innerHTML;
 for(i =0; i<N; i++){
   list.childNodes[i].innerHTML = list.childNodes[i+1].innerHTML;
 }
 list.childNodes[N].innerHTML = xDiv.innerHTML;
 }

} catch(e) {}

}

function shadow(objId, onOff) {

// var objLayer = document.getElementById("background"); if(!objLayer) return;
 var objTarget= document.getElementById(objId); if(!objTarget) return;
// if (isIE) objLayer.style.height = document.body.clientHeight;
// objLayer.style.display=(onOff ? "block":"none");
 objTarget.style.display=(onOff ? "block":"none");

// objTarget.style.left = (document.body.clientWidth - objTarget.clientWidth) / 2 + 'px'; //

}

