﻿
//***************************************************
//链接到内嵌祯
//参数：
//frameName     内嵌祯的名字
//url           链接地址
//imgUrl1       栏目所属风格的背景图片1
//imgUrl2       栏目所属风格的背景图片2
//***************************************************
function frameLink(frameName, url, imgUrl1, imgUrl2)
{
    document.getElementById(frameName).setAttribute("src", url);
    
    changeImg(imgUrl1, imgUrl2)
}

//换图片
function changeImg(imgUrl1, imgUrl2)
{
    document.getElementById("imgStyle1").setAttribute("src", imgUrl1);
    document.getElementById("imgStyle2").setAttribute("src", imgUrl2);
}

//弹出页面
function showWindowLink(url, imgUrl1, imgUrl2)
{
    var strWidth, strHeight;
    
    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(url, '_blank', sFeature);
    
    if(imgUrl1 != '' && imgUrl2 != '')
        changeImg(imgUrl1, imgUrl2);
}

function redirectOtherSystem(sysName, imgUrl1, imgUrl2)
{
    var url = '';
    
    switch(sysName)
    {
        case 'EDI_ENTRY':
        url = document.getElementById('HiddenEdiSystemUrl').value;
        break;
        case 'ENTRYMANAGEMENTAPPLY':
        url = document.getElementById('HiddenEMSystemUrl').value;
        break;
        case 'IC_CARD':
        url = document.getElementById('HiddenICASystemUrl').value;
    }
    
     window.open(url, '_blank');
    
    changeImg(imgUrl1, imgUrl2);
}

//取消点击
function cancelLink()
{
    event.returnValue = false;
}


function exchangeSitePicture(sitePicSrc)
{
    var imgSite = document.getElementById("imgSitePic");
    
    imgSite.src = sitePicSrc;
}
