var windowTitleGlobal; var titleTextGlobal; var errorTextGlobal; var windowRedirectUrl; function open_error_window(errorText, titleText, urlRedirect, windowTitle, width, height, left, top) { //Use: //open_error_window(errorText); //open_error_window(errorText,'title'); //open_error_window(errorText,'title','http://www.casadellibro.com'); //... var putItThere = null; var chasm = screen.availWidth; var mount = screen.availHeight; if ((urlRedirect== null) || (urlRedirect=='undefined')) { windowRedirectUrl=''; } else { windowRedirectUrl=urlRedirect; } if ((windowTitle == null) || (windowTitle=='undefined')) { windowTitleGlobal ='::Casa Del Libro:: - Error'; } else { windowTitleGlobal=windowTitle; } if ((titleText == null)||(titleText=='undefined')) { titleTextGlobal='por favor,
compruebe los siguientes campos'; } else { titleTextGlobal=titleText; } if ((errorText == null)||(errorText=='undefined')) { errorText=''; } else { errorTextGlobal=errorText; } if ((width == null) || (width=='undefined')) width ='300'; if ((height == null) || (height=='undefined')) height ='300'; if ((left == null) || (left=='undefined')) left =((chasm - width - 10) * .5); if ((top == null) || (top=='undefined')) top =((mount - height - 30) * .5); new_window = open("/cdl/cda/javascript/windowPopUp.html","displayWindow","width="+width+",height="+height+",left="+ left +",top="+ top); } function checkTextLength(textControl, textName, length) { if (textControl.value.length > length) { open_error_window('',textName+' no puede contener más de '+length+' caracteres.'); textControl.value=textControl.value.substring(0,length-1); //textControl.focus(); return false; }; return true; }