
document.write('<script type="text/javascript" src="/js/swfobject.js"><\/script>');

function swf(id){
 var path="/img/flash/";
 if(typeof this.window['SWFObject']!=='function'){
	 return false;
 }
 //var swf=new SWFObject("./img/visual.swf?"+(new Date()).getTime(),"visual","100%","100%","8","#ffffff");
 var swf=new SWFObject("./img/visual4.swf?"+(new Date()).getTime(),"visual","100%","100%","8","#ffffff");
 swf.addParam("scale","noscale");
 swf.addParam("wmode","transparent");
 swf.addVariable("tim",5);
 swf.addVariable("path",path);

//if(location.href=='http://'+document.domain+'/' || location.href=='http://'+document.domain+'/index.php'){
//  swf.addVariable("topFlag","true");
// }
 var a = new Ajax.Request(
  path+"cnt.php?r="+(new Date()).getTime(),{"method":"get",onSuccess:function(request){
   swf.addVariable("imgCnt",request.responseText);
   swf.write(id);
  }
 });
}


var Cipher=function(){};

Cipher.base64=function(str){
	var base64list='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
	var res='';
	var p=-8;
	var a=0;
	var c,d;
	for(var i=0;i<str.length;i++){
		if((c=base64list.indexOf(str.charAt(i)))<0) continue;
		a=(a<<6)|(c&63);
		if((p+=6)>=0){
			d=(a>>p)&255;
			if(c!=64){
				res+=String.fromCharCode(d);
				a&=63;
				p-=8;
			}
		}
	}
	return res;
};

Cipher.mail=function(str,text,linkflag){
	var m=this.base64(str);
	if(!linkflag){
		return '<a '+'hr'+'ef="mai'+'lto'+':'+m+'">'+(text ? text : m)+'</'+'a>';
	}else{
		return (text ? text : m);
	}
};

Cipher.mailload=function(){
	$A($$('span[id^=ciph_]')).each(function(obj){
		var d=obj.id.replace(/^ciph_/,'');
		var d=d.split('-');
		var text=(d[1]) ? decodeURI(Cipher.base64(d[1])) : '';
		var linkflag=(d[2]) ? d[2] : '';
		obj.innerHTML=Cipher.mail(d[0],text,linkflag);
	});
};


/*Event.observe(window,'load',function(){
// swf("image");
 Cipher.mailload();
 //alert($$('span[id^=ciph_]').length);
});*/
