var title = "i-Store.hu – Szoftver Webáruház";
var url = top.location.href;

function bl() {
  if (navigator.userAgent.toLowerCase().indexOf("opera") != -1) {
    document.write('<a href="'+url+'" title="'+title+'" rel="sidebar">');
  } else {
    document.write('<a href="javascript:CreateBookmarkLink()">');
  }
  document.write('<img src="/img/button_kedvencek.png" border="0" alt="[BookmarkThis]" title="Oldal hozzáadása a Kedvencekhez (könyvjelző)" style="width:32px;height:32px;" /><\/a>');
}

function CreateBookmarkLink() {
  if (window.sidebar) { // firefox
  	window.sidebar.addPanel(title, url, "");
  } else if(document.all) { // ie
  	window.external.AddFavorite(url, title);
  } else {
  }
}

function NewWnd(element,exceptlocal) {
	if (exceptlocal==1&&element.getAttribute('href').search(/www\.i\-store\.hu/)>=0) return true
	var newWindow = window.open(element.getAttribute('href'), '_blank');
	newWindow.focus();
	return false;
}

function IncDLC(emt,opennewwnd) {
	var xtp=newXMLHTTP();
	if (!xtp||window.disableIncDLC) return false;

	// Open Xmlhttp
	xtp.open("GET","downloads.php?id="+window.location.href.match(/id=(\d+)/)[1]+"&t="+encodeURI(document.title));

	// Ready state listener
	xtp.onreadystatechange=function() {
		// Check for succesful request headers
		if (xtp.readyState==4) {
			var xtx=xtp.responseText;
			if (xtp.status==200) {
				if (opennewwnd==1) {
					//NewWnd(emt);
				} else window.location.href=emt.href;
			} else {
			}
		}
	}

	// Send request
	xtp.send(null);
	//window.disableIncDLC=true;
	if (opennewwnd==1) { NewWnd(emt); return  false; }
	emt.onclick=null;
	return false;
}

function newXMLHTTP() {
	var xmlhttp=false;

	// MS/IE ActiveX
	try { xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e1){ try { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e2) {
			xmlhttp=false;
		}
	}

	// Mozilla & Opera
	if (!xmlhttp&&typeof XMLHttpRequest!='undefined') {
		xmlhttp=new XMLHttpRequest();
	}

	if (!xmlhttp&&typeof XMLHttpRequest!='undefined') return false;

	return xmlhttp;
}