// JavaScript Document
var scrollcposition=0;
var scrollcposition2= 0;
var scrollcposition3 = 0;

var scrollingSrc = null;
var scroll1 = true;
var scroll2 = true;
var scroll3 = true;
function scrolltextup(id)
	{
	//alert(document.getElementById(id).style.top);
	if(id=="scrollarea1"){
		if(scrollcposition>=10)
			{
			scrollcposition-=10;
			document.getElementById(id).scrollTop = scrollcposition; 
			}
		}
	else if(id=="scrollarea2"){
		if(scrollcposition2>=10)
			{
			scrollcposition2-=10;
			document.getElementById(id).scrollTop = scrollcposition2; 
			}
		}
	else if(id=="scrollarea3"){
		if(scrollcposition3>=10)
			{
			scrollcposition3-=10;
			document.getElementById(id).scrollTop = scrollcposition3; 
			}
		}
	}
function scrolltextdown(id)
	{
	//alert(document.getElementById(id).scrollHeight);
	if(id=="scrollarea1"){
		if((scrollcposition)<=document.getElementById(id).scrollHeight)
			{
			scrollcposition+=10;
			document.getElementById(id).scrollTop = scrollcposition; 
			}
		}
	else if(id=="scrollarea2"){
		if((scrollcposition2)<=document.getElementById(id).scrollHeight)
			{
			scrollcposition2+=10;
			document.getElementById(id).scrollTop = scrollcposition2; 
			}
		}
	else if(id=="scrollarea3"){
		if((scrollcposition3)<=document.getElementById(id).scrollHeight)
			{
			scrollcposition3+=10;
			document.getElementById(id).scrollTop = scrollcposition3; 
			}
		}
	}
function initScroll(id,imgtop,imgbot)
	{
	if(document.getElementById(id).scrollHeight<=100)
		{
		document.getElementById(imgtop).style.display="none";
		document.getElementById(imgbot).style.display="none";
		return false;
		}
	return true;
	}


function handle(delta) 
	{
	if (delta < 0)
		{
		scrolltextdown(scrollingSrc.id);
		}
	else
		{
		scrolltextup(scrollingSrc.id);	
		}
	}

/** Event handler for mouse wheel event.
 */
function wheel(event)
	{
    var delta = 0;
    if (!event) /* For IE. */
	    event = window.event;
    if (event.wheelDelta) { /* IE/Opera. */
        delta = event.wheelDelta/120;
        /** In Opera 9, delta differs in sign as compared to IE.
        */
    if (window.opera)
	    delta = -delta;
    } else if (event.detail) { /** Mozilla case. */
                /** In Mozilla, sign of delta is different than in IE.
                 * Also, delta is multiple of 3.
                 */
                delta = -event.detail/3;
     }
      /** If delta is nonzero, handle it.
       * Basically, delta is now positive if wheel was scrolled up,
       * and negative, if wheel was scrolled down.
       */
     if (delta)
	     handle(delta);
        /** Prevent default actions caused by mouse wheel.
        * That might be ugly, but we handle scrolls somehow
        * anyway, so don't bother here..
        */
     if (event.preventDefault)
	     event.preventDefault();
	 event.returnValue = false;
	}
/*function brochuredownload()
	{
	openLayer();
	top = '<div style="position: relative;"><div style="width: 320px; float: left;"><h2 align="center"> Download Brochure</h2></div><div align="right" style="width: 20px; float: left;"><img alt="Eclose" src="http://cn2.cybernetikz.com/images/eclose.gif" style="cursor: pointer;" onclick="closePopup()"/></div></div>';
	$("#popup").css("border","5px solid #0B5560");
	$("#popup").css("padding","0 0 10px 10px");
	$("#popup").css("background","#022126");
	$("#popup").css("z-index",10000);
	$("#popup").html(top+$("#brochureContent").html());
	$("#popup").css("left",(($(document).width()/2)-349/2));
	$("#popup").css("top",$(window).scrollTop()+80);
	$("#popup").fadeIn("slow");
	}

function openLayer()
	{
	$('#layer').css("left",0);
	$('#layer').css("top",0);
	$('#layer').css("z-index",9999);
	$('#layer').css("height",$(document).height());
	$('#layer').css("width",$(document).width());
	$('#layer').fadeIn("Slow");
	$('#layer').click = closePopup;
	}
function closePopup()
	{
	$("#popup").fadeOut("slow");	
	$('#layer').fadeOut('slow');	
	}*/
