str = document.URL;

nor = new RegExp("(http://)([a-z0-9\-]+)(.seesaa.net)", "i");
origindomain = new RegExp("(http://)(.*)(/)", "i");

if (str.match(nor)){
	userID = RegExp.$2;
	ref_matchurl ="http://" + userID +  ".seesaa.net/";
} else if (str.match(origindomain)){
	userID = "http://"+ RegExp.$2 +"/";
	ref_matchurl = userID;
} else{
	userID = "";
	ref_matchurl = "random";
}
document.write('<ifr'+'ame name="maad" src="http://bw.microad.jp/mad.cgi?blogid='+in_uid+'&templateid='+in_templateid+'&charset='+in_charset+'&group='+in_group+'&HBgColor='+in_HBgColor+'&HBorderColor='+in_HBorderColor+'&HTitelColor='+in_HTitleColor+'&HTextColor='+in_HTextColor+'&HUrlColor='+in_HUrlColor+'&matchurl='+ref_matchurl+'&cssid='+in_group+'"');
document.write(' width="'+ frame_width +'"'+
' height="'+ frame_height +'"'+
' scrolling="no"'+
' frameborder="no"'+
' marginwidth="0"'+
' marginheight="0"'+
' allowTransparency="true"'+' ></ifr'+'ame>');