var j = jQuery.noConflict();

j(document).ready(function() {
    j('.bannerSwap').cycle({
        fx: 'fade',
        speed:  4000,
        timeout: 4000   
    });
});

/* Browser check */
var IS_DOM = (document.getElementById) ? true : false;
var IS_IE = (document.all) ? true : false;
var IS_IE50 = (navigator.userAgent.indexOf("IE 5.0") != -1);
var IS_Mac = (navigator.appVersion.indexOf("Mac") != -1);

// preload level 1 buttons
var btnLevel1 = new Array();
if (sLanguage == "en")
{
	btnLevel1 = ["", "solutions", "products", "services-training", "support", "about-us", "news-events"];
}
else
{
	if (sLanguage == "ko" || sLanguage == "ru") {
	} else {
	btnLevel1 = ["", "solutions", "products", "support", "about-us", "news-events"];
	}
}
for (var i = 1; i < btnLevel1.length; i++) { 
	eval("var menu" + i + "on = new Image();"); eval("var menu" + i + "off = new Image();");
	eval("menu" + i + "on.src = \"" + sFolderLevel + "img/navigation/" + sLanguage + "/l1-" + btnLevel1[i] + "-1.gif\";");
	eval("menu" + i + "off.src = \"" + sFolderLevel + "img/navigation/" + sLanguage + "/l1-" + btnLevel1[i] + "-0.gif\";");
	if (sSelectedButton == btnLevel1[i]) {
		eval("menu" + i + "off.src = \"" + sFolderLevel + "img/navigation/" + sLanguage + "/l1-" + btnLevel1[i] + "-1.gif\";");
	}
}

// Image Swapping
function changeImages() 
{
  if (document.getElementById) {
    for (var i = 0; i < arguments.length; i += 2) { 
  		document.getElementById(arguments[i]).src = eval(arguments[i + 1] + ".src"); 
	}
  }
}

// Get an ID 
function getThis(sId)
{
	var oObject;
	oObject = false;
	
	if (IS_DOM) {
		if (document.getElementById(sId)) {
			oObject = document.getElementById(sId);
		}
	}
	
	return oObject;
}

// accessible popup functions, this will work with or without javascript enabled
// reference like this "<a href="popup.htm" onclick="popUp(this.href,'console',400,200);return false;" target="newWin" title="This link will pop open a new window">This is my link</a>"
	function popUp(strURL,strType,strHeight,strWidth,strWindow)
	{
	  var strOptions="";
	  if (strType=="console") {
	    strOptions="resizable,height=" + strHeight + ",width=" + strWidth;
	  }
	  if (strType=="fixed") {
	    strOptions="status,height=" + strHeight + ",width=" + strWidth;
	  }
	  if (strType=="elastic") {
	    strOptions="toolbar,menubar,scrollbars,resizable,location,height=" + strHeight + ",width=" + strWidth;
	  }
	  if (strType=="scroll") {
	    strOptions="status,scrollbars,resizable,height=" + strHeight + ",width=" + strWidth;
	  }
	  window.open(strURL, strWindow, strOptions);
	}

// Reference parent window from popup
function parentWin(url) {
	window.opener.location = url;
	self.close();

}

function showPrPopup()
{
	var oPopup = getThis("prPopup");
	
	if (oPopup)
	{
		var oDisplay = oPopup.style.display;
		
		if (oPopup.style.display != "block")
		{
			oPopup.style.display = "block";
		}
		else
		{
			oPopup.style.display = "none";
		}
	}
}
