

<!-- Begin
//slider's width
var swidth=165

//slider's height
var sheight=115

//slider's speed
var sspeed=1



function start(){
	if (document.all) 
		return
	if (document.getElementById){
		document.getElementById("slider").style.visibility="show"
		ns6marquee(document.getElementById('slider'))
	}
	else if(document.layers){
		document.slider1.visibility="show"
		ns4marquee(document.slider1.document.slider2)
	}
}

function ns4marquee(whichlayer){
	ns4layer=eval(whichlayer)
	ns4layer.document.write(wholemessage)
	ns4layer.document.close()
	sizeup=ns4layer.document.height
	ns4layer.top-=sizeup
	ns4slide()
}

function ns4slide(){
	if (ns4layer.top>=sizeup*(-1)){
		ns4layer.top-=sspeed
		setTimeout("ns4slide()",100)
	}
	else{
		ns4layer.top=sheight
		ns4slide()
	}
}

function ns6marquee(whichdiv){
	ns6div=eval(whichdiv)
	ns6div.innerHTML=wholemessage
	ns6div.style.top=sheight
	sizeup=sheight
	ns6slide()
}

function ns6slide(){
	if (parseInt(ns6div.style.top)>=sizeup*(-1)){
		ns6div.style.top=parseInt(ns6div.style.top)-sspeed
		setTimeout("ns6slide()",100)
	}
	else{
		ns6div.style.top=sheight
		ns6slide()
	}
}
//  End -->


function artContent(pId, pVis){
	try{ 
		if (pVis=='1'){
			document.getElementById(pId).style.position = 'relative';
			document.getElementById(pId).style.visibility = 'visible';
		}
		else{
			document.getElementById(pId).style.position = 'absolute';
			document.getElementById(pId).style.visibility = 'hidden';
		}
		
		var artid_substring = "";
		if (pId!=null)
			artid_substring = pId.substring(4);
			window.location.hash = artid_substring;
	}
	catch (e){
		alert(e);
	}
}

function popup( page, name, width, height, clean, properties )
{
  if( !properties )
    properties = ',location=no, scrollbars=no,top=100,left=100'
  window.open(page,name,'width='+width+',height='+ height +properties)
}


var ic = 9;     // Number of alternative images
var xoxo = new Array(ic);  // Array to hold filenames
        
xoxo[0] = "images/ALFM-intranet-header_1.jpg";
xoxo[1] = "images/ALFM-intranet-header_2.jpg";
xoxo[2] = "images/ALFM-intranet-header_3.jpg";
xoxo[3] = "images/ALFM-intranet-header_4.jpg";
xoxo[4] = "images/ALFM-intranet-header_5.jpg";
xoxo[5] = "images/ALFM-intranet-header_6.jpg";
xoxo[6] = "images/ALFM-intranet-header_7.jpg";
xoxo[7] = "images/ALFM-intranet-header_8.jpg";
xoxo[8] = "images/ALFM-intranet-header_9.jpg";


function pickRandom(range) {
	if (Math.random)
		return Math.round(Math.random() * (range-1));
	else {
		var now = new Date();
		return (now.getTime() / 1000) % range;
	}
}

var choice = pickRandom(ic);
function topImageLoader()
{
   document.getElementById('topImage').src=xoxo[choice]
}


function openForum()
{
	var winForum = popup('../Frm/index.jsp?pInstance=3','SDP_FORUM',550,400,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winForum.focus();
	}
	catch(exception ){
	}
	
}

function openCalendar()
{
	var winCalendar = popup('../Schedule/index.jsp?pInstance=530','ALFM_Calendar',850,600,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winCalendar.focus();
	}
	catch(exception ){
	}
}

function opengdoc()
{
	var winCalendar = popup('../DocumentalCenter/index.jsp?pInstance=532','ALFM_Calendar',850,600,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winCalendar.focus();
	}
	catch(exception ){
	}
}


function openWorkFlow()
{
	var winwf = popup('../wfl/index.jsp?pInstance=534','ALFM_Workflow',850,600,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winwf.focus()
	}
	catch(exception){
		
	}
}

function openHelpdesk()
{
	var winhd = popup('../Helpdesk/index.jsp?pInstance=533','ALFM_Helpdesk',850,600,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winhd.focus()
	}
	catch(exception){
		
	}
}


// setStyleById: given an element id, style property and 
// value, apply the style.
// args:
//  i - element id
//  p - property
//  v - value
//
function setStyleById(i, p, v) {
	var n = document.getElementById(i);
	n.style[p] = v;
}


function profile()
{
	var winprofile = popup('../Users/userProfile.jsp','ALFM_userprofile',550,650,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winprofile.focus()
	}
	catch(exception){
		
	}
	
}

function password()
{
	var winpwd = popup('../Users/change_password.jsp','ALFM_password',340,200,'',',location=no,scrollbars=yes,resizable=yes');
	try{
		winpwd.focus()
	}
	catch(exception){
		
	}
	
}

function hideLayer( id, pos )
{
	if( document.getElementById(id) )
	{
		document.getElementById(id).style.visibility = 'hidden'
		if( pos )
			document.getElementById(id).style.position = 'absolute'
	}
}

function iFrameHeight(pIdFrame, pTheFrame) {
	if(document.getElementById && !(document.all)) {
		h = document.getElementById(pIdFrame).contentDocument.body.scrollHeight;
		document.getElementById(pIdFrame).style.height = h+40;
	}
	else if(document.all) {
		h = document.frames(pIdFrame).document.body.scrollHeight;
		pTheFrame.style.height = h+40;
	}
}
