var t = Array()
var step = 0.32

function dissolve_pro(id)
{
	if (!$(id))
		return false

	if (getOpacity(id) <= 0 || getOpacity(id) == '')
		zoomin_pro(id)
	else
		zoomout_pro(id)
}

function zoomin_pro (id)
{
	if ($(id).style.zIndex <= 0)
		$(id).style.zIndex = 100
		
	op = getOpacity(id) + step 
	setOpacity(op,id)

	if (getOpacity(id) >= 10)
		clearTimeout(t[id])
	else
		t[id] = setTimeout("zoomin_pro('"+id+"')")
}

function zoomout_pro(id)
{
		
	op = getOpacity(id) - step 
	setOpacity(op,id)

	if (getOpacity(id) <= 0)
	{
		$(id).style.zIndex = -5 
		clearTimeout(t[id])
	}
	else
		t[id] = setTimeout("zoomout_pro('"+id+"')")
}

function setOpacity(value,id)
{
	//alert(id);
	if (BrowserDetect.browser == "Explorer")
	{
		if (BrowserDetect.version > 7)
			$(id).style.filter = "progid:DXImageTransform.Microsoft.Alpha(Opacity=" + value*10 + ")"
		else
			$(id).style.filter = 'alpha(opacity=' + value*10 + ')'
	}
	else if (document.layer)
		{
			$(id).style.opacity = value/10
		}
	else if (document.getElementById)
		{
			$(id).style.opacity = value/10
		}
}

function getOpacity (id)
{
	if (document.all)
	{
		return $(id).style.filter / 10
	}
	else if (document.layer)
	{
		return $(id).style.opacity * 10
	}
	else if (document.getElementById)
	{
		return $(id).style.opacity * 10
	}
}

function scrolldiv(id)
{
	if (window.innerHeight)
	{
		if (removePXfloat($(id).style.top) == window.innerHeight)
			$(id).style.top = "-" + String($(id).style.height)
	}
	else
	{
		if (removePXfloat($(id).style.top) == document.body.offsetHeight)
			$(id).style.top = "-" + String($(id).style.height)
	}
	
		$(id).style.top = String(removePX($(id).style.top) + 1) + "px"
	t = setTimeout("scrolldiv('"+id+"')",50)
}

function removePX (string)
{
	return parseInt(String(string).replace("px",""),10)
}

function removePXfloat (string)
{
	return parseFloat(String(string).replace("px",""))
}

function posInit()
{
	var idObj = Array('sys','net','webdev','ass')

	for (i=0; i < idObj.length; i++)
		if ($(idObj[i]))
		{
			if ($(idObj[i]).style.pixelLeft)
                	{
	                       	$(idObj[i]).style.pixelLeft = rand() 
                       		$(idObj[i]).style.pixelTop =  rand()
   		        }
   			else
        	        {
                	        $(idObj[i]).style.left = String(rand()) + 'px'
                        	$(idObj[i]).style.top = String(rand()) + 'px'
	                }
		}
}

function rand (min, max)
{
    var args = arguments.length;
    if (args === 0) {
        min = 0;
        max = 768;
    } else if (args === 1) {
        throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');
    }
    ret = Math.floor(Math.random() * (max - min + 1)) + min;

    return ret
}

