<script>
document.writeln("브라우저의 전체 높이",screen.availheight); //이것은 해상도의 높이에서 하단의 퀵런치 만큼의 사이즈만큼 빠지는거구요
document.writeln("브라우저의 전체 너비",screen.availwidth); //너비는 해상도와 일치할겁니다.
document.writeln("모니터의 해상도 높이 ",screen.height);
document.writeln("모니터의 해상도 너비 ",screen.width);
document.writeln("브라우저안쪽의 높이 ",document.body.clientheight);

document.writeln("브라우저안쪽의 너비 ",document.body.clientwidth);
<script>

페이지 이동

<meta http-equiv='Refresh' URL='페이지 이동'>

 

<첫번째 방법>
아이프레임 이름을 lastword로 지정했을 경우. 아래의 스크립트를 <head></head> 사이에 넣으세요
<script>
function initsize() {
lastword.resizeTo(lastword.document.body.scrollWidth, lastword.document.body.scrollHeight);
}
</script>

<body> 태그에 onLoad="initsize();"를 넣어 주세요
<body bgcolor="#FFFFFF" onLoad="initsize();">

아이프레임 사용예.
<iframe name="lastword" src="/tt/board/ttboard.cgi?db=last_word" width="300" height="250" frameborder="no" scrolling="no"></iframe>

한가지 주의할것은 불러오는 문서와 불러지는 문서가 서로 같은 계정에 있어야만 동작합니다.

<두번째 방법>
또다른 방법으로 불러지는 문서에 직접삽입하는 방법으로 서로 다른계정에 있어도 사용가능합니다.

<script>
function initsize() {
self.resizeTo(document.body.scrollWidth, document.body.scrollHeight);
}
</script>
<body bgcolor="#FFFFFF" onLoad="initsize();">

//체크박스 관련함수 ---------------------------------------------------------
//하나라도 선택되었으면 true, 아니면 false 리턴
function checkSelected()
{
   var frm = document.frm;
   var selectyn = frm["selectyn[]"];
   if (!selectyn)
  {
     return false;
  }
if(selectyn.length > 1)
{
   var flag = false;
    for (var i=0; i < selectyn.length; i++)
   {
        if (selectyn[i].checked)
       {
          flag = true;
       }
}
if (!flag)
{
return false;
}
}
else
{
if (!selectyn.checked)
{
return false;
}
}
return true;

function checkTitleFileType(obj){

pathpoint = obj.lastIndexOf('.');
filepoint = obj.substring(pathpoint+1,obj.length);
filetype = filepoint.toLowerCase();
if (filetype == 'gif'|| filetype == 'jpg' || filetype == 'jpeg'){

       return true;
}else{

      alert("파일 이상해 ㅡㅡ;" );
      return false;
}
}

function checkM(member_id){

    if (member_id.split(" ").join("") =="") {
     alert('아이디를 입력해주세요');
     return false;
    }
    if (member_id.indexOf(" ") > -1) {
     alert('아이디에 공백문자(Space)가 있으면 안됩니다.\n\n다시 확인하시고 입력하여 주십시오.');
     return false;
    }
    if (member_id.indexOf("'") > -1) {
     alert('아이디에 작은따옴표가 있으면 안됩니다.\n\n다시 확인하시고 입력하여 주십시오.');
     return false;
    }
    for (var i = 0; i < member_id.length; i++) {
    ret = member_id.charCodeAt(i);
    if ((ret > 122) || (ret < 48) || (ret > 57 && ret < 65) || (ret > 90 && ret < 97)) {
     alert("영문자와 숫자만을 입력하세요");
     return false;
    }
   }
    return true;
  }

자주쓰는 폼 태그

일일이 막상넣을려면 귀찮다는거 ....

학력

<select name="lastac" class="inputbox2" style="width:122px">   
     <option value="Z">대학원졸업이상</option>    
     <option value="O">대학원재학</option>    
     <option value="J" selected>대학교졸업</option>
     <option value="H">대학교재학</option>    
     <option value="9">고등학교졸업</option>    
     <option value="7">고등학교재학</option>    
     <option value="6">중학교졸업</option>    
     <option value="4">중학교재학</option>    
     <option value="2">초등학교졸업</option>    
     <option value="1">초등학교재학</option>    
     <option value="0">없음</option>    
   </select>

직업
<select name="curjob" class="inputbox" style="width:122px">   
     <option value="00">무직</option>    
     <option value="10">학생</option>    
     <option value="30" selected>컴퓨터/인터넷</option>
     <option value="50">언론</option>    
     <option value="70">공무원</option>    
     <option value="90">군인</option>    
     <option value="A0">서비스업</option>    
     <option value="C0">교육</option>    
     <option value="E0">금융/증권/보험업</option>    
     <option value="G0">유통업</option>    
     <option value="I0">예술</option>    
     <option value="K0">의료</option>    
     <option value="M0">법률</option>    
     <option value="O0">건설업</option>    
     <option value="Q0">제조업</option>    
     <option value="S0">부동산업</option>    
     <option value="U0">운송업</option>    
     <option value="W0">농/수/임/광산업</option>    
     <option value="Y0">가사</option>    
     <option value="z0">기타</option>    
</select>

지역번호

    <SELECT NAME="telno1">
     <option value="0002">02</option>
     <option value="0031">031</option>
     <option value="0032">032</option>
     <option value="0033">033</option>
     <option value="0041">041</option>
     <option value="0042">042</option>
     <option value="0043">043</option>
     <option value="0051" selected>051</option>
     <option value="0052">052</option>
     <option value="0053">053</option>
     <option value="0054">054</option>
     <option value="0055">055</option>
     <option value="0061">061</option>
     <option value="0062">062</option>
     <option value="0063">063</option>
     <option value="0064">064</option>
     <option value="0502">0502</option>
    </SELECT>

핸드폰번호

    <SELECT NAME="mtelno1">
     <option value="0010" selected>010</option>
     <option value="0011">011</option>
     <option value="0016">016</option>
     <option value="0017">017</option>
     <option value="0018">018</option>
     <option value="0019">019</option>
    </SELECT>

지역선택

            <select id="SelectArea" style="font-size: 9pt; font-family: 굴림체">
                <option  value="전체보기">전체보기</option>
                <option  value="서울/경기">서울/경기</option>
                <option  value="인천/부천">인천/부천</option>
                <option  value="춘천/강원">춘천/강원</option>
                <option  value="부산/울산/경남">부산/울산/경남</option>
                <option  value="대구/경북">대구/경북</option>
                <option  value="전주/전북">전주/전북</option>
                <option  value="광주/전남">광주/전남</option>
                <option  value="청주/충북">청주/충북</option>
                <option  value="청주/충북">청주/충북</option>
                <option  value="대전/충남">대전/충남</option>
                <option  value="제주">제주</option>
            </select>

미국내 지역 .NET DropDownList

  <asp:DropDownList ID="DropDownListState" runat="server">
                                                <asp:ListItem>Alabama</asp:ListItem>
                                                <asp:ListItem>Alaska</asp:ListItem>
                                                <asp:ListItem>Arizona</asp:ListItem>
                                                <asp:ListItem>Arkansas</asp:ListItem>
                                                <asp:ListItem>California</asp:ListItem>
                                                <asp:ListItem>Colorado</asp:ListItem>
                                                <asp:ListItem>Connecticut</asp:ListItem>
                                                <asp:ListItem>Delaware</asp:ListItem>
                                                <asp:ListItem>District Of Columbia</asp:ListItem>
                                                <asp:ListItem>Florida</asp:ListItem>
                                                <asp:ListItem>Georgia</asp:ListItem>
                                                <asp:ListItem>Hawaii</asp:ListItem>
                                                <asp:ListItem>Idaho</asp:ListItem>
                                                <asp:ListItem>Illinois</asp:ListItem>
                                                <asp:ListItem>Indiana</asp:ListItem>
                                                <asp:ListItem>Iowa</asp:ListItem>
                                                <asp:ListItem>Kansas</asp:ListItem>
                                                <asp:ListItem>Kentucky</asp:ListItem>
                                                <asp:ListItem>Louisiana</asp:ListItem>
                                                <asp:ListItem>Maine</asp:ListItem>
                                                <asp:ListItem>Maryland</asp:ListItem>
                                                <asp:ListItem>Massachusetts</asp:ListItem>
                                                <asp:ListItem>Michigan</asp:ListItem>
                                                <asp:ListItem>Minnesota</asp:ListItem>
                                                <asp:ListItem>Mississippi</asp:ListItem>
                                                <asp:ListItem>Missouri</asp:ListItem>
                                                <asp:ListItem>Montana</asp:ListItem>
                                                <asp:ListItem>Nebraska</asp:ListItem>
                                                <asp:ListItem>Nevada</asp:ListItem>
                                                <asp:ListItem>New Hampshire</asp:ListItem>
                                                <asp:ListItem>New Mexico</asp:ListItem>
                                                <asp:ListItem>New York</asp:ListItem>
                                                <asp:ListItem>North Carolina</asp:ListItem>
                                                <asp:ListItem>North Dakota</asp:ListItem>
                                                <asp:ListItem>Ohio</asp:ListItem>
                                                <asp:ListItem>Oklahoma</asp:ListItem>
                                                <asp:ListItem>Oregon</asp:ListItem>
                                                <asp:ListItem>Pennsylvania</asp:ListItem>
                                                <asp:ListItem>Rhode Island</asp:ListItem>
                                                <asp:ListItem>South Carolina</asp:ListItem>
                                                <asp:ListItem>South Dakota</asp:ListItem>
                                                <asp:ListItem>Tennessee</asp:ListItem>
                                                <asp:ListItem>Texas</asp:ListItem>
                                                <asp:ListItem>Utah</asp:ListItem>
                                                <asp:ListItem>Vermont</asp:ListItem>
                                                <asp:ListItem>Virginia</asp:ListItem>
                                                <asp:ListItem>Washington</asp:ListItem>
                                                <asp:ListItem>West Virginia</asp:ListItem>
                                                <asp:ListItem>Wisconsin</asp:ListItem>
                                                <asp:ListItem>Wyoming</asp:ListItem>
                                                <asp:ListItem>Not in US</asp:ListItem>
                                            </asp:DropDownList>

출생지

      <select class="m_input"  name="dListHC05" id="dListHC05">
  <option value="200">강원 춘천시</option>
  <option value="209">강원 화천군</option>
  <option value="210">강원 강릉시</option>
  <option value="100">서울시</option>
  <option value="215">강원 양양군</option>
  <option value="217">강원 속초시</option>
  <option value="219">강원 고성군</option>
  <option value="220">강원 원주시</option>
  <option value="225">강원 횡성군</option>
  <option value="230">강원 영월군</option>
  <option value="232">강원 평창군</option>
  <option value="233">강원 정선군</option>
  <option value="235">강원 태백시</option>
  <option value="240">강원 동해시</option>
  <option value="245">강원 삼척시</option>
  <option value="250">강원 홍천군</option>
  <option value="252">강원 인제군</option>
  <option value="255">강원 양구군</option>
  <option value="269">강원 철원군</option>
  <option value="312">충남 금산군</option>
  <option value="314">충남 공주시</option>
  <option value="320">충남 논산시</option>
  <option value="323">충남 부여군</option>
  <option value="325">충남 서천군</option>
  <option value="330">충남 천안시</option>
  <option value="336">충남 아산시</option>
  <option value="339">충남 연기군</option>
  <option value="340">충남 예산군</option>
  <option value="343">충남 당진군</option>
  <option value="345">충남 청양군</option>
  <option value="350">충남 홍성군</option>
  <option value="355">충남 보령시</option>
  <option value="356">충남 서산시</option>
  <option value="357">충남 태안군</option>
  <option value="360">충북 청주시</option>
  <option value="363">충북 청원군</option>
  <option value="365">충북 진천군</option>
  <option value="367">충북 괴산군</option>
  <option value="369">충북 음성군</option>
  <option value="370">충북 영동군</option>
  <option value="373">충북 옥천군</option>
  <option value="376">충북 보은군</option>
  <option value="380">충북 충주시</option>
  <option value="390">충북 제천시</option>
  <option value="395">충북 단양군</option>
  <option value="400">인천시</option>
  <option value="411">경기 고양시</option>
  <option value="413">경기 파주시</option>
  <option value="415">경기 김포시</option>
  <option value="417">인천 강화군</option>
  <option value="420">경기 부천시</option>
  <option value="423">경기 광명시</option>
  <option value="425">경기 안산시</option>
  <option value="427">경기 과천시</option>
  <option value="429">경기 시흥시</option>
  <option value="430">경기 안양시</option>
  <option value="435">경기 군포시</option>
  <option value="437">경기 의왕시</option>
  <option value="440">경기 수원시</option>
  <option value="445">경기 화성시</option>
  <option value="447">경기 오산시</option>
  <option value="449">경기 용인시</option>
  <option value="450">경기 평택시</option>
  <option value="451">경기 평택시</option>
  <option value="456">경기 안성시</option>
  <option value="459">경기 평택시</option>
  <option value="461">경기 성남시</option>
  <option value="464">경기 광주시</option>
  <option value="465">경기 하남시</option>
  <option value="467">경기 이천시</option>
  <option value="469">경기 여주군</option>
  <option value="471">경기 구리시</option>
  <option value="472">경기 남양주시</option>
  <option value="476">경기 양평군</option>
  <option value="477">경기 가평군</option>
  <option value="480">경기 의정부시</option>
  <option value="482">경기 양주군</option>
  <option value="483">경기 동두천시</option>
  <option value="486">경기 연천군</option>
  <option value="487">경기 포천군</option>
  <option value="500">광주시</option>
  <option value="506">광주 광산구</option>
  <option value="513">전남 영광군</option>
  <option value="515">전남 장성군</option>
  <option value="516">전남 곡성군</option>
  <option value="517">전남 담양군</option>
  <option value="519">전남 화순군</option>
  <option value="520">전남 나주시</option>
  <option value="525">전남 함평군</option>
  <option value="526">전남 영암군</option>
  <option value="527">전남 강진군</option>
  <option value="529">전남 장흥군</option>
  <option value="530">전남 목포시</option>
  <option value="534">전남 무안군</option>
  <option value="535">전남 신안군</option>
  <option value="536">전남 해남군</option>
  <option value="537">전남 완도군</option>
  <option value="539">전남 진도군</option>
  <option value="540">전남 순천시</option>
  <option value="542">전남 구례군</option>
  <option value="545">전남 광양시</option>
  <option value="546">전남 보성군</option>
  <option value="548">전남 고흥군</option>
  <option value="550">전남 여수시</option>
  <option value="555">전남 여수시</option>
  <option value="556">전남 여수시</option>
  <option value="560">전북 전주시</option>
  <option value="565">전북 완주군</option>
  <option value="566">전북 임실군</option>
  <option value="567">전북 진안군</option>
  <option value="568">전북 무주군</option>
  <option value="570">전북 익산시</option>
  <option value="573">전북 군산시</option>
  <option value="576">전북 김제시</option>
  <option value="579">전북 부안군</option>
  <option value="580">전북 정읍시</option>
  <option value="585">전북 고창군</option>
  <option value="590">전북 남원시</option>
  <option value="595">전북 순창군</option>
  <option value="597">전북 장수군</option>
  <option value="600">부산시</option>
  <option value="621">경남 김해시</option>
  <option value="626">경남 양산시</option>
  <option value="627">경남 밀양시</option>
  <option value="630">경남 마산시</option>
  <option value="635">경남 창녕군</option>
  <option value="636">경남 의령군</option>
  <option value="637">경남 함안군</option>
  <option value="638">경남 고성군</option>
  <option value="641">경남 창원시</option>
  <option value="645">경남 진해시</option>
  <option value="650">경남 통영시</option>
  <option value="656">경남 거제시</option>
  <option value="660">경남 진주시</option>
  <option value="664">경남 사천시</option>
  <option value="666">경남 산청군</option>
  <option value="667">경남 하동군</option>
  <option value="668">경남 남해군</option>
  <option value="670">경남 거창군</option>
  <option value="676">경남 함양군</option>
  <option value="678">경남 합천군</option>
  <option value="680">울산시</option>
  <option value="690">제주도</option>
  <option value="700">대구시</option>
  <option value="712">경북 경산시</option>
  <option value="714">경북 청도군</option>
  <option value="716">경북 군위군</option>
  <option value="717">경북 고령군</option>
  <option value="718">경북 칠곡군</option>
  <option value="719">경북 성주군</option>
  <option value="730">경북 구미시</option>
  <option value="740">경북 김천시</option>
  <option value="742">경북 상주시</option>
  <option value="745">경북 문경시</option>
  <option value="750">경북 영주시</option>
  <option value="755">경북 봉화군</option>
  <option value="757">경북 예천군</option>
  <option value="760">경북 안동시</option>
  <option value="763">경북 청송군</option>
  <option value="764">경북 영양군</option>
  <option value="766">경북 영덕군</option>
  <option value="767">경북 울진군</option>
  <option value="769">경북 의성군</option>
  <option value="770">경북 영천시</option>
  <option value="780">경북 경주시</option>
  <option value="790">경북 포항시</option>
  <option value="799">경북 울릉군</option>
  <option value="900">해외</option>
  <option value="300">대전시</option>
  <option value="765">경북 영일군</option>

</select>

보훈

  <option value="B">유족</option>
  <option value="C">독립유공</option>
  <option value="D">반공상이</option>
  <option value="E">무공</option>
  <option value="F">월귀</option>
  <option value="G">포상</option>
  <option value="H">전상</option>

장애인

<option value="A01">등록장애인</option>
  <option value="A02">국가유공(보훈)장애인</option>
  <option value="A03">산업재해장애인</option>
  <option value="A04">지체장애</option>
  <option value="A05">뇌병변장애</option>
  <option value="A06">시각장애</option>
  <option value="A07">청각장애</option>
  <option value="A08">언어장애</option>
  <option value="A09">안면장애</option>
  <option value="A10">신장장애</option>
  <option value="A11">심장장애</option>
  <option value="A12">간장애</option>
  <option value="A13">호흡기장애</option>
  <option value="A14">장루장애</option>
  <option value="A15">간질장애</option>
  <option value="A16">정신지체</option>
  <option value="A17">정신장애</option>
  <option value="A18">발달장애</option>

병역

  <option value="A">병역필</option>
  <option value="B">병역면제</option>
  <option value="C">병역미필</option>
  <option value="D">해당무</option>
  <option value="E">특례필</option>
  <option value="F">특례</option>
  <option value="G">비대상(여자)</option>

군별

  <option value="A">육군</option>
  <option value="A1">육방</option>
  <option value="A2">카튜샤</option>
  <option value="B">해군</option>
  <option value="B1">해방</option>
  <option value="C">해병</option>
  <option value="C1">해방</option>
  <option value="D">공군</option>
  <option value="D1">공방</option>
  <option value="E">전경</option>
  <option value="E1">해경</option>
  <option value="E2">의경</option>
  <option value="F">공익근무</option>

계급

<option value="00">훈병</option>
  <option value="01">이병</option>
  <option value="02">일병</option>
  <option value="03">상병</option>
  <option value="04">병장</option>
  <option value="11">하사</option>
  <option value="12">중사</option>
  <option value="13">상사</option>
  <option value="20">준위</option>
  <option value="21">원사</option>
  <option value="31">소위</option>
  <option value="32">중위</option>
  <option value="33">대위</option>
  <option value="41">소령</option>
  <option value="42">중령</option>
  <option value="43">대령</option>
  <option value="51">준장</option>
  <option value="52">소장</option>
  <option value="53">중장</option>
  <option value="54">대장</option>

전역/면제사유

  <option value="A">만기제대</option>
  <option value="A1">의가사제대</option>
  <option value="A2">의병제대</option>
  <option value="A3">상이제대</option>
  <option value="A4">불명예제대</option>
  <option value="B">소집해제</option>
  <option value="E">예편</option>
  <option value="F">퇴역</option>
  <option value="G1">의가사면제</option>
  <option value="G2">의병면제</option>
  <option value="G3">연령초과면제</option>
  <option value="H">징집면제</option>
  <option value="J">소집면제</option>

최종학력

     <option value="ZZ">선택하세요</option>
     <option selected="selected" value="J2">중학수료</option>
     <option value="J3">중학중퇴</option>
     <option value="M2">초등수료</option>
     <option value="G3">고교중퇴</option>
     <option value="G2">고교수료</option>
     <option value="C4">대졸예정</option>
     <option value="A2">대학원수료</option>
     <option value="A4">대학원재학</option>
     <option value="A1">대학원졸</option>
     <option value="C1">대졸</option>
     <option value="E3">대학편입</option>
     <option value="E1">전문대졸</option>
     <option value="G4">고교재학</option>
     <option value="J1">중졸</option>
     <option value="J4">중학재학</option>
     <option value="Z8">미취학</option>
     <option value="M1">초등졸</option>
     <option value="M4">초등재학</option>
     <option value="G1">고졸</option>
     <option value="A3">대학원중퇴</option>
     <option value="P4">유치원재학</option>
     <option value="C2">대학수료</option>
     <option value="C3">대학중퇴</option>
     <option value="E4">전문대재학</option>
     <option value="E2">전문대수료</option>
     <option value="Z9">무학</option>

  <option value="K1">특례필(자사)</option>
  <option value="K2">특례필(타사)</option>

  <option value="G">특례</option>
  <option value="G1">기간산업</option>
  <option value="G2">방위산업</option>

테이블에 마우스를 올리면 셀의 색상이 바뀝니다.

onmouseover="this.style.backgroundColor='색상값&RGB색상코드'"

//마우스가 올라갔을때 색상
onmouseout="this.style.backgroundColor='색상값&RGB색상코드'"

//마우스를 뗐을때 셀의 색상

소스보시면 이해가 빠르시겠네요.

테이블에 색깔을 넣어 이쁘게 한번 장식해보세요.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

[예제]

<table width=300 height=200 bgcolor=brown cellspacing=1>

<tr bgcolor=#ffffff>
<td onmouseover="this.style.backgroundColor='#FFFF95'" onmouseout="this.style.backgroundColor='#FEFAD8'" align=center>

노랑색</td>
<td onmouseover="this.style.backgroundColor='#FFB9DC'" onmouseout="this.style.backgroundColor='#FFEEFF'" align=center>분홍색</td>
</tr>

<tr bgcolor=#ffffff>
<td onmouseover="this.style.backgroundColor='#BBFDA8'" onmouseout="this.style.backgroundColor='#E6FFE6'" align=center>

초록색</td>
<td onmouseover="this.style.backgroundColor='#ACD6FF'" onmouseout="this.style.backgroundColor='#D7EBFF'" align=center>

하늘색</td>
</tr>

</table>

브라우저에 따른 처리방법
 
function xDOM(objectId, style) 
{
    if (stdDOM) return style ? document.getElementById(objectId).style  : document.getElementById(objectId);
    if (ieDOM)  return style ? document.all[objectId].style  : document.all[objectId];
    if (nsDOM)  return document.layers[objectId];
}
 
//new fcns added 03.04.06
function SetBackgroundColor(element, color)
{
    xDOM(element, 0).style.backgroundColor = color;
}

function DisplayOff(element)
{
    xDOM(element, 0).style.display = 'none';
}
 
 
gettyimage.com 에서 사용하고 있는 스크립트
/* Search_common.js - 12/27/05
 * General helper functions for scripts used in Search controls.
 *
 * Functions defined in other search js files depend on this file.
 *
*/
//03.03.06 X-browser DOM sniff...
var aDOM   = 0; 
var ieDOM  = 0;
var nsDOM  = 0;
var stdDOM = document.getElementById;

if (stdDOM) aDOM = 1; 
else 
{
    ieDOM = document.all; 
    if (ieDOM) aDOM = 1; 
    else 
    { 
        var nsDOM = ((navigator.appName.indexOf('Netscape') != -1) && (parseInt(navigator.appVersion) ==4)); 
        if (nsDOM) aDOM = 1; 
    }
}

//03.03.06: Encaps the DOM bidness...
function xDOM(objectId, style) 
{
    if (stdDOM) return style ? document.getElementById(objectId).style : document.getElementById(objectId);
    if (ieDOM)  return style ? document.all[objectId].style            : document.all[objectId];
    if (nsDOM)  return document.layers[objectId];
}
//new fcns added 03.04.06
function SetBackgroundColor(element, color)
{
    xDOM(element, 0).style.backgroundColor = color;
}

function DisplayOff(element)
{
    xDOM(element, 0).style.display = 'none';
}

// Do not allow the quick search flyout to popup before the body load event.
var g_ie6display = null; 
var g_ie6loaded = false; 
function IE6BodyLoad()
{
    g_ie6loaded = true;
    
    if (g_ie6display != null) 
    {
        IE6DisplayOn(g_ie6display);
    }
}
function IE6DisplayOn(element)
{
    if (!g_ie6loaded)
         g_ie6display = element
    else       
        xDOM(element, 0).style.display = 'block';
}

function DisplayOn(element)
{
    xDOM(element, 0).style.display = 'block';
}

function ToggleDisplay(element)
{
    e = xDOM(element, 0);
    e.style.display = (e.style.display == 'none') ? 'block' : 'none';
}
//new fcns added 03.04.06

function SetChecked(element, isChecked)
{
    xDOM(element, 0).checked = isChecked;
}

function WasChecked(element)
{
    return xDOM(element, 0).checked;
}

function swapBox(imgName) {    
	if (document.getElementById(imgName).src.indexOf("/images/arrow_right.gif") >-1) 
		document.getElementById(imgName).src = "/images/arrow_down.gif";
	else 
		document.getElementById(imgName).src = "/images/arrow_right.gif";
}

function swapCarrot(imgName) {    
	if (document.getElementById(imgName).src.indexOf("/images/arrow_right.gif") >-1)
		document.getElementById(imgName).src = "/images/arrow_down.gif";
	else
		document.getElementById(imgName).src = "/images/arrow_right.gif";
}

function imageSwap(imageElement, theSrc){
	imageElement.src = theSrc;
}

var g_isNav4 = false;
if (navigator.appName.toLowerCase() == "netscape")
	g_isNav4 = true;

// This nested If statement is necessary due to Navigator choking on e.keyCode.
function IsACR(e) {
	var retVal = false;
	if (g_isNav4)
	{
		if (e.which && (e.which == 13 || e.which == 3)) 
		{
			e.returnValue = false; // turn off event;
			retVal = true;
		} 
		else 
		{
			e.returnValue = e.keyCode;
		}
	}
	else 
	{
		if (e.keyCode && (e.keyCode == 13 || e.keyCode == 3))
		{
			event.returnValue = false; // turn off event;
			retVal = true;
		}	
		else 
		{
			event.returnValue = event.keyCode;
		}
	}
	
	return retVal;
}

function Trimmed(strInString)
{
	if (strInString == null)
		return "";
	
	var strOutString = "";
	for (var i = strInString.length-1; i >= 0; i--) {
		if (strInString.charAt(i) != ' ') {
			strOutString = strInString.substr(0, i+1)
			break;
		}
	}
	for (var i = 0; i < strOutString.length; i++) {
		if (strOutString.charAt(i) != ' ') {
			strOutString = strOutString.substr(i)
			break;
		}
	}
	return strOutString;
}

function CollapseNode(imagename, element)
{    
    swapCarrot(imagename);
    ToggleDisplay(element);
}

function gotSearchEnter(evt, ex, btn) 
{    
    if (!IsACR(evt)) 
        return false;
    var elCtrl = xDOM(btn, 0); 
    elCtrl.click();
    evt.cancelBubble=true; 
    return false;
}       


function CheckParentOption(ctrlChild, ctrlParent, excludedSection)
{
	var elChild = xDOM(ctrlChild, 0);
	var elParent = xDOM(ctrlParent, 0);
	if(elChild.checked)
	{
		SetChecked(ctrlParent, true);
	}

	if(excludedSection != '')
	{
		DisplayOff(excludedSection);
	}
}

function CheckChildOption(ctrlChild, ctrlParent, excludedSection)
{
	var elChild = xDOM(ctrlChild, 0);
	var elParent = xDOM(ctrlParent, 0);
	
	if(!elParent.checked)
	{
		SetChecked(ctrlChild, false);
	}
}

function CheckDropDownParent(ctrlParent, excludedSection)
{
	var elParent = xDOM(ctrlParent, 0);
	SetChecked(ctrlParent, true);
	if(excludedSection != '')
	{
		DisplayOff(excludedSection);
	}			
}

<script language="javascript" type="text/javascript">

/*

한꺼번에 선택하기 <input name="CehckAll" type="checkbox" value="checkbox" onclick="selectAll()" />

*/
    function selectAll(){

   var frm=document.forms[0];

/*selectIDX는 반복되어져 나오는 INPUT 박스 이름입니다.

<input name="CehckAll" type="checkbox" value="checkbox" onclick="selectAll()" />

<input name="selectIDX" type="checkbox" value="1234" />

<input name="selectIDX" type="checkbox" value="456"  />

<input name="selectIDX" type="checkbox" value="254"  />

*/

//selectIDX 가 한개도 없을수가 있으니깐 총 갯수를 체크~
   var list_size = document.forms[0].selectIDX.length;     
    if (list_size==null) list_size = 0;
   if (list_size != 0){  
      if (document.forms[0].CehckAll.checked == true){

                    for(i = 0; i < frm.selectIDX.length; ++i) {
                        frm.selectIDX[i].checked = true;
                    }

                }else{

                    for(i = 0; i < frm.selectIDX.length; ++i) {
                        frm.selectIDX[i].checked = false;
                    }

                }
      }else{

//이부분은 만약 selectIDX가 1개만 있다면 length 가 없으니깐 따로 처리를 해줘야 합니다~
         if (document.forms[0].CehckAll.checked == true){
            frm.selectIDX.checked = true;
        }else{
            frm.selectIDX.checked = false;
        }

      }

    }

//확인버튼 눌렀을때 선택된 체크박스가 있는지 확인하기
    function memoFormSubmit(){
    var Check_Count = 0;
    var frm=document.forms[0];

    if(frm.idx.length > 0){

        for(i = 0; i < frm.idx.length; ++i) {
            if(frm.selectIDX[i].checked == true) Check_Count ++;

        }

    }
    else{
    if(frm.selectIDX.checked == true) Check_Count ++;

    }

    if(Check_Count == 0){
            alert("삭제하실 항목을 하나 이상 선택 하세요.");
            return;
    }

    if(confirm("선택하신 항목을 삭제 하시겠습니까?"))
            return true;

    }

</script>

또는

            var   bool =  document.forms[0].CehckAll.checked;

            var obj = document.getElementsByName("selectIDX");

            for (var i=0; i<obj.length; i++) obj[i].checked = bool;

+ Recent posts