﻿function InsertPicture(FileAddressDesc)
{
    if (CheckFileName(FileAddressDesc))
    {
    IframeID.focus();
    IframeID.document.execCommand('InsertImage', false,FileAddressDesc);
    return;
    }
}
function CheckFileName(fileName)
{
    if(fileName.lastIndexOf(".")!=-1)
    {
        var fileType = (fileName.substring(fileName.lastIndexOf(".")+1,fileName.length)).toLowerCase();
        var suppotFile = new Array();
        suppotFile[0] = "gif";
        suppotFile[1] = "bmp";
        suppotFile[2] = "jpg";
        for(var i =0;i<suppotFile.length;i++)
        {
            if(suppotFile[i]==fileType)
        {
        return true;
        }
        else
        {
            continue;
        }
        }
        alert("不支持文件类型"+fileType);
        return false;
        }
        else
        {
            alert("文件只支持JIF，BMP，JPG");
        }
}

function MoveDiv44()
{
    var x=event.x;
    var y=event.y;
    document.all.divPhoneRegister.style.left=512;
    document.all.divPhoneRegister.style.top=384;
    mask.style.visibility="visible";
    document.all.divPhoneRegister.style.display = "";
}
