function LinkSelect(form, sel)
{
adrs = sel.options[sel.selectedIndex].value;
if (adrs != "-" ) location.href = adrs;
}

function init() {
	sSheet = document.styleSheets[document.styleSheets.length-1];
	if ( document.defaultView.getComputedStyle(document.body,"").getPropertyValue("font-size") == "14px" ){
		sSheet.insertRule("body {font-size: 16px}",sSheet.cssRules.length);
	}
}

if ( document.defaultView && document.styleSheets ) window.onload = init;


function newWindow(url) {
window.open(url,"chiiki","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes,width=380,height=300");
}
function newWindow2(url) {
window.open(url,"chiiki","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=no,width=480,height=287");
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/* */
// JavaScript Document
//scrollbar_act

var Mac = navigator.appVersion.indexOf('Mac',0) != -1;
var Win = navigator.appVersion.indexOf('Win',0) != -1;
var IE  = navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1;
var NN  = navigator.appName.indexOf("Netscape",0) != -1;
var Moz = navigator.userAgent.indexOf("Gecko") != -1;


function setObj(id) {
 if (document.all) {
  return document.all(id);
 } else if (document.getElementById) {
  return document.getElementById(id);
 } else if (document.layers) {
  return document.layers[id];
 }
 return false;
}

function getScrollL() {
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollLeft;
 } else if (window.pageXOffset) {
  return window.pageXOffset;
 } else {
  return 0;
 }
}

function getScrollT() {
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollTop;
 } else if (window.pageYOffset) {
  return window.pageYOffset;
 } else {
  return 0;
 }
}

function getScrollW() {
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollWidth;
 } else if (window.innerWidth) {
  return window.innerWidth;
 }
 return 0;
}

function getScrollH() {
 if ((navigator.appName.indexOf("Microsoft Internet Explorer",0) != -1)) {
  return document.body.scrollHeight;
 } else if (window.innerHeight) {
  return window.innerHeight;
 }
 return 0;
}

var pScrollTime;
function pScroll(nextX,nextY,frms,curX,curY) {
 if (pScrollTime) clearTimeout(pScrollTime);
 if (!nextX || nextX < 0) nextX = 0;
 if (!nextY || nextY < 0) nextY = 0;
 if (!curX) curX = 0 + getScrollL();
 if (!curY) curY = 0 + getScrollT();
 if (!frms) frms = 6;

 if (nextY > curY && nextY > (getAnchorPosObj('end','enddiv').y) - getInnerSize().height) nextY = (getAnchorPosObj('end','enddiv').y - getInnerSize().height) + 1;
 curX += (nextX - getScrollL()) / frms; if (curX < 0) curX = 0;
 curY += (nextY - getScrollT()) / frms;  if (curY < 0) curY = 0;
 var posX = Math.floor(curX);
 var posY = Math.floor(curY);
 window.scrollTo(posX, posY);

 if (posX != nextX || posY != nextY) {
  pScrollTime = setTimeout("pScroll("+nextX+","+nextY+","+frms+","+curX+","+curY+")",16);
 }
}

function jumpToPageTop() {
  pScroll(0,0,5);
}

function getInnerSize() {
 var obj = new Object();

 if (document.all || (document.getElementById && IE)) {
  obj.width = document.body.clientWidth;
  obj.height = document.body.clientHeight;
 } else if (document.layers || (document.getElementById && Moz)) {
  obj.width = window.innerWidth;
  obj.height = window.innerHeight;
 }

 return obj;
}

function getAnchorPosObj(elementname, elementid) {
 var obj = setObj(elementname);
 var objnew = new Object();
 var objtmp;

 if (document.getElementById && IE) {
  objtmp = obj;
  objnew.x = objtmp.offsetLeft;
  objnew.y = objtmp.offsetTop;
  while ((objtmp = objtmp.offsetParent) != null) {
   objnew.x += objtmp.offsetLeft;
   objnew.y += objtmp.offsetTop;
  }
 } else if (document.getElementById && Moz) {
  objnew.x = document.getElementsByTagName("DIV").namedItem(elementid).offsetLeft;
  objnew.y = document.getElementsByTagName("DIV").namedItem(elementid).offsetTop;
 } else if (document.all) {
  objtmp = obj;
  objnew.x = objtmp.offsetLeft;
  objnew.y = objtmp.offsetTop;
  while ((objtmp = objtmp.offsetParent) != null) {
   objnew.x += objtmp.offsetLeft;
   objnew.y += objtmp.offsetTop;
  }
 } else if (document.layers) {
  objnew.x = document.anchors[elementname].x;
  objnew.y = document.anchors[elementname].y;
 } else {
  objnew.x = 0;
  objnew.y = 0;
 }
 return objnew;
}

function jumpToAnchor(elementname, elementid) {
 if (getAnchorPosObj(elementname, elementid).x != 0 || getAnchorPosObj(elementname, elementid).y != 0) {
  pScroll(0,getAnchorPosObj(elementname, elementid).y,5);
 } else {
  location.hash = elementname;
 }
}

function jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
