﻿function OpenPan1(path)
{
    if(getCookie('hae') == null)
    {
        if(exist('openPanObj') == true)
        {
            remove_Div('openPanObj');
        }
        
        var obj = document.createElement("div");
        obj.id="openPanObj";
        obj.innerHTML = "<div id=\"openPanDiv\" class=\"divPosition\" style=\"left: 35%; top: 51%; height:120px;display:block;\"><div style=\"background-color:#B4D8F8; border-bottom:1px solid #F0F0F0;height:30px;\"><div style=\"float:left; height:20px; padding-left:10px; margin-top:5px; font-size:14px; color:#FFFFFF;font-weight:bolder;\">此文件需要安装99盘才能在线浏览</div><div style=\"float:right; margin-top:5px; padding-right:5px;\"><img src=\"http://data.99pan.com/download/images/gifclose.gif\" onclick=\"remove_Div('openPanObj')\" /></div></div><div style=\"width:330px; height:20px; padding:10px; font-size:14px;\"><a href=\"http://www.99pan.com\">马上体验</a>和自己硬盘一模一样的网络硬盘</div><div style=\"width:330px;padding:10px; border-top:1px solid #F0F0F0;\"> <input name=\"button\" type=\"button\"  class=\"n_inputClass\" value=\"下载安装99盘\" onclick=\"doNo()\"/>&nbsp;&nbsp;&nbsp;<input name=\"\" type=\"button\" value=\"我已安装99盘\" class=\"v_inputClass\" onclick=\"dohae('"+path+"')\"/></div>";
        document.body.appendChild(obj);
        openMask();
    }
    else
    {
        window.location.href = "99pan:\\"+path;
    }
}
//测试弹出
function OpenPan(ev,path)
{
    //var objPos = mousePosition(ev);
    if(getCookie('hae') == null)
    {
    messContent="<div id=\"openPanDiv\"></div><div style=\"width:330px; height:20px; padding:10px; font-size:14px;\"><a href=\"http://www.99pan.com\">马上体验</a>和自己硬盘一模一样的网络硬盘</div><div style=\"width:330px;padding:10px; border-top:1px solid #F0F0F0;\"> <input name=\"button\" type=\"button\"  class=\"n_inputClass\" value=\"下载安装99盘\" onclick=\"doNo()\"/>&nbsp;&nbsp;&nbsp;<input name=\"\" type=\"button\" value=\"我已安装99盘\" class=\"v_inputClass\" onclick=\"dohae('"+path+"')\"/></div>";
    showMessageBox('此文件需要安装99盘才能在线浏览',messContent,ev,350);
    }
    else
    {
        window.location.href = "99pan:\\"+path;
    }
}
function setCookie(eN,eV)
{
	var Days = 365;
	var exp = new Date(); 
	exp.setTime(exp.getTime() + Days*24*60*60*1000);
	document.cookie = eN+"=" + escape(eV)+ "; expires ="+ exp.toGMTString() + "; path=/;domain=99pan.com";
}
function dohae(path)
{
	setCookie('hae','hae');
	window.location.href = "99pan:\\"+path;
	closeWindow();
}
function doNo()
{
	window.location.href = "http://www.99pan.com/setup/99pan_Setup_2010.07.16(1.68)_1.exe";
}

/*
	判读obj对象是否存在
	*/
function exist(obj)
{
    var return_bool = true;
    try{
       var m_obj = document.getElementById(obj).style.display;
    }catch (ex) {
		return_bool = false;
	}
	return return_bool;
}

/*

    删除Div
    */
function remove_Div(u)
{
    var obj = document.getElementById(u);
    document.body.removeChild(obj);
    closeWindow();
}