
function notification(type,url,formname) {
	// alert(type);
	if (type == 'asend') {
		// aSend('notificationarea',url);
		open_layer('notifactionlayer');
	} else if (type == 'submit') {
		// mysubmit('notificationarea',url,formname);
		open_layer('notifactionlayer');
	} else {
		open_layer('notifactionlayer');
		// document.getElementById('notificationarea').innerHTML=formname+''+url;
		return false;
	}
	
	// window.load=startCountdown();
	// window.load=setTimeout("close_layer('notifactionlayer')", 9000);
	
}


function open_layer(layername) {
	// alert(layername);
	// alert(g_iCount);
	e=document.getElementById(layername);

	if (g_iCount == 0) {
		var g_iCount = new Number();
		var g_iCount = 10;
	}
	
	new opacity(layername, 0, 100, 500);

	if (layername == 'loginmenu') e.style.zIndex = 5;
	
	if (document.getElementById('MouseXl').value == 0) var height = '50%';
	else var height = (document.getElementById('MouseXl').value-90);
	
	e.style.top = height;
	// document.getElementById(layername).style.left = (parseInt(document.getElementById('MouseYl').value)+140);
	// document.getElementById(layername).style.left = '45%';
	
	setTimeout("e.style.display = 'block'", 50);
	
	// return g_iCount;
}


function close_layer(layername) {
	opacity(layername, 100, 0, 500);
	e = document.getElementById(layername);
	setTimeout("e.style.display='none'", 300);
	if (layername == 'loginmenu') setTimeout("document.getElementById('loginmenu').style.zIndex = 0", 300);
}


// Fade out div
// http://brainerror.net/scripts/javascript/blendtrans/
function shiftOpacity(id, millisec) {
    //if an element is invisible, make it visible, else make it ivisible
    if(document.getElementById(id).style.opacity == 0) {
        opacity(id, 0, 100, millisec);
    } else {
        opacity(id, 100, 0, millisec);
    }
}

function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}



