📄 jscriptfun.js
字号:
function search_onclick()
{
var i;
var bflag;
bflag=false;
//if (!searchsubmit()) return false;
for(i=0;i<document.ListItemForSale.hotelcity.length;i++)
{
if (document.ListItemForSale.hotelcity[i].checked)
{
bflag=true;
break;
}
}
if (bflag)
{
//document.ListItemForSale.submit();
return true;
}
else
{
if (document.ListItemForSale.catmenu_0.selectedIndex >= 0)
document.ListItemForSale.province.value = document.ListItemForSale.catmenu_0.options[document.ListItemForSale.catmenu_0.selectedIndex].value;
if (document.ListItemForSale.catmenu_1.selectedIndex >= 0)
if (document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value > 0)
{
// if (document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value < 1000)
document.ListItemForSale.city.value = document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value - 100;
// else
// document.ListItemForSale.city.value = document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value;
}
if ((document.ListItemForSale.province.value == "" || document.ListItemForSale.city.value == "") && document.ListItemForSale.cityename.value == "")
{
window.alert('请选择宾馆所在的省和城市!!');
document.ListItemForSale.catmenu_0.focus();
}
else
{
// document.ListItemForSale.submit();
return true;
}
}
return false;
}
function searchintl_onclick()
{
var i;
var bflag;
bflag=false;
/*for(i=0;i<document.ListItemForSale.hotelcity.length;i++)
{
if (document.ListItemForSale.hotelcity[i].checked)
{
bflag=true;
break;
}
}*/
if (bflag)
{ document.ListItemForSale.submit();}
else
{
if (document.ListItemForSale.catmenu_0.selectedIndex==-1)
{
window.alert('请选择宾馆所在的国家和城市!!');
document.ListItemForSale.catmenu_0.focus();
return false;
}
if (document.ListItemForSale.catmenu_1.selectedIndex==-1)
{
window.alert('请选择宾馆所在的国家和城市!!');
document.ListItemForSale.catmenu_1.focus();
return false;
}
document.ListItemForSale.country.value = document.ListItemForSale.catmenu_0.options[document.ListItemForSale.catmenu_0.selectedIndex].value;
if (document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value > 0)
{
if (document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value < 1000)
document.ListItemForSale.city.value = document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value - 100;
else
document.ListItemForSale.city.value = document.ListItemForSale.catmenu_1.options[document.ListItemForSale.catmenu_1.selectedIndex].value;
}
if (document.ListItemForSale.country.value == "" || document.ListItemForSale.city.value == "")
{
window.alert('请选择宾馆所在的国家和城市!!');
document.ListItemForSale.catmenu_0.focus();
return false;
}
else
// document.ListItemForSale.submit();
return true
}
}
function changecityename()
{
document.ListItemForSale.city.value="";
catmenu[0].selectedIndex = -1;
catmenu[1].selectedIndex = -1;
for (i=0;i<document.ListItemForSale.hotelcity.length;i++)
{
if (document.ListItemForSale.hotelcity[i].checked)
{
document.ListItemForSale.hotelcity[i].checked=false;
break;
}
}
}
function changecity(cityvalue)
{
document.ListItemForSale.city.value=cityvalue;
catmenu[0].selectedIndex = -1;
catmenu[1].selectedIndex = -1;
document.ListItemForSale.cityename.value="";
}
function changemenu(cm)
{
var chosencategory;
var numChildren;
var CatId;
var CatName;
var i;
if (cm!=-1)
for (i=0;i<document.ListItemForSale.hotelcity.length;i++)
{
if (document.ListItemForSale.hotelcity[i].checked)
{
document.ListItemForSale.hotelcity[i].checked=false;
break;
}
document.ListItemForSale.cityename.value="";
}
// make sure user didn't click on an empty box
if ((cm != -1) && (catmenu[cm].length <= 1))
return;
// get the chosen category from this catmenu
if (cm == -1)
chosencategory = 0;
else
{
if (catmenu[cm].selectedIndex == -1)
return;
chosencategory = catmenu[cm].options[catmenu[cm].selectedIndex].value;
}
// if no children, then user is done;
if (c[chosencategory] == null)
{
document.ListItemForSale.category1.value = chosencategory;
numChildren = 0;
}
else
{
if (cm != -1)
{
if (document.ListItemForSale.name != "ChangePreferencesShow")
document.ListItemForSale.category1.value = "";
else
document.ListItemForSale.category1.value = chosencategory;
}
numChildren = c[chosencategory].length;
}
// fill up the next based on the chosencategory
if ((cm+1) < catmenu.length)
{
for (i = 0; i < numChildren; i++)
{
CatId = c[chosencategory][i];
CatName = (c[CatId]==null) ? n[CatId] : n[CatId]+ " ->";
catmenu[cm+1].options[i] = new Option(CatName, CatId);
// if (i == numChildren-1 && cm+1 == catmenu.length-1)
if (i == 0 && cm+1 == catmenu.length-1)
{
catmenu[cm+1].options[i].selected = true;
document.ListItemForSale.category1.value=catmenu[cm+1].options[i].value;
}
}
catmenu[cm+1].length = numChildren;
}
// clear out all menus to the right of this menu
for (i = cm+2; i < catmenu.length; i++)
{
catmenu[i].length = 0;
}
// add a blank entry to the end of each columnn that was affected
//for (i = cm+1; i <catmenu.length; i++)
//{
// if (i)
// catmenu[i].options[catmenu[i].length] = new Option("-----------------------------------");
//}
}
function changemenuintl(cm)
{
var chosencategory;
var numChildren;
var CatId;
var CatName;
var i;
/*if (cm!=-1)
for (i=0;i<document.ListItemForSale.hotelcity.length;i++)
{
if (document.ListItemForSale.hotelcity[i].checked)
{
document.ListItemForSale.hotelcity[i].checked=false;
break;
}
}*/
// make sure user didn't click on an empty box
if ((cm != -1) && (catmenu[cm].length <= 1))
return;
// get the chosen category from this catmenu
if (cm == -1)
chosencategory = 0;
else
{
if (catmenu[cm].selectedIndex == -1)
return;
chosencategory = catmenu[cm].options[catmenu[cm].selectedIndex].value;
}
// if no children, then user is done;
if (c[chosencategory] == null)
{
document.ListItemForSale.category1.value = chosencategory;
numChildren = 0;
}
else
{
if (cm != -1)
{
if (document.ListItemForSale.name != "ChangePreferencesShow")
document.ListItemForSale.category1.value = "";
else
document.ListItemForSale.category1.value = chosencategory;
}
numChildren = c[chosencategory].length;
}
// fill up the next based on the chosencategory
if ((cm+1) < catmenu.length)
{
for (i = 0; i < numChildren; i++)
{
CatId = c[chosencategory][i];
CatName = (c[CatId]==null) ? n[CatId] : n[CatId]+ " ->";
catmenu[cm+1].options[i] = new Option(CatName, CatId);
//if (i == numChildren-1 && cm+1 == catmenu.length-1)
if (i == 0 && cm+1 == catmenu.length-1)
{
catmenu[cm+1].options[i].selected = true;
document.ListItemForSale.category1.value=catmenu[cm+1].options[i].value;
}
}
catmenu[cm+1].length = numChildren;
}
// clear out all menus to the right of this menu
for (i = cm+2; i < catmenu.length; i++)
{
catmenu[i].length = 0;
}
// add a blank entry to the end of each columnn that was affected
//for (i = cm+1; i <catmenu.length; i++)
//{
// if (i)
// catmenu[i].options[catmenu[i].length] = new Option("-----------------------------------");
//}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -