﻿// JScript 文件
// iframe自适应高度
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] 
//extra height in px to add to iframe in FireFox 1.0+ browsers 
var FFextraHeight=getFFVersion>=0.1? 16 : 0 
function dyniframesize(down, minHeight)
{
	var pTar = null; 
	var bottomMargin = 10;
	if (document.getElementById)
	{ 
		pTar = document.getElementById(down); 
	} 
	else
	{ 
		eval('pTar = ' + down + ';'); 
	} 
	if (pTar && !window.opera)
	{
		//begin resizing iframe 
		pTar.style.display="block";
		if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight)
		{ 
			//ns6 syntax 
			pTar.height = pTar.contentDocument.body.offsetHeight + FFextraHeight + bottomMargin;
		} 
		else if (pTar.Document && pTar.Document.body.scrollHeight)
		{ 
			//ie5+ syntax 
			pTar.height = pTar.Document.body.scrollHeight + bottomMargin;
		} 
		if (minHeight)
			pTar.height = pTar.height < minHeight ? minHeight : pTar.height;			
	}	
}
function ActiveTab(obj)
{
    var div = obj;
    if(div.className!="OutsetChar5ButtonDown") div.className = "OutsetChar5ButtonOver";
}
function DeactivateTab(obj)
{
    var div = obj;
    if(div.className!="OutsetChar5ButtonDown") div.className = "OutsetChar5ButtonUp";
}
function ClickTab(obj)
{
    var div = obj;
    div.className = "OutsetChar5ButtonDown";
    
    var menu = null;
    for(var i = 1; i <= 13; i++)
    {
        menu = document.getElementById("Tab"+i);
        if(menu!=null&&menu.id != div.id && menu.className == "OutsetChar5ButtonDown")
        {
            menu.className = "OutsetChar5ButtonUp";
        }
    }
    
    if(div.id=="Tab1") document.getElementById('ifrmContent').src = "ContentMaintenance.aspx";
    if(div.id=="Tab2") document.getElementById('ifrmContent').src = "UserManagement.aspx";
    if(div.id=="Tab3") document.getElementById('ifrmContent').src = "BasicData.aspx";
}

function ActiveSolidButton(obj)
{
    var div = obj;
    if(div.className=="SolidChar2Button") div.className = "SolidChar2ButtonOver";
    //if(div.className=="SolidChar4Button") div.className = "SolidChar4ButtonOver";
}
function DeactivateSolidButton(obj)
{
    var div = obj;
    if(div.className=="SolidChar2ButtonOver") div.className = "SolidChar2Button";
    //if(div.className=="SolidChar4ButtonOver") div.className = "SolidChar4Button";
}
function ClickSolidButton(obj)
{
    var div = obj;
    if(div.innerText=="登出") 
    {
        document.forms[0].action = "Home.aspx?logout=1";
        document.forms[0].method = "POST";
        document.forms[0].submit();
    }
    if(div.innerText=="帮助") window.location.href = "Help.aspx";
}
