1 2function validate(strValidateStr,objValue) 3{ 4 //alert(strValidateStr); 5 if(strValidateStr) 6 { 7 strError=strValidateStr.name; 8 switch(objValue) 9 { 10 case "req": 11 { 12 strError+=" : must not be blank"; 13 //alert(objValue); 14 ret = TestRequired(strValidateStr,strError); 15 break; 16 } 17 case "num": 18 { strError+=" : must be number"; 19 ret = TestInput(strValidateStr,/^-?\d+$/,strError); 20 break; 21 } 22 case "dec": 23 { strError+=" : must be number"; 24 ret = TestInput(strValidateStr,/^[-+]?[0-9]+(\.[0-9]+)?$/,strError); 25 break; 26 } 27 case "email": 28 { strError+=" : must be valid email"; 29 ret = TestEmail2(strValidateStr,strError); 30 break; 31 } 32 case "ans": 33 { strError+=": Only alpha-numeric characters and space allowed "; 34 ret = TestInput(strValidateStr,/[A-Za-z0-9\\s]/,strError); 35 break; 36 } 37 case "char": 38 { strError+=": Only characters and space allowed "; 39 ret = TestInput(strValidateStr,/[A-Za-z]+/,strError); 40 break; 41 } 42 43 case "date": 44 { strError+=": Wrong Date Format "; 45 ret = TestInput(strValidateStr,/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/,strError); 46 break; 47 } 48 case "select": 49 { strError+=": Choose one please"; 50 validateSelect(strValidateStr,strError); 51 break; 52 } 53 case "radio2": //only 2 radio with the same name 54 { 55 validateRadio2(strValidateStr,strError); 56 break; 57 } 58 } 59 } 60 return ret; 61} 62function validateRadio2(strValidateStr,strError) 63{ 64 if(strValidateStr[0].checked==""&&strValidateStr[1].checked=="") 65 { 66 ret = false;
67 alert("Choose one please"); 68 strValidateStr[0].checked=true; 69 } 70 else 71 ret = true; 72} 73function validateSelect(strValidateStr,strError) 74{ 75 if(strValidateStr.value=="") 76 { 77 ret = false; 78 alert(strError); 79 strValidateStr.focus(); 80 } 81 else 82 ret = true; 83} 84function TestRequired(strValidateStr,strError) 85{ 86 var ok=true; 87 //alert(strValidateStr.value.length); 88 if(strValidateStr.value.length==0) 89 { 90 alert(strError); 91 strValidateStr.focus(); 92 ok=false; 93 } 94 return ok; 95} 96function TestInput(objValue,strRegExp,strError) 97{ 98 var ret = false; 99 //var charpos =objValue.value.search(strRegExp); 100 var charpos = strRegExp.test(objValue.value); 101 102 //alert(charpos); 103 if(charpos) 104 { 105 106 ret = true; 107 } 108 else 109 { 110 alert(strError); 111 objValue.focus(); 112 } 113 return ret; 114} 115function TestEmail2(objValue,strError) 116{ 117var ret = false; 118 if(objValue.value.length > 0 && validateEmail(objValue.value) ) 119 { 120 ret = true; 121 }else 122 alert(strError); 123return ret; 124} 125function validateEmail(email) 126{ 127 var splitted = email.match("^(.+)@(.+)$"); 128 if(splitted == null) return false; 129 if(splitted[1] != null ) 130 { 131 var regexp_user=/^\"?[\w-_\.]*\"?$/; 132 if(splitted[1].match(regexp_user) == null) return false; 133 } 134 if(splitted[2] != null) 135 { 136 var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/; 137 if(splitted[2].match(regexp_domain) == null) 138 { 139 var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/; 140 if(splitted[2].match(regexp_ip) == null) return false; 141 }// if 142 return true; 143 } 144return false; 145} 146function validatecontact(form) 147{ 148 //alert("enter"); 149 //alert(form.elements[0].value); 150var check=""; 151if(form.elements[1].value=="1") 152 check="email"; 153else if(form.elements[1].value=="2") 154 check="num"; 155else if(form.elements[1].value=="3") 156 check="ans"; 157 //alert(check); 158 159if(validate(form.elements[3],check)&&validate(form.elements[4],'req')&&validate(form.elements[5],'req')) 160return true; 161else 162return false; 163} 164 165function IsNumeric(sText) 166{ 167 var ValidChars = "0123456789."; 168 var IsNumber=true; 169 var Char; 170 171 172 for (i = 0; i < sText.length && IsNumber == true; i++) 173 { 174 Char = sText.charAt(i); 175 if (ValidChars.indexOf(Char) == -1) 176 { 177 IsNumber = false; 178 } 179 } 180 return IsNumber; 181 182 } 183 184 185function showform2(item, iState) // 1 visible, 0 hidden 186{ 187 var obj = document.layers ? document.layers[item] : 188 document.getElementById ? document.getElementById(item).style : 189 document.all[item].style; 190 if(iState==1) { 191 obj.visibility = "visible"; 192 } 193else { 194 obj.visibility = "hidden"; 195 } 196} 197 198 199function showform(item, iState) // 1 visible, 0 hidden 200{ 201 var obj = document.layers ? document.layers[item] : 202 document.getElementById ? document.getElementById(item).style : 203 document.all[item].style; 204 205 obj.visibility = document.layers ? (iState ? "show" : "hide") : 206 (iState ? "visible" : "hidden"); 207} 208 209 210 211function showDisplay(item, iState) // 1 visible, 0 hidden 212{ 213 var obj = document.layers ? document.layers[item] : 214 document.getElementById ? document.getElementById(item).style : 215 document.all[item].style; 216 217 obj.display= document.layers ? (iState ? "block" : "none") : 218 (iState ? "block" : "none"); 219} 220 221 222 223 function showNewColor(targetid, status) { 224 225 // setup vars 226 227 228 229 var correctColor = "#ECF6FF"; 230 231 var elseColor = "#FAC9B8"; 232 233 234 235 if((document.getElementById)&& (document.getElementById(targetid)!=null)) { 236 237 // Get a reference to the element 238 239 var myElement = document.getElementById(targetid); 240 241 242 243 // Check the element's style object and background property are available 244 245 if (myElement.style) { 246 247 // Check the value of the property 248 249 if(status == 'correct'){ 250 251 // change style to new color 252 253 document.getElementById(targetid).style.backgroundColor = correctColor; 254 255 }else { 256 257 258 document.getElementById(targetid).style.backgroundColor = elseColor; 259 260 } 261 262 }else { 263 264 265 266 return; 267 268 } 269 270 }else { 271 272 return; 273 274 } 275 276 } 277 278 279 280function showHelp(vars) 281{ 282 myArray = vars.split("|"); 283 parentDiv = myArray[0]; 284 titleHelp = myArray[1]; 285 messageHelp = myArray[2]; 286 imagePath= myArray[3]; 287 state = myArray[4]; 288 289 layer_ref='HELP';
290 counter = 1; 291 292while (counter < 52) { 293 294 var ThisDivText = 'Help' + counter; 295 296if (ThisDiv =(document.getElementById(ThisDivText))){ 297ThisDiv.innerHTML=''; 298ThisDiv.style.visibility = 'hidden'; } 299 300counter = counter + 1; 301 } 302 303if (state == 'visible') 304{ 305 306 var newdiv = document.createElement('div'); 307 var ni = document.getElementById(parentDiv); 308 ni.innerHTML=''; 309 310 newdiv.setAttribute('id',layer_ref); 311 var strOut; 312 var strOut = "<fieldset id="+layer_ref +" class=HelpPopUpFieldset>"; 313 var strOut = strOut + "<legend class=HelpPopUplegend2>"+titleHelp + "</legend> <legend class=HelpPopUplegend1><a href=# onClick=\"showHelp(\'" + parentDiv + "\');\">"+ CloseButton +"</legend>"; 314 var strOut = strOut + "<table width=100% border=0><tr><td valign=top width=15%>"; 315 var strOut = strOut + "<img src="+imagePath+" width=29 height=60>"; 316 var strOut = strOut + "</td><td valign=top width=85% ><font size=1>"; 317 var strOut = strOut + messageHelp + "</font></td></tr></table></fieldset>"; 318 319 newdiv.innerHTML = strOut; 320 ni.appendChild(newdiv); 321 322if (document.all) { //IS IE 4 or 5 (or 6 beta) 323eval( "document.all." + parentDiv + ".style.visibility = 'visible'"); 324} 325else if (document.layers) { //IS NETSCAPE 4 or below 326document.layers[parentDiv].visibility = 'visible'; 327} 328else { 329ni.style.visibility = 'visible'; 330 } 331 332} 333 334else { 335 336 toDestroy = document.getElementById(parentDiv); 337 toDestroy.innerHTML=''; 338 339if (document.all) { //IS IE 4 or 5 (or 6 beta) 340eval( "document.all." + parentDiv + ".style.visibility = 'hidden'"); 341} 342else if (document.layers) { //IS NETSCAPE 4 or below 343document.layers[parentDiv].visibility = 'hidden'; 344} 345else { 346 347toDestroy.style.visibility = 'hidden'; 348 } 349 350} 351 352} 353 354 355 356/********** DROP DOWN MENU **************************************/ 357 358var timeout = 500; 359var closetimer = 0; 360var ddmenuitem = 0; 361 362function IsNumeric(sText) 363{ 364 var ValidChars = "0123456789."; 365 var IsNumber=true; 366 var Char; 367 368 369 for (i = 0; i < sText.length && IsNumber == true; i++) 370 { 371 Char = sText.charAt(i); 372 if (ValidChars.indexOf(Char) == -1) 373 { 374 IsNumber = false; 375 } 376 } 377 return IsNumber; 378 379 } 380 381 382function showform2(item, iState) // 1 visible, 0 hidden 383{ 384 var obj = document.layers ? document.layers[item] : 385 document.getElementById ? document.getElementById(item).style : 386 document.all[item].style; 387 if(iState==1) { 388 obj.visibility = "visible"; 389 } 390else { 391 obj.visibility = "hidden"; 392 } 393} 394 395 396function showform(item, iState) // 1 visible, 0 hidden 397{ 398 var obj = document.layers ? document.layers[item] : 399 document.getElementById ? document.getElementById(item).style : 400 document.all[item].style; 401 402 obj.visibility = document.layers ? (iState ? "show" : "hide") : 403 (iState ? "visible" : "hidden"); 404} 405 406 407 408function showDisplay(item, iState) // 1 visible, 0 hidden 409{ 410 var obj = document.layers ? document.layers[item] : 411 document.getElementById ? document.getElementById(item).style : 412 document.all[item].style; 413 414 obj.display= document.layers ? (iState ? "block" : "none") : 415 (iState ? "block" : "none"); 416} 417 418 419 420 function showNewColor(targetid, status) { 421 422 // setup vars 423 424 425 426 var correctColor = "#ECF6FF"; 427 428 var elseColor = "#FAC9B8"; 429 430 431 432 if((document.getElementById)&& (document.getElementById(targetid)!=null)) { 433 434 // Get a reference to the element 435 436 var myElement = document.getElementById(targetid); 437 438 439 440 // Check the element's style object and background property are available 441 442 if (myElement.style) { 443 444 // Check the value of the property 445 446 if(status == 'correct'){ 447 448 // change style to new color 449 450 document.getElementById(targetid).style.backgroundColor = correctColor; 451 452 }else { 453 454 455 document.getElementById(targetid).style.backgroundColor = elseColor; 456 457 } 458 459 }else { 460 461 462 463 return; 464 465 } 466 467 }else { 468 469 return; 470 471 } 472 473 } 474 475 476function jsddm_open() 477{ jsddm_canceltimer(); 478 jsddm_close(); 479 ddmenuitem = $(this).find('ul').eq(0).css('visibility', 'visible');} 480 481function jsddm_close() 482{ if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');} 483 484function jsddm_timer() 485{ closetimer = window.setTimeout(jsddm_close, timeout);} 486 487function jsddm_canceltimer() 488{ if(closetimer) 489 { window.clearTimeout(closetimer); 490 closetimer = null;}} 491 492 493/********** GET ELEMENT BY CLASS NAME **************************************/ 494
495function getElementsByClass( searchClass, domNode, tagName) { 496 if (domNode == null) domNode = document; 497 if (tagName == null) tagName = '*'; 498 var el = new Array(); 499 var tags = domNode.getElementsByTagName(tagName); 500 var tcl = " "+searchClass+" "; 501 for(i=0,j=0; i<tags.length; i++) { 502 var test = " " + tags[i].className + " "; 503 if (test.indexOf(tcl) != -1) 504 el[j++] = tags[i]; 505 } 506 return el; 507} 508 509function showtab(tabname) 510{ 511 // hide every element with class 'tab' 512 var tabs = getElementsByClass('tab'); 513 for(i=0; i<tabs.length; i++) 514 tabs[i].style.display = 'none'; 515 // hide every element with class 'tab' 516 517 document.getElementById(tabname).style.display='block'; 518 // show element with given tabname 519} 520 521/********** CHECK WITH COOKIES **************************************/ 522function check(id_1){ 523 524 var c_1 = ReadCookie(id_1);if (c_1 == "valid"){hide_left_menu();} 525} 526/********** HIDE LEFT MENU **************************************/ 527function hide_left_menu(){ 528 document.getElementById('main_left_menu_shown').style.display='none'; 529 document.getElementById('main_left_menu_hidden').style.display=''; 530 document.getElementById('main_body').width='100%'; 531 SetCookie("hide_menu", "valid", 86400*7); 532} 533/********** SHOW LEFT MENU **************************************/ 534function show_left_menu(){ 535 document.getElementById('main_left_menu_shown').style.display=''; 536 document.getElementById('main_left_menu_hidden').style.display='none'; 537 document.getElementById('main_body').width='80%'; 538 SetCookie("hide_menu", "", -86400*7); 539} 540/********** SET COOKIE **************************************/ 541function SetCookie() { 542 543 if(arguments.length < 2) { return; } 544 var n = arguments[0]; 545 var v = arguments[1]; 546 var d = 0; 547 if(arguments.length > 2) { d = parseInt(arguments[2]); } 548 var exp = ''; 549 if(d > 0){ 550 var now = new Date(); 551 then = now.getTime() + (d * 24 * 60 * 60 * 1000); 552 now.setTime(then); 553 exp = '; expires=' + now.toGMTString(); 554 } 555 document.cookie = n + "=" + escape(String(v)) + '; path=/' + exp; 556 557} 558/********** READ COOKIE **************************************/ 559function ReadCookie(n) { 560var cookiecontent = new String(); 561if(document.cookie.length > 0) { 562 var cookiename = n+ '='; 563 var cookiebegin = document.cookie.indexOf(cookiename); 564 var cookieend = 0; 565 if(cookiebegin > -1) { 566 cookiebegin += cookiename.length; 567 cookieend = document.cookie.indexOf(";",cookiebegin); 568 if(cookieend < cookiebegin) { cookieend = document.cookie.length; } 569 cookiecontent = document.cookie.substring(cookiebegin,cookieend); 570 } 571 } 572return unescape(cookiecontent); 573} 574/********** NEW JS FUNCTIONS **************************************/ 575 576//check needed fields function 577function check_needed_fields(and_fields_id,or_fields_id,form_name){ 578 579 // check 'and' fields values 580 if (and_fields_id){ 581 582 var splited_fields_id = and_fields_id.split(","); 583 var fields_cnt = splited_fields_id.length; 584 var chkd_fields_array = new Array(); 585 586 for (var f=0;f<fields_cnt;f++){ 587 var chkd_field_id = splited_fields_id[f]; 588 var chkd_field_val = document.getElementById(chkd_field_id).value; 589 if (chkd_field_val){ 590 chkd_fields_array[f] = chkd_field_val; 591 } 592 } 593 594 if(chkd_fields_array.length != splited_fields_id.length) 595 var and_fields_flag = false; 596 else 597 var and_fields_flag = true; 598 599 }else{ 600 var and_fields_flag = true; 601 } 602 603 604 // check 'or' fields values 605 if (or_fields_id){ 606 607 var splited_fields_id = or_fields_id.split(","); 608 var fields_cnt = splited_fields_id.length; 609 var chkd_fields_array = new Array(); 610 611 for (var f=0;f<fields_cnt;f++){ 612 var chkd_field_id = splited_fields_id[f]; 613 var chkd_field_val = document.getElementById(chkd_field_id).value; 614 if (chkd_field_val){ 615 chkd_fields_array[f] = chkd_field_val; 616 } 617 } 618 619 if(chkd_fields_array.length >= 1) 620 var or_fields_flag = true; 621 else 622 var or_fields_flag = false; 623 624 }else{ 625 var or_fields_flag = true; 626 } 627 628 if (or_fields_flag && and_fields_flag) 629 document.forms[form_name].submit(); 630 else 631 alert('Please Complete All Required Fields !'); 632} 633 634//function close after seconds 635function close_after_seconds(seconds){ 636 setTimeout(function() { 637 window.close(); 638 }, seconds); 639} 640/*****************************************************************/ 641 642 function unMarkAllRows( container_id ) { 643 var rows = document.getElementById(container_id).getElementsByTagName('tr'); 644 var unique_id; 645 var checkbox; 646 647 for ( var i = 0; i < rows.length; i++ ) { 648 649 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 650 651 if ( checkbox && checkbox.type == 'checkbox' ) { 652 unique_id = checkbox.name + checkbox.value; 653 checkbox.checked = false;
654 655 } 656 } 657 658 return true; 659} 660 661 662 663 664 function markAllRows( container_id ) { 665 666 var rows = document.getElementById(container_id).getElementsByTagName('tr'); 667 var unique_id; 668 var checkbox; 669 670 for ( var i = 0; i < rows.length; i++ ) { 671 672 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 673 674 if ( checkbox && checkbox.type == 'checkbox' ) { 675 unique_id = checkbox.name + checkbox.value; 676 677 if ( checkbox.disabled == false ) { 678 checkbox.checked = true; 679 680 } 681 } 682 } 683 684 return true; 685} 686 687 688function popitup(url, name, atributes) { 689 newwindow=window.open(url,name, atributes); 690 if (window.focus) {newwindow.focus()} 691 return false; 692} 693 694 695function ajax_do_general (url) { 696 697 var jsel = document.createElement('SCRIPT'); 698 jsel.type = 'text/javascript'; 699 jsel.src = url; 700 701 // Append JS element (therefore executing the 'AJAX' call) 702 document.body.appendChild (jsel); 703 704 } 705 706function display(myimage) { 707 html = "<HTML><HEAD><TITLE>Photo</TITLE>" + 708 "</HEAD><BODY LEFTMARGIN=0 " 709 + "MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER>" 710 + "<IMG SRC='" + myimage + "' BORDER=0 NAME=image " 711 + "onload='window.resizeTo(document.image.width,document.image.height)'>" 712 + "</CENTER>" 713 + "</BODY></HTML>"; 714 popup= 715 window.open 716 ('','image', 717 'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1'); 718 popup.document.open(); 719 popup.document.write(html); 720 popup.document.focus(); 721 popup.document.close() 722 } 723 724 725 726 727 function unMarkAllRowsX( container_id ) { 728 var rows = document.getElementById(container_id).getElementsByTagName('td'); 729 var unique_id; 730 var checkbox; 731 732 for ( var i = 0; i < rows.length; i++ ) { 733 734 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 735 736 if ( checkbox && checkbox.type == 'checkbox' ) { 737 unique_id = checkbox.name + checkbox.value; 738 checkbox.checked = false; 739 740 } 741 } 742 743 return true; 744} 745 746 747 748 749 function markAllRowsX( container_id ) { 750 751 //alert('xxxxxxxxxxx'); 752 var rows = document.getElementById(container_id).getElementsByTagName('td'); 753 var unique_id; 754 var checkbox; 755 756 for ( var i = 0; i < rows.length; i++ ) { 757 758 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 759 760 if ( checkbox && checkbox.type == 'checkbox' ) { 761 unique_id = checkbox.name + checkbox.value; 762 if ( checkbox.disabled == false ) { 763 checkbox.checked = true; 764 765 } 766 } 767 } 768 769 return true; 770} 771 772 773 function markAllRowsW( container_id, className ) { 774 var rows = document.getElementById(container_id).getElementsByTagName('td'); 775 var unique_id; 776 var checkbox; 777 778 for ( var i = 0; i < rows.length; i++ ) { 779 780 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 781 782 if ( checkbox && checkbox.type == 'checkbox' && checkbox.className==className) { 783 unique_id = checkbox.name + checkbox.value; 784 if ( checkbox.disabled == false ) { 785 checkbox.checked = true; 786 787 } 788 } 789 } 790 791 return true; 792} 793 794 795 796function unMarkAllRowsW( container_id, className ) { 797 var rows = document.getElementById(container_id).getElementsByTagName('td'); 798 var unique_id; 799 var checkbox; 800 801 for ( var i = 0; i < rows.length; i++ ) { 802 803 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 804 805 if ( checkbox && checkbox.type == 'checkbox' && checkbox.className==className) { 806 unique_id = checkbox.name + checkbox.value; 807 checkbox.checked = false; 808 809 } 810 } 811 812 return true; 813} 814 815 816 817 818 function markAllRowsZ( container_id, className ) { 819 var rows = document.getElementById(container_id).getElementsByTagName('td'); 820 var unique_id; 821 var checkbox; 822 823 for ( var i = 0; i < rows.length; i++ ) { 824 825 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 826 827 if ( checkbox && checkbox.type == 'checkbox' && checkbox.id==className) { 828 unique_id = checkbox.name + checkbox.value; 829 if ( checkbox.disabled == false ) { 830 checkbox.checked = true; 831 832 } 833 } 834 } 835 836 return true; 837} 838/////////////////////////// ENAS ////////////////////////////////////////////////// 839function markAllRowsInput( container_id, className,input_id ) { 840 var rows = document.getElementById(container_id).getElementsByTagName('td'); 841 var input_value = document.getElementById(input_id).value; 842 input_value=parseInt(input_value); 843 844 var unique_id; 845 var text_input; 846 var text_input_hidden; 847 var error_flag; 848 849 for ( var i = 0; i < rows.length; i++ ) { 850 851 text_input = rows[i].getElementsByTagName( 'input' )[0]; 852 text_input_hidden = rows[i].getElementsByTagName( 'input' )[1]; 853 854 if ( text_input && text_input.type == 'text') { 855 856 if(text_input_hidden){ 857 var hidden_value=parseInt(text_input_hidden.value); 858 859 if( input_value <= hidden_value ){ 860 error_flag=0; 861 unique_id = text_input.name + text_input.value; 862 if ( text_input.value == '' ) { 863 text_input.value = input_value; 864 865 } 866 //alert('hidden:' + hidden_value + 'allot:' + input_value + 'flag:' + error_flag); 867 } 868 else{ 869 error_flag=1; 870 //alert('hidden1:' + hidden_value + 'allot:' + input_value + 'flag:' + error_flag); 871 //alert('xxxxxxxxxx'); 872 } 873 874 } 875 else{ 876 unique_id = text_input.name + text_input.value; 877 if ( text_input.value == '' ) { 878 text_input.value = input_value; 879 880 } 881 error_flag=0; 882 } 883 } 884 } 885 886 if(error_flag==1){alert('The Number You Entered Bigger than Available,Please try Again');return false;} 887 else {return true;} 888} 889 890function UnmarkAllRowsInput( container_id, className,input_id ) { 891 var rows = document.getElementById(container_id).getElementsByTagName('td'); 892 893 var unique_id; 894 var text_input; 895 896 for ( var i = 0; i < rows.length; i++ ) { 897 text_input = rows[i].getElementsByTagName( 'input' )[0]; 898 899 if (text_input && text_input.type == 'text') { 900 unique_id = text_input.name + text_input.value; 901 text_input.value = '' ; 902 903 } 904 } 905 906 return true; 907} 908 909function markAllRowsInputsW( container_id, className,input_id ) { 910var rows = document.getElementById(container_id).getElementsByTagName('td'); 911var input_value = document.getElementById(input_id).value; 912input_value=parseInt(input_value); 913 914var unique_id; 915var text_input; 916var text_input_hidden; 917var error_flag=0; 918 919for ( var i = 0; i < rows.length; i++ ) { 920 921 text_input = rows[i].getElementsByTagName( 'input' )[0]; 922 text_input_hidden = rows[i].getElementsByTagName( 'input' )[1]; 923 924 if ( text_input && text_input.type == 'text' && text_input.className==className) { 925 if(text_input_hidden){ 926 var hidden_value=parseInt(text_input_hidden.value); 927 928 if(hidden_value >= input_value){ 929 error_flag=0; 930 unique_id = text_input.name + text_input.value; 931 if ( text_input.value == '' ) { 932 text_input.value = input_value; 933 } 934 } 935 else{ 936 error_flag=1; 937 } 938 } 939 else{ 940 unique_id = text_input.name + text_input.value; 941 if ( text_input.value == '' ) { 942 text_input.value = input_value; 943 } 944 error_flag=0; 945 } 946 } 947} 948if(error_flag==1){alert('The Number You Entered Bigger than Available,Please try Again');return false;} 949else {return true;} 950} 951 952function UnmarkAllRowsInputsW( container_id, className,input_id ) { 953var rows = document.getElementById(container_id).getElementsByTagName('td'); 954 955var unique_id; 956var text_input; 957 958for ( var i = 0; i < rows.length; i++ ) { 959 960 text_input = rows[i].getElementsByTagName( 'input' )[0]; 961 962 if ( text_input && text_input.type == 'text' && text_input.className==className) { 963 unique_id = text_input.name + text_input.value; 964 text_input.value =''; 965 966 } 967} 968 969return true; 970} 971 972 function markAllRowsInputsZ( container_id, className,input_id ) { 973 var rows = document.getElementById(container_id).getElementsByTagName('td'); 974 var input_value = document.getElementById(input_id).value; 975 input_value=parseInt(input_value); 976 977 var unique_id; 978 var text_input; 979 var text_input_hidden; 980 var error_flag=0; 981 982 for ( var i = 0; i < rows.length; i++ ) { 983 984 text_input = rows[i].getElementsByTagName( 'input' )[0]; 985 text_input_hidden = rows[i].getElementsByTagName( 'input' )[1]; 986 987 if ( text_input && text_input.type == 'text' && text_input.id==className) { 988 if(text_input_hidden){ 989 var hidden_value=parseInt(text_input_hidden.value); 990 if(hidden_value >= input_value){ 991 error_flag=0; 992 993 unique_id = text_input.name + text_input.value; 994 if ( text_input.value == '' ) { 995 text_input.value = input_value; 996 } 997 } 998 else{ 999 error_flag=1; 1000 } 1001 } 1002 else{ 1003 unique_id = text_input.name + text_input.value; 1004 if ( text_input.value == '' ) { 1005 text_input.value = input_value; 1006 1007 } 1008 error_flag=0; 1009 } 1010 } 1011} 1012 1013if(error_flag==1){alert('The Number You Entered Bigger than Available,Please try Again');return false;} 1014else {return true;} 1015} 1016 1017function UnmarkAllRowsInputsZ( container_id, className,input_id ) { 1018 var rows = document.getElementById(container_id).getElementsByTagName('td'); 1019 var unique_id; 1020 var text_input; 1021 1022 for ( var i = 0; i < rows.length; i++ ) { 1023 1024 text_input = rows[i].getElementsByTagName( 'input' )[0]; 1025 1026 if ( text_input && text_input.type == 'text' && text_input.id==className) { 1027 unique_id = text_input.name + text_input.value; 1028 text_input.value = ''; 1029 1030 } 1031 } 1032 1033 return true; 1034} 1035 1036function unMarkAllRowsInputX( container_id,input_id ) { 1037 var rows = document.getElementById(container_id).getElementsByTagName('td'); 1038 var unique_id; 1039 var text_input; 1040 1041 for ( var i = 0; i < rows.length; i++ ) { 1042 1043 text_input = rows[i].getElementsByTagName( 'input' )[0]; 1044 1045 if ( text_input && text_input.type == 'text' ) { 1046 unique_id = text_input.name + text_input.value; 1047 text_input.value = ''; 1048 1049 } 1050 } 1051 1052 return true; 1053} 1054 1055 1056 1057 1058 function markAllRowsInputX( container_id ,input_id) { 1059 var rows = document.getElementById(container_id).getElementsByTagName('td'); 1060 var input_value = document.getElementById(input_id).value; 1061 1062 var unique_id; 1063 var text_input; 1064 1065 for ( var i = 0; i < rows.length; i++ ) { 1066 1067 text_input = rows[i].getElementsByTagName( 'input' )[0]; 1068 1069 if ( text_input && text_input.type == 'text' ) { 1070 unique_id = text_input.name + text_input.value; 1071 if ( text_input.value == '' ) { 1072 text_input.value = input_value; 1073 1074 } 1075 } 1076 } 1077 1078 return true; 1079} 1080 1081 1082////////////////////////////////////////////////////////////////////////////////////// 1083 1084function unMarkAllRowsZ( container_id, className ) { 1085 var rows = document.getElementById(container_id).getElementsByTagName('td'); 1086 var unique_id; 1087 var checkbox; 1088 1089 for ( var i = 0; i < rows.length; i++ ) { 1090 1091 checkbox = rows[i].getElementsByTagName( 'input' )[0]; 1092 1093 if ( checkbox && checkbox.type == 'checkbox' && checkbox.id==className) { 1094 unique_id = checkbox.name + checkbox.value; 1095 checkbox.checked = false;
1096 1097 } 1098 } 1099 1100 return true; 1101} 1102 1103 1104function IsNumeric(sText) 1105{ 1106 var ValidChars = "0123456789."; 1107 var IsNumber=true; 1108 var Char; 1109 1110 1111 for (i = 0; i < sText.length && IsNumber == true; i++) 1112 { 1113 Char = sText.charAt(i); 1114 if (ValidChars.indexOf(Char) == -1) 1115 { 1116 IsNumber = false; 1117 } 1118 } 1119 return IsNumber; 1120 1121 } 1122 1123 1124function showform2(item, iState) // 1 visible, 0 hidden 1125{ 1126 var obj = document.layers ? document.layers[item] : 1127 document.getElementById ? document.getElementById(item).style : 1128 document.all[item].style; 1129 if(iState==1) { 1130 obj.visibility = "visible"; 1131 } 1132else { 1133 obj.visibility = "hidden"; 1134 } 1135} 1136 1137 1138function showform(item, iState) // 1 visible, 0 hidden 1139{ 1140 var obj = document.layers ? document.layers[item] : 1141 document.getElementById ? document.getElementById(item).style : 1142 document.all[item].style; 1143 1144 obj.visibility = document.layers ? (iState ? "show" : "hide") : 1145 (iState ? "visible" : "hidden"); 1146} 1147 1148 1149 1150function showDisplay(item, iState) // 1 visible, 0 hidden 1151{ 1152 var obj = document.layers ? document.layers[item] : 1153 document.getElementById ? document.getElementById(item).style : 1154 document.all[item].style; 1155 1156 obj.display= document.layers ? (iState ? "block" : "none") : 1157 (iState ? "block" : "none"); 1158} 1159 1160 1161 1162 function showNewColor(targetid, status) { 1163 1164 // setup vars 1165 1166 1167 1168 var correctColor = "#ECF6FF"; 1169 1170 var elseColor = "#FAC9B8"; 1171 1172 1173 1174 if((document.getElementById)&& (document.getElementById(targetid)!=null)) { 1175 1176 // Get a reference to the element 1177 1178 var myElement = document.getElementById(targetid); 1179 1180 1181 1182 // Check the element's style object and background property are available 1183 1184 if (myElement.style) { 1185 1186 // Check the value of the property 1187 1188 if(status == 'correct'){ 1189 1190 // change style to new color 1191 1192 document.getElementById(targetid).style.backgroundColor = correctColor; 1193 1194 }else { 1195 1196 1197 document.getElementById(targetid).style.backgroundColor = elseColor; 1198 1199 } 1200 1201 }else { 1202 1203 1204 1205 return; 1206 1207 } 1208 1209 }else { 1210 1211 return; 1212 1213 } 1214 1215 } 1216 1217function ShowWaiting() { 1218 document.getElementById('header').style.display = 'none'; 1219 document.getElementById('Content-bg').style.display = 'none'; 1220 document.getElementById('cuerpoCentral').style.display = 'none'; 1221 document.getElementById('footer').style.display = 'none'; 1222 document.getElementById('ContentDiv').style.display = 'none'; 1223 1224 document.getElementById('Waiting').style.display = 'block'; 1225 document.HotelsReservationEngine.submit(); 1226 1227 } 1228 1229 1230function poptastic(pageURL, title,w,h) { 1231var left = (screen.width/2)-(w/2); 1232var top = (screen.height/2)-(h/2); 1233var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=1, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left); 1234} 1235 1236 1237function check_ContactUs_fields() { 1238var errormessage=''; 1239if( 1240document.getElementById('NewContactName').value=='' || 1241document.getElementById('NewContactfamilyname').value=='' || 1242document.getElementById('NewContactemail').value=='' || 1243document.getElementById('SelectedCountries').value=='' || 1244document.getElementById('NewContactPhone').value=='' || 1245document.getElementById('NewContactmessage').value=='' || 1246!document.RequestRegister.NewUserAcceptConditions.checked 1247 1248) 1249{errormessage+="Por favor rellene toda la informacion necesaria\\n ";} 1250if(errormessage!='') { alert(errormessage); return false; } 1251else{document.ContactUs.submit(); } 1252 } 1253 1254function printElement(elem, append, delimiter) { 1255 document.getElementById("btnPrint").onclick = function () { 1256 printElement(document.getElementById("printThis")); 1257} 1258 1259} 1260function printElement(elem2) { 1261 1262elem=document.getElementById(elem2); 1263 var domClone = elem.cloneNode(true); 1264 1265 var $printSection = document.getElementById("printSection"); 1266 1267 if (!$printSection) { 1268 var $printSection = document.createElement("div"); 1269 $printSection.id = "printSection"; 1270 document.body.appendChild($printSection); 1271 } 1272 1273 $printSection.innerHTML = ""; 1274 $printSection.appendChild(domClone); 1275 1276 window.print(); 1277} 1278
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.