home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 November
/
Chip_2002-11_cd1.bin
/
zkuste
/
vbasic
/
Data
/
Utils
/
WME71SDK.exe
/
RCDATA
/
CABINET
/
newsgroups.js
< prev
next >
Wrap
Text File
|
2001-03-15
|
4KB
|
176 lines
//
// FORM VALIDATION CODE
//
function ValidateForm()
{
if ("" == document.Form1.NGName.value || "" == document.Form1.startdate.value ){
if("" == document.Form1.NGName.value){
window.alert("Please enter NewsgroupName");
document.Form1.NGName.focus();
document.Form1.NGName.select();
}
else{
window.alert("Please enter Date");
}
return false;
}else{
return DateValidate();
}
}
function DateValidate(){
var dateStr = document.Form1.startdate.value
var mm,dd,yyyy
var dateArray
var today
today = new Date()
dateArray = dateStr.split("/");
mm = dateArray[0]
dd = dateArray[1]
yyyy = dateArray[2]
if (isNaN(dateArray[0])){
alert ("Not a valide date format : please enter 'mm/dd/yyyy'")
return false;
}
if ( mm == "" || mm >12 || mm < 1 ) {
window.alert("Please correct Month");
return false;
}else{
if(dd =="" || dd >31 || dd< 1){
window.alert("Please correct Day");
return false;
}else{
if(yyyy == "" || yyyy < 1999 || yyyy > today.getYear()){
window.alert("Please correct year");
return false;
}else{
return true;
}
}
}
}
function fnTabClick( nTab )
{
nTab = parseInt(nTab);
var oTab;
var prevTab = nTab-1;
var nextTab = nTab+1;
document.Form1.tabIndex.value = nTab;
event.cancelBubble = true;
el = event.srcElement;
for (var i = 0; i < newsContent.length; i++)
{
oTab = tabs[i];
oTab.className = "clsTab";
oTab.style.borderLeftStyle = "";
oTab.style.borderRightStyle = "";
newsContent[i].style.display = "none";
}
newsContent[nTab].style.display = "block";
tabs[nTab].className = "clsTabSelected";
oTab = tabs[nextTab];
if (oTab) oTab.style.borderLeftStyle = "none";
oTab = tabs[prevTab];
if (oTab) oTab.style.borderRightStyle = "none";
event.returnValue = false;
}
function RedirectASC( SortCal , Period ){
event.cancelBubble = true
var StartsWith;
if(document.Form1.mode[0].checked){
StartsWith = "0";
}
else{
StartsWith = "1";
}
UrlStr = "default.asp?NGName="+document.Form1.NGName.value+"&mode="+StartsWith+"&period="+Period+"&startdate="+document.Form1.startdate.value+"&sortcolumn="+SortCal+"&sort="+"ASC"+"&tabIndex="+ document.Form1.tabIndex.value;
window.location.href = UrlStr ;
return false ;
}
function RedirectDESC( SortCal , Period ){
event.cancelBubble = true
var StartsWith;
if(document.Form1.mode[0].checked){
StartsWith = "0";
}
else{
StartsWith = "1";
}
UrlStr = "default.asp?NGName="+document.Form1.NGName.value+"&mode="+StartsWith+"&period="+Period+"&startdate="+document.Form1.startdate.value+"&sortcolumn="+SortCal+"&sort="+"DESC"+"&tabIndex="+ document.Form1.tabIndex.value;
window.location.href = UrlStr ;
return false ;
}
function fnTabClickTT( nTab )
{
nTab = parseInt(nTab);
var oTab;
var prevTab = nTab-1;
var nextTab = nTab+1;
event.cancelBubble = true;
el = event.srcElement;
for (var i = 0; i < 3; i++)
{
oTab = tabs[i];
oTab.className = "clsTab";
oTab.style.borderLeftStyle = "";
oTab.style.borderRightStyle = "";
NGReport[i].style.display = "none";
}
NGReport[nTab].style.display = "block";
tabs[nTab].className = "clsNgHead";
oTab = tabs[nextTab];
if (oTab) oTab.style.borderLeftStyle = "none";
oTab = tabs[prevTab];
if (oTab) oTab.style.borderRightStyle = "none";
event.returnValue = false;
}
function fnTabClickTTSub( nTab )
{
nTab = parseInt(nTab);
var oTab;
var prevTab = nTab-1;
var nextTab = nTab+1;
event.cancelBubble = true;
el = event.srcElement;
for (var i = 0; i < 3; i++)
{
oTab = tabs[i];
oTab.className = "clsTab";
oTab.style.borderLeftStyle = "";
oTab.style.borderRightStyle = "";
NGReportTTSub[i].style.display = "none";
}
NGReportTTSub[nTab].style.display = "block";
tabs[nTab].className = "clsNgHead";
oTab = tabs[nextTab];
if (oTab) oTab.style.borderLeftStyle = "none";
oTab = tabs[prevTab];
if (oTab) oTab.style.borderRightStyle = "none";
event.returnValue = false;
}