﻿//定义系统全局常量





//------------------------- 打开新窗口 --------------------------
//url 要打开的页面地址
//width 宽度（数字整型）
//height 高度（数字整型）
//fs 是否可以放大缩小（1/0）
function new_open(url, width, height, fs)
{
    var t_left = window.screen.width/2-width/2;   
    var t_top = window.screen.height/2-height/2;  
    var newWindow = null;
    newWindow = window.open(url, 'UniThink_'+(Math.floor(Math.random()*10000)+1), 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable='+fs+',width='+ width +',height='+ height +',left='+ t_left +',top='+ t_top +''); 
    return newWindow;
}
//url 要打开的页面地址
//width 宽度（数字整型）
//height 高度（数字整型）
//fs 是否可以放大缩小（1/0）
function sonwin_open(url, sonWinName)
{
    if(sonWinName == null || sonWinName == "")
    {
        if( url.search("/") == -1 )
            sonWinName = "UniThink" + url.split(".aspx")[0].replace(/\W/g,"");
        else
            sonWinName = "UniThink" + url.split(".aspx")[0].split("/")[1].replace(/\W/g,"");
    }
   
    var sonwinwidth = window.screen.width * 0.8;
    var sonwinheight = window.screen.height * 0.8;
    window.open(url, sonWinName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=1,width='+ sonwinwidth +',height='+ sonwinheight +',top=80,left=170'); 
}
function modelnew_open(url, wid, hei, scr)
{
    //createPopup();
    if(scr == null)
    {
        scr = "no";
    }
    else
    {
        scr = "auto";
    }
    showModalDialog(url,window,"dialogWidth:"+ wid +"px;dialogHeight:"+ hei +"px;scroll:" + scr + ";resizable:no;");
    //showModelessDialog(url,WinName,"dialogWidth:"+ wid +"px;dialogHeight:"+ hei +"px;scroll:no;");
}
//---------------------------------------------------------------

//--------------------------页面标题---------------------------
//s 页面标题后面要加的字
//n 是长度
function title_end(s, n)
{
	var a = new Array();
	for (var i=0;i<n;i++)
		a[a.length] = s;
	return a.join("");
}
//---------------------------------------------------------------
