function showMenu(obj)
{
    if(document.getElementById)
    {
	    var el = document.getElementById(obj);
	    var ar = document.getElementById("menutop").getElementsByTagName("DIV");
	    if(el.style.display == "none")
	    {
		for (var i=0; i<ar.length; i++)
		{
		    ar[i].style.display = "none";
		}
		el.style.display = "block";
	    }
	    else
	    {
		el.style.display = "none";
	    }
    }

}
			
function SwitchMenu(obj)
{
    if(document.getElementById)
    {
	    var el = document.getElementById(obj);
	    var ar = document.getElementById("cont").getElementsByTagName("DIV");
	    if(el.style.display == "none")
	    {
		for (var i=0; i<ar.length; i++)
		{
		    ar[i].style.display = "none";
		}
		el.style.display = "block";
	    }
	    else
	    {
		el.style.display = "none";
	    }
    }
}


function hideMenuSelect()
{
	var id1 = document.getElementById("menuTop1");
	id1.className='menuTopCell';
	var id2 = document.getElementById("menuTop2");
	id2.className='menuTopCell';
	var id3 = document.getElementById("menuTop3");
	id3.className='menuTopCell';
	var id4 = document.getElementById("menuTop4");
	id4.className='menuTopCell';
	var id5 = document.getElementById("menuTop5");
	id5.className='menuTopCell';
	var id6 = document.getElementById("menuTop6");
	id6.className='menuTopCell';
	var id7 = document.getElementById("menuTop7");
	id7.className='menuTopCell';
	var id8 = document.getElementById("menuTop8");
	id8.className='menuTopCell';	
}

function hideMenuSelect2()
{
	var id1 = document.getElementById("menuTop1");
	id1.className='menuTopCell';
	var id2 = document.getElementById("menuTop2");
	id2.className='menuTopCell';
	var id3 = document.getElementById("menuTop3");
	id3.className='menuTopCell';
	var id4 = document.getElementById("menuTop4");
	id4.className='menuTopCell';
	var id5 = document.getElementById("menuTop5");
	id5.className='menuTopCell';
	var id6 = document.getElementById("menuTop6");
	id6.className='menuTopCell';	
}


function winjadid(linkref,wh,ht){
  newwin=window.open(linkref,'newWin','menubar=no,toolbar=no,status=no,width='+wh+',height='+ht);
}

function winjadid2(linkref){
  newwin2=window.open(linkref,'newWin','menubar=no,toolbar=no,scrollbars=yes,status=no,resizable=yes,width=420,height=300');
}

//******************* Right Menu

function msgShow(){
 var obj=document.getElementById('rightClick');
 var curX=window.event.clientX;  
 var curY=window.event.clientY;

 if((curX+160)>(screen.width-20)){
  curX=curX - 180;
 }  
 obj.style.left=curX;
 obj.style.top=curY;
 obj.style.display="block";
 //window.status = 'X=' + window.event.clientX + ' Y=' + window.event.clientY + '   کليک راست دانشكده مهندسي برق و كامپيوتر' ; 
}

function msgHide(){
 var obj=document.getElementById('rightClick');
 obj.style.display="none"; 
}

function DisableContextMenu(e){
 msgShow();
 return false;
}