function popUp(URL,h,w) {
	var left = 0;
	var top = 0;

	if (h == '') {
		h = 400;
	}
	if (w == '' ) {
		w = 400;
	}

	if(window.innerWidth) {
		left = (window.innerWidth - w) / 2;
		top = (window.innerHeight - h) / 2;
	} else {
		left = (screen.width - w) / 2;
		top = (screen.height - h) / 2;
	}
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' + w +',height=' + h +',left = ' + left + ',top = ' + top + '');");
}

function changemodule(id) {
	longstring = id;
	brokenstring = longstring.split("-");
	singleid = brokenstring[0];

	document.getElementById(singleid).style.display = 'none';
	document.getElementById(id).style.display = 'block';
	document.getElementById(singleid+'active').style.background = 'none';
}

function returnmodule(id) {
   // return;
	longstring = id;
	brokenstring = longstring.split("-");
	singleid = brokenstring[0];

	document.getElementById(id).style.display = 'none';
	document.getElementById(singleid).style.display = 'block';
	document.getElementById(singleid+'active').style.background = 'url("/images/index/vcs/mypipe.gif")';
	document.getElementById(singleid+'active').style.backgroundRepeat = 'no-repeat';
	document.getElementById(singleid+'active').style.backgroundPosition = '127px 4px';
}

function selectphone() {
	var form = document.getElementById('phonesel');
	var dropindex = document.getElementById('phonesel').selectedIndex;
	location.href = form.options[dropindex].value;
}

function selectphonesorry() {
	var form = document.getElementById('phonesel2');
	var dropindex = document.getElementById('phonesel2').selectedIndex;
	location.href = form.options[dropindex].value;
}

function getScrollPosition() {
	var position = [0, 0];
	
	if(typeof window.pageYOffset != 'undefined') {
		position = [
			window.pageXOffset,
			window.pageYOffset,	
		];
	}else if (typeof document.documentElement.scrollTop != 'undefined' && document.documentElement.scrollTop > 0) {
		position = [
			document.documentElement.scrollLeft,
			document.documentElement.scrollTop,
		];
	}else if(typeof document.body.scrollTop != 'undefined') {
		position = [
			document.body.scrollLeft,
			document.body.scrollTop,
		];
	}
return position;
}

function getBrowserSize() {
	var size = [0, 0];
	
	if(typeof window.innerWidth != 'undefined') {
		size = [
			window.innerWidth,
			window.innerHeight
		];
	}else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		size = [
			document.documentElement.clientWidth,
			document.documentElement.clientHeight
		];
	}else {
		size = [
			document.getElementsByTagName('body')[0].clientWidth,
			document.getElementsByTagName('body')[0].clientHeight,
		];
	}
return size;
}

function hideSelects() {
	if(document.getElementById('quickSearchForm')) {
		document.getElementById('quickSearchForm').className = 'hidden_div';
	}
}

function identifyBrowser()
{
	var agent = navigator.userAgent.toLowerCase();
	
	if(typeof navigator.vendor != "undefined" && navigator.vendor == "KDE" && typeof window.sidebar != "undefined") {
		return "kde";	
	}else if(typeof window.opera != "undefined") {
		var version = parseFloat(agent.replace(/.*opera[\/ ]([^ $]+).*/, "$1"));
		if(version >= 7) {
			return "opera7";	
		}else if (version >= 5) {
			return "opera 5";
		}
		return false;
	}else if (typeof document.all != "undefined") {
		if(typeof document.getElementById != "undefined") {
			var browser = agent.replace(/.*ms(ie[\/ ][^ $]+).*/, "$1").replace(/ /, "");
			if(typeof document.uniqueID != "undefined") {
				if(browser.indexOf("5.5") != -1) {
					return browser.replace(/(.*5\.5).*/, "$1");	
				}else {
					return browser.replace(/(.*)\..*/, "$1");		
				}
			}else {
				return "ie5mac";	
			}
		}
		return false;
	}else if(typeof document.getElementById != "undefined") {
		if(navigator.vendor.indexOf("Apple Computer, Inc.") != -1) {
			if(typeof window.XMLHttpRequest != "undefined") {
				return "safari1.2";
			}
			return "safari1";
		}else if(agent.indexOf("gecko") != -1) {
				return "mozilla";
		}
	}
	return false;
}
