function menuFix() {
	menuFix1("nav");
	menuFix1("nav2");
}

function menuFix1(id) {
	var sfEls = document.getElementById(id).getElementsByTagName("li");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseDown=function() {
			this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onMouseUp=function() {
			this.className+=(this.className.length>0? " ": "") + "sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),"");
		}
	}
}

window.onload=menuFix;

function job_open(url)
{
	open_window = window.open (url, "newwindow", "height=480, width=600, top=200, left=80, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes,location=yes, status=yes");
}
function job_open2(url)
{
	open_window2 = window.open (url, "newwindow", "height=480, width=900, top=100, left=50, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no");
	open_window2.focus();
}

/*
* Í¼Æ¬µã»÷ºó±äÊÓÆµ
*/
function pic2video(id,url,w,h){
	//document.getElementById(id).innerHTML = '<object width="' + w + '" height="' + h +'"><param name="movie" value="http://www.youtube.com/v/' + url + '&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/' + url + '&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowfullscreen="true" width="' + w +'" height="' + h +'"></embed></object>';
	document.getElementById(id).innerHTML = '<iframe title="Player" width="' + w + '" height="' + h + '" src="http://www.youtube.com/embed/' + url + '" frameborder="0" scrolling="no"></iframe>';
}

function  div_up_down(id,_top,_left){
	var me=id.charAt?document.getElementById(id):id,
		d1=document.body,
		d2=document.documentElement;
	if(_top>20){
		_top = _top- 20;
	}
	d1.style.height=d2.style.height='100%';me.style.top=_top?_top+'px':0;
	//me.style[(_left>0?'left':'right')]=_left?Math.abs(_left)+'px':0;
	//me.style.position='absolute';
	me.style.position='relative';
	setInterval(function (){me.style.top=parseInt(me.style.top)+(Math.max(d1.scrollTop,d2.scrollTop)+_top-parseInt(me.style.top))*0.1+'px';},10+parseInt(Math.random()*20));
	return arguments.callee;
}
