function linkborderremove() {
	for(a in document.links) {
		document.links[a].onfocus = document.links[a].blur;
	}
}

function popup(photo, title, width, height) {
	var content="<html><head><title>"+title+"</title></head><body topmargin='0' leftmargin='0'><p><a href='javascript:self.close()'><img border='0' src='"+photo+"'></a><div id='Layer1' style='position:absolute; z-index:1; left: 2; top: 2; background-color:#000; padding:5px;'><a href='javascript:window.close();'  style='text-decoration:none;'><font size='1' color='white' face='Arial'>"+title+"</font></a></div></p></body></html>";
	var new_win=open("","","title="+title+",resizable=no,scrollbars=no,width="+width+", height="+height+"");
	new_win.document.write(content);
}

// opening popups
// Use like this:
// <a href="popup.html" onclick="return Popup.openup(this);">Popup with default size</a>
// <a href="popup.html" onclick="return Popup.openup(this,1000,400);">Popup with special size</a>
PopupWindow = {
	openup:function(obj, w, h) {
		var url = (obj.getAttribute)? obj.getAttribute('href') : obj.href;
		if(!url) return true; // if href is not given, no popup will be opened
		var w = (w === undefined)? 710 : w;
		var h = (h === undefined)? 570 : h;
		var pop = window.open(url, '', 'width='+w+', height='+h+', resizable=yes, scrollbars=yes');
		if (pop) {
			if (pop.focus) pop.focus();
			return false; // prevents link to open in parent window
		} else {
			return true; // if popup could not be opened link opens in original window
		}
	}
}

function resize(){
	var sidebar = document.getElementById('right_menu');
	var body = document.getElementById('body');

	var browserName = navigator.appName;
	if(browserName == "Microsoft Internet Explorer"){
    	var xtra_height = 8;
	}else{
		var xtra_height = 0;
	}

	if(sidebar && body.offsetHeight < sidebar.offsetHeight){
		var new_height = sidebar.offsetHeight+50;
		body.style.height = new_height+"px";
	}
}

function sendForm(e,id){
	var characterCode;

	if(e && e.which){
		e = e
		characterCode = e.which //character code is contained in NN4's which property
	}
	else{
		e = event
		characterCode = e.keyCode //character code is contained in IE's keyCode property
	}

	if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
		document.getElementById(id).submit() //submit the form
		return false
	}
	else{
		return true
	}
}

function showElement(id) {
	_showHide(id, 'visible');
}

function hideElement(id) {
	_showHide(id, 'hidden');
}

function _showHide(id, visibility){
	if(visibility == 'hidden'){
		display = 'none';
	}else{
		display = 'block';
	}
	if (document.getElementById) { // DOM3 = IE5, NS6
		document.getElementById(id).style.display = display; 
	} else {
		if (document.layers) { // Netscape 4
			document.id.visibility = visibility; 
		} else { // IE 4
			document.all.id.style.visibility = visibility; 
		}
	}
}

function removeFromBasket(id) {
	var to_remove = document.getElementById('remove_'+id);
	to_remove.checked = true;
	document.forms.basket.submit();
}
