var ClassAjaxOpenwin = function() {
this.staticFlage = false;
this.divId = "";
this.ajaxUrl = "";
this.setStaticFlage = function() {
//document.writeln("setStateicFlage");
this.staticFlage = true;
}
this.getAll = function(id, flag, kuan, thisObject, divid, action, searchType) {
var self = this;
$.ajax({
type: "POST",
url: "/ajax/ajaxHotels.aspx",
data: "id=" + id + "&flag=" + flag + "&action=" + action + "&searchType=" + searchType,
success: function(msg) {
self.winOpenStr(msg, divid, flag);
}
});
this.winOpen(kuan, thisObject, divid);
}
this.divHinden = function() {
this.staticFlage = false;
window.Obj = this;
var t = setTimeout("Obj.divHinden2()", 500);
}
this.divHinden2 = function() {
var thisDiv = document.getElementById("winpop");
if (this.staticFlage == false) {
thisDiv.innerHTML = "";
thisDiv.style.display = "none";
}
}
this.winOpen = function(kuan, thisObject, divid) {
var pos = this.getPos(thisObject);
var thisDiv = document.getElementById(divid);
var theKuan = kuan * 80;
thisDiv.style.width = theKuan + "px";
thisDiv.style.left = pos.x + "px";
thisDiv.style.top = (pos.y + 10) + "px";
//alert(thisDiv.style.width);
}
this.winOpenStr = function(data, divid, flag) {
var thisDiv = document.getElementById(divid);
var htmlStr = "<ul>";
var listStr = new Array();
listStr = data.split(",");
for (var i = 0; i < listStr.length; i++) {
htmlStr = htmlStr + "<li><a href='?action=" + flag + "&searchFlag=2&searchType=" + listStr[i] + "'>" + listStr[i] + "</a></li>";
}
htmlStr = htmlStr + "</ul>";
thisDiv.innerHTML = htmlStr;
thisDiv.style.display = "";
}
this.getPos = function(o) //取元素坐标
{
var x = 0, y = 0;
do {
x += o.offsetLeft;
y += o.offsetTop;
} while (o = o.offsetParent);
return { 'x': x, 'y': y };
}
}
this.staticFlage = false;
this.divId = "";
this.ajaxUrl = "";
this.setStaticFlage = function() {
//document.writeln("setStateicFlage");
this.staticFlage = true;
}
this.getAll = function(id, flag, kuan, thisObject, divid, action, searchType) {
var self = this;
$.ajax({
type: "POST",
url: "/ajax/ajaxHotels.aspx",
data: "id=" + id + "&flag=" + flag + "&action=" + action + "&searchType=" + searchType,
success: function(msg) {
self.winOpenStr(msg, divid, flag);
}
});
this.winOpen(kuan, thisObject, divid);
}
this.divHinden = function() {
this.staticFlage = false;
window.Obj = this;
var t = setTimeout("Obj.divHinden2()", 500);
}
this.divHinden2 = function() {
var thisDiv = document.getElementById("winpop");
if (this.staticFlage == false) {
thisDiv.innerHTML = "";
thisDiv.style.display = "none";
}
}
this.winOpen = function(kuan, thisObject, divid) {
var pos = this.getPos(thisObject);
var thisDiv = document.getElementById(divid);
var theKuan = kuan * 80;
thisDiv.style.width = theKuan + "px";
thisDiv.style.left = pos.x + "px";
thisDiv.style.top = (pos.y + 10) + "px";
//alert(thisDiv.style.width);
}
this.winOpenStr = function(data, divid, flag) {
var thisDiv = document.getElementById(divid);
var htmlStr = "<ul>";
var listStr = new Array();
listStr = data.split(",");
for (var i = 0; i < listStr.length; i++) {
htmlStr = htmlStr + "<li><a href='?action=" + flag + "&searchFlag=2&searchType=" + listStr[i] + "'>" + listStr[i] + "</a></li>";
}
htmlStr = htmlStr + "</ul>";
thisDiv.innerHTML = htmlStr;
thisDiv.style.display = "";
}
this.getPos = function(o) //取元素坐标
{
var x = 0, y = 0;
do {
x += o.offsetLeft;
y += o.offsetTop;
} while (o = o.offsetParent);
return { 'x': x, 'y': y };
}
}