// Code section for Enable Event Tracking
function dcsParseSvl(sv){
	sv=sv.split(" ").join("");
	sv=sv.split("\t").join("");
	sv=sv.split("\n").join("");
	var pos=sv.toUpperCase().indexOf("WT.SVL=");
	if (pos!=-1){
		var start=pos+8;
		var end=sv.indexOf('"',start);
		if (end==-1){
			end=sv.indexOf("'",start);
			if (end==-1){
				end=sv.length;
			}
		}
		return sv.substring(start,end);
	}
	return "";
}
function dcsIsOnsite(host){
//	var doms="minimini.jp,minimini.co.jp";
	var doms=location.host;
    var aDoms=doms.split(',');
    for (var i=0;i<aDoms.length;i++){
		if (host.indexOf(aDoms[i])!=-1){
		       return 1;
		}
    }
    return 0;
}
function dcsIsHttp(e){
	return (e.href&&e.protocol&&(e.protocol.indexOf("http")!=-1))?true:false;
}

var gHref="";
var gFrame="";
function dcsSaveHref(evt){
	if (evt.preventDefault){
		if (evt.target.target){
			gFrame=evt.target.target.toLowerCase();
			if (gFrame=="_top"||gFrame=="_parent"){
			} else if (gFrame=="_self"){
				gFrame="";
			} else if (gFrame=="_blank"||!window.top[gFrame]){
				gFrame="";
				return;
			}
		}
		if (evt.target.href){
			evt.preventDefault();
			gHref=evt.target.href;
		} else {
			gFrame="";
		}
	}
}
function dcsLoadHref(evt){
	if (gHref.length>0){
		if (gFrame.length>0){
			window.open(gHref,gFrame);
		}else{
			window.location=gHref;
		}
		gHref=gFrame="";
	}
}
function dcsEvt(evt,tag){
	var e=evt.target||evt.srcElement;
	while (e.tagName&&(e.tagName!=tag)){
		e=e.parentElement||e.parentNode;
	}
	return e;
}
function dcsBind(event,func){
	if ((typeof(window[func])=="function")&&document.body){
		if (document.body.addEventListener){
			document.body.addEventListener(event, window[func], true);
		}
		else if(document.body.attachEvent){
			document.body.attachEvent("on"+event, window[func]);
		}
	}
}
function dcsET(){
	dcsBind("click","dcsOffsite");
}
