var popUp; 


function OpenCalendar(idname, postBack)
{
	popUp = window.open('../Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=220,height=250,left=200,top=250');
}
function OpenCalendar1(idname, postBack)
{
	popUp = window.open('Calendar.aspx?formname=' + document.forms[0].name + 
		'&id=' + idname + '&selected=' + document.forms[0].elements[idname].value + '&postBack=' + postBack, 
		'popupcal', 
		'width=220,height=250,left=200,top=250');
}
function SetDate(formName, id, newDate, postBack)
{
	eval('var theform = document.' + formName + ';');
	popUp.close();
	theform.elements[id].value = newDate;
//	if (postBack)		__doPostBack(id,'');
}		

function OpenUploadPic(editor,folder) {
	
	
	var galleryscript ='../imagegallery.aspx?rif='+folder+'&cif='+folder;
	imgArr = showModalDialog(galleryscript,window,'dialogWidth:560px; dialogHeight:500px;help:0;status:0;resizeable:1;');

	if (imgArr != null) {
		imagestring = imgArr['filename'];
		i=imagestring.indexOf("/",1);
		
		imagestring=imagestring.substring(i,imagestring.length);
		document.forms[0].elements[editor].value=imagestring;
	} else {
		//alert("You did not select an image");
	}
}

function OpenViewWin(cUrl)    //打开显示窗口
  { cFeatures="width=800,height=600,resizable=0,scrollbars=1,left=50,top=50";
    var cName="annouce";
    var xWin = window.open(cUrl, cName, cFeatures);
    if (xWin) xWin.focus();
  }
  
function OpenMap(cUrl)    //打开显示窗口
  { cFeatures="width=520,height=430,resizable=0,scrollbars=0,left=50,top=50,location=no,menubar=no,toolbar=no";
    var cName="map";
    var xWin = window.open(cUrl, cName, cFeatures);
    if (xWin) xWin.focus();
  }
 
 function OpenReply(cUrl)    //打开显示窗口
  { cFeatures="width=700,height=430,resizable=0,scrollbars=0,left=50,top=50,location=no,menubar=no,toolbar=no";
    var cName="reply";
    var xWin = window.open(cUrl, cName, cFeatures);
    if (xWin) xWin.focus();
  }
   
