/* * sTEPiT.js * Version 0.6 since 2006/02/17 */ var hglf_targetName= 'swfReplace'; var hglf_targetNameVertical= 'vswfReplace'; var hglf_targetNameVerticalMultiColumn= 'mswfReplace'; var hglf_mimeType= 'application/x-shockwave-flash'; var hglf_foundationSwfURL= 'http://glyph-on.jp/stepitv2_demo/loader.swf'; var hglf_userAgent= 0; var hglf_prefixId= "hglf_movie_"; var hglf_MovieId= 0; var hglf_debug= 0; var hglf_userkey= 'f23a856ebd042a01ae21d7552bb05a62'; var hglf_targetAttrName= 'stepit'; var hglf_limitLength= 65535; //400*3 * 1.2; var hglf_limitStages= 256; //20; var hglf_saveInnerHTML= new Array(); // if(!Array.prototype.push){ // alert("Array dose not have a 'push' property!"); // } // if(!Array.prototype.pop){ // alert("Array dose not have a 'pop' property!"); // } // if(!Array.prototype.shift){ // alert("Array dose not have a 'shift' property!"); // } // if(!Array.prototype.unshift){ // alert("Array dose not have a 'unshift' property!"); // } // if(!Array.prototype.splice){ // alert("Array dose not have a 'splice' property!"); // } function get_quote_type(str){ if(!str) return ''; if(str.match(/^\'/) && str.match(/\'$/)) return "'"; if(str.match(/^\"/) && str.match(/\"$/)) return '"'; return ''; } function clip_quote(str){ if(!str) return ''; str= str.replace(/^\s+/,'').replace(/\s+$/,''); if(str.match(/^\'/) && str.match(/\'$/)) return str.replace(/^\'/,'').replace(/\'$/,''); if(str.match(/^\"/) && str.match(/\"$/)) return str.replace(/^\"/,'').replace(/\"$/,''); return str; } function reverse_quote(quote){ if(quote=='"') return "'"; if(quote=="'") return '"'; return ''; } function hglf_getSelectedValue(id) { var e= document.getElementById(id); if(!e) return ''; for(var i=0; i=0 && token_type=='d'){ var rule= ''; for(var i=n-7; i=0; i--){ var n= this.eq[i]; var token= this.token[n-2]; if(token==ppty){ this.token[n+2]= value; count++; if(RECURCE) break; } } return count; } hglf_cCSS.prototype.removeProperty= function(ppty, RECURCE) { var last_token= this.check_last_token_type(); var rm= new Array(); for(var i=this.eq.length-1; i>=0; i--){ var n= this.eq[i]; var token= this.token[n-2]; if(token==ppty){ var ext= 0; if(i==this.eq.length-1 && last_token!='' && last_token!='d'){ // if last ';' is ommited in removing last property, // do remove last ';' to make it the same style. ext= 2; } // 7 letters means 'twew(t|l)wd'. for(var j=n-2-ext; j=0){ if(this.token_type[i]!='w') return this.token_type[i]; else --i; } return ''; } hglf_cCSS.prototype.addProperty= function(ppty, value) { var last_token= this.check_last_token_type(); if(last_token!='' && last_token!='d') this.push(';','d'); this.push('', 'w'); this.push(clip_quote(ppty), 't'); this.push('', 'w'); this.push(':', 'e'); this.push('', 'w'); get_quote_type(value) ? this.push(value, 'l'): this.push(value, 't'); this.push(';'); if(last_token!='d') this.pop(); } function hglf_parseCSS(str) { if(!str || !str.length) return new hglf_cCSS(); str= str.split(''); str.push(';'); var css= new hglf_cCSS(); var reg_ws= new RegExp('[ \\s\\t\\r\\n]'); var c, mode='', token='', white_space='', literal='', quote= ''; for(var i=0; i "+width+"x"+height); e.parentNode.style.overflow= "visible"; e.width= width; e.parentNode.style.width= width; if(isMSIE()){ e.width= width; e.parentNode.style.width= width; e.height= height; e.parentNode.style.height= height; /* note e.height should be faster than e.parentNode.style.height! */ } else{ e.width= width; e.parentNode.style.width= width; e.height= height; e.parentNode.style.height= "auto"; } /* Note: 2006/06/02 sakai [ at ] nya.to On Firefox, e.parentNode.style.{width,height} seems to be a private data. This code still works good though it makes an error message on JavaScriptConsole. But this is not the problem, read SWF data TWICE is the problem on Firefox. MSIE will read it ONCE. */ } function isOpera(){ var ua= navigator.userAgent; if(ua.indexOf("Opera")!=-1) return true; else return false; } function isMacIE(){ var ua= navigator.userAgent; if(ua.indexOf("MSIE")!=-1 && ua.indexOf("Mac")!=-1) return true; else return false; } function isMSIE(){ var ua= navigator.userAgent; if(ua.indexOf("MSIE")!=-1) return true; else return false; } function hglf_checkUserAgent(){ if(hglf_userAgent) return hglf_userAgent; var ua= navigator.userAgent; if(ua.indexOf("MSIE")!=-1&&ua.indexOf("Windows")!=-1) hglf_userAgent= 1; /* MSIE on Windows */ else if(ua.indexOf("Firefox")!=-1) hglf_userAgent= 2; /* Firefox */ else if(ua.indexOf("MSIE")!=-1&&ua.indexOf("Mac")!=-1) hglf_userAgent= 3; else hglf_userAgent= 3; return hglf_userAgent; } function hglf_checkFlashPlayer(){ } function hglf_makeNewInnerHTMLString(id,width,height) /* int id, String fontFamily, int fontSize, int width, int height */ { if(hglf_checkUserAgent()==1){ return '' + '' + '' + '' + ''; } else{ return '' + '' + '' + ''; } } function hglf_getRootTags(){ var es= document.getElementsByTagName('*'); var es_roots= new Array(); var str= ""; for(var i=0; i