// nvIR.js Version 1.2.1
// 2011-02-02
// www.synck.com

var nvIRObj = new Object();

nvIRObj.imageRoot = website.images;
nvIRObj.pulldown = null;
nvIRObj.pulldownHN = null;
nvIRObj.pulldownTimer = 1000;
nvIRObj.opacityTime = 70;
nvIRObj.SoundEffect = null;
if(navigator.userAgent.indexOf("MSIE") > -1)
	nvIRObj.lang = navigator.browserLanguage.toLowerCase();
else
	nvIRObj.lang = navigator.language.toLowerCase()
//nvIRObj.lang = "en";
if(nvIRObj.lang.indexOf('ja') > -1 || nvIRObj.lang.indexOf('jp') > -1)
	nvIRObj.lang = "";
else
	nvIRObj.lang = "e_";

var nvIRaObj = new Object();
var nvIRhref = "";

function nvIR_onload(){
	var d = window.document;
	var aObjects = d.getElementsByTagName("a");
	for (i=0;i<aObjects.length;i++) {
		if(aObjects[i].className == "nvIR"){
			aObjects[i].style.backgroundImage = 'url('+nvIRObj.imageRoot+nvIRObj.lang+aObjects[i].id+'.gif'+nocache+')';
			aObjects[i].style.display = "block";
			if(nvIRObj.lang == "")
				aObjects[i].style.textIndent = "-5000px";
			aObjects[i].style.height = aObjects[i].rel + "px";
			if(location.href.replace("index.html","").split(document.domain)[1] == aObjects[i].href.replace("index.html","").split(document.domain)[1])
				aObjects[i].style.backgroundPosition = "0px "+((aObjects[i].rel*2)*-1)+"px";
			else if(location.href.replace("index.html","").split(document.domain)[1] != "/" && location.href.replace("index.html","").split(document.domain)[1].indexOf(aObjects[i].href.replace("index.html","").split(document.domain)[1]) > -1)
				aObjects[i].style.backgroundPosition = "0px "+((aObjects[i].rel*2)*-1)+"px";
		}
		if(aObjects[i].rel == "external")
			aObjects[i].target = '_blank';
		if(aObjects[i].href.indexOf('https://') > -1)
			aObjects[i].href = aObjects[i].href.replace('https','http');
		if(aObjects[i].href.indexOf('gt-net110.com') == -1)
			aObjects[i].target = "_blank";
	}
	$("a.nvIR").mouseover(function(){
		nvIR_over(this);
	});
	$("a.nvIR").mouseout(function(){
		nvIR_out(this);
	});
	$("a.nvIR").mousedown(function(){
		nvIR_down(this);
	});
	$("a.nvIR").mouseup(function(){
		nvIR_up(this);
	});
	$("a.nvIRPDn").mouseover(function(){
		nvIR_puldown_over();
	});
	$("a.nvIRPDn").mouseout(function(){
		nvIR_puldown_out();
	});
	if(navigator.userAgent.indexOf("MSIE") == -1){
		var bodyObj = d.getElementsByTagName("body").item(0);
		var audioObj = d.createElement('audio');
		if(navigator.userAgent.indexOf("Safari") > -1 && navigator.userAgent.indexOf("Chrome") == -1)
			audioObj.src = website.root + "commons/click.wav";
		else
			audioObj.src = website.root + "commons/click.ogg";
		audioObj.id = 'clickSE';
		audioObj.autobuffer = true;
		bodyObj.appendChild(audioObj);
		d.getElementById('clickSE').load();
		nvIRObj.SoundEffect = true;
	}
}
function nvIR_up(obj){
	var d = window.document;
	//d.getElementById('LS_loadingScreen').style.display = 'block';
	//d.getElementById('LS_loadingImage').style.display = 'block';
	//d.getElementById('LS_busyImage').style.display = 'none';
	if(location.href.replace("index.html","").split(document.domain)[1] == obj.href.replace("index.html","").split(document.domain)[1])
		obj.style.backgroundPosition = "0px "+((obj.rel*2)*-1)+"px";
	else if(location.href.replace("index.html","").split(document.domain)[1] != "/" && location.href.replace("index.html","").split(document.domain)[1].indexOf(obj.href.replace("index.html","").split(document.domain)[1]) > -1)
		obj.style.backgroundPosition = "0px "+((obj.rel*2)*-1)+"px";
}
function nvIR_down(obj){
	var d = window.document;
	if(nvIRObj.SoundEffect)
		d.getElementById('clickSE').play();
	obj.style.backgroundPosition = "0px "+((obj.rel*3)*-1)+"px";
	return false;
}
function nvIR_over(obj){
	var d = window.document;
	if(nvIRObj.pulldownHN != null)
		clearTimeout(nvIRObj.pulldownHN);
	if(obj.href != location.href && location.href.replace("index.html","").split(document.domain)[1].indexOf(obj.href.replace("index.html","").split(document.domain)[1]) == -1)
		obj.style.backgroundPosition = "0px "+((obj.rel)*-1)+"px";
	if(nvIRObj.pulldown != null && ( nvIRObj.pulldown != obj.id || obj.id.indexOf(nvIRObj.pulldown) == -1))
		nvIR_hide_pulldown(nvIRObj.pulldown);
	if(d.getElementById("pd_"+obj.id+"_navigator")){
		nvIRObj.pulldown = obj.id;
		d.getElementById("pd_"+obj.id+"_navigator").style.display = "block";
		nvIR_setOpacity("pd_"+obj.id+"_navigator",50);
		setTimeout('nvIR_setOpacity("pd_'+obj.id+'_navigator",100)',nvIRObj.opacityTime);
		if(d.getElementById("pd_"+obj.id+"_background")){
			d.getElementById("pd_"+obj.id+"_background").style.display = "block";
			nvIR_setOpacity("pd_"+obj.id+"_background",50);
			setTimeout('nvIR_setOpacity("pd_'+obj.id+'_background",100)',nvIRObj.opacityTime);
		}
	}
}
function nvIR_out(obj){
	if(typeof obj != "undefined" && obj != null){
		if(obj.href != location.href && location.href.replace("index.html","").split(document.domain)[1].indexOf(obj.href.replace("index.html","").split(document.domain)[1]) == -1 && obj.id != nvIRObj.pulldown)
			obj.style.backgroundPosition = "0px 0px";
		if(nvIRObj.pulldown != null)
			nvIRObj.pulldownHN = setTimeout("nvIR_hide_pulldown('"+nvIRObj.pulldown+"')",nvIRObj.pulldownTimer);
	}
}
function nvIR_puldown_over(){
	if(nvIRObj.pulldownHN != null){
		clearTimeout(nvIRObj.pulldownHN);
	}
}
function nvIR_puldown_out(){
	if(nvIRObj.pulldownHN != null)
		clearTimeout(nvIRObj.pulldownHN);
	nvIRObj.pulldownHN = setTimeout("nvIR_hide_pulldown('"+nvIRObj.pulldown+"')",nvIRObj.pulldownTimer);
}
function nvIR_hide_pulldown(id){
	var d = window.document;
	if(nvIRObj.pulldownHN != null)
		clearTimeout(nvIRObj.pulldownHN);
	nvIRObj.pulldown = null;
	nvIR_out(d.getElementById(id));
	if(d.getElementById("pd_"+id+"_background")){
		nvIR_setOpacity("pd_"+id+"_navigator",50);
		setTimeout('document.getElementById("pd_'+id+'_background").style.display="none"',nvIRObj.opacityTime);
		setTimeout('nvIR_setOpacity("pd_'+id+'_background",0)',nvIRObj.opacityTime);
	}
	if(d.getElementById("pd_"+id+"_navigator")){
		nvIR_setOpacity("pd_"+id+"_navigator",50);
		setTimeout('document.getElementById("pd_'+id+'_navigator").style.display="none"',nvIRObj.opacityTime);
		setTimeout('nvIR_setOpacity("pd_'+id+'_navigator",0)',nvIRObj.opacityTime);
	}
}
function nvIR_setOpacity(id,opt){
	var d = window.document;
	if(navigator.appVersion.indexOf("Safari") > -1 || navigator.userAgent.indexOf("Opera") > -1)
		d.getElementById(id).style.opacity = (opt/100);
	else if(navigator.userAgent.indexOf('Gecko') != -1)
		d.getElementById(id).style.MozOpacity = (opt/100);
	else if(document.all) {
		d.all(id).style.filter = "alpha(opacity=0)";
		d.all(id).filters.alpha.Opacity = opt;
	}
}
try{
	window.addEventListener("load",function(){nvIR_onload();},false);
}
catch(e){
	window.attachEvent("onload",function(){nvIR_onload();});
}

//addEventSet(window,"load",function(){nvIR_onload();});
//$(document).ready(nvIR_onload);
