// Initialize DHTML Menu functions
var HM_DOM = (document.getElementById) ? true : false;
var HM_NS4 = (document.layers) ? true : false;
var HM_IE = (document.all) ? true : false;
var HM_IE4 = HM_IE && !HM_DOM;
var HM_Mac = (navigator.appVersion.indexOf("Mac") != -1);
var HM_IE4M = HM_IE4 && HM_Mac;

// Set default window status
window.defaultStatus = 'WS-I Summit Series: Architecting for Interoperability in an SOA World';

// Initialize global variables
var blnHomepage = false;

// Include JS Date function for IR site
function MakeArray(n) {
	this.length = n
	return this;
}

function customDateString(oneDate) {
	var theDay = dayNames[oneDate.getDay() + 1];
	var theMonth = monthNames[oneDate.getMonth() + 1];
	var theYear = oneDate.getFullYear();
	return theMonth.toUpperCase() + " " + oneDate.getDate() + ", " + theYear;
}

function copyrightDate(oneDate) {
	var theYear = oneDate.getFullYear();
	return theYear;
}

var monthNames = new MakeArray(12);
monthNames[1] = "January";
monthNames[2] = "February";
monthNames[3] = "March";
monthNames[4] = "April";
monthNames[5] = "May";
monthNames[6] = "June";
monthNames[7] = "July";
monthNames[8] = "August";
monthNames[9] = "September";
monthNames[10] = "October";
monthNames[11] = "November";
monthNames[12] = "December";

var dayNames = new MakeArray(7);
dayNames[1] = "Sunday";
dayNames[2] = "Monday";
dayNames[3] = "Tuesday";
dayNames[4] = "Wednesday";
dayNames[5] = "Thursday";
dayNames[6] = "Friday";
dayNames[7] = "Saturday";

// Begin Global JS Functions
function DropdownChooser(Product) {
	if (Product != "") {
		window.location = Product;
	}
}

function SpawnWin(wURL,wName,wW,wH) {
Spawned = window.open(wURL,wName,'width='+wW+',height='+wH);
// Refocus window
setTimeout("Spawned.focus()",500);
}

function imgHilite(imgID) {
	// Replaces the terminus of an image "_off.gif" with "_on.gif" only
	var thisSrc = eval(GetDIVStyleID(imgID)).src;
	var newSrc =  thisSrc.substring(0,thisSrc.lastIndexOf('-off.gif')) + "-on.gif";
	eval(GetDIVStyleID(imgID)).src = newSrc;
}

function imgUnHilite(imgID) {
	// Replaces the terminus of an image "_on.gif" with "_off.gif" only
	var thisSrc = eval(GetDIVStyleID(imgID)).src;
	var newSrc =  thisSrc.substring(0,thisSrc.lastIndexOf('-on.gif')) + "-off.gif";
	eval(GetDIVStyleID(imgID)).src = newSrc;
}

function TriggerFlash() {
var args = TriggerFlash.arguments;
	for (x = 0; x < args.length; x++) {
		var Root = eval("window." + args[x]);
		if (Root) {
			Root.Play();
		}
	}
}

function GetDIVStyleID(myid) {
	if ((HM_IE) || (HM_DOM)) {
		// Explorer
		if (HM_IE){
			var ThisDIV = document.all[myid];
		}
		// DOM Browsers
		else if (HM_DOM) {
			var ThisDIV = document.getElementById(myid);
		}
		return (ThisDIV);
	}
	else {
		return false;
	}
}

function ShowItem(myid,mydisplay) {
	if (mydisplay == "none") {
		eval(GetDIVStyleID(myid)).style.display = "none";
	}
	else if (mydisplay == "block") {
		eval(GetDIVStyleID(myid)).style.display = "block";
	}
}

function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	if (obj.filters) {obj.filters.alpha.opacity=opacity;}
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
} 

function isBlank(val){
	if (val==null) {return true;}
	for(var i=0;i<val.length;i++) {
		if ((val.charAt(i)!=' ')&&(val.charAt(i)!="\t")&&(val.charAt(i)!="\n")&&(val.charAt(i)!="\r")){return false;}
	}
	return true;
}

function isInteger(val){
	if (isBlank(val)){return false;}
	for(var i=0;i<val.length;i++){
		if(!isDigit(val.charAt(i))){return false;}
	}
	return true;
}

function isNumeric(val){return(parseFloat(val,10)==(val*1));}

function isArray(obj){return(typeof(obj.length)=="undefined")?false:true;}

function isDigit(num) {
	if (num.length>1){return false;}
	var string="1234567890";
	if (string.indexOf(num)!=-1){return true;}
	return false;
}