﻿	/*============================================================================
	=	Function : bluring()
	=	A, Image Focus bluring
	============================================================================*/

	function bluring(){
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
	} 
	document.onfocusin=bluring; 

	/*============================================================================
	=	Function : request(theName)
	=	Get메소드 쿼리의 theName 필드에 해당하는 값을 반환.
	============================================================================*/

	var getQuery = window.location.search.substr(1, window.location.search.length).split("&");
	var queryInfo = new Array();
	
	for (var i = 0; getQuery[i]; i++)
	{
		queryInfo[getQuery[i].substring(0, (getQuery[i].indexOf("=")))] = getQuery[i].substring((getQuery[i].indexOf("=") + 1), (getQuery[i].length));
	}

	
	function request(theName)
	{
		if (queryInfo[theName])
		{
			return queryInfo[theName]
		}
		else
		{
			return null;
		}
	}

	/*============================================================================
	=	Function : reIntSize(oldInt)
	============================================================================*/
	
	function reIntSize(oldInt)
	{
		if (parseInt(oldInt) < 10)
		{
			return ("0" + parseInt(oldInt));
		}
		else
		{
			return parseInt(oldInt);
		}
	}

	/*============================================================================
	=	Function : lenInput(obj, max)
	=	ojb Input객체에 문자 입력시 max자리를 넘었는지 확인 넘으면 경고메세지 반환.
	============================================================================*/
		
	function lenInput(obj, max)
	{
		var lenObj = 0;
		
		for (var i = 0; i < obj.value.length; i++)
		{
			if (obj.value.charCodeAt(i) > 128)
			{
				lenObj += 2;
			}
			else
			{
				lenObj += 1;
			}
			
			if (lenObj > max)
			{
				alert("본 항목은 한글 " + parseInt(max / 2) + "자 / 영문 " + max + "자 이상은 입력되지 않습니다.");
				obj.value = obj.value.substr(0,i);
			}
		}
	}

	/*============================================================================
	=	Function : toURL(theStr)
	=	theStr를 URL형식으로 변환하여 반환.
	============================================================================*/
	
	function toURL(theStr)
	{
		if ((theStr.substr(0,7) != "http://") && (theStr.substr(0,6) != "ftp://") && (theStr.substr(0,6) != "mms://") && (theStr.substr(0,2) != "\\\\"))
		{
			theStr = "http://" + theStr;
		}
		
		return theStr;
	}

	/*============================================================================
	=	Function : isMail(theStr)
	=	theStr가 메일형식인지 검사하여 Boolean값 반환.
	============================================================================*/
	
	function isMail(theStr)
	{
		var intA = 0;
		var intDot = 0;
		var allowChar = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
		var intAllow = 0;
	
		for (var i = 1; i < theStr.length - 1; i++)	//적어도 첫 글자와 마지막 글자에 "@"나 "."는 올 수 없다.
		{
			if (theStr.substr(i, 1) == "@")
			{
				intA++;
				
				if (theStr.substr(i + 1, 1) != "@")
				{
					i++;
				}
				
				continue;
			}
			
			if (intA == 1 && theStr.substr(i, 1) == ".")
			{
				if (theStr.substr(i + 1, 1) == ".")
				{
					return false;
				}
				
				intDot++;
			}
		}
		
		for (var i = 0; i < theStr.length; i++)
		{
			if (allowChar.indexOf(theStr.substr(i, 1)) != -1)
			{
				intAllow++;
			}
		}
		
		if (intA != 1 || (intDot == 0 || intDot > 2) || intAllow != (theStr.length - (intA + intDot)))
		{
			return false;
		}
		else
		{
			return true;
		}
	}

	/*============================================================================
	=	Function : isInt(target, start, end)
	=	target이 start부터 end 사이의 숫자인지 검사하여 Boolean값 반환.
	============================================================================*/
		
	function isInt(target, start, end)
	{
		var allowchar = "0123456789"
		
		for (var i = 0; i < target.length; i++)
		{
			if (i == 0 && target.substr(i,1) == "-")
			{
				continue;
			}
			
			if (allowchar.indexOf(target.substr(i,1)) == -1)
			{
				return false;
			}
		}
		
		if (start)
		{
			if (parseInt(target) < parseInt(start))
			{
				return false;
			}
		}
		
		if (end)
		{
			if (parseInt(target) > parseInt(end))
			{
				return false;
			}
		}
		
		return true;
	}

	/*============================================================================
	=	Function : isResID(resid1, resid2)
	=	resid1/resid2가 주민등록번호 앞/뒤자리이지 검사하여 Boolean형 반환.
	============================================================================*/
		
	function isResID(resid1, resid2)
	{
		if ((!resid1) || (!resid2))
		{
			return false;
		}
		
		if ((!isInt(resid1)) || (!isInt(resid2, 1000000, 3000000)))
		{
			return false;
		}
		
		if (resid1.length != 6 || resid2.length != 7)
		{
			return false;
		}
		
		var year = parseFloat(resid1.substring(0, 2));
		var mon = parseFloat(resid1.substring(2, 4));
		var day = parseFloat(resid1.substring(4, 6));
		
		if (day < 1)
		{
			return false;
		}
		
		switch(mon)
		{
			case 1: case 3: case 5: case 7: case 8: case 10: case 12:
				if (day > 31)
				{
					return false;
				}
				break;
				
			case 4: case 6: case 9: case 11:
				if (day > 30)
				{
					return false;
				}
				break;
				
			case 2:
				if ((year % 4 == 0 && day > 29) || (year % 4 != 0 && day > 28))
				{
					return false;
				}
				break;
				
			default:
				return false;
		}
		
		var idArray = new Array(13);
		var sum = 0
		var mod;
		
		idArray[0] = parseInt(resid1.substring(0, 1)) * 2;
		idArray[1] = parseInt(resid1.substring(1, 2)) * 3;
		idArray[2] = parseInt(resid1.substring(2, 3)) * 4;
		idArray[3] = parseInt(resid1.substring(3, 4)) * 5;
		idArray[4] = parseInt(resid1.substring(4, 5)) * 6;
		idArray[5] = parseInt(resid1.substring(5, 6)) * 7;
		idArray[6] = parseInt(resid2.substring(0, 1)) * 8;
		idArray[7] = parseInt(resid2.substring(1, 2)) * 9;
		idArray[8] = parseInt(resid2.substring(2, 3)) * 2;
		idArray[9] = parseInt(resid2.substring(3, 4)) * 3;
		idArray[10] = parseInt(resid2.substring(4, 5)) * 4;
		idArray[11] = parseInt(resid2.substring(5, 6)) * 5;
		idArray[12] = parseInt(resid2.substring(6, 7));
		
		for (var i = 0; i < 12; i++)
		{
			sum += idArray[i];
		}
		
		mod = sum % 11;
		
		if (mod == 0)
		{
			mod = 1;
		}
		else if (mod == 1)
		{
			mod = 0;
		}
		else
		{
			mod = 11 - mod;
		}
		
		if (mod != idArray[12])
		{
			return false;
		}
		
		return true;
	}	
	
	/*============================================================================
	=	Function : isIDPwd(str, min_size, max_size)
	=	strType값이 알파벳, 숫자, -, _ 로 구성된 문자열인지 검사하고,
	=	minSize이상 maxSize이하 크기의 문자열인지 검사하여 Boolean형 반환.
	============================================================================*/
	
	function isIDPwd(str, min_size, max_size)
	{
		var chr = "abcdefghijklmnopqrstuvwxyz0123456789-_";
		
		if (!str)
		{
			return false;
		}
		
		if (str.length < min_size || str.length > max_size)
		{
			return false;
		}
		
		for (var i = 0; i < str.length; i++)
		{
			if (chr.indexOf(str.substring(i, i + 1).toLowerCase()) == -1)
			{
				return false;
			}
		}
		
		return true;
	}


	/*============================================================================
	title : mEmbed v1.1
	contents : IE패치로 인한 embed 태그를 js로 출력한다.
	이 소스가 들어가는 JS파일은 반드시 src로 외부에서 호출되어야하고
	<script>mEmbed("src=source.swf","width=100","height=100", "wmode=Tranpsarent");</script>
	와 같은 형식으로 플래쉬 태그를 대신해서 넣어준다.
	mGET 함수는 두배열을 이용한 키값의 Data 를 가져오는 함수.(mEmbed에 필요)
	ex) srcdata = mGET(key,value,'src'); -> php의 $srcdata = $array['src'];
	============================================================================*/

	function mGET(arrayKey, arrayValue, Value) {
		count = arrayKey.length;
		for(i=0;i<count;i++) {
			if(arrayKey[i]==Value) {
				return arrayValue[i];
				break;
			}
		}
	}

	function mEmbed() {
		var key = new Array();
		var value = new Array();
		var contents;
		var embed_type;
		var error_check=0;
		var i, j;
		var count;
		var data;
		var temp;
		if(mEmbed.arguments.length==1) {
			contents = mEmbed.arguments[0];
		} else {
			for(i=0;i<mEmbed.arguments.length;i++) {
				temp = mEmbed.arguments[i].replace(/"|'/g,"");
				data = temp.split('=');
				key[i] = data[0];
				value[i] = data[1];
				count = data.length;

				for(j=2;j<count;j++) {
					value[i] += '=' + data[j];
				}
			}

			contents='';
			srcdata = mGET(key,value,'src');

			if(/\.(swf)$/.test(srcdata)) {
				embed_type = 1;
			} else if(/\.(mov|avi|wma|wmv)$/.test(srcdata)) {
				embed_type = 2;
			}

			var classid = mGET(key,value,'classid');
			var codebase = mGET(key,value,'codebase');

			if(embed_type==1) {
				classid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
				codebase = 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0';
			} else if(embed_type==2) {
				classid = 'clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95';
				codebase = 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715';
			}

			if(classid && codebase) {
				contents += '<object';
				if(classid) {
					contents += ' classid="' + classid + '"';
				}
				if(codebase) {
					contents += ' codebase="' + codebase + '"';
				}
				count = key.length;
				for(i=0;i<count;i++) {
					if(value[i]!='') {
						if(key[i]!='src') {
							contents += ' ' + key[i] + '="' + value[i] + '"';
						}
					}
				}
				contents += '>';
				for(i=0;i<count;i++) {
					if(value[i]!='') {
						if(embed_type==1 && key[i]=='src') {
							contents += '<param name="movie" value="' + value[i] + '" />';
						} else {
							contents += '<param name="' + key[i] + '" value="' + value[i] + '" />';
						}
					}
				}
			}
			count = key.length;
			contents += '<embed';
			for(i=0;i<count;i++) {
				if(value[i]!='') {
					contents += ' ' + key[i] + '="' + value[i] + '"';
				}
			}
			contents += '>';
			contents += '</embed>';
			if(classid && codebase) {
				contents += '</object>';
			}
		}
		document.write(contents);
	}

	/*============================================================================
	=	Function : 
	=	Banner Scrolling(QuickMenu)
	============================================================================*/

	var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
	var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");

	var bodyscrollTop = 0;
	function scrollCursorHandler (evt) {
	if (document.compatMode && document.compatMode != 'BackCompat') {
	bodyscrollTop = document.documentElement.scrollTop;
	}
	else {
	bodyscrollTop = document.body.scrollTop;
	}
	}
	window.onload = window.onscroll = scrollCursorHandler;
	function CheckUIElements()
	{
			var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
			if ( bNetscape4plus ) { 
					yMenuFrom   = document["quickmenu"].top;
					yMenuTo     = top.pageYOffset + 234; 
			}
			else if ( bExplorer4plus ) {
					yMenuFrom   = parseInt (quickmenu.style.top, 10);
					yMenuTo     = bodyscrollTop + 234;
			}
			timeoutNextCheck = 500;
			if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
					setTimeout ("CheckUIElements()", timeoutNextCheck);
					return;
			}        if ( yButtonFrom != yButtonTo ) {
					yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
					if ( yButtonTo < yButtonFrom )
							yOffset = -yOffset;
					if ( bNetscape4plus )
							document["divLinkButton"].top += yOffset;
					else if ( bExplorer4plus )
							divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;
					timeoutNextCheck = 10;
			}
			if ( yMenuFrom != yMenuTo ) {
					yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
					if ( yMenuTo < yMenuFrom )
							yOffset = -yOffset;
					if ( bNetscape4plus )
							document["quickmenu"].top += yOffset;
					else if ( bExplorer4plus )
							quickmenu.style.top = parseInt (quickmenu.style.top, 10) + yOffset;
					timeoutNextCheck = 10;
			}
			setTimeout ("CheckUIElements()", timeoutNextCheck);
	}
	function OnLoad()
	{
			var y;

			if ( top.frames.length )

			if ( bNetscape4plus ) {
					document["quickmenu"].top = top.pageYOffset + 234;
					document["quickmenu"].visibility = "visible";
			}
			else if ( bExplorer4plus ) {
					quickmenu.style.top = bodyscrollTop + 234;
					quickmenu.style.visibility = "visible";
			}
			CheckUIElements();
			return true;
	}

	/*============================================================================
	=	Function : 
	=	Cols Scroll
	============================================================================*/

	var scrollerwidth=86;		// 스크롤러의 가로 
	var html,total_area=0,wait_flag=true;

	var bMouseOver = 1;
	var scrollspeed = 1;		// Scrolling 속도         
	var waitingtime = 1000;		// 멈추는 시간
	var s_tmp = 0, s_amount = 86;
	var scroll_content=new Array();
	var startPanel=0, n_panel=0, i=0;		

	function startscroll() 
	{ // 스크롤 시작
		i=0;
		for (i in scroll_content)
			n_panel++;
			
		n_panel = n_panel -1 ;

		startPanel = Math.round(Math.random()*n_panel);
		if(startPanel == 0)
		{
			i=0;
			for (i in scroll_content) 
				insert_area(total_area, total_area++); // area 삽입
		}
		else if(startPanel == n_panel)
		{
			insert_area(startPanel, total_area);
			total_area++;
			for (i=0; i<startPanel; i++) 
			{
				insert_area(i, total_area); // area 삽입
				total_area++;
			}
		}
		else if((startPanel > 0) || (startPanel < n_panel))
		{
			insert_area(startPanel, total_area);
			total_area++;
			for (i=startPanel+1; i<=n_panel; i++) 
			{
				insert_area(i, total_area); // area 삽입
				total_area++;
			}
			for (i=0; i<startPanel; i++) 
			{
				insert_area(i, total_area); // area 삽입
				total_area++;
			}
		}
		window.setTimeout("scrolling()",waitingtime);
	}

	function scrolling(){ // 실제로 스크롤 하는 부분
		if (bMouseOver && wait_flag)
		{
			for (i=0;i<total_area;i++){
				tmp = document.getElementById('scroll_area'+i).style;
				tmp.left = parseInt(tmp.left)-scrollspeed;

				if (parseInt(tmp.left) <= -scrollerwidth){
					tmp.left = scrollerwidth*(total_area-1);
				}
				if (s_tmp++ > (s_amount-1)*scroll_content.length){
					wait_flag=false;
					window.setTimeout("wait_flag=true;s_tmp=0;",waitingtime);
				}
			}
		}
		window.setTimeout("scrolling()",1);
	}

	function insert_area(idx, n){ // area 삽입
		html='<div style= "top:0px; width: 86; position: absolute; left: '+(scrollerwidth*n)+'px"; id="scroll_area'+n+'">';
		html+=scroll_content[idx]+'\n';
		html+='</div>\n';
		document.write(html);
	}

	/*============================================================================
	=	Function : 
	=	Rows Scroll
	============================================================================*/

	function NvScroll() {
		this.version = "0.2";
		this.name = "NvScroll";
		this.divId = "list";
		this.item = new Array();
		this.itemcount = 0;
		this.currentspeed = 0;
		this.scrollspeed = 50;
		this.pausedelay = 1000;
		this.pausemouseover = false;
		this.stop = false;
		this.height = 100;
		this.width = 100;
		this.stopHeight=0;
		this.i=0;
		this.reloadData = 0;

		this.add = function () {
			var text = arguments[0];
			this.item[this.itemcount] = text;
			this.itemcount = this.itemcount + 1;
		};

		this.start = function () {
			if ( this.itemcount == 1 ) {
				this.add(this.item[0]);
			}
			this.display();
			this.currentspeed = this.scrollspeed;
			this.stop = true;
			setTimeout(this.name+'.scroll()',this.currentspeed);
			window.setTimeout(this.name+".stop = false", this.pausedelay);
		};
		
		this.display = function () {
			var htmlCode;
			htmlCode = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:display; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">';
			for(var i = 0; i < this.itemcount; i++) {
				htmlCode += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
				htmlCode += this.item[i];
				htmlCode += '</div>';
			}
			htmlCode += '</div>';

			document.getElementById(this.divId).innerHTML=htmlCode;  
		};
		
		this.scroll = function () {
			if ( this.pause == true ) {
				window.setTimeout(this.name+".scroll()",this.pausedelay);
				this.pause = false;
			} else {
				this.currentspeed = this.scrollspeed;
				if ( !this.stop ) {
					for (var i = 0; i < this.itemcount; i++) {
						obj = document.getElementById(this.name+'item'+i).style;
						obj.top = parseInt(obj.top) - 1;
						if ( parseInt(obj.top) <= this.height * (-1) ) obj.top = this.height * (this.itemcount-1);
						if ( parseInt(obj.top) == 0 ) {
							this.currentspeed = this.pausedelay;
							this.i = i;
						}
					}
				}
				if( !this.stop && i == this.itemcount && parseInt(obj.top) == 0 && this.reloadData == 1 ) {
					this.reloadData = 0;
				}
				else {
					window.setTimeout(this.name+".scroll()",this.currentspeed);
				}
			}
		};
		
		this.rolling = function () {
			if ( this.stop == false  ) {
				this.next();
			}
			window.setTimeout(this.name+".rolling()",this.scrollspeed);
		}
		
		this.onmouseover = function () {
			//if( this.i < 5 ) msg('msg_01');
			//else msg('msg_02');
			if ( this.pausemouseover ) {
				this.stop = true;
			}
			for( var i = 0; i < 10; ++i ) {
				var ii = i + 1;
				if( ii < 10 ) ii = "r0" + ii;
				else ii = "r" + ii;
				var itemObj = document.getElementById(ii);
				if( itemObj ) {
					if( i == this.i ) itemObj.style.fontWeight='bold';
					else itemObj.style.fontWeight='normal';
				}
			}
		};
		
		this.onmouseout = function () {
			if ( this.pausemouseover ) {
				this.stop = false;
			}
		};
		
		this.next = function() {
		
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					width = this.width + parseInt(obj.left);
					break;
				}
			}
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = this.width * (this.itemcount-1);
				} else {
					obj.left = parseInt(obj.left) - width;
				}
			}
		
		}
		
		this.prev = function() {
		
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					width = parseInt(obj.left) * (-1);
					break;
				}
			}
			if ( width == 0 ) {
				total_width = this.width * (this.itemcount-1);
				for (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( parseInt(obj.left) + 1 > total_width ) { 
						obj.left = 0;
					} else {
						obj.left = parseInt(obj.left) + this.width;
					}
				}
			} else {
				for (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( parseInt(obj.left) < 1 ) { 
						obj.left = 0;
					} else {
						obj.left = parseInt(obj.left) + width;
					}
				}
			}
		}
		
		this.unext = function () {
			this.onmouseover();
			this.next();
			window.setTimeout(this.name+".onmouseout()",this.pausedelay);
		}
		
		this.uprev = function () {
			this.onmouseover();
			this.prev();
			window.setTimeout(this.name+".onmouseout()",this.pausedelay);
		}
	}

	function NvScroll1() {
		this.version = "0.2";
		this.name = "NvScroll1";
		this.divId = "list1";
		this.item = new Array();
		this.itemcount = 0;
		this.currentspeed = 0;
		this.scrollspeed = 50;
		this.pausedelay = 1000;
		this.pausemouseover = false;
		this.stop = false;
		this.height = 100;
		this.width = 100;
		this.stopHeight=0;
		this.i=0;
		this.reloadData = 0;

		this.add = function () {
			var text = arguments[0];
			this.item[this.itemcount] = text;
			this.itemcount = this.itemcount + 1;
		};

		this.start = function () {
			if ( this.itemcount == 1 ) {
				this.add(this.item[0]);
			}
			this.display();
			this.currentspeed = this.scrollspeed;
			this.stop = true;
			setTimeout(this.name+'.scroll()',this.currentspeed);
			window.setTimeout(this.name+".stop = false", this.pausedelay);
		};
		
		this.display = function () {
			var htmlCode;
			htmlCode = '<div id="'+this.name+'" style="height:'+this.height+'; width:'+this.width+'; position:relative; overflow:display; " OnMouseOver="'+this.name+'.onmouseover(); " OnMouseOut="'+this.name+'.onmouseout(); ">';
			for(var i = 0; i < this.itemcount; i++) {
				htmlCode += '<div id="'+this.name+'item'+i+'"style="left:0px; width:'+this.width+'; position:absolute; top:'+(this.height*i)+'px; ">';
				htmlCode += this.item[i];
				htmlCode += '</div>';
			}
			htmlCode += '</div>';

			document.getElementById(this.divId).innerHTML=htmlCode;  
		};
		
		this.scroll = function () {
			if ( this.pause == true ) {
				window.setTimeout(this.name+".scroll()",this.pausedelay);
				this.pause = false;
			} else {
				this.currentspeed = this.scrollspeed;
				if ( !this.stop ) {
					for (var i = 0; i < this.itemcount; i++) {
						obj = document.getElementById(this.name+'item'+i).style;
						obj.top = parseInt(obj.top) - 1;
						if ( parseInt(obj.top) <= this.height * (-1) ) obj.top = this.height * (this.itemcount-1);
						if ( parseInt(obj.top) == 0 ) {
							this.currentspeed = this.pausedelay;
							this.i = i;
						}
					}
				}
				if( !this.stop && i == this.itemcount && parseInt(obj.top) == 0 && this.reloadData == 1 ) {
					this.reloadData = 0;
				}
				else {
					window.setTimeout(this.name+".scroll()",this.currentspeed);
				}
			}
		};
		
		this.rolling = function () {
			if ( this.stop == false  ) {
				this.next();
			}
			window.setTimeout(this.name+".rolling()",this.scrollspeed);
		}
		
		this.onmouseover = function () {
			//if( this.i < 5 ) msg('msg_01');
			//else msg('msg_02');
			if ( this.pausemouseover ) {
				this.stop = true;
			}
			for( var i = 0; i < 10; ++i ) {
				var ii = i + 1;
				if( ii < 10 ) ii = "r0" + ii;
				else ii = "r" + ii;
				var itemObj = document.getElementById(ii);
				if( itemObj ) {
					if( i == this.i ) itemObj.style.fontWeight='bold';
					else itemObj.style.fontWeight='normal';
				}
			}
		};
		
		this.onmouseout = function () {
			if ( this.pausemouseover ) {
				this.stop = false;
			}
		};
		
		this.next = function() {
		
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					width = this.width + parseInt(obj.left);
					break;
				}
			}
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					obj.left = this.width * (this.itemcount-1);
				} else {
					obj.left = parseInt(obj.left) - width;
				}
			}
		
		}
		
		this.prev = function() {
		
			for (i = 0; i < this.itemcount; i++) {
				obj = document.getElementById(this.name+'item'+i).style;
				if ( parseInt(obj.left) < 1 ) { 
					width = parseInt(obj.left) * (-1);
					break;
				}
			}
			if ( width == 0 ) {
				total_width = this.width * (this.itemcount-1);
				for (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( parseInt(obj.left) + 1 > total_width ) { 
						obj.left = 0;
					} else {
						obj.left = parseInt(obj.left) + this.width;
					}
				}
			} else {
				for (i = 0; i < this.itemcount; i++) {
					obj = document.getElementById(this.name+'item'+i).style;
					if ( parseInt(obj.left) < 1 ) { 
						obj.left = 0;
					} else {
						obj.left = parseInt(obj.left) + width;
					}
				}
			}
		}
		
		this.unext = function () {
			this.onmouseover();
			this.next();
			window.setTimeout(this.name+".onmouseout()",this.pausedelay);
		}
		
		this.uprev = function () {
			this.onmouseover();
			this.prev();
			window.setTimeout(this.name+".onmouseout()",this.pausedelay);
		}
	}
