function getDateString(oInputSrc,oInstance,content)
{ //content指定控件所在的父元素中 第一个带滚动条的父元素
//alert(oInputSrc); alert(oInstance);
//alert(22); return;
if(oInputSrc&&oInstance)
{
var CalendarDiv=$(oInstance.sDIVID);
oInstance.oTaget=oInputSrc;
/* mfb +stz*/
// alert(CalendargetPos(oInputSrc,"Left")+oInstance.Width); // alert(screen.width)
CalendarDiv.style.display="";
CalendarDiv.style.pixelLeft=-oInstance.Width-100;
CalendarDiv.style.pixelTop=-CalendarDiv.offsetHeight-100;
// alert(CalendarDiv);
if(checkWebBrouser()!="IE"){
CalendarDiv.style.left=-oInstance.Width-100;
CalendarDiv.style.top=-CalendarDiv.offsetHeight-100;
}
//alert(CalendarDiv.scrollHeight); //alert(CalendarDiv.clientHeight); alert(CalendarDiv.offsetHeight);
var posleft=CalendargetPos(oInputSrc,"Left"), postop=CalendargetPos(oInputSrc,"Top") + oInputSrc.offsetHeight;
// CalendarDiv.style.display=(CalendarDiv.style.display=="none")?"":"none";
//if(!content){
//}else{
var content=$(content);
//}
if(!content) content=document.body;
if(CalendarDiv.style.pixelLeft<0){ //显示或隐藏【其实是移动到负的一段的距离】
if(content!=document.body){ //alert(1);
if(posleft+oInstance.Width <content.scrollWidth){
CalendarDiv.style.left=posleft-content.scrollLeft+"px";
CalendarDiv.style.top=postop-content.scrollTop+"px"; //pixelTop
}else{
CalendarDiv.style.left=content.offsetWidth+parseInt(content.currentStyle.paddingLeft)+parseInt(content.currentStyle.paddingRight)-oInstance.Width+"px"; //中间多那些是因为content的scrollWidth没算入padding的空间
CalendarDiv.style.top=postop-content.scrollTop+"px";
}
}else{ // if(content!=document.body)
if(posleft+oInstance.Width <content.scrollWidth){
if(postop+CalendarDiv.clientHeight<content.scrollHeight){
CalendarDiv.style.left=posleft+"px";
CalendarDiv.style.top=postop+"px";
}else{
CalendarDiv.style.left=posleft+"px";
CalendarDiv.style.top=CalendargetPos(oInputSrc,"Top")-CalendarDiv.offsetHeight+"px";
}
}else{
if(postop+CalendarDiv.clientHeight<content.scrollHeight){
CalendarDiv.style.left=content.scrollWidth-oInstance.Width+"px";
CalendarDiv.style.top=postop+"px";
}else{
CalendarDiv.style.left=content.scrollWidth-oInstance.Width+"px";
CalendarDiv.style.top=CalendargetPos(oInputSrc,"Top")-CalendarDiv.offsetHeight+"px";
}
}
}
}else{
CalendarDiv.style.left=-oInstance.Width-100+"px";
CalendarDiv.style.top=-CalendarDiv.offsetHeight-100+"px";
}
if(getIEVersion()=="IE6"){ //+stz 解决ie6 层被select挡住的bug
//alert(1);
var maskDiv=document.getElementById("bottom_"+ oInstance.sDIVID);
if(!maskDiv){
var framemask = "<iframe src='' frameborder='0' id='bottom_"+ oInstance.sDIVID +"' style='visibility:visible;position:absolute;width:0px;height:0px;left:0px;top:0px;background-color:#ffffff; z-index:999'></iframe>" // allowtransparency='true'
document.body.insertAdjacentHTML("beforeEnd", framemask);
maskDiv=document.getElementById("bottom_"+ oInstance.sDIVID);
maskDiv.style.width = CalendarDiv.offsetWidth;
maskDiv.style.height = CalendarDiv.offsetHeight;
maskDiv.style.left = CalendarDiv.style.pixelLeft;
maskDiv.style.top = CalendarDiv.style.pixelTop;
{ //content指定控件所在的父元素中 第一个带滚动条的父元素
//alert(oInputSrc); alert(oInstance);
//alert(22); return;
if(oInputSrc&&oInstance)
{
var CalendarDiv=$(oInstance.sDIVID);
oInstance.oTaget=oInputSrc;
/* mfb +stz*/
// alert(CalendargetPos(oInputSrc,"Left")+oInstance.Width); // alert(screen.width)
CalendarDiv.style.display="";
CalendarDiv.style.pixelLeft=-oInstance.Width-100;
CalendarDiv.style.pixelTop=-CalendarDiv.offsetHeight-100;
// alert(CalendarDiv);
if(checkWebBrouser()!="IE"){
CalendarDiv.style.left=-oInstance.Width-100;
CalendarDiv.style.top=-CalendarDiv.offsetHeight-100;
}
//alert(CalendarDiv.scrollHeight); //alert(CalendarDiv.clientHeight); alert(CalendarDiv.offsetHeight);
var posleft=CalendargetPos(oInputSrc,"Left"), postop=CalendargetPos(oInputSrc,"Top") + oInputSrc.offsetHeight;
// CalendarDiv.style.display=(CalendarDiv.style.display=="none")?"":"none";
//if(!content){
//}else{
var content=$(content);
//}
if(!content) content=document.body;
if(CalendarDiv.style.pixelLeft<0){ //显示或隐藏【其实是移动到负的一段的距离】
if(content!=document.body){ //alert(1);
if(posleft+oInstance.Width <content.scrollWidth){
CalendarDiv.style.left=posleft-content.scrollLeft+"px";
CalendarDiv.style.top=postop-content.scrollTop+"px"; //pixelTop
}else{
CalendarDiv.style.left=content.offsetWidth+parseInt(content.currentStyle.paddingLeft)+parseInt(content.currentStyle.paddingRight)-oInstance.Width+"px"; //中间多那些是因为content的scrollWidth没算入padding的空间
CalendarDiv.style.top=postop-content.scrollTop+"px";
}
}else{ // if(content!=document.body)
if(posleft+oInstance.Width <content.scrollWidth){
if(postop+CalendarDiv.clientHeight<content.scrollHeight){
CalendarDiv.style.left=posleft+"px";
CalendarDiv.style.top=postop+"px";
}else{
CalendarDiv.style.left=posleft+"px";
CalendarDiv.style.top=CalendargetPos(oInputSrc,"Top")-CalendarDiv.offsetHeight+"px";
}
}else{
if(postop+CalendarDiv.clientHeight<content.scrollHeight){
CalendarDiv.style.left=content.scrollWidth-oInstance.Width+"px";
CalendarDiv.style.top=postop+"px";
}else{
CalendarDiv.style.left=content.scrollWidth-oInstance.Width+"px";
CalendarDiv.style.top=CalendargetPos(oInputSrc,"Top")-CalendarDiv.offsetHeight+"px";
}
}
}
}else{
CalendarDiv.style.left=-oInstance.Width-100+"px";
CalendarDiv.style.top=-CalendarDiv.offsetHeight-100+"px";
}
if(getIEVersion()=="IE6"){ //+stz 解决ie6 层被select挡住的bug
//alert(1);
var maskDiv=document.getElementById("bottom_"+ oInstance.sDIVID);
if(!maskDiv){
var framemask = "<iframe src='' frameborder='0' id='bottom_"+ oInstance.sDIVID +"' style='visibility:visible;position:absolute;width:0px;height:0px;left:0px;top:0px;background-color:#ffffff; z-index:999'></iframe>" // allowtransparency='true'
document.body.insertAdjacentHTML("beforeEnd", framemask);
maskDiv=document.getElementById("bottom_"+ oInstance.sDIVID);
maskDiv.style.width = CalendarDiv.offsetWidth;
maskDiv.style.height = CalendarDiv.offsetHeight;
maskDiv.style.left = CalendarDiv.style.pixelLeft;
maskDiv.style.top = CalendarDiv.style.pixelTop;