You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.0 KiB
JavaScript
83 lines
2.0 KiB
JavaScript
document.writeln("<div id=\"_cruiseDatePanel\" style=\"position:absolute;visibility:hidden;z-index:9999;background-color:#FFFFFF;border:0px solid #666666;width:498px;height:389px;filter:alpha(opacity=90);-moz-opacity:0.9;opacity: 0.9;\">");
|
|
document.writeln("<iframe name=\"cruiseDate\" id=\"cruiseDate\" src=\"tpjs.htm\" width=\"100%\" height=\"100%\" scrolling=\"no\" frameborder=\"0\" style=\"margin:0px;\"></iframe>");
|
|
document.writeln("</div>");
|
|
|
|
function ieFlag(){
|
|
if (document.all) return true;
|
|
return false;
|
|
}
|
|
|
|
var o1 = null;
|
|
function displayCalendar(o,csn){
|
|
|
|
var panel = document.getElementById("_cruiseDatePanel");
|
|
|
|
|
|
var xy = getAbsPosition(o);
|
|
|
|
panel.style.left = xy.x + "px";
|
|
panel.style.top = (xy.y + o.offsetHeight) + "px";
|
|
|
|
panel.style.visibility = "visible";
|
|
|
|
var _cc = window.frames['cruiseDate'];
|
|
_cc._csn = csn;
|
|
|
|
_cc.targetObj = o;
|
|
tmpObj = isNaN(Date.parse(o.value))?new Date():new Date(o.value);
|
|
_cc.setCalendricTime(tmpObj.getYear()+1900,tmpObj.getMonth()+1,csn);
|
|
|
|
|
|
o1 = {x:parseInt(panel.style.width),y:parseInt(panel.style.height)};
|
|
o2 = {x:5,y:4};
|
|
ieFlag()?toe(0.03):tox();
|
|
}
|
|
|
|
|
|
function toe(o){
|
|
var panel = document.getElementById("_cruiseDatePanel");
|
|
panel.style.zoom = o;
|
|
o = o + 0.03;
|
|
o<1?setTimeout("toe("+o+")",10):panel.style.zoom=1;
|
|
}
|
|
|
|
function tox(){
|
|
|
|
var panel = document.getElementById("_cruiseDatePanel");
|
|
|
|
|
|
panel.style.width = o2.x + "px";
|
|
panel.style.height = o2.y + "px";
|
|
_tx = o2.x +10;
|
|
_ty = o2.y +8;
|
|
o2 = {x:_tx,y:_ty};
|
|
if (o2.x<o1.x){
|
|
setTimeout("tox()",1);
|
|
}else{
|
|
panel.style.width = o1.x + "px";
|
|
panel.style.height = o1.y + "px";
|
|
}
|
|
}
|
|
|
|
function closeCalendar(){
|
|
var panel = document.getElementById("_cruiseDatePanel");
|
|
panel.style.visibility = "hidden";
|
|
}
|
|
|
|
|
|
function getAbsPosition(_e){
|
|
var _x = _e.offsetLeft;
|
|
var _y = _e.offsetTop;
|
|
while(_e = _e.offsetParent){
|
|
_x += _e.offsetLeft;
|
|
_y += _e.offsetTop;
|
|
}
|
|
return {"x":_x,"y":_y};
|
|
};
|
|
|
|
var sleep = function(n){
|
|
var _start=new Date().getTime();
|
|
while(true) if(new Date().getTime()-_start>n) break;
|
|
}
|
|
|