1/* 2=========================================================== 3ãã©ã³ããµã¤ãºå¤æ´ã¹ã¯ãªããï¼ã¿ã¤ãCï¼ 4Last Updated:09/21/2001 5 6insomnia!Web Labo. 7http://www3.airnet.ne.jp/insomnia/ 8http://www3.airnet.ne.jp/insomnia/labo/fsc/fscC.html 9=========================================================== 10*/ 11 12/* 13========== ::: åæè¨å® ::: ========== 14*/ 15 16// å¤ã®åä½ãè¨å®ï¼å¿ ãããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ãï¼ 17var fontSizeUnit = "%"; 18 19// ä¸åã®æä½ã§å¤åãããå¤ãè¨å®ï¼ããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããªãï¼ 20var perOrder = 20; 21 22// åæç¶æ ã®å¤ãè¨å®ï¼ããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããªãï¼ 23var defaultSize = 100; 24 25// ã¯ããã¼ã®ååï¼å¿ ãããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ãï¼ 26var ckName = "ckfontsize"; 27 28// ã¯ããã¼ã®æå¹æéï¼æ¥ï¼ï¼ããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããªãï¼ 29var ckDays = 2; 30 31// ã¯ããã¼ã®ãã¹ï¼å¿ ãããã«ã¯ãªã¼ããã¯ãªã¼ãã§æ¬ããæå®ãä¸è¦ã®å ´åã¯"/"ã«ããï¼ 32var ckPath = "/"; 33 34/* 35========== ::: ãã¼ã¸èªã¿è¾¼ã¿æã®å¤ãè¨å® ::: ========== 36*/ 37 38// ã¯ããã¼èªã¿åºã 39var fsCK = GetCookie( ckName ); 40 41if ( fsCK == null ){ 42 var currentSize = defaultSize; //ã¯ããã¼ãç¡ããã°ç¾å¨ã®å¤ãåæç¶æ ã®å¤ã«è¨å® 43} 44else{ 45 var currentSize = eval( fsCK ); //ã¯ããã¼ãããã°ç¾å¨ã®å¤ãã¯ããã¼ã®å¤ã«è¨å® 46} 47 48/* 49========== ::: headå ã«styleè¦ç´ ãåºå ::: ========== 50*/ 51 52currentSize_h1 = currentSize + 50; 53currentSize_h2 = currentSize + 30; 54currentSize_h3 = currentSize + 20; 55currentSize_h4 = currentSize + 10; 56currentSize_h5 = currentSize; 57currentSize_t_h2 = currentSize + 20; 58currentSize_t_h3 = currentSize + 10; 59document.writeln( '<style type="text/css" media="screen,print,tv">' ); 60document.write( 'body,th,td{font-size:' + currentSize + fontSizeUnit+ '}' ); 61document.write( 'h1{font-size:' + currentSize_h1 + fontSizeUnit+ '}' ); 62document.write( 'h2{font-size:' + currentSize_h2 + fontSizeUnit+ '}' ); 63document.write( 'h3{font-size:' + currentSize_h3 + fontSizeUnit+ '}' ); 64document.write( 'h4{font-size:' + currentSize_h4 + fontSizeUnit+ '}' ); 65document.write( 'h5,h6{font-size:' + currentSize_h5 + fontSizeUnit+ '}' ); 66document.write( '#mainmenu h2{font-size:' + currentSize_t_h2 + fontSizeUnit+ '}' ); 67document.write( '#mainmenu h3,#contentmenu h2,#contentmenu h3{font-size:' + currentSize_t_h3 + fontSizeUnit+ '}' ); 68document.writeln( '</style>' ); 69 70/*=================================== 71 [颿° fsc] 72 弿°CMDã«æ¸¡ãããå¤ã«å¿ã㦠73 夿´å¾ã®å¤ãç®åºãã¯ããã¼ã«æ¸ãè¾¼ãã 74====================================*/ 75 76function fsc( CMD ){ 77 // æ¡å¤§ï¼ç¾æç¹ã®å¤ã«ä¸åã®æä½ã§å¤åãããå¤ãå ãã¦æä½å¾ã®å¤"newSize"ã«ä»£å ¥ 78 if ( CMD == "larger" ){ 79 var newSize = Number( currentSize + perOrder ); 80 SetCookie( ckName , newSize ); //ã¯ããã¼æ¸ã込㿠81 } 82 83 // 縮å°ï¼ç¾æç¹ã®å¤ããä¸åã®æä½ã§å¤åãããå¤ãå¼ãæä½å¾ã®å¤ã«ä»£å ¥ 84 // ç¾æç¹ã®ãµã¤ãºã®å¤ãä¸åã®æä½ã§å¤åãããå¤ã¨åããªããã®ã¾ã¾æä½å¾ã®å¤ã«ä»£å ¥ 85 if ( CMD == "smaller" ){ 86 if ( currentSize != perOrder ){ 87 var newSize = Number( currentSize - perOrder ); 88 SetCookie( ckName , newSize ); //ã¯ããã¼æ¸ã込㿠89 } 90 else{ 91 var newSize = Number( currentSize ); 92 } 93 } 94 95 // å ã«æ»ãï¼æä½å¾ã®å¤ãåæå¤ã«ãã 96 if ( CMD == "default" ){ 97 DeleteCookie( ckName ); //ã¯ããã¼åé¤ 98 } 99 100 // ãã¼ã¸ã®åèªã¿è¾¼ã¿ 101 // åèªã¿è¾¼ã¿ããããã¨ã§å¤æ´å¾ã®å¤ãåæ ããstyleè¦ç´ ãåºåããã 102 location.reload(); 103} 104 105// _______________________________________ end of function fsc() ___ 106 107/*=================================== 108 [颿° SetCookie] 109 ã¯ããã¼ã«å¤ãæ¸ãè¾¼ã 110====================================*/ 111function SetCookie( name , value ){ 112 var dobj = new Date(); 113 dobj.setTime(dobj.getTime() + 24 * 60 * 60 * ckDays * 1000); 114 var expiryDate = dobj.toGMTString(); 115 document.cookie = name + '=' + escape(value) + ';expires=' + expiryDate + ';path=' + ckPath; 116 117} 118 119/*=================================== 120 [颿° GetCookie] 121 ã¯ããã¼ãåå¾ãã 122====================================*/ 123function GetCookie (name){ 124 var arg = name + "="; 125 var alen = arg.length; 126 var clen = document.cookie.length; 127 var i = 0; 128 while (i < clen){ 129 var j = i + alen; 130 if (document.cookie.substring(i, j) == arg) 131 return getCookieVal (j); 132 i = document.cookie.indexOf(" ", i) + 1; 133 if (i == 0) break; 134 } 135 return null; 136} 137 138/*=================================== 139 [颿° getCookieVal] 140 ã¯ããã¼ã®å¤ãæ½åºãã 141====================================*/ 142function getCookieVal (offset){ 143 var endstr = document.cookie.indexOf (";", offset); 144 if (endstr == -1) 145 endstr = document.cookie.length; 146 return unescape(document.cookie.substring(offset,endstr)); 147} 148 149/*=================================== 150 [颿° DeleteCookie] 151 ã¯ããã¼ãåé¤ãã 152====================================*/ 153function DeleteCookie(name){ 154 if (GetCookie(name)){ 155 document.cookie = name + '=' + 156 '; expires=Thu, 01-Jan-70 00:00:01 GMT;path='+ckPath; 157 } 158} 159 160/* FONTã¿ã°ã®ãµã¤ãºãªã©ãã¹ã¿ã¤ã«æå®ã«å¤æãã颿°ï¼convert_some_tag_to_styleï¼ã®å®ç¾© 161 * 2009.07.23 Netcrew N.Iè¿½è¨ 162*/ 163function convert_some_tag_to_style(){ 164 var font_tags = document.getElementsByTagName('font'); 165 166 for(i=0,L=font_tags.length;i<L;i++){ 167 switch(font_tags[i].getAttribute("size")){ 168 case "+3": 169 font_tags[i].style.fontSize=currentSize_h1+fontSizeUnit; 170 break; 171 case "+2": 172 font_tags[i].style.fontSize=currentSize_h2+fontSizeUnit; 173 break; 174 case "+1": 175 font_tags[i].style.fontSize=currentSize_h3+fontSizeUnit; 176 break; 177 case "+0": 178 default: 179 break; 180 case "-1": 181 font_tags[i].style.fontSize=currentSize_h4+fontSizeUnit; 182 break; 183 case "-2": 184 font_tags[i].style.fontSize=currentSize_h5+fontSizeUnit; 185 break; 186 case "-3": 187 font_tags[i].style.fontSize=currentSize_h5+fontSizeUnit; 188 break; 189 } 190 font_tags[i].removeAttribute("size"); 191 } 192} 193 194function change_image_init(){ 195 try { 196 var img_array = document.getElementsByTagName("img"); 197 var img_num = img_array.length; 198 for(var i=0; i < img_num; i++){ 199 if(img_array[i].getAttribute("src").match("_off.")){ 200 img_array[i].onmouseover = function (){ 201 this.setAttribute("src", this.getAttribute("src").replace("off", "hover")); 202 } 203 img_array[i].onmouseout = function() { 204 this.setAttribute("src", this.getAttribute("src").replace("hover", "off")); 205 } 206 } 207 } 208 } catch(e){ 209// alert("test"); 210 } 211} 212 213 214window.onload = change_image_init,convert_some_tag_to_style; 215 216//EOF
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.