/*____________________________________________________
 update:2009.10.13
 (C)2006 SonyChemicals&InformationDeviceCorp.
 (C)2006 ContentsBrainInc.
	.Sepalate css by Browsers
	.RollOver
	.Disable LinkImgOutLine
____________________________________________________*/


// Sepalate by Browsers@-- >

function getUA() {
	var usrAgt = navigator.userAgent;
	var appNam = navigator.appName;
	var appVer = navigator.appVersion;
	
	this._dom = document.getElementById;
	this._all = document.all;
	
	
	// Browsers
	this.sfr = this._dom && usrAgt.indexOf('AppleWebKit') != -1;			// Safari (OmniWeb 4.5+)
	this.ns = this._dom && usrAgt.indexOf('Gecko/') != -1;					// Mozilla (Netscape)
	this.ff = usrAgt.indexOf('Firefox/') != -1 && this._dom;					// Mozilla (Netscape)
	this.op  = usrAgt.indexOf('Opera') != -1 && this._dom;					// Opera
	this.ie  = usrAgt.indexOf('MSIE') != -1 && this._all && !this.op;		// IE
	this.ie6 = usrAgt.indexOf('MSIE 6') != -1 && this.ie;					// IE 6
	this.ie5 = usrAgt.indexOf('MSIE 5.0') != -1 && this.ie;					// IE 5.0
	this.ie55 = usrAgt.indexOf('MSIE 5.5') != -1 && this.ie;				// IE 5.5
	this.ie4 = usrAgt.indexOf('MSIE 4') != -1 && this.ie;					// IE 4
	
	
	// Browser Versions
	this.brwsVer = (this.ie) ? parseInt(appVer.split('MSIE ')[1]) : 
				(this.op) ? parseInt(usrAgt.split('Opera ')[1]) : parseInt(appVer);
	this.stdVer = this.brwsVer > 4;
	
	
	// Platform
	this.mac = usrAgt.indexOf('Mac') != -1;
	this.win = usrAgt.indexOf('Windows') != -1;
	this.otrOS = !this.mac && !this.win;
	
	this.macIE = this.mac && this.ie;
	
	
	// CSS
	this.cssDir = '/en/common/css/';
	this.cssWinIE5 = 'win.css';
	this.cssSfr = 'mac.css';
	this.cssOp6 = 'win.css';
	this.cssns = 'win.css';
	this.cssff = 'win.css';
	
	if (this.ie5) this.css = this.cssWinIE5;
	if (this.ie6) this.css = this.cssWinIE5;
	if (this.sfr) this.css = this.cssSfr;
	if (this.op) this.css = this.cssOp6;
	if (this.ns) this.css = this.cssns;
	if (this.ff) this.css = this.cssff;
		
	this.cssPath = this.cssDir + this.css;
}


// appendCSS
getUA.prototype.appendCSS = function(linkHref) {
	linkRel = 'stylesheet';
	linkType = 'text/css';
	
	if (document.createStyleSheet && ua.stdVer && !ua.macIE) {
		tagLink = document.createStyleSheet(linkHref);
	} else if (document.documentElement && ua.stdVer && !ua.macIE) {
		tagLink = document.createElement('link');
		tagLink.rel = linkRel;
		tagLink.type = linkType;
		tagLink.href = linkHref;
		document.getElementsByTagName('head')[0].appendChild(tagLink);
	} else if (ua.brwsVer >= 4) {
		document.write('<link rel=\"' + linkRel + '\" type=\"' + linkType + '\" href=\"' + linkHref + '\">');
	}
}

var ua = new getUA();
if (ua.css) ua.appendCSS(ua.cssPath);



//RollOver

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];}
}

//Disable LinkImgOutLine(updata 2009.10.13)

function disableOutLine()
{
for(i=0; i < document.links.length ;i++) {
document.links[i].onfocus = function() { this.blur(); }
}
}
