//////////////////////////////////////////////////////////////////////////////////////////////////////

//网上营业厅菜单   函数作者:周末

function showSubMenu(obj,idx)
{
		var LineHeight = 25;		//行高
		var inndex     = idx;		//菜单排序数
		var imgX       = '20px';	//图标显示位置X位置
		var imgY;					//图标显示位置Y位置
		
		imgX = '25px';
		imgY = LineHeight * inndex - 17+'px';
														//更新图标显示
		$('CaseMenu').setStyle({backgroundPosition:imgX+' '+imgY});
		
		var titles = $$('.case_menu li');
		titles.each( function(s)
		{											
			//菜单初始化
			if(s.down()) {
					s.down().setStyle({ color:'#1159B2'});
			}
														
			if (typeof s.down(1) != 'undefined')
				{
						//初始化子菜单
					/*	var k = s.down(1).childNodes;
						for (i=0; i < k.length; i++){
									if (typeof k[i].tagName != 'undefined'){
											k[i].down().setStyle({ color:'#1159B2'});
									}
							}*/
					//关闭子菜单
					s.down(1).hide();
				}
		});
		
		obj.setStyle({ color:'#eb5b02'});		//改变点击菜单姿色
		
		if (typeof obj.next(0) != 'undefined')
			{
						obj.next(0).show();				//如果有子菜单,显示子菜单
			}
}

function SubMenuClick(Element) {
	var submenus = Element.up(1).childNodes;
	for (i=0; i < submenus.length; i++){
		
		if (typeof submenus[i].tagName != 'undefined'){
				if(submenus[i].down()) submenus[i].down().setStyle({ color:'#1159B2'});
		}
	}
	
	Element.setStyle({ color:'#F90' });
}

/*
* 窗口重设高度
* 修改: 周末 2008-10-17
*/

function iframe_Onload()	{
		if (window.parent.pindex){
				window.parent.pindex.window.document.onload = new function(){
						 try {
									if(document.all){//IE
											document.getElementById("pindex").style.height =window.pindex.document.body.offsetHeight + 30;
									}
									else	{
											window.document.getElementById("pindex").height = pindex.window.document.body.offsetHeight + 30;
									}
							}
							catch(e){
							}
				}
		}
}


		/*--------------------------------------------
		*  namespace CVTT
		*  梁亚利	@2007 -12-10
		*  弹出层窗口
		---------------------------------------------*/
		var _win=null;
		function htmlload(){
		_win = new Window("winid",{className: "alphacube", 
									title:"", 
									width:450,
									height:300, 
									showEffectOptions: {duration:1.5},
									//showEffect:Effect.BlindDown, 
									//hideEffect: Effect.SwitchOff,
									parent:document.body,
									maximizable:false,
									minimizable:false,
									closable: true
									});
		_subwin = new Window("subwin",{className: "alphacube", 
									title: "", 
									width:470,
									height:350, 
									showEffectOptions: {duration:1.5},
									parent:document.body,
									maximizable:false,
									minimizable:false,
									closable: true
									});
		_winB = new Window("win_B",{className: "alphacube", 
									title: "", 
									width:470,
									height:350, 
									showEffectOptions: {duration:1.5},
									parent:document.body,
									maximizable:false,
									minimizable:false,
									closable: true
									});
		}
		 
		//打开主窗口
		 function openWindow(strurl)
		 {
		   _win.setURL(strurl);
		 	_win.showCenter('window');
		 }
		 
		 function openWinB(strurl)
		 {
		   _winB.setURL(strurl);
		 	_winB.showCenter('window');
		 }
		 
		 function openSubWin(strurl)
		 {
			_subwin.setURL(strurl);
		 	_subwin.showCenter('window');
		 }
		 
		 
		 
		 //关闭弹出子窗口
		 function closeWindow(url)
		 {  
		 	$('pindex').src=url;
		 	_win.close();
		 }
		 
		 //关闭二级子窗口,调出一级子窗口
		 function closeSubWin(url)
		 {  
			_win.setURL(url);
		 	_subwin.close();
		 }
		 
		 //关闭设置窗口,调出子窗口
		 function closwinB(url,Grade)
		 {
			 if(Grade=='4')
			 {
					_subwin.setURL(url);
		 			//_subwin.showCenter('window');
					
			 }
			 else
			 {
				  _win.setURL(url);
		 			//_win.showCenter('window');
			 }
			 _winB.close();
			 
		 }
