// Common js file for Sefrex

function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

//===================================================

	// IE 5.0 doesn't have push, so add it
var a = new Array();
if (!a.push) {
	Array.prototype.push = function(v) {
		this[this.length] = v;
	}

}

//===================================================

	// IE 5.0 doesn't have shift, so add it
var a = new Array();
if (!a.shift) {
	Array.prototype.shift = function() {
		var first_value = this[0];

		for (var i=0; i<this.length-1; i++) {
			this[i] = this[i+1];		
		}

		this[this.length-1] = null;
		this.length--;
		
		return first_value;
	}

}

//===================================================

function get(id) {
	// Version 1.00

	return document.getElementById(id);
}

//===================================================

document.getElementsByClass = function(c) {

	var result_list = Array();
	var list = document.getElementsByTagName('div');
	
	for (var i=0; i<list.length; i++) {
		if (list[i].className.indexOf(c,0)>=0) {
			result_list.push(list[i]);
		}
	}

	return result_list;

	//alert('getElementsByClass done');
}

//===================================================

	// browser check
var ie = (document.all) ? 1 : 0;

//===================================================

function statusMessage(m) {

	status = m;
	return true;

}

//===================================================
/*
function openWindow(name,url,left,top,width,height,scrollbars) {

	//features = 'width=120px,height=120px,left=528px,top=500px,scrollbars=yes';
		
	var f = ''

	if (!left) { left = 20; }
	if (!top) { top = 20; }
	if (!width) { width = 200; }
	if (!height) { height = 200; }
	if (!scrollbars) { scrollbars = 'no'; }
	//if (!sb) { sb = 'yes'; }

	f = 'left=' + left + 'px,top=' + top + 'px,width=' + width + 'px,height=' + height + "px,scrollbars=" + scrollbars + ",status=yes";

	window.open(url,name+'Win',f);

}
*/

function openWindow(name,url,left,top,width,height,scrollbars,status,toolbar,menubar,alwaysRaised,alwaysLowered,resizable,dependent) {
		// Version 1.11

	var f = ''

	if (!left) { left = 20; }
	if (!top) { top = 20; }
	if (!width) { width = 200; }
	if (!height) { height = 200; }
	if (scrollbars) { scrollbars = 'yes'; } else { scrollbars = 'no'; }
	if (status) { status = 'yes'; } else { status = 'no'; }		
	if (toolbar) { toolbar = 'yes'; } else { toolbar = 'no'; }		
	if (menubar) { menubar = 'yes'; } else { menubar = 'no'; }
	
	if (alwaysRaised) { alwaysRaised = 'yes'; } else { alwaysRaised = 'no'; }
	if (alwaysLowered) { alwaysLowered = 'yes'; } else { alwaysLowered = 'no'; }
	if (resizable) { resizable = 'yes'; } else { resizable = 'no'; }
	if (dependent) { dependent = 'yes'; } else { dependent = 'no'; }

	f = 'left=' + left + 'px,top=' + top + 'px,width=' + width + 'px,height=' + height + "px,scrollbars=" + scrollbars + ",status=" + status + ",toolbar=" + toolbar + ",menubar=" + menubar + ',alwaysRaised=' + alwaysRaised + ',alwaysLowered=' + alwaysLowered + ',resizable=' + resizable + ',dependent=' + dependent;

	//alert('features: ' + f);

	window.open(url,name+'Win',f);

}


//===================================================

function getRadioValue(r) {
			// Version 1.00

	for (var i=0; i<r.length; i++) {
		if (r[i].checked) {
			return r[i].value;
		}	
	}
	
}

//===================================================
/*

function isNotIE() {
		// Version 1.00
			alert('1');

	(document.getElementById('introimgDiv').style.visibility = 'hidden';
	document.getElementById('companyNameDiv').style.visibility = 'hidden';
	document.getElementById('skipdiv').style.visibility = 'hidden';
	document.getElementById('LeftColMiddleImgDiv').style.visibility = 'hidden';)

	if (document.getElementById('introimgDiv').style.visibility = 'visible';
	document.getElementById('companyNameDiv').style.visibility = 'visible';
	document.getElementById('skipdiv').style.visibility = 'visible';
	document.getElementById('LeftColMiddleImgDiv').style.visibility = 'visible';){
		return 1;
	} else {
		return 0;
	}
}
	alert('2');
*/
//===================================================

function isIE() {
		// Version 1.00
	if (document.all) {
		return 1;
	} else {
		return 0;
	}
}

//===================================================

function isMac() {
		// Version 1.00

	if (navigator.platform == "MacPPC") {
		return 1;
	} else {
		return 0;
	}
}

//===================================================

function transition(e) {
		// Version 1.10
	var ie = isIE();
	//var ie = 1;

	if (ie) {
		for (var i=0; i<e.length; i++) {
			if (e[i].filters[0]) {
				e[i].filters[0].apply();
			}
		}
		
	}
	
	for (var i=0; i<e.length; i++) {
		e[i].style.visibility = 'visible';
	}
	
	if (ie) {
		for (var i=0; i<e.length; i++) {
			if (e[i].filters[0]) {
				e[i].filters[0].play();
			}
		}
	}
}

//===================================================

function show(id) {
		// Version 1.00

	var h1 = document.getElementById(id);
	
	if (h1) {
		h1.style.visibility = 'visible';
	}

}

//===================================================

function hide(id) {
		// Version 1.00

	var h1 = document.getElementById(id);
	
	if (h1) {
		h1.style.visibility = 'hidden';
	}

}

//===================================================
