// Handle popup confirmation box

function popup()
{
	//var popupElement = document.getElementById('popupBox');
	//popupElement.style.display='';
	//setTimeout("hidepopup()",100000);
}

function hidepopup()
{
	//var popupElement = document.getElementById('popupBox');
	//popupElement.style.display='none';
}

// Handle popup failure notice
function popupfail()
{
	var popupElement = document.getElementById('popupBoxFail');
	popupElement.style.display='';
	setTimeout("hidepopupfail()",2000);
}

function hidepopupfail()
{
	var popupElement = document.getElementById('popupBoxFail');
	popupElement.style.display='none';
}
	
	
function openWin(url, winname, status)
{
	//var x = window.open("", "popup_menu")
//	x.close();
	x = window.open(url, "popup_menu", "width=700,height=350,scrollbars=yes,status=no");
	x.focus();
}

function openWin_promotioncode(url, winname, status)
{
	//var x = window.open("", "popup_menu")
//	x.close();
	x = window.open(url, "popup_menu", "width=400,height=350,scrollbars=yes,status=no");
	x.focus();
}

function borderRed(textbox)
{
	textbox.style.borderColor="red";
}

function resetBorder(textbox)
{
	textbox.style.borderColor="";
	textbox.style.borderWidth="1";
	textbox.style.borderStyle="solid";
}

var css_browser_selector = function() {
	var 
		ua=navigator.userAgent.toLowerCase(),
		is=function(t){ return ua.indexOf(t) != -1; },
		h=document.getElementsByTagName('html')[0],
		b=(!(/opera|webtv/i.test(ua))&&/msie (\d)/.test(ua))?('ie ie'+RegExp.$1):is('gecko/')? 'gecko':is('opera/9')?'opera opera9':/opera (\d)/.test(ua)?'opera opera'+RegExp.$1:is('konqueror')?'konqueror':is('applewebkit/')?'webkit safari':is('mozilla/')?'gecko':'',
		os=(is('x11')||is('linux'))?' linux':is('mac')?' mac':is('win')?' win':'';
	var c=b+os+' js';
	h.className += h.className?' '+c:c;
}();

var clearSearchbox = function(clientid)
{
	var box = document.getElementById(clientid);
	box.value="";	
};
