// JavaScript Document

function show(){
if(document.system.formone.value == 'occupied'){
document.getElementById('window1').style.visibility='hidden'
document.getElementById('window_name1').style.visibility='hidden'
document.getElementById('DIVframe1').style.visibility='hidden'
document.getElementById('close_min1').style.visibility='hidden'
document.windowB_img1.src='theme/default/desktop_images/window_hidden.png'
document.indowB_img2.src='theme/default/desktop_images/window_open.png'
document.getElementById('process2').innerHTML=document.system.window_name.value;	
document.getElementById('Wbottom_name2').style.left='217px'
document.getElementById('windowSH2').style.left='211px'
document.getElementById('close_min2').style.visibility='visible'
document.getElementById('window2').style.visibility='visible'
document.getElementById('window_name2').style.visibility='visible'
document.getElementById('Wbottom_name2').style.visibility='visible'
document.getElementById('windowSH2').style.visibility='visible'
document.getElementById('DIVframe2').style.visibility='visible'
document.system.formtwo.value='occupied'
frames['frametwo'].location = document.system.address.value;
document.getElementById('window_name2').innerHTML=document.system.window_name.value;
document.getElementById('Wbottom_name2').innerHTML=document.system.window_name.value;
}else{
document.windowB_img1.src='theme/default/desktop_images/window_open.png'
document.getElementById('process1').innerHTML=document.system.window_name.value;
document.getElementById('Wbottom_name2').style.left='217px'
document.getElementById('windowSH2').style.left='211px'
document.getElementById('close_min1').style.visibility='visible'
document.getElementById('window1').style.visibility='visible'
document.getElementById('window_name1').style.visibility='visible'
document.getElementById('Wbottom_name1').style.visibility='visible'
document.getElementById('windowSH1').style.visibility='visible'
document.getElementById('DIVframe1').style.visibility='visible'
document.system.formone.value='occupied';
frames['frameone'].location = document.system.address.value;
document.getElementById('window_name1').innerHTML=document.system.window_name.value;
document.getElementById('Wbottom_name1').innerHTML=document.system.window_name.value;
}
}

function check(location,name1) {
if(document.system.formone.value==document.system.formtwo.value){
document.getElementById('text').innerHTML='You have tried to open more than two windows at the same time. Please close a window first and then try to open your chosen window. Use the "Kill Process" button to close the window';
document.getElementById('syscloseDIV').style.visibility='visible';	
document.getElementById('sysManagerInfo').style.visibility='visible';
document.getElementById('sysText').style.visibility='visible';
document.getElementById('system_managerDIV').style.visibility='visible';
hidden1();
hidden2();
}else{
document.getElementById('text').innerHTML='Welcome to the Process Manager. Use this to end processes and manage your open windows';	
document.system.address.value=location;
document.system.window_name.value=name1;
show();
}
}

function hide1(){
if(document.system.formtwo.value=='occupied'){
document.getElementById('close_min1').style.visibility='hidden'	
document.getElementById('process1').innerHTML='No Process Running'
document.getElementById('window1').style.visibility='hidden'
document.getElementById('window_name1').style.visibility='hidden'
document.getElementById('Wbottom_name1').style.visibility='hidden'
document.getElementById('windowSH1').style.visibility='hidden'
document.getElementById('DIVframe1').style.visibility='hidden'
setTimeout(document.system.formone.value='1',100);
document.getElementById('Wbottom_name2').style.left='36px';
document.getElementById('windowSH2').style.left='31px';
frames['frameone'].location = 'null.html';
document.getElementById('text').innerHTML='Welcome to the Process Manager. Use this to end processes and manage your open windows.'
}else{
document.getElementById('close_min1').style.visibility='hidden'	
document.getElementById('process1').innerHTML='No Process Running'
document.getElementById('window1').style.visibility='hidden'
document.getElementById('window_name1').style.visibility='hidden'
document.getElementById('Wbottom_name1').style.visibility='hidden'
document.getElementById('windowSH1').style.visibility='hidden'
document.getElementById('DIVframe1').style.visibility='hidden'
frames['frameone'].location = 'null.html';
document.getElementById('text').innerHTML='Welcome to the Process Manager. Use this to end processes and manage your open windows.'
setTimeout(document.system.formone.value='1',100);
}
}

function hide2(){
if(document.system.formtwo.value=='occupied'){
document.getElementById('close_min2').style.visibility='hidden'
document.getElementById('process2').innerHTML='No Process Running'
document.getElementById('window2').style.visibility='hidden'
document.getElementById('window_name2').style.visibility='hidden'
document.getElementById('Wbottom_name2').style.visibility='hidden'
document.getElementById('windowSH2').style.visibility='hidden'
document.getElementById('DIVframe2').style.visibility='hidden'
frames['frametwo'].location = 'null.html';
document.indowB_img2.src='theme/default/desktop_images/window_open.png'
setTimeout(document.system.formtwo.value='2',100);
document.getElementById('text').innerHTML='Welcome to the Process Manager. Use this to end processes and manage your open windows.'
}
}

function hidden2(){
document.getElementById('window2').style.visibility='hidden'
document.getElementById('window_name2').style.visibility='hidden'
document.getElementById('DIVframe2').style.visibility='hidden'
document.getElementById('close_min2').style.visibility='hidden'
document.indowB_img2.src='theme/default/desktop_images/window_hidden.png'
}

function hidden1(){
document.getElementById('window1').style.visibility='hidden'
document.getElementById('window_name1').style.visibility='hidden'
document.getElementById('DIVframe1').style.visibility='hidden'
document.getElementById('close_min1').style.visibility='hidden'
document.windowB_img1.src='theme/default/desktop_images/window_hidden.png'
}

function show2(){
document.getElementById('window2').style.visibility='visible'
document.getElementById('window_name2').style.visibility='visible'
document.getElementById('Wbottom_name2').style.visibility='visible'
document.getElementById('windowSH2').style.visibility='visible'
document.getElementById('DIVframe2').style.visibility='visible'
document.getElementById('close_min2').style.visibility='visible'
document.indowB_img2.src='theme/default/desktop_images/window_open.png'
}

function show1(){
document.getElementById('close_min1').style.visibility='visible'
document.getElementById('window1').style.visibility='visible'
document.getElementById('window_name1').style.visibility='visible'
document.getElementById('Wbottom_name1').style.visibility='visible'
document.getElementById('windowSH1').style.visibility='visible'
document.getElementById('DIVframe1').style.visibility='visible'
document.windowB_img1.src='theme/default/desktop_images/window_open.png'
}

function hideSysP(){
document.getElementById('syscloseDIV').style.visibility='hidden'	
document.getElementById('sysManagerInfo').style.visibility='hidden'
document.getElementById('sysText').style.visibility='hidden'
document.getElementById('system_managerDIV').style.visibility='hidden'
}

function showsysp(){
document.getElementById('syscloseDIV').style.visibility='visible'	
document.getElementById('sysManagerInfo').style.visibility='visible'
document.getElementById('sysText').style.visibility='visible'
document.getElementById('system_managerDIV').style.visibility='visible'
}