var slider;
var slideTime = 400, topMargin;
/**/var max_height_slinding=0;
	
	xAddEventListener(window, 'load',
	  function () {
		slider = new getObj('for_slide');
		wWidth = getWindowWidth();
		topMargin = 0;
		/**/max_height_slinding=xHeight('slider_parent_td')/*-xHeight('for_slide')*/;
		winOnResize(); // set initial position
		xAddEventListener(window, 'resize', winOnResize, false);
		xAddEventListener(window, 'scroll', winOnScroll, false);
		
	  }, false
	);
	function winOnResize() {
		slider = new getObj('for_slide');
		wWidth = getWindowWidth();
		/*if (wWidth >= 1250)  {
			xMoveTo('lightbox_content', 18, topMargin);
			slider.style.display = 'block';
			winOnScroll(); // initial slide
		} else {
			slider.style.display = 'none';
			if (typeof(temp) != 'undefined') {
				if (temp) {
					clearTimeout(temp);
				}
			}
		}*/
	}
	function winOnScroll() {
		//if (is_loaded_big_image==1){
		//alert(is_loaded_big_image+' '+getPageScroll()[1]+' - '+xScrollTop());
	//	alert(topMargin);
	  	xSlideTo('for_slide', xLeft('for_slide'),  xScrollTop()+ topMargin, slideTime);
		//xSlideTo('for_slide', xLeft('for_slide'),  xScrollTop(), slideTime);
		//} 
	}

function getObj(name)

{

  if (document.getElementById)
  {
	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }

  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }

  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}



function getWindowWidth() {
	N=window.navigator.appName.substring(0,8);
	if (N=="Microsof") {
		width = parent.document.body.clientWidth;
	} else {
		width = parent.window.innerWidth;
	}
	return width;
}

function getBodyInnerHeight(){
		var ua = navigator.userAgent.toLowerCase();
		var isOpera = (ua.indexOf('opera') > -1);
		var isSafari = (ua.indexOf('safari') > -1);
		var isIE = (window.ActiveXObject);
		var height = -1;
         var mode = document.compatMode;

         if ( (mode || isIE) && !isOpera ) {
            switch (mode) { // (IE, Gecko)
               case 'CSS1Compat': // Standards mode
                  height = document.documentElement.clientHeight;
                  break;

               default: // Quirks
                  height = document.body.clientHeight;
            }
         } else { // Safari, Opera
            height = self.innerHeight;
         }
		 return height;
	}

