/*
----------------------------------------------------------------
	CreativeDevece JavaScript Library
	core scripts
----------------------------------------------------------------
	version			0.88
	last update		2009/08/12
	author			Yoshihisa Kato/YAH!-cyberstudio
----------------------------------------------------------------
*/

var CD={
	Version:"0.88",
	
	Libs:new Array(
		"alert",
		//"embed",
		"menu",
		"anchorctrl",
		//"extenddiv",
		"cssswitch",
		"settings"
	),

	Load:function(){
		/*define global vars*/
		this.UA=new CD_userAgent.Get();

		var dir=null;
		var scripts=document.getElementsByTagName("script");
		for(var i=0;i<scripts.length;i++){
			if(scripts[i].src.indexOf("/cd.js")!=-1){
				dir=scripts[i].src.replace(/cd\.js/,"");
				break;
			}
		}

		/*attach css*/
		document.write('<link rel="styleSheet" type="text/css" media="screen,print" href="'+dir+'style/cd.css">');

		/*attach image*/
		this.imageDir=dir+'/image/';

		/*
		CD_core.createObject("link",'CDstyleSheet','',document.getElementsByTagName("head")[0]);
		$('CDstyleSheet').setAttribute('rel','stylesheet');
		$('CDstyleSheet').setAttribute('type','text/css');
		$('CDstyleSheet').setAttribute('media','screen,print');
		$('CDstyleSheet').setAttribute('href',dir+'/style/.cd.css');
		*/

		/*attach part of script*/
		for(var i=0;i<this.Libs.length;i++){
			path=dir+'cd_'+this.Libs[i]+'.js';
			document.write('<script language="JavaScript" type="text/javascript" src="'+path+'"></script>');
		}

		CD_core.setEvent(function(){
			CD_core.addEvent(document,'mousemove',function(e){
				CD._mouseX=CD_core._mouseX(e);
				CD._mouseY=CD_core._mouseY(e);
			});
		});
	},

	/*global vars*/

	UA:'',	//userAgent
	imageDir:'',	//directory for images
	_mouseX:0,		//mouse position X at document mousemove;
	_mouseY:0,		//mouse position Y at document mousemove;
	_minDepth:1000,	//use with CD_core.swapDepths
	debugMode:false	//using debug Mode Flag (true or false)
}

var CD_core={

	createObject:function(Tag,ids,classs,targets){
		var obj=document.createElement(Tag);
		obj.setAttribute("id",ids);

		if(!$(ids)){
			if(!targets){
				document.body.appendChild(obj);
			}else{
				targets.appendChild(obj);
			}
		}

		if(classs)$(ids).className=classs;
	},

/* Get object position */

	getPosition:function(obj,adjustX,adjustY,adjustW,adjustH,setPosition){
		this._name=obj.getAttribute('id');

		if(obj.style.left){
			this._x=parseInt(obj.style.left.replace(/px/i,''));
		}else{
			this._x=CD_core.getEmbedStyle(obj,'left');
			if(this._x==undefined){
				if(setPosition){
					if(CD.UA.asn=="ie" || CD.UA.asn=="op"){
						do{
							this._x+=obj.offsetLeft;
							obj=obj.offsetParent;
						}while(obj);
						obj=$(objID);
					}else{
						this._x=obj.offsetLeft;
					}
					this._x+=adjustX;
				}else{
					this._x=0;
				}
			}else{
				this._x=parseInt(this._x.replace(/px/,''));
			}
		}

		if(obj.style.top){
			this._y=parseInt(obj.style.top.replace(/px/i,''));
		}else{
			this._y=CD_core.getEmbedStyle(obj,'top');
			if(this._y==undefined){
				if(setPosition){
					if(CD.UA.asn=="ie" || CD.UA.asn=="op"){
						do{
							this._y+=obj.offsetTop;
							obj=obj.offsetParent;
						}while(obj);
						obj=$(objID);
					}else{
						this._y=obj.offsetTop;
					}
					this._y+=adjustY;
				}else{
					this._y=0;
				}
			}else{
				this._y=parseInt(this._y.replace(/px/,''));
			}
		}

		if(obj.style.width){
			this._width=parseInt(obj.style.width.replace(/px/i,''));
		}else{
			this._width=CD_core.getEmbedStyle(obj,'width');
			if(this._width==undefined){
				this._width=obj.offsetWidth+adjustW;
			}else{
				this._width=parseInt(this._width.replace(/px/,''));
			}
		}

		if(obj.style.height){
			this._height=parseInt(obj.style.height.replace(/px/i,''));
		}else{
			this._height=CD_core.getEmbedStyle(obj,'height');
			if(this._height==undefined){
				this._height=obj.offsetHeight+adjustH;
			}else{
				this._height=parseInt(this._height.replace(/px/,''));
			}
		}

		if(setPosition){
			obj.style.left=(this._x+adjustX)+"px";
			obj.style.top=(this._y+adjustY)+"px";
			obj.style.width=(this._width+adjustW)+"px";
			obj.style.height=(this._height+adjustH)+"px";
		}

		if(obj.style.position=="absolute" || obj.style.position=="fixed"){
			this._bottom=parseInt(CD_core.getStyle(obj,"Bottom","bottom","bottom"));
			this._right=parseInt(CD_core.getStyle(obj,"Right","right","right"));
		}
	},

	getParentPos:function(objID,adjustX,adjustY,adjustW,adjustH,setPosition){
		var obj=$(objID).parentNode;
		this._name=obj.getAttribute("id");

		var param=new CD_core.getPosition(obj,adjustX,adjustY,adjustW,adjustH,setPosition);
		this._x=param._x;
		this._y=param._y;
		this._width=param._width;
		this._height=param._height;
	},

/* Get Style Attribute */
	getStyle:function(obj,IEStyleProp,CSSStyleProp,Prop){
		var Val=this.getInlineStyle(obj,IEStyleProp,CSSStyleProp,Prop);
		if(!Val || Val==null || Val==undefined || Val=="initial"){
			Val=this.getEmbedStyle(obj,Prop);
		}
		if(!Val || Val==null || Val==undefined || Val=="initial"){
			return undefined;
		}else{
			return Val;
		}
	},

	getInlineStyle:function(obj,IEStyleProp,CSSStyleProp,Prop) {
		if(obj.style[Prop]){
			return obj.style[Prop];
		}else{
			if (obj.currentStyle) {
				return obj.currentStyle[IEStyleProp];
			} else if (document.defaultView.getComputedStyle) {
				var compStyle = document.defaultView.getComputedStyle(obj,"")||window.getComputedStyle(obj,"");
				return compStyle.getPropertyValue(CSSStyleProp);
			}
		}

	},

	getEmbedStyle:function(obj,Prop){
		var settedClass=obj.className;
		var objID=obj.getAttribute("id");
		var classValue=undefined;
		var cssFile=document.styleSheets;
		if(cssFile){
			for(var i=0;i<cssFile.length;i++){
				var rules=(cssFile[i].cssRules||cssFile[i].rules);
				for(var n=0;n<rules.length;n++){
					if(rules[n].selectorText==("."+settedClass)||rules[n].selectorText==("#"+objID)){
						if(rules[n].style[Prop]){
							classValue=rules[n].style[Prop];
						}
					}
				}
			}
		}
		return classValue;
	},

	getOffset:function(obj){
		if(CD.UA.asn=="ie" || CD.UA.asn=="op"){
			do{
				this._x+=obj.offsetLeft;
				obj=obj.offsetParent;
			}while(obj);
			obj=$(objID);
		}else{
			this._x=obj.offsetLeft;
		}

		if(CD.UA.asn=="ie" || CD.UA.asn=="op"){
			do{
				this._y+=obj.offsetTop;
				obj=obj.offsetParent;
			}while(obj);
			obj=$(objID);
		}else{
			this._y=obj.offsetTop;
		}

		this._width=obj.offsetWidth;
		this._height=obj.offsetHeight;
	},

/* Set Object Position */
	setPosition:function(obj,Attr,Val){
		if(Attr == "x"){
			obj.style.left=Val+"px";
		}else if(Attr == "y"){
			obj.style.top=Val+"px";
		}else if(Attr == "width"){
			obj.style.width=Val+"px";
		}else if(Attr == "height"){
			obj.style.height=Val+"px";
		}else if(Attr == "bottom"){
			obj.style.bottom=Val+"px";
		}else if(Attr == "right"){
			obj.style.right=Val+"px";
		}
	},

	setPositionPixel:function(obj,Attr,Val){
		if(Attr == "x"){
			obj.style.pixelLeft=Val+"px";
		}else if(Attr == "y"){
			obj.style.PixelTop=Val+"px";
		}else if(Attr == "width"){
			obj.style.pixelWidth=Val+"px";
		}else if(Attr == "height"){
			obj.style.pixelHeight=Val+"px";
		}
	},

	setCenter:function(obj){
		this.setPosition($(obj),"x",(this._windowWidth()-parseInt(this.getStyle($(obj),"Width","width","width")))/2);
		this.setPosition($(obj),"y",(this._windowHeight()-parseInt(this.getStyle($(obj),"Height","height","height")))/2);
	},

	setFixedPosition:function(obj,x,y){
		switch(x){
			case "center":
				x=(this._windowWidth()-parseInt(this.getStyle($(obj),"Width","width","width")))/2;
			break;
			case "right":
				x=this._windowWidth()-parseInt(this.getStyle($(obj),"Width","width","width"));
			break;
			case "left":
				x=0;
			break;
		}

		if(x)this.setPosition($(obj),"x",x);
		if(y)this.setPosition($(obj),"y",(this._scrollY()+y));
	},

	swapDepths:function(objID,val){
		if(!$(objID).style.zIndex){
			$(objID).style.zIndex=0;
		}
		var depth=(val=="nextHighestDepth")?CD._minDepth:val;
		$(objID).style.zIndex=depth;
		if(val=="nextHighestDepth"){CD._minDepth++;}
	},

/* Alpha(Opacity) */

	getAlpha:function(obj){
		var Val='';

		switch(CD.UA.asn){

			case "ie":
			Val=this.getStyle($(obj),"Filter","filter","filter").replace(/alpha\(opacity=|\)/ig,"");
			break;

			case "ff":
			Val=this.getStyle($(obj),"MozOpacity","-moz-opacity","-moz-opacity");
			break;

			case "nn":
			Val=this.getStyle($(obj),"MozOpacity","-moz-opacity","-moz-opacity");
			break;

			default:
			Val=this.getStyle($(obj),"Opacity","opacity","opacity");

		}

		return Val;
	},

	setAlpha:function(obj,Alpha){
		$(obj).style.filter = "alpha(opacity="+Alpha+")";
		$(obj).style.mozOpacity = Alpha / 100;
		$(obj).style.opacity = Alpha / 100;
	},

/* Window position Attribute */
	_mouseX:function(e){
		if(navigator.appName == "Opera"){
			return e.clientX;
		}else if(navigator.appName == "Microsoft Internet Explorer"){
			return e.clientX+(document.documentElement.scrollLeft || document.body.scrollLeft);
		}else{
			return e.pageX;
		}
	},

	_mouseY:function(e){
		if(navigator.appName == "Opera"){
			return e.clientY;
		}else if(navigator.appName == "Microsoft Internet Explorer"){
			return e.clientY+(document.documentElement.scrollTop || document.body.scrollTop);
		}else{
			return e.pageY;
		}
	},

	_scrollX:function(){
		return document.body.scrollLeft||document.documentElement.scrollLeft;
	},
	
	_scrollY:function(){
		return document.body.scrollTop||document.documentElement.scrollTop;
	},

	_scrollWidth:function(){
		return document.body.scrollWidth||document.documentElement.scrollWidth;
	},
	
	_scrollHeight:function(){
		return document.body.scrollHeight||document.documentElement.scrollHeight;
	},

	_windowWidth:function(){
		if(CD.UA.asn!="ie"){
			return window.innerWidth;
		}else{
			return document.body.clientWidth||document.documentElement.clientWidth;
		}
	},
	
	_windowHeight:function(){
		if(CD.UA.asn!="ie"){
			return window.innerHeight;
		}else{
			return document.body.clientHeight||document.documentElement.clientHeight;
		}
	},
	
	_documentWidth:function(){
		return document.body.clientWidth||document.documentElement.clientWidth;
	},
	
	_documentHeight:function(){
		return document.body.clientHeight||document.documentElement.clientHeight;
	},

/*EVENT*/	
	addEvent:function(obj,ev,func){
		if(obj.addEventListener){
			obj.addEventListener(ev,func,false);
		}else{
			/*__ex:www.r-definition.com/program/js/dom/eventListener.htm__*/
			if(obj==document){
	            if( ! func._bridge ) {
    	            func._bridge = new Array(0);
        	    }
            	var i = func._bridge.length;
            	func._bridge[i] = new Array(3);
            	func._bridge[i][0] = obj;
            	func._bridge[i][1] = ev;
            	func._bridge[i][2] = function() {
            	    func.apply(obj, arguments);
            	};
            	obj.attachEvent("on"+ev, func._bridge[i][2]);
			}else{
            	obj.attachEvent("on"+ev,func);
			}
			/*__end_ex__*/
		}
	},

	delEvent:function(obj,ev,func){
		if(obj.addEventListener){
			obj.removeEventListener(ev,func,false);
		}else{
			try{
			/*__ex:www.r-definition.com/program/js/dom/eventListener.htm__*/
	            var i = 0; var f = null;
    	        while( i < func._bridge.length ) {
        	        if( func._bridge[i][0] == obj && func._bridge[i][1] == ev ) {
            	        f = func._bridge[i][2];
						//alert(f);
                	    break;
                	}
                	i++;
            	}
            	obj.detachEvent("on"+ev, f);
            	func._bridge.splice(i,1);
			/*__end_ex__*/
			}catch(e){}
		}
/*
		if(event.preventDefault){
			event.preventDefault();
			event.stopPropagation();
		}else{
			event.returnValue = false;
			event.cancelBubble = true;
		}
*/
	},

	setEvent:function(func){
		if(CD.UA.asn!="ie" && CD.UA.asn!="op"){
			CD_core.addEvent(document,"DOMContentLoaded",func);
/*
		}else if(CD.UA.asn=="op"){
			CD_core.addEvent(window,"load",function(){
				for (var i = 0; i < document.styleSheets.length; i++)
					if (document.styleSheets[i].disabled) {
						setTimeout(arguments.callee, 0);
						return;
					}
					func.call(document);
			});
*/
		}else{
			CD_core.addEvent(window,"load",func);
		}
	},

/*utility*/

	chomp:function(str){
		str=str.replace(/[\r|\n]/ig,'');
		return str;
	},

/*Tween*/
	startPos:new Array(),
	endofPos:new Array(),
	moveVect:new Array(),
	timer:new Array(),
	fps:33,
	dpf:5,

	options:new Array(),

	addTween:function(obj,attr,pos,ease,option){
		if(this.timer[obj+"_"+attr]){
			this.endTween(obj,attr);
		}

		this.options[obj]=new Array();
		if(option){
			var optVals=option.split(";");
			for(i=0;i<optVals.length;i++){
				this.options[obj][optVals[i].split(":")[0]]=optVals[i].split(":")[1];
			}
		}

		if(attr=="x"){
			styleAttr="left";
		}else if(attr=="y"){
			styleAttr="top";
		}else{
			styleAttr=attr;
		}

		if($(obj).style[styleAttr]!=pos+"px"){
			if($(obj).style.position=="static" || $(obj).style.position==''){
				$(obj).style.position="relative";
			}
			this.endofPos[obj+"_"+attr]=pos;
			this.timer[obj+"_"+attr]=setInterval("CD_core.actTween(\'"+obj+"\',\'"+attr+"\',\'"+ease+"\')",this.fps);
			if(this.options[obj]['start'])eval(this.options[obj]['start']);
		}
	},	

	actTween:function(obj,attr,ease){

		var pos=new CD_core.getPosition($(obj),0,0,0,0,0);
		var vect=(pos["_"+attr]>this.endofPos[obj+"_"+attr])?-1:1;
		this.dpf=Math.abs(Math.floor((this.endofPos[obj+"_"+attr]-pos["_"+attr])/(this.fps*(ease/100))));
		this.dpf=(this.dpf<1)?1:this.dpf;
		var move=pos["_"+attr]+(this.dpf*vect);

		if(this.endofPos[obj+"_"+attr]-move<=1 && vect==1){
			CD_core.setPosition($(obj),attr,this.endofPos[obj+"_"+attr]);
			if(this.options[obj]['complete']){eval(this.options[obj]['complete']);}
			clearInterval(this.timer[obj+"_"+attr]);
		}else if(this.endofPos[obj+"_"+attr]-move>=1 && vect==-1){
			CD_core.setPosition($(obj),attr,this.endofPos[obj+"_"+attr]);
			if(this.options[obj]['complete']){eval(this.options[obj]['complete']);}
			clearInterval(this.timer[obj+"_"+attr]);
		}else{
			CD_core.setPosition($(obj),attr,move);
		}

		if(this.options[obj]['enterframe'])eval(this.options[obj]['enterframe']);

		if(this.options[obj]['fixedCenter']=="true"){
			CD_core.setPosition($(obj),'x',(this._windowWidth()-move)/2);
		}

	},

	endTween:function(obj,attr){
		clearInterval(this.timer[obj+"_"+attr]);
	},

/*Cookie*/
	setCookie:function(cookieName,cookieValue,expireTime,cPath){
		var expdate=new Date();
		expdate.setTime(expdate.getTime()+expireTime*(60*60*1000))
		document.cookie=cookieName+"="+escape(cookieValue)+
		((expdate==null)?"":("; expires="+expdate.toGMTString()))+
		((cPath==null)?"; path=/":("; path="+cPath));
	},

	getCookie:function(cookieName){
		var cname=cookieName+"=";
		var i=0;
		while(i<document.cookie.length){
			var j=i+cname.length;
			if(document.cookie.substring(i,j)==cname){
			var leng=document.cookie.indexOf(";",j);
			if(leng==-1)
				leng=document.cookie.length;
				return unescape(document.cookie.substring(j,leng));
			}
			i=document.cookie.indexOf(" ",i)+1;
			if(i==0)break;
		}
		return "";
	},

	cookieDisableMsg:function(layerID){
		var cookieStatus=CD_canCookie();
		var disableMsg='<strong class="notice">Cookieをご利用いただかない場合、サイトの機能の一部がご利用いただけなくなります。<br />CookieをONにして、ご覧いただきますよう、お願いします。</strong>';
		if(!cookieStatus){
			$(layerID).style.display="block";
			$(layerID).innerHTML=disableMsg;
		}
	},

	canCookie:function(){
		var checkValue=navigator.cookieEnabled;
		if(!checkValue){
			CD_setCookie("test","true",1);checkValue=CD_getCookie("test");
		}
		return checkValue;
	}
}

/*USER AGENT*/
CD_userAgent={
	Get:function(){
		var NavBrowser=navigator.appName;
		var Agent=navigator.userAgent;
		var AgentVer=navigator.appVersion;
		var NN="Netscape";

		this.navigator="["+Agent+" :: "+AgentVer+" :: "+NavBrowser+"]";

		if(Agent.indexOf("Mac", 0) >=0){
			this.os="Mac";
			for(i=0;i<navigator.plugins.length;i++){
				if(navigator.plugins[i].filename.indexOf(".plugin") >=0){
					this.osVer="X";
				}
			}
		}
		else if(Agent.indexOf("Win", 0) >=0){
			this.os="Windows";
			if(Agent.indexOf("NT 6.0",0) >=0){
				this.osVer="Vista";
			}else if(Agent.indexOf("NT 5.2",0) >=0){
				this.osVer="2003";
			}else if(Agent.indexOf("NT 5.1",0) >=0){
				this.osVer="XP";
			}else if(Agent.indexOf("NT 5.0",0) >=0){
				this.osVer="2000";
			}
		}
		else{
			this.os=this.osVer=undefined;
		}

		// OPERA
		if(Agent.indexOf("Opera",0) >=0){
			this.app="Opera";
			this.asn="op";
			blength=this.app.length;
			ver_start=Agent.indexOf("Opera",0) + blength + 1;
			ver_end=Agent.length - ver_start;
			this.appVer=Agent.substr(ver_start,ver_end);
			this.appVer=this.appVer.substr(0,5);
		}
	
		// Firefox
		else if(Agent.indexOf("Firefox",0) >=0){
			this.app="Firefox";
			this.asn="ff";
			blength=this.app.length;
			ver_start=Agent.indexOf("Firefox",0) + blength +1;
			ver_end=Agent.length - ver_start;
			this.appVer=Agent.substr(ver_start,ver_end);
		}
	
		// InternetExplorer 
		else if(Agent.indexOf("MSIE 8", 0) >=0){
			this.app="InternetExplorer";	this.appVer="8";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 7", 0) >=0){
			this.app="InternetExplorer";	this.appVer="7";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 6", 0) >=0){
			this.app="InternetExplorer";	this.appVer="6";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 5.5", 0) >=0){
			this.app="InternetExplorer";	this.appVer="5.5";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 5.2", 0) >=0){
			this.app="InternetExplorer";	this.appVer="5.2";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 5.1", 0) >=0){
			this.app="InternetExplorer";	this.appVer="5.1";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 5", 0) >=0){
			this.app="InternetExplorer";	this.appVer="5";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 4.01", 0) >=0){
			this.app="InternetExplorer";	this.appVer="4.01";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 4.5", 0) >=0){
			this.app="InternetExplorer";	this.appVer="4.5";
			this.asn="ie";
		}
		else if(Agent.indexOf("MSIE 4", 0) >=0){
			this.app="InternetExplorer";
			this.asn="ie";
			this.appVer="4";
		}

		// Chrome
		else if(Agent.indexOf("Chrome", 0) >=0){
			this.app="Google Chrome";
			this.asn="gc";
			this.appVer=Agent.split("/")[3].split(" ")[0];
		}

		// Safari
		else if(Agent.indexOf("Safari", 0) >=0){
			this.app="Safari";
			this.asn="sf";
			var s=Agent.split("/")[4]
			var n=Agent.split("/")[3];
			var n2=n.split(" ")[0];

			if(n.indexOf("Safari")!=-1){
				this.appVer=n2+"("+s+")";
			}
			else if(n >=419.3){
				this.appVer="2.0.4("+n+")";
			}
			else if(n >=410){
				this.appVer="2.0("+n+")";
			}
			else if(n >=312.6){
				this.appVer="1.3.2("+n+")";
			}
			else if(n >=130){
				this.appVer="1.3("+n+")";
			}
			else if(n >=125.12){
				this.appVer="1.2.4("+n+")";
			}
			else if(n>120){
				this.appVer="1.2("+n+")";
			}
			else if(n>100){
				this.appVer="1.1("+n+")";
			}
			else if(n>86){
				this.appVer="1.0("+n+")";
			}
			else{
				this.appVer="unknown";
			}
		}

		// Netscape 6,7
		else if(NN=="Netscape" && Agent.indexOf("Netscape",0) >=0){
			this.app="Netscape";
			this.asn="nn";
			blength=this.app.length;
			ver_start=Agent.indexOf("Netscape",0) + blength +1;
			ver_end=Agent.length - ver_start;
			this.appVer=Agent.substr(ver_start,ver_end);
		}

		// Netscape 4.x
		else if(NN=="Netscape" && Agent.indexOf("4.",0) >=0){
			this.app="Netscape";
			this.asn="nn";
			this.appVer="4";
		}

		// Mozilla
		else if(this.NavBrowser=="Netscape" && Agent.indexOf("Mozilla",0) >=0 && Agent.indexOf("Gecko",0) >=0){
			this.app="Mozilla";
			this.asn="mz";
			ver_start=Agent.indexOf("rv:",0) + 3;
			this.appVer=Agent.substr(ver_start,5);
		}

		else{
			this.app=this.appVer=undefined;
			this.asn="undef";
		}

		//appVer=appVer.replace("/","");
	},

	Show:function(obj,useN){
		var ua=new this.Get();
		var viewSrc='<dl>';

		viewSrc+='<dt>OS</dt><dd>'+ua.os+'</dd>';
		viewSrc+='<dt>OS version</dt><dd>'+ua.osVer+'</dd>';
		viewSrc+='<dt>Browser</dt><dd>'+ua.app+'</dd>';
		viewSrc+='<dt>Browser Version</dt><dd>'+ua.appVer+'</dd>';

		if(useN){
			viewSrc+='<dt>Navigator Property</dt><dd>'+ua.navigator+'</dd>';
		}
		viewSrc+='</dl>';

		$(obj).innerHTML=viewSrc;
	}
}

/*FUNCTIONS*/

function $(ids){
	return document.getElementById(ids);
}

/*DEBUG*/
function trace(str){
	if(CD.debugMode){
		if(!$("CD_trace")){
			CD_core.createObject("div","CD_trace","CD_trace");
			$("CD_trace").innerHTML=str;
			$("CD_trace").style.position="absolute";
		}else{
			$("CD_trace").innerHTML=str+"<br />"+$("CD_trace").innerHTML;
		}
		$("CD_trace").style.visibility="visible";
		CD_core.swapDepths("CD_trace");
	}
}


/**
 * Emulates insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement()
 * three functions so they work with Netscape 6/Mozilla
 * by Thor Larholm me@jscript.dk
 */

if(typeof HTMLElement!='undefined'){
	if(typeof HTMLElement.insertAdjacentHTML=='undefined'){
		HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) {
	  	switch (where){
			case 'beforeBegin':
				this.parentNode.insertBefore(parsedNode,this);
				break;
			case 'afterBegin':
				this.insertBefore(parsedNode,this.firstChild);
				break;
			case 'beforeEnd':
				this.appendChild(parsedNode);
				break;
			case 'afterEnd':
				if (this.nextSibling) { 
					this.parentNode.insertBefore(parsedNode,this.nextSibling); 
				}else{ 
					this.parentNode.appendChild(parsedNode); 
				}
			break;
		  }
		};
	}

	if (CD.UA.asn!="ie"){
		if(typeof HTMLElement.insertAdjacentHTML=='undefined'){
			HTMLElement.prototype.insertAdjacentHTML = function (where,htmlStr) {
				var r = this.ownerDocument.createRange();
				r.setStartBefore(this);
				var parsedHTML = r.createContextualFragment(htmlStr);
				this.insertAdjacentElement(where,parsedHTML);
			};
		}

	   if(typeof HTMLElement.insertAdjacentText=='undefined'){
			HTMLElement.prototype.insertAdjacentText = function (where,txtStr) {
				var parsedText = document.createTextNode(txtStr);
				this.insertAdjacentElement(where,parsedText);
			};
		}
	}

/*add*/
	if(typeof HTMLElement.insertAfter=='undefined'){
		HTMLElement.prototype.insertAfter=function(newElem,targetObj){
			var parent=targetObj.parentNode;
			if(parent.lastChild==targetObj){
				parent.appendChild(newElem);
			}else{
				parent.insertBefore(newElem,targetObj.nextSibling);
			}
		};
	}

}

/*______________EXECUTE______________*/
CD.Load();
