//The SCRIPT is Created By Aamod Dongre //EMAIL ADDRESS aamod_dongre@hotmail.com //ALL RIGHTS RESERVED /* isBlank(str) //Checks if the String is Blank isSpace(str) //Checks if the whole String is Space(s) isEmail(str) //Checks if the Email is valid or not isNumeric(str) // Checks whether the number is valid or not isOutOfRange(fieldvalue,lbound,ubound) // Checks whether the entered value is within range or not isEqual(x,y) //Checks whether the two strings or two numbers are equal iscontainsSpace(str) //Checks whether the String contains any space or not isShort(str) //Checks if the Password is less than 4 characters */ //***************************** //=+=+=+=+=+=+=+=+= variales block -START =+=+=+=+=+=+=+=+=+=+ var bw =navigator.appName var IE = "Microsoft Internet Explorer" //Custom Variable var NS = "Netscape" //Custom Variable var ver1 =navigator.appVersion //gives full version of browser majorver = ver1.substring(0,1) //gives major version of browser //=================== variales block -END ==================== if(bw==NS && majorver >=4){ //START of if for NS document.captureEvents(Event.KEYPRESS); //captures keypress event in Netscape Nevigator } //END of if for NS if(bw==IE && majorver >=4){ //START of if for IE function handleEvnt(){ // this function handle keypress event for IE if(event.keyCode ==1){ alert("\n All ASP and JAVASCRIPT Code in the site is Created By Aamod Dongre (Team Leader) \n\n At \n\n WebTech Developers Pvt. Ltd., Pune \n\n Email : aamod_dongre@rediffmail.com\n\n"); }//end if 2 }//end of function } //END of if for IE else{ if(bw==NS && majorver >=4 ){ //START of if for NS function handleEvnt1(evnt){ // this function handle keypress event for IE if (evnt.which == 1){ // event parameter is required if not supplied function will not work alert("\n All ASP and JAVASCRIPT Code in the site is Created By Aamod Dongre (Team Leader) \n\n At \n\n WebTech Developers Pvt. Ltd., Pune \n\n Email : aamod_dongre@rediffmail.com\n\n"); } } document.onkeypress =handleEvnt1; //send the control to function handleEvnt1() } //END of if for NS } // end of else block // ########### CODE END HERE ################## //***************************** function isBlank(x) { /* Function isBlank() Created by Aamod Dongre email aamod_dongre@hotmail.com */ if( x.length==0){ return true; } else{ return false; } } function isSpace(str) { /* Function isSpace() Created by Aamod Dongre email aamod_dongre@hotmail.com */ var i; var flag =""; for(i=0;i1) { return(true); } else { return(false); } } function isDot(str) { /* Function isDot() Created by Aamod Dongre email aamod_dongre@hotmail.com */ var c=0; var i; for(i=0;i 0 ){ if( mailstr ="" || mailstr.indexOf('@',1) == -1 || mailstr.indexOf('.',1) == -1 || isRepeat(mailstr) || isSpace(mailstr) || isDot(mailstr) || mailstr.charAt(0) == " ") { flag =false; } else{ flag =true; } } else{ flag =false; } return flag; } function isNumeric(x){ str =x.toString() flag =""; for(i=0;i b || isNaN(myval)) { flag=true; } else { flag=false; } return flag; } // func function isSymbol(str){ //Function isSymbol() //Used to Check whether a CheckBox is Checked or not //Created by Aamod Dongre var i; var s = str for(i=0;i "z" ) { return(true); } } } return(false); } function checked(check) { //Function checked() //Used to Check whether a CheckBox is Checked or not //Created by Aamod Dongre var checkval = check; var flag=""; if(checkval == true) { flag = true; } else{ flag = false; } return flag; } function isShort(x){ //Function checked() //Used to Check if Password is less than 4 characters //Created by Aamod Dongre var myvalx = x; if(myvalx.length < 4) { return true; } else { return false; } } function isEqual(x,y) { //Function isEqual() //Used to Check whether a the two numbers are equal //Created by Aamod Dongre var myvalx = x; var myvaly = y; if(myvalx==myvaly) { return true; } else{ return false; } } //func //Uplaod file function function FdRename(form,strFileName,folder,filekey,fileExtn,FileLoc_count) { //alert("Form Name=" + form); //alert(document.frmGENERAL.FileNameString.value); //alert("FileLoc_count =" + FileLoc_count) var strFileNewName =""+prompt("Please rename the file:", strFileName); if (strFileNewName=="null"){ return; } else{ var strFileNewNameLowcase = strFileNewName.toLowerCase(); if (strFileNewName=="" || strFileNewName.length < 3 || strFileNewName.indexOf(".")==-1 || isContains2ormoreDots(strFileNewName)|| strFileNewName.indexOf(";")>=0 || strFileNewName.indexOf("\\")>=0 || strFileNewName.indexOf("/")>=0 || strFileNewName.indexOf(":")>=0 || strFileNewName.indexOf("*")>=0 || strFileNewName.indexOf("?")>=0 || strFileNewName.indexOf("|")>=0 || strFileNewName.indexOf("<")>=0 || strFileNewName.indexOf(">")>=0 || strFileNewName.indexOf(",")>=0 || strFileNewName.indexOf("\"")>=0) { alert("The New file name is : " + strFileNewName + "\n\n\t The new file name is invalid. \n \n A file name cannot contain any of the following characters \n \t \\ / : ; * ? < > | \n Also there Should be one Dot(.) in the filename \n \t Also file name cannot be null"); } else if (strFileNewName.toLowerCase() == strFileName.toLowerCase()) { alert("The file name has no change."); } else if (strFileNewName.length > 127) { alert ("The new file name is invalid.\nThe length of new file name must be less than 128 characters."); } else if (strFileNewNameLowcase.length>=0) { var ret = confirm("Would you like to replace the existing file?"); if (ret==true) { //alert(""+form+".myfilepath_"+FileLoc_count+".value") //var strFilePath1 =eval(""+form+".myfilepath_"+FileLoc_count+".value") eval(""+form+".FileKey_"+folder+".value" + "='"+ filekey+"'") eval(""+form+".FileExtn_"+folder+".value" + "='"+ fileExtn+"'") eval(""+form+".NewFileName_"+folder+".value" + "='"+ strFileNewName+"'") FileKey = eval(""+form+".FileKey_"+folder+".value") FileExtn = eval(""+form+".FileExtn_"+folder+".value") FileNamepath = eval(""+form+".FileNamepath_"+folder+".value") NewFileName = eval(""+form+".NewFileName_"+folder+".value") //alert("strFilePath1 =" + strFilePath1) /*alert("FileKey =" + FileKey) alert("FileExtn =" + FileExtn) alert("FileNamepath =" + FileNamepath) alert("NewFileName =" + NewFileName) */ var tmpaction =eval(""+form+".action") tmpaction =tmpaction +"&count="+FileLoc_count //alert("tmpaction =" + tmpaction) eval(""+form+".action" + "=\"" + tmpaction + "\"") //alert(eval(""+form+".action")) eval(""+form+".submit()") } } else { return; } } } function IsFileNameValid(fileName){ var strFileNewName =fileName; var flag ="0"; if (strFileNewName=="" || strFileNewName.length < 3 || strFileNewName.indexOf(".")==-1 || isContains2ormoreDots(strFileNewName)|| strFileNewName.indexOf(";")>=0 || strFileNewName.indexOf("\\")>=0 || strFileNewName.indexOf("/")>=0 || strFileNewName.indexOf(":")>=0 || strFileNewName.indexOf("*")>=0 || strFileNewName.indexOf("?")>=0 || strFileNewName.indexOf("|")>=0 || strFileNewName.indexOf("<")>=0 || strFileNewName.indexOf(">")>=0 || strFileNewName.indexOf(",")>=0 || strFileNewName.indexOf("\"")>=0) { flag =1; } else if (strFileNewName.length > 127) { // alert ("The file name is invalid.\nThe length of file name must be less than 128 characters."); flag =2; } else { flag =3; } return flag; } function AddNewFolder(folder) { var file var sWidth = 400 var sHeight = 300 file = "add_folder.asp?fldr=" file = file + folder //alert("file =" + file) sHeight = parseInt(sHeight) * 1.5; sWidth = parseInt(sWidth) * 1.1; if ( sWidth > window.screen.availWidth ) { sWidth = window.screen.availWidth; } if (sHeight > window.screen.availHeight ) { sHeight = window.screen.availHeight; } if ( parseInt(sWidth) < 350 ) { sWidth = 350; } if ( parseInt(sHeight) < 300 ) { sHeight = 300; } if ( navigator.appName == "Microsoft Internet Explorer" ) { window.open(file, "_blank", "status=yes, toolbar=no, resizable=yes, location=no, menubar=no, top=30, left=20 height=" + sHeight + ", width=" + sWidth); } if ( navigator.appName == "Netscape" ) { window.open(file,"_blank","alwaysRaised,dependant,innerheight=" + sHeight + ",innerwidth=" + sWidth); } } function UpoladFile1(folderkey,dispname) { alert("HI ") var file ="" var sWidth = 540 var sHeight = 200 file = "add_document.asp?fldr=" file = file + folderkey file = file + "&dispname="+dispname alert("file =" + file) sHeight = parseInt(sHeight) * 1.5; sWidth = parseInt(sWidth) * 1.1; if ( sWidth > window.screen.availWidth ) { sWidth = window.screen.availWidth; } if (sHeight > window.screen.availHeight ) { sHeight = window.screen.availHeight; } if ( parseInt(sWidth) < 450 ) { sWidth = 450; } if ( parseInt(sHeight) < 200 ) { sHeight = 200; } if ( navigator.appName == "Microsoft Internet Explorer" ) { window.open(file, "_blank", "status=yes, toolbar=no, resizable=yes, location=no, menubar=no, top=50, left=50 height=" + sHeight + ", width=" + sWidth); } if ( navigator.appName == "Netscape" ) { window.open(file,"_blank","alwaysRaised,dependant,innerheight=" + sHeight + ",innerwidth=" + sWidth); } } function CheckAll(myform) { var e var chkboxname ="chkDeleteAllFile_"+myform for (var i=0;i 0; iI--) { if(czString.charAt(iI) != " ") break; iLength -= 1; } return czString.substr(0, iLength); } function Trim(czString) { return TrimLeft(TrimRight(czString)); } // added by amar these functions to trim the string in js on 4/08/2001 till here