if (document.layers) document.all = document.layers

appN=navigator.appName.charAt(0)
appV=navigator.appVersion.charAt(0)

IE=(appN=='M') ? true : false
NN=(appN=='N') ? true : false

IE3=(IE && appV>2) ? true : false
NN3=(NN && appV>2) ? true : false

IE4=(IE && appV>3) ? true : false
NN4=(NN && appV>3) ? true : false

IE5=(IE && appV>4) ? true : false
NN5=(NN && appV>4) ? true : false


function init(){}

// cookie

function getCookie(name,begin,end){
	begin = document.cookie.indexOf(name+"=")
	if(begin==-1) return ""
	begin = document.cookie.indexOf("=",begin)+1
	end = document.cookie.indexOf("; ",begin)
	if (end == -1) end = document.cookie.length
	return document.cookie.substring(begin,end)
}

function setCookie (name,content,expires,path,domain){
  if(expires && expires==-1) expires='Thu, 21 Sep 2010 07:59:00 GMT'
  expires = (expires) ? 'expires='+expires+'; ' : ''

  path = (path) ? 'path='+path+'; ' : ''
  domain = (domain) ? ' domain='+domain+'; ' : '';
  document.cookie = name+'='+content+'; '+path+expires+domain
}

// common 

function set_page( name, page ){
	setCookie( '_page_'+name, page )
}

function re_page( name, page ){
	setCookie( '_page_'+name, page )
	location.reload()
}

if( !window.name ) window.name='MAIN'

function openwnd( url, target, param, wnd , default_param){
	default_param = 'toolbar=0,status=1,scrollbars=1,top=20,left=20,screenY=20,screenX=20,resizable=1'
	param = (param) ? ','+param : '';
	param =  default_param + param
	wnd=open( url, target, param )
	wnd.focus()
	return wnd
}

function wfloat () {
	openwnd ('','wfloat','width=200,height=100,scrollbars=no');
}

function selectURL (obj,v) {
	v = obj.options[obj.options.selectedIndex].value
	if (v) document.location = v
		else obj.options.selectedIndex = 0;
}

