
function openPopUp_520x390(href, target)
{
	window.open(href, target, 'width=520, height=390, top=0, toolbar=0, location=0, directories=0, status=1, menuBar=0, scrollBars=1, resizable=0');
	return false;
}
function InvalidEmail(elm)
{
	if (elm.value.indexOf("@") <= 0 || elm.value.indexOf(".") <= 0 || elm.value.indexOf("@.") > 0 || elm.value.indexOf(".@") > 0)
		return true;
	else
		return false;
}
function InvalidPassword(elm)
{
	if (elm.value.length < 6)
		return true;
	else
		return false;
}
function IsEmpty(elm)
{
	if (elm.value == '' || elm.value == null)
		return true;
	else
		return false;
}
function errorMsg(element, errmsg)
{
	alert(errmsg);
	element.focus();
	return false;
}
function showImage(source, target)
{
	document.getElementById(source).src = target;
}
function whichBrowser()
{
	var agt = navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1)
		return 'Opera';
	if (agt.indexOf("staroffice") != -1)
		return 'Star Office';
	if (agt.indexOf("webtv") != -1) 
		return 'WebTV';
	if (agt.indexOf("beonex") != -1)
		return 'Beonex';
	if (agt.indexOf("chimera") != -1)
		return 'Chimera';
	if (agt.indexOf("netpositive") != -1)
		return 'NetPositive';
	if (agt.indexOf("phoenix") != -1)
		return 'Phoenix';
	if (agt.indexOf("firefox") != -1)
		return 'Firefox';
	if (agt.indexOf("safari") != -1)
		return 'Safari';
	if (agt.indexOf("skipstone") != -1)
		return 'SkipStone';
	if (agt.indexOf("msie") != -1)
		return 'MSIE';
	if (agt.indexOf("netscape") != -1)
		return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1)
		return 'Mozilla';
	if (agt.indexOf('\/') != -1)
	{
		if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') 
		{
			return navigator.userAgent.substr(0,agt.indexOf('\/'));
		}
		else
			return 'Netscape';
	}
	else if (agt.indexOf(' ') != -1)
		return navigator.userAgent.substr(0,agt.indexOf(' '));
	else
		return navigator.userAgent;
}
function getBrowserVersion(tmp)
{
	switch(tmp)
	{
		case 'MSIE':
			return navigator.appVersion.match(/MSIE (.\..)/)[1] ;
			break;
	}
}
function heightOptimizer()
{
	var _height = document.getElementById('base_middle').offsetHeight;
		
	if(_height < document.getElementById('base_left').offsetHeight)
		_height = document.getElementById('base_left').offsetHeight;
	
	if (document.getElementById('base_right'))
	{
		if(_height < document.getElementById('base_right').offsetHeight)
			_height = document.getElementById('base_right').offsetHeight;
		document.getElementById('base_right').style.height = _height + 'px';
	}
	
	document.getElementById('base_left').style.height = _height + 'px';
	document.getElementById('base_middle').style.height = _height + 'px';
}
function loadTabContent(idx,no)
{
	document.getElementById('tab_1').className = 'pas';
	document.getElementById('tab_2').className = 'pas';
	document.getElementById('tab_3').className = 'pas';
	switch (no)
	{
		case 1:
			document.getElementById('tab_1').className = 'act';
			showProductDescription(idx);
			break;
		case 2:
			document.getElementById('tab_2').className = 'act';
			showProductComments(idx);
			break;
		case 3:
			document.getElementById('tab_3').className = 'act';
			showProductInstalments(idx);
			break;
	}
}