// JavaScript Document
function $(e){
if(typeof(e)=='string') {
if(document.getElementById) e=document.getElementById(e);
else if(document.all) e=document.all[e];
else e=null;
}
return e;
}
function toggle(id){
var oj = $(id);
if(oj.style.display == "none"){
oj.style.display = "block";
}else{
oj.style.display = "none";
}
}
function tooltip(id){
window.document.onmousemove = function(e){
if(document.all) {
$(id).style.pixelLeft = getMousePosition(e).x;
$(id).style.pixelTop = getMousePosition(e).y + 25;
}else {
$(id).style.left = getMousePosition(e).x + "px";
$(id).style.top = getMousePosition(e).y + 25 + "px";
}
}
toggle(id);
}
function getMousePosition(e) {
var obj = new Object();
if(e) {
obj.x = e.pageX;
obj.y = e.pageY;
}else {
obj.x = event.x + document.body.scrollLeft;
obj.y = event.y + document.body.scrollTop;
}
return obj;
}
function check_on(id,src,h,w){
//if($('filefield'+id).value != ""){
/*var src = $('filefield'+id).value;
if($("filefield"+id).files){
src = $("filefield"+id).files[0].getAsDataURL();
}*/
//alert(id+" "+src+" "+h+" "+w)
$('file_check'+id).innerHTML = "";
var thumb = document.createElement('img');
thumb.id= "thumb"+id;
thumb.src = src;
$('file_check'+id).appendChild(thumb);
var bh = 72;
var bw = 208;
if(w>bw || h>bh){
if(h>w){
var vw = bw;
var vh = bw * h / w;
thumb.width = vw;
thumb.height = vh;
thumb.style.marginTop = ((bh - vh) /2) +"px";
}else{
var vh = bh;
var vw = bh * w / h;
thumb.width = vw;
thumb.height = vh;
thumb.style.marginLeft = (bw - vw)/2 +"px";
//alert(bw+" "+vw);
}
}else{
var vh = h;
var vw = w;
thumb.style.marginTop = ((bh - vh) /2) +"px";
thumb.style.marginLeft = ((bw - vw) /2) +"px";
}
//alert(bh+" "+bw+" "+h+" "+w+" "+vh+" "+vw);
$('file_check'+id).innerHTML = "
";
$('select_image'+id).value = src;
//$('cabinet'+id).style.backgroundImage = "url(img/spacer.gif)";
$('filefield'+id).blur();
}
function init_text(id,num){
if($(id).value == "" || $(id).value == "画像の上にのせる文字を一行ごとに設定できます(ココに入力)"){
$(id).style.color = "#BBBBBB";
$(id).value = "画像の上にのせる文字を一行ごとに設定できます(ココに入力)";
}else{
$('add_field_btn'+num).style.display = 'inline';
}
}
function check_text(id,num){
init_text(id,num);
}
function forcus_text(id){
if($(id).value == "" || $(id).value == "画像の上にのせる文字を一行ごとに設定できます(ココに入力)"){
$(id).value = "";
$(id).style.color = "#000000";
}
}
function randobet(n) {
var t = 'abcdefghijklmnopqrstuvwxyz'
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+ '0123456789';
t = t.split('');
var result = '';
for (var i = 0; i < n; i++) {
result += t[Math.floor(Math.random() * t.length)];
}
return result;
};
function getRadio(forms,names) {
var radioGroup = $(forms).names;
for (i=0; i";
$('pre_fla').innerHTML += "";
$('pre_fla').innerHTML += "";
$('pre_fla').innerHTML += "";*/
$('pre_fla').innerHTML += "";
//$('pre_fla').innerHTML += "";
$('pre_fla').display = "block";
$('pre_fla').style.marginTop = "5px";
var w = Math.max(eval($('size_w').value),500);
var size_field = document.createElement('div');
size_field.id= "swf_size";
size_field.innerHTML = $('size_w').value+"px × "+$('size_h').value+"px";
size_field.style.width = w + "px";
$('step1').appendChild(size_field);
var buy_btn = document.createElement('div');
buy_btn.id= "buy_btn";
$('step1').appendChild(buy_btn);
$('step1').style.width = w +"px";
buy_btn.style.marginLeft = w/2 - 168 +"px";
buy_btn.style.cursor = "pointer";
buy_btn.innerHTML = "
";
buy_btn.onclick = function(){
//alert($('preview_field').id)
$('step2').style.display = "block";
$('step3').style.display = "block";
stepInt('preview_field',"['marginLeft',0,"+(-w)+",5]");
stepInt('preview',"['width',"+$('size_w').value+",500,5]");
stepInt('preview',"['height',"+$('preview').offsetHeight+","+$('step2').offsetHeight+",5]");
var y = parseInt(getWindowHeight())/2 - $('step2').offsetHeight/2;
var x = getWindowWidth()/2 - (500 + 10)/2;
var btn_x = getWindowWidth()/2 + (500)/2 - 15;
var btn_y = y - 10;
if(document.all) {
stepInt('preview',"['pixelLeft',"+$('preview').style.pixelLeft+","+x+",5]");
stepInt('preview',"['pixelTop',"+$('preview').style.pixelTop+","+y+",5]");
stepInt('preview_close_btn',"['pixelLeft',"+$('preview_close_btn').style.pixelLeft+","+btn_x+",5]");
stepInt('preview_close_btn',"['pixelTop',"+$('preview_close_btn').style.pixelTop+","+btn_y+",5]");
}else {
stepInt('preview',"['left',"+$('preview').style.left.replace('px','')+","+x+",5]");
stepInt('preview',"['top',"+$('preview').style.top.replace('px','')+","+y+",5]");
stepInt('preview_close_btn',"['left',"+$('preview_close_btn').style.left.replace('px','')+","+btn_x+",5]");
stepInt('preview_close_btn',"['top',"+$('preview_close_btn').style.top.replace('px','')+","+btn_y+",5]");
}
}
var freead_btn = document.createElement('div');
freead_btn.id= "freead_btn";
$('step1').appendChild(freead_btn);
freead_btn.style.cursor = "pointer";
freead_btn.innerHTML = "
";
freead_btn.onclick = function(){
$('thanks').innerHTML = ""
$('step2').style.display = "none";
$('step3').style.display = "none";
//貼りつけコード
var code_field = document.createElement('div');
code_field.id= "code_field";
$('thanks').appendChild(code_field);
var code_field = document.createElement('textarea');
code_field.id= "code";
$('code_field').appendChild(code_field);
$('code').style.width = "480px";
$('code').style.height = "50px";
$('code_field').style.marginTop = "5px";
$('code_field').style.paddingLeft = "5px";
$('code').style.display = "block";
$('code').style.overflow = "hidden";
$('code').value = "";
$('code').value += ""+ad+"
";
$('code').value += "";
$('code').value += "