/* balloon.js v1.1 */ /* (C)t.hira ( http://thira.plavox.info/ ) */ /* Licensed under Creative Commons Attribution 2.1 Japan ( http://creativecommons.org/licenses/by/2.1/jp/ ) */ /* Licensed under MIT License http://www.opensource.org/licenses/mit-license.php */ // Constructor function Balloon(){ this.initMousePosition(); this.mouseX=0; this.mouseY=0; this.clear(); return false; } //Clear BalloonStyle Balloon.prototype.clear=function(s){ this.setBalloonRound(20); this.setBalloonWidth(240); this.setBalloonHeight(120); this.setBalloonLadder(35); this.setBalloonLadderStyle(0); this.setFontSize(12); } //Set BallonRound Balloon.prototype.setBalloonRound=function(s){ Balloon.round=s; } //Set BalloonWidth Balloon.prototype.setBalloonWidth=function(s){ Balloon.width=s; } //Set BalloonHeight Balloon.prototype.setBalloonHeight=function(s){ Balloon.height=s; } //Set BalloonLadder Balloon.prototype.setBalloonLadder=function(s){ Balloon.ladder=s; } //Set BalloonLadderStyle Balloon.prototype.setBalloonLadderStyle=function(s){ if(s==1){ Balloon.ladderStyle=90-Math.ceil(Balloon.ladder/3); Balloon.ladderWidth=Math.ceil(Balloon.ladder/3*1.7); Balloon.ladderOffsetX=Math.ceil(Balloon.ladder/3); Balloon.ladderSpacerX=Math.ceil(Balloon.ladder/3)-2; } else if(s==2){ Balloon.ladderStyle=120; Balloon.ladderWidth=120; Balloon.ladderOffsetX=Math.ceil(Balloon.ladder/1.4); Balloon.ladderSpacerX=0; } else{ Balloon.ladderStyle=10; Balloon.ladderWidth=60; Balloon.ladderOffsetX=Math.ceil(Balloon.ladder/8); Balloon.ladderSpacerX=0; } } //Set BalloonLadder Balloon.prototype.setFontSize=function(s){ Balloon.fontSize=s; } //Balloon PopUp Balloon.prototype.popup=function(id,msg){ var objBalloon = document.createElement("div"); var balloonHTML; balloonHTML="
\n"; balloonHTML+=""+msg+"