﻿/*for agathe 6.x*/


/* Sutructure
==================================================
Set Up Object
Img Change
Form
Anchor Action
==================================================
Ini
	Setup Attribute
	Lord Other JavaScript
================================================== */


/* ==================================================
Set Up Object
================================================== */
	bAgent = navigator.userAgent;
	bName = navigator.appName;
	bPlugins = navigator.plugins;
	
	w = window;
	s = w.screen;
	d = document;
	
	usrUrl = location.href;
	usrDomain = d.domain;
	usrRoot = "/";
	
	function sniffer(){
		/* OS */
		this.Win = bAgent.indexOf("Win",0) != -1 ? 1 : 0;
		this.WinVista = bAgent.indexOf("Windows NT 6.0",0) != -1 ? 1 : 0;
		this.Mac = bAgent.indexOf("Mac",0) != -1 ? 1 : 0;
		this.MacOSX = ((bAgent.indexOf("Mozilla") != -1) && (bAgent.indexOf("Mac OS X") != -1)) ? 1 : 0;
		if(bPlugins){for(i = 0 ;i < bPlugins.length;i++){if(this.Mac && (bPlugins[i].filename.indexOf("QuickTime Plugin.plugin") != -1)){this.MacOSX = true;}}}
		
		/* Browser */
		this.IE        = ((bAgent.indexOf("MSIE") != -1) && (bAgent.indexOf("Opera") == -1)) ? 1 : 0;
		this.NS        = ((bName == "Netscape") && (bAgent.indexOf("Opera") == -1)) ? 1 : 0;
		this.NC        = ((bName == "Netscape") && (bAgent.indexOf("Gecko") == -1) && (bAgent.indexOf("Opera") == -1)) ? 1 : 0;
		this.Gecko     = (bAgent.indexOf("Gecko") != -1) ? 1 : 0;
		this.Moz       = ((bAgent.indexOf("Gecko") != -1) && (bAgent.indexOf("Safari",0) == -1)) ? 1 : 0;
		this.OPERA     = bAgent.indexOf("Opera",0) != -1 ? 1 : 0;
		this.Firefox   = (bAgent.indexOf("Firefox") != -1) ? 1 : 0;
		this.SAFARI    = bAgent.indexOf("Safari",0) != -1 ? 1 : 0;
		this.ICAB      = bAgent.indexOf("iCab",0) != -1 ? 1 : 0;
		
		/* Object */
		/* SAFARI,Firefox,NS6+,OPERA6=4, IE5+,OPERA5,7+=3, IE4=2, NS4=1, others=0 */
		this.checkObj      = d.all ? (d.getElementById ? 3 : 2) : (d.getElementById ? 4 : (d.layers ? 1 : 0));
		this.checkObj4     = (d.getElementById && !d.all) ? 1 : 0;
		this.checkObj3     = (d.getElementById && d.all) ? 1 : 0;
		this.checkObj2     = (d.all && !d.getElementById) ? 1 : 0;
		this.checkObj1     = d.layers ? 1 : 0;
		this.allObj        = ((this.checkObj == 3) || (this.checkObj == 4));
		
		/* Compat Mode */
		this.modeStandard  = d.compatMode == "CSS1Compat" ? 1 : 0;
		this.modeQuirks    = d.compatMode == "BackCompat" ? 1 : 0;
		
		/* Each Browser */
		this.IE5           = (this.Win && this.IE && (bAgent.indexOf('MSIE 5.',0) != -1));
		this.IE55          = (this.Win && this.IE && (bAgent.indexOf('MSIE 5.5.',0) != -1));
		this.IE55later     = (this.Win && this.IE && (w.createPopup != -1));
		this.IE6           = (this.Win && this.IE && (bAgent.indexOf('MSIE 6.',0) != -1));
		this.IE6below      = (this.IE5 && this.IE55 && this.IE6);
		this.IE7           = (this.Win && this.IE && (bAgent.indexOf('MSIE 7.',0) != -1));
		
		this.WinIEs        = (this.Win && this.IE && this.modeStandard);
		this.WinIEq        = (this.Win && this.IE && this.modeQuirks);
		
		this.MacFirefox    = (this.Mac && this.Firefox);
		this.MacOPERA      = (this.Mac && this.OPERA);
		
		return this;
	}
	var usr = new sniffer;


/* ==================================================
Img Change
================================================== */
	var imgIdG1 = imgIdL1 = imgIdP1 = "";
	var hldIdG1 = hldIdL1 = hldIdP1 = "";
	function changeImg(imgId,imgState,idName) {
		if(!idName){
			if(usr.allObj) {
				var stringId0 = imgId.substring(0,4);
				var stringIdG1 = imgId.substring(3,6);
				var stringIdL1 = imgId.substring(3,8);
				if(((imgState == "out") || (imgState == "ovr")) && (stringId0 == "navl") && (stringIdL1 == imgIdP1)){
					if(imgState == "out"){
						d.getElementById(imgId).src = eval(imgId + "opt" + ".src");
					}else if(imgState == "ovr"){
						d.getElementById(imgId).src = eval(imgId + "opv" + ".src");
					}
				} else if(((imgState == "out") || (imgState == "ovr")) && ((stringId0 == "navg") || (stringId0 == "navl")) && ((stringIdG1 == imgIdG1) || (stringIdL1 == imgIdL1))){
					if(imgState == "out"){
						d.getElementById(imgId).src = eval(imgId + "ovr" + ".src");
						//d.getElementById(imgId).src = eval(imgId + "hld" + ".src");
					}else if(imgState == "ovr"){
						d.getElementById(imgId).src = eval(imgId + "ovr" + ".src");
						//d.getElementById(imgId).src = eval(imgId + "hlv" + ".src");
					}
				} else {
					if(imgState == "hld")imgState = "ovr";
					d.getElementById(imgId).src = eval(imgId + imgState + ".src");
				}
			}
		}else if(!!idName){
			if(usr.allObj){
				d.getElementById(imgId).src = eval(imgId + imgState + ".src");
			}else if(usr.checkObj == 1){
				d.layers[idName].d[imgId].src = eval(imgId + imgState + ".src");
			}
		}
	}

	function hldNavG1(hldIdG1){
		if(hldIdG1 == "00"){
			return true;
		} else if(!!hldIdG1){
			changeImg("navg" + hldIdG1,"hld");
			imgIdG1 = ("g" + hldIdG1);
		} else {
			return true;
		}
	}

	function hldNavL1(hldIdL1){
		if(hldIdL1 == "0000"){
			return true;
		} else if(!!hldIdL1){
			parentIdL1 = hldIdL1.substring(2,4);
			parentIdL2 = hldIdL1.substring(0,2);
			hldIdP1 = (parentIdL2 + "00");
			if(parentIdL1 == "00"){
				changeImg("navl" + hldIdL1,"hld");
				imgIdL1 = ("l" + hldIdL1);
			} else {
				changeImg("navl" + hldIdL1,"hld");
				//changeImg("navl" + parentIdL2 + "00","opt");
				imgIdL1 = ("l" + hldIdL1);
				imgIdP1 = ("l" + hldIdP1);
			}
		} else {
			return true;
		}
	}


/* ==================================================
Form
================================================== */
	function fieldTxtFcs(target){
		if(!!(usr.allObj)){
			target.style.backgroundColor='#CAD9D3';
			target.style.color='#333333';
		}
	}

	function fieldTxtBlr(target){
		if(!!(usr.allObj)){
			target.style.backgroundColor='#e8e8e8';
			target.style.color='#333333';
		}
	}


/*  ================================================================================
Anchor Action

targetBlankClassName = "newBlank";
flagDomainName = 1;
omitDomainName = "googlesyndication";

function setAnchorAction(){
	if(!d.getElementsByTagName) return;
	var existAnchors = d.getElementsByTagName("a");

	for(var i=0;i<existAnchors.length;i++){
		var existAnchor = existAnchors[i];
		if(existAnchor.getAttribute("href")){
			if((existAnchor.getAttribute("class")||existAnchor.getAttribute("className")).indexOf(targetBlankClassName,0) != -1){
				existAnchor.target = "_blank";
			}if(!!flagDomainName){
				if(!(existAnchor.getAttribute("href").indexOf(usrDomain,0) != -1) && !(existAnchor.getAttribute("href").indexOf(omitDomainName,0) != -1)){
					existAnchor.target = "_blank";
				}
			}
		}
	}
}
================================================================================  */

/* ==================================================
Setup Attribute
================================================== */
	//if(usr.WinVista){
	if(usr.Win && usr.IE){
		document.write('<link rel=\"stylesheet\" href=\"/wp-content/themes/coliss-ver4/css-fontstyle-vista.css\" type=\"text/css\" media=\"screen\" />');
	}

/* ==================================================
Lord Other JavaScript
================================================== */
function LoadJavascript(){
	for(var i=0;i<arguments.length;i++){
		document.write('<script type=\"text/javascript\" src=\"'+arguments[i]+'\"><\/script>');
	}
}

LoadJavascript('/wp-content/script/previewbubble/previewbubble.js','/shared/js/js-set-flash.js');
