﻿//弹出全屏窗口
function showFullScreenWindow(url)
{
	newwin=window.open("","_blank","scrollbars=no,status=yes,toolbar=no,menubar=no,location=no");
	if (document.all){
			newwin.moveTo(0,0);
			newwin.resizeTo(screen.width,screen.height);
	}
	newwin.location = url;
}

function fullSearch()
{
    var text = document.getElementById('TextSearch').value;

    showNewWindows(800, 600, addBaseUrl('ETWebApp/ETPortalSite/SearchCenter/FullTextSearch.aspx?SearchText=' + text + '&SearchLogic=OR'));
}

//打开新的 Window 窗口
function showNewWindows(strWidth, strHeight, strLink)
{
	if (strWidth > window.screen.width)
	{
		strWidth = window.screen.width * 0.9;
	}
	if (strHeight > window.screen.height)
	{
		strHeight = window.screen.height * 0.92;
	}
	
	strLeft = (window.screen.width-strWidth)*0.5;
	if (strHeight > 650)
		strTop = 10;
	else
		strTop = (window.screen.height-strHeight-20)*0.5;
	
	var sFeature = "width=" + strWidth + "px, height=" + strHeight + "px,status=no,toolbar=no,menubar=no,center=yes,location=no,resizable=yes,scrollbars=yes,top=" + strTop + ",left=" + strLeft;
	
	window.open(strLink, '_blank', sFeature);
}

function frameLink(guide, url)
{
    document.getElementById("mainframe").setAttribute("src", url);
    document.getElementById("spanGuide").innerText = "您现在所在的位置：" + guide;
}

function redirectOtherSystem(sysName)
{
    var url = '';
    
    switch(sysName)
    {
        case 'EDI_ENTRY':
            url = document.getElementById('HiddenEdiSystemUrl').value;
            if(url.length > 0) showFullScreenWindow(url);
            break;
        case 'ENTRYMANAGEMENTAPPLY':
            url = document.getElementById('HiddenEMSystemUrl').value;
            if(url.length > 0) window.open(url, '_blank');
            break;
        case 'CHN_IC_CARD':
            url = document.getElementById('HiddenCHNICASystemUrl').value;
            if(url.length > 0) window.open(url, '_blank');
            break;
        case 'TJ_IC_CARD':
            url = document.getElementById('HiddenTJICASystemUrl').value;
            if(url.length > 0) window.open(url, '_blank');
        case 'QP_FEE':
            url = document.getElementById('HiddenQPFeeSystemUrl').value;
            if(url.length > 0) window.open(url, '_blank');
    }
}

function addBaseUrl(url)
{
    var baseUrl = document.getElementById("HiddenBaseUrl").value;
    
    if (baseUrl.length == 0) event.returnValue = false;
    else return baseUrl + url;
}

//取消点击
function cancelLink()
{
    event.returnValue = false;
}
