/* ===============================================
 Rollover [on] or [off]
=============================================== */
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");

		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));
				}
			}
		}
	}
}

if(window.addEventListener) {
	window.addEventListener("load", smartRollover, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", smartRollover);
}


/* ===============================================
 Mail To
=============================================== */
function writeMailto() {
	mail1 = "frangijp";
	mail2 = "yahoo.co.jp";
	document.open();
	document.write("<a href=mailto:"+mail1+"&#64;"+mail2+">"+mail1+"&#64;"+mail2+"</a>");
	document.close();
}

function writeMailto2() {
	mail1 = "frangi";
	mail2 = "telkom.net";
	document.open();
	document.write("<a href=mailto:"+mail1+"&#64;"+mail2+">"+mail1+"&#64;"+mail2+"</a>");
	document.close();
}

function writeMailtoMayura() {
	mail1 = "info";
	mail2 = "mayura-ayura.com";
	document.open();
	document.write("<a href=mailto:"+mail1+"&#64;"+mail2+">"+mail1+"&#64;"+mail2+"</a>");
	document.close();
}

function writeMailtoFragment() {
	mail1 = "info";
	mail2 = "fragmentinc.co.jp";
	document.open();
	document.write("<a href=mailto:"+mail1+"&#64;"+mail2+">"+mail1+"&#64;"+mail2+"</a>");
	document.close();
}

function writeMailtoFrangiyamada() {
	mail1 = "frangiyamada";
	mail2 = "yahoo.co.jp";
	document.open();
	document.write("<a href=mailto:"+mail1+"&#64;"+mail2+">"+mail1+"&#64;"+mail2+"</a>");
	document.close();
}

/* ===============================================
 google-analytics
=============================================== */
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");

var header = document.getElementsByTagName("head")[0];
var scriptTag = document.createElement("script");
scriptTag.setAttribute("src", gaJsHost + "google-analytics.com/ga.js");
scriptTag.setAttribute("type", "text/javascript");

header.appendChild(scriptTag);

function analytics() {
	try {
		var pageTracker = _gat._getTracker("UA-23799400-1");
		pageTracker._trackPageview();
	} catch(err) {
		// alert("Google Analytics:" + err);
	}
}

if (window.attachEvent) {
	window.attachEvent("onload", analytics);
} else {
	window.addEventListener("load", analytics, false);
}

