﻿/* namespace nazono */ if( typeof(nazono)!='object' ) nazono={}; with(nazono) {

/**
  @fileoverview
   クロスブラウザの基本関数群
  @feature
    - なるべく名前空間を汚さないように作っています
    - x と y を持つ Point クラスを定義し、縦横を一度に取得/設定します。
  @timestamp Last Modified: Fri, 03 Jun 2005 20:05:05 +0900
  @updates
    2005/05/23:
     - nazono.manualexport が false の時は export しないように

  @auther  nazoking <nazoiking@gmail.com>
 */
/* *********************************************************************** */


/** @ignore */
if( !nazono.xdom ) { nazono.xdom={};
/**
  コンストラクタではない。
  
  通常の関数として使用すると {@link xdom#defaultFunc} で設定されている関数として使える
  @see #defaultFunc
  @class
  DOM 操作系ライブラリ。
 
  位置を取得する機能の多くは {@link Point} クラスにより縦横を同時に取得する
  @version 0.1.2
  @updates
   2005/05/28:
    - IE5 対応
   2005/05/22 :
    - #getSize で offsetHeight を返すように
    - #seHeight, #setWidth, #setSize 追加
   2005/05/20 :
    - #eventStop で preventDefault を呼ぶように。
    - #eventAtDom2 で preventDefault を定義
    - #eventAttach で attachEvent 時(IE)、引数に window.event をつけるように
 */
xdom= function(){ return xdom.defaultFunc.apply( xdom, arguments ); };
}
/**
  ID からエレメントを返す
 
  引数としてエレメントを与えたときはそのまま返す。
  @param {string} id  エレメントのID。これがobjectの場合はそのまま返す
  @param {HTMLElement} element  エレメントを探す範囲。未指定の場合は window.document
  @return {HTMLElement}
  @browsers
   - Microsoft Internet Explore 5 for Windows
   - Microsoft Internet Explore 6 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.get=function(id,element){
  if( void(0)==element ) element=window.document;
  if( typeof(id)=='object' ) return id;
  if( element.getElementById ) return element.getElementById(id);
  if( element.all ) return element.all(id);
  if( document.layers ) return document.layers[id];
  throw "unsupport browser";
}

/**
  指定したスタイルシート・クラス名を持つエレメントを探す。
  
  スペース区切りで複数のクラスが設定されているものも可能。
  結果は見つけたエレメントの配列。
  @param {strting} c   探すクラス名。
             Function が渡された場合、c( className ) が true を返すものを探す
  @param {HTMLElement} element  親エレメントのID 　指定されない場合は window.document 
                    配列の場合は、その配列を HTMLElementの配列と見なして、それらの内から探す
  @param {int} max        探す最大数。0や未指定の場合は最後まで探す
  @return {Array}
  @browsers
   - Microsoft Internet Explore 6 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getsByClass = function(c,element,max){
  if( void(0)==element ) element=window.document;
  else if( typeof(element) != 'object' ) element=xdom.get(element) || window.document;
  if( typeof( c )!='function' ){
    var rep = new RegExp('(^| )'+c+'( |$)');
    c=function(c){ return rep.test(c); };
  }
  if( element.constructor != Array )
    element = element.getElementsByTagName ? element.getElementsByTagName('*') : element.all;
  var finded = new Array();
  for (var i = 0; i < element.length; i++){
    if( c( element[i].className ) ){
      finded.push(element[i]);
      if( max && finded.length < max ) break;
    }
  }
  return finded;
}

/**
  エレメントの右上位置を Point オブジェクトで返す
  @param {HTMLElement} element  エレメント
  @return {Point}
  @requires xdom#get, Point
  @browsers
  - Microsoft Internet Explore 6 for Windows
  - Firefox 1.0 for Windows
  - Opera 7.54u2 for Windows
 */
xdom.getPoint = function( element ){
  element = xdom.get(element);
  if( void(0) != element.offsetLeft ){ // op7+ ff1 ie5+
    var p = new Point(element.offsetLeft, element.offsetTop);
    while ( element = element.offsetParent )
      p.add( element.offsetLeft, element.offsetTop );
    if( isbrowser.ie5mac() ) p.add( document.body.leftMargin, document.body.topMargin );
    return p;
  }
  if( element.style && void(0) != element.style.pixelLeft ){ // ie4 op6
    return new Point(element.style.pixelLeft,element.style.pixelTop);
  }
  if( element.style && void(0) != element.style.left && element.style.left != '' )
    return new Point(element.style.left, element.style.top);
  if( void(0) != element.left ) return new Point( element.left, element.top ); // nn4
}

/**
  エレメントの表示場所移動( position:absolute 時のみ )
  @param {HTMLElement} element
  @param {Point} p
  @requires xdom#get, Point
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
  @version 0.1.1
  @updates
   0.1.1 : 位置の引数を num,num などでも受け取れるようにした
 */
xdom.setPoint=function( element, p ){
  element = xdom.get(element);
  p=new Point( arguments[1],arguments[2] );
  if( document.getElementById ) with(element.style){left=p.x+"px";top=p.y+"px"; }  //e5,e6,n6,m1,o6
  else if(element.style&& void(0)!=element.style.pixelLeft) with(element.style){ pixelLeft=p.x; pixelTop=p.y; } //e4用
}
if( document.layers ){
  xdom.setPoint=function( element, p ){
    element.moveTo(p.x,p.y); //n4用
  }
}


/**
 get offset size
 @browsers
  - Microsoft Internet Explore 6.0 for Windows
  - Firefox 1.0 for Windows
  - Opera 7.54u2 for Windows
 */
xdom.getSize=function ( element ){
  element = xdom.get(element);
  if( void(0) != element.offsetWidth ) // ie6, ff1 op1
    return new Point( element.offsetWidth , element.offsetHeight );
  if( element.ownerDocument && element.ownerDocument.defaultView && element.ownerDocument.defaultView.getComputedStyle ){
    var style = element.ownerDocument.defaultView.getComputedStyle(element,null);
    return new Point( style.getPropertyValue('width'), style.getPropertyValue('height') );
  }
  if( void(0) != element.currentStyle) return new Point( element.currentStyle.width , element.currentStyle.height );
  if( element.style ){
    if( void(0) != element.style.pixelHeight ) return new Point( element.style.pixelWidth , element.style.pixelHeight );
    return new Point( element.style.width , element.style.height );
  }
}
/**
 set offset size
 @browsers
  - Microsoft Internet Explore 5.0 SP2 for Windows
  - Microsoft Internet Explore 6.0 for Windows
  - Firefox 1.0 for Windows
  - Opera 7.54u2 for Windows
 */
xdom.setSize=function ( element, x, y ){
  if( typeof(x)=='object'){
    var p = new Point( arguments[1], arguments[2] );
    w = p.x; h=p.y;
  }
  if( void(0) != w ) xdom.setWidth( element,w );
  if( void(0) != h ) xdom.setHeight( element,h );
}

/**
 set offset height ( with border and padding height )
 @browsers
  - Microsoft Internet Explore 5.0 SP2 for Windows
  - Microsoft Internet Explore 6.0 for Windows
  - Firefox 1.0 for Windows
  - Opera 7.54u2 for Windows
 */
xdom.setHeight=function( element, h ){
  if( void(0) != element.offsetHeight ){
    return element.style.height = h + (  Point.parseInt(element.style.height) - element.offsetHeight );
  }
}

/**
 set offset width ( with border and padding width )
 @browsers
  - Microsoft Internet Explore 5.0 SP2 for Windows
  - Microsoft Internet Explore 6.0 for Windows
  - Firefox 1.0 for Windows
  - Opera 7.54u2 for Windows
 */
xdom.setWidth=function( element, w ){
  if( void(0) != element.offsetWidth && '' != element.style.width ){
    return element.style.width = w + ( Point.parseInt(element.style.width) - element.offsetWidth );
  }
  if( void(0) != element.style.pixelWidth ){ // ie5
    return element.style.pixelWidth = Math.max( w,2 );
  }
}

/**
  event からマウスの位置を帰す
  @return {Point}
  @requires Point
  @browsers
   - Microsoft Internet Explore 5.0 SP2 for Windows
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getMousePoint=function(event){
  if( void(0)!= event.pageX ) return new Point( event.pageX, event.pageY ); // nn4 moz1 nn6
  if( void(0)!= document.body.scrollLeft && void(0)!= event.clientX )
    return new Point(document.body.scrollLeft+event.clientX,
                     document.body.scrollTop +event.clientY ); // ie4
  if( void(0)!= event.clientX ) return new Point( event.clientX, event.clientY ); // o6
}

/**
  ウィンドウ w の内部サイズを Point オブジェクトで返す
  w (window)は省略可能
  @return {Point}
  @requires Point
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.windowSize=function( w ){
  if( !w ) w=window;
  if( void(0)!= w.innerWidth ) return new Point( w.innerWidth, w.innerHeight );
  if(w.document.body && typeof(w.document.body.clientWidth) == 'number')
    return new Point( w.document.body.clientWidth, w.document.body.clientHeight ); // ie
  return void(0);
}

/**
  ページの表示開始位置を Point オブジェクトで返す
  @requires Point
  @return {Point}
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getPageScrollOffset = function(w){
  if (!w)w = window; 
  if (typeof(w.pageXOffset) == 'number') return new Point( w.pageXOffset,w.pageYOffset );
  if (w.document.body && typeof(w.document.body.scrollLeft) == 'number')
    return new Point( w.document.body.scrollLeft, w.document.body.scrollTop );
  return undefined;
}


/**
  このフレームのウィンドウは親フレームで言うところのどれ？
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getIFrameByWindow = function(win){
  var iframes = document.getElementsByTagName("IFRAME");
  for (var i=0; i<iframes.length; i++) {
    var iframe = iframes.item(i);
    var w = null;
    if(iframe.contentWindow) w = iframe.contentWindow; // For IE
    else if( window.frames && window.frames[iframe.id].window ) w = window.frames[iframe.id];
    if (w == win ) return iframe;
  }
  return undefined;
}


/**
  表示して欲しくないものを隠す
 
  ie5,6 のバグで select がどのレイヤよりも最前面に来てしまうので隠す
  @param {HTMLElement} unshownlayer  隠したくないものがあるレイヤ。
                                     未指定の場合は「すべて表示」
  @requires  xdom#get, isbrowser
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.eyesoreElementsHide = function(unshownlayer){
  if( !isbrowser.iewin() ) return;
  var b = xdom.eyesoreElementsHide.changevisiblitys;
  var selects = document.all.tags("select");
  for( var i=0; i<selects.length; i++ ){
    if( !unshownlayer || unshownlayer.contains( selects[i] ) ){
      if( void(0)!=b[selects[i].uniqueID] ){
        selects[i].style.visibility = b[selects[i].uniqueID];
        b[selects[i].uniqueID] = undefined;
      }
    }else{
      if( selects[i].style.visibility!='hidden' ){
        b[selects[i].uniqueID] = selects[i].style.visibility;
        selects[i].style.visibility = 'hidden';
      }
    }
  }
}
xdom.eyesoreElementsHide.changevisiblitys = {}; // 隠したエレメント 

/**
  visibility の変更。
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.setElementVisibility = function(e,value){
  if( value == 'visible' ) return e.style.visibility = 'visible';
  if( value == 'hidden' || value == 'hide' || value == 'none') return e.style.visibility = 'hidden';
  return e.style.visibility = '';
}

/**
  visibility の取得。
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getElementVisibility=function (e){
  if(e.style){
    if( e.style.value == 'visible' ) return 'visible';
    if( e.style.value == 'hidden' || e.style.value == 'hide' || e.style.value == 'none') return 'hidden';
    return 'inherit';
  }
}


/**
  透明度の設定
  @param {HTMLElement} elmenet
  @param {Float} op    透明度 0(透明)～1(不透明)
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
 */
xdom.setOpacity=function(element,op){
  if(document.all){
    element.style.filter="alpha(opacity=0)";
    if( void(0)!=element.filters.alpha.Opacity )
      return element.filters.alpha.Opacity  = (op * 100);
  }else if( void(0)!=element.style.MozOpacity )
    return document.getElementById(layName).style.MozOpacity = op;
}

/**
  elementA が elementB の親・祖先のエレメントか？
 
  mozilla で使える contain 
  @param {HTMLElement}  親・祖先であるべきHTMLElement
  @param {HTMLElement}  子・孫であるべきHTMLElement
  @browsers
   - Microsoft Internet Explore 5 for Windows
   - Microsoft Internet Explore 6 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.elementAContainsB=function ( elementA, elementB ){
  if( elementA.contains ) return elementA.contains( elementB );
  var b = elementB;
  while( b.parentNode) if ((b = b.parentNode) == elementA) return true;
  return false;
}


/**
  element の親ドキュメントを返す
  @return {HTMLDocumentElement}
  @browsers
   - Microsoft Internet Explore 5.0 for Windows
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getDocument=function (element){
  return ( void(0)!=element.ownerDocument )? element.ownerDocument : element.document;
}


/**
  element の親ウィンドウを返す
  @return {HTMLWindow}
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.getElementWindow=function (element){
  var document=xdom.getElementDocument(element);
  return ( void(0)!=document.defaultView )? document.defaultView : document.parentWindow;
}


/**
  スタイルシートにルールを追加する。
  追加されたルールオブジェクトを返す。追加できない場合は undefined を返す。
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.addRuleToStyleElement=function ( styleSheetElement, selector, declaration){
  if( styleSheetElement.insertRule ){
    var styleSheetLength = styleSheetElement.length;
    var i = styleSheetElement.insertRule( selector + " { " + declaration + " }", styleSheetElement.length);  
    return styleSheetElement.cssRules.item( i );
  }else if( styleSheetElement.addRule ) {
    styleSheetElement.addRule(selector, declaration );
    return styleSheetElement.rules.item( styleSheetElement.rules.length-1 );
  }
  return undefined;
}
/**
  エレメント e にクラス classname を追加
  @param {HTMLElement} e
  @param {string} classname
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.addClass=function(e,classname){
  e.className +=" "+classname;
}

/**
  エレメント e からクラス classname を削除
  @param {HTMLElement} e
  @param {string} classname
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.delClass=function(e,classname){
  e.className = e.className.replace( new RegExp('(^| +)'+classname+'( |$)','g'),RegExp.$1+'');
}


/**
 イベントのアタッチ

  ie のイベントでも listener の引数は window.event 
  @param {HTMLElement} element
  @param {string} type
  @param {Function} listener
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.eventAttach=function( element, type, listener ){
  if (element.addEventListener) return element.addEventListener( type, listener, false); //dom
  if (element.attachEvent) return element.attachEvent( 'on'+type, function(){ return listener( window.event ) } ); //ie
  listener.oldlistener = ( element['on'+type] )?element['on'+type]:(new Function());
  element['on'+type] = function(e){ if(window.event)e=window.event;return listener(e) && listener.oldlistener(e); };
}

/**
 イベントのアタッチ 2

  detachできる
  @param {HTMLElement} element
  @param {string} type
  @param {Function} listener
  @browsers
   - Microsoft Internet Explore 6.0 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
 */
xdom.eventAttachRaw=function( element, type, listener ){
  if (element.addEventListener) return element.addEventListener( type, listener, false); //dom
  if (element.attachEvent) return element.attachEvent( 'on'+type, listener ); //ie
  listener.oldlistener = ( element['on'+type] )?element['on'+type]:(new Function());
  element['on'+type] = function(e){ if(window.event)e=window.event;return listener(e) && listener.oldlistener(e); };
}

/*
xdom.eventDetach=function( element, type, listener ){
  if( element.removeEventListener ) return element.removeEventListener( type, listener, false); //dom
  if( element.detachEvent ) return element.detachEvent( 'on'+type, function(){ return listener( window.event ) } ); //ie
}
*/

/**
 IE のEventオブジェクトを DOM2風に変換
 @param {Event} Event
 */
xdom.eventAtDom2=function ( event,currentTarget ){
  if( event.target ) return event;
  var e= {
  ieEvent         : event,
  type            : event.type,
  target          : event.srcElement,
  currentTarget   : currentTarget,
  clientX         : event.clientX,
  clientY         : event.clientY,
  pageY           : document.body.scrollTop + event.clientY,
  shiftKey        : event.shiftKey,
  stopPropagation : function() { this.ieEvent.cancelBubble = true },
  preventDefault  : function() { this.ieEvent.returnValue = true }
  };
  if(event.fromElement)e.relatedTarget = event.fromElement;
  else if(event.toElement)e.relatedTarget = event.toElement;
  return e;
}

/**
 stop event and stop bubble
 @param {Event} Event
 */
xdom.eventStop=function( event ){
  if( event.stopPropagation ){
    event.stopPropagation();
    if( event.preventDefault ) event.preventDefault();
  }else{
    event.cancelBubble=true;
    event.returnValue=false;
  }
}





/**
  remove all Child nodes
  @param {HTMLElement} element
 */
xdom.clearChildren=function( element ){
  element = xdom.get(element);
  while( element.latChild ) element.removeChild( element.latChild );
}


/**
  xdom( hogehoge ) で呼ばれる関数を定義
  @type Function
 **/
xdom.defaultFunc=xdom.get;


/* *********************************************************************** */
nazono.Point={};
/**
  いくつかの引数形式に対応
  
  Point( )                => 0,0<br>
  Point( point, ... );    => point.x, point.y;<br>
  Point( [point, ...] )   => point.x, point.y;<br>
  Point( x,y ,... );      => x, y;<br>
  Point( [x,y,...],... ); => x, y;<br>
  Point( 1 )              => 1,1<br>
  @class 
  x と y の構造体
  @constructor 
  @browsers
   - Microsoft Internet Explore 5 for Windows
   - Microsoft Internet Explore 6 for Windows
   - Firefox 1.0 for Windows
   - Opera 7.54u2 for Windows
  @version 0.1
 */
Point = function (){
  if( this.constructor != nazono.Point ) return new Point( arguments[0],arguments[1] );
  this.set( arguments[0],arguments[1] );
}
/**
  @type int
 */
Point.prototype.x = 0;

/**
  @type int
 */
Point.prototype.y = 0;

/**
  パラメータを解析して設定
  @return {Point}
 */
Point.prototype.set=function (){
  if( void(0) == arguments[0] ) return this;
  if( arguments[0].constructor == nazono.Point ){ this.x = arguments[0].x; this.y = arguments[0].y; return this; }
  if( arguments[0].constructor == Array ) return this.set( arguments[0][0], arguments[0][1] );
  if( void(0) == arguments[1] ){ this.x = this.y = Point.parseInt(arguments[0]); return this; }
  this.x = Point.parseInt(arguments[0]); this.y = Point.parseInt(arguments[1]);
  return this;
}
/*
 testcode
c=[" ''+ Point()                   ","'0,1'   "
  ," ''+ Point(10)                 ","'10,10' "
  ," ''+ Point(10,20)              ","'10,20' "
  ," ''+ Point(10,20,30)           ","'10,20' "
  ," ''+ Point([10,20])            ","'10,20' "
  ," ''+ Point([10,20],30)         ","'10,20' "
  ," ''+ Point([10,20,30])         ","'10,20' "
  ," ''+ Point([[10,20],30])       ","'10,20' "
  ," ''+ Point(  Point(10,20) )    ","'10,20' "
  ," ''+ Point(  Point(10,20),30 ) ","'10,20' "
  ," ''+ Point([ Point(10,20),30]) ","'10,20' "
  ];
with(nazono){ for( var i=0; i<c.length; i+=2 ){
  eval( "if("+c[i]+"=="+c[i+1]+'){}else{alert("'+c[i]+'!='+c[i+1]+'")}');
} }
*/

/**
  new Point( this.x + o.x,  this.y + o.y )
  @return {Point}
 */
Point.prototype.add=function (){
  var o = new Point(arguments[0],arguments[1]);
  o.x += this.x; o.y += this.y;
  return o;
}

/**
  new Point( this.x - o.x,  this.y - o.y )
  @return {Point}
 */
Point.prototype.sub=function(){
  var o = new Point(arguments[0],arguments[1]);
  o.x = this.x - o.x; o.y = this.y - o.y;
  return o;
}

/**
 equal x==x && y==y
 @return {Point}
 */
Point.prototype.equal=function(){
  var o = new Point(arguments[0],arguments[1]);
  return o.x==this.x && o.y == this.y;
}

/**
  for debug "x,y"
  @return {string}
 */
Point.prototype.toString=function(){
  return ""+this.x+","+this.y;
}

/**
  NaN にならない parseInt
 
  というか parseInt で NaN の時は 0 を返す
  @return {int}
 */
Point.parseInt=function(n){
  return isNaN(n = parseInt(n))?0:n;
}


/* *********************************************************************** */



nazono.isbrowser={};
/**
  コンストラクタは呼び出さないこと
  @class isbrowser
  @version 0.1
  @constructor
  @class
  いろんなブラウザ判定モジュール
 */
isbrowser = function(){};
/*@cc_on @*/

/**
  Internet Explorer 4+
  @return {bool}
 */
isbrowser.ie= function(){ return /*@if (@_jscript) true  @else @*/ false /*@end @*/; };
/**
  Gecko ( ff1, ns6, ... )
  @return {bool}
 */
isbrowser.gecko= function(){return navigator.userAgent.indexOf('Gecko/')!=-1;};
/**
  AppleWebkit
  @return {bool}
 */
isbrowser.safari= function(){ return navigator.userAgent.indexOf('AppleWebKit')!=-1; };
/**
  Opera
  @return {bool}
 */
isbrowser.opera= function(){ return (window.opera)?true:false; };
/**
  Netscape Navigator 4
  @return {bool}
 */
isbrowser.nn4= function(){ return (document.layers)?true:false; };

// os
/**
  Windows
  @return {bool}
 */
isbrowser.win= function(){ return navigator.userAgent.indexOf("Win")!=-1; };
/**
  Macintosh
  @return {bool}
 */
isbrowser.mac= function(){return navigator.userAgent.indexOf('Mac')!=-1;};
// complex

/**
  Gecko revision 1
  @return {bool}
 */
isbrowser.gecko1= function(){ return isbrowser.gecko() && (navigator.userAgent.indexOf("rv:1.") != -1); };

/**
  Internet Explorer for Windows
  @return {bool}
 */
isbrowser.iewin= function(){ return isbrowser.ie() && isbrowser.win(); };

/**
  Internet Explorer for Macintosh
  @return {bool}
 */
isbrowser.iemac= function(){ return /*@if (@_mac) true  @else @*/ false /*@end @*/; };

/**
  Internet Explorer 5
  @return {bool}
 */
isbrowser.ie5= function(){ return /*@if (@_jscript) (document.getElementById)?true:false  @else @*/ false /*@end @*/; };

/**
  Internet Explorer 5 for Macintosh
  @return {bool}
 */
isbrowser.ie5mac= function(){ return ( isbrowser.mac() && navigator.userAgent.indexOf('MSIE 5')!=-1); };


// feature
/**
  Cookie Enable?
  @return {bool}
 */
isbrowser.cookieEnabled= function(){
  if (void(0)!=navigator.cookieEnabled ) return navigator.cookieEnabled; // ie4+,gecko1+
  if( void(0)== document.cookie ) return false;
  var backup = document.cookie;
  document.cookie="cookieEnabled"
  var ce = (document.cookie.indexOf("cookieEnabled")!=-1)? true : false;
  document.cookie = backup;
  return ce;
}

/* *********************************************************************** */


if (!Array.prototype.push){ // ie5
  Array.prototype.push = function() {
    for (var i = 0; i < arguments.length; i++) this[this.length] = arguments[i];
    return this.length;
  }
}

if (!Function.prototype.apply){ // ie5
  Function.prototype.apply = function(o, p) { 
    var ar = new Array;
    if (p) for (var i = 0; i < p.length; i++) ar.push( 'p['+i+']' );
    var fname = '__apply__';
    var fcnt = 0;
    while( void(0)!=o[fname+fcnt] ) fcnt++; fname += fcnt;
    o[fname] = this;
    var result = eval('o[fname](' + ar.join(',') + ')');
    o[fname] = void(0);
    return result;
  }
}




/* ***** namespace nazono * */ }
//export
if( !nazono.manualexport ){
  isbrowser = nazono.isbrowser;
  xdom = nazono.xdom;
  Point = nazono.Point;
}
