
<!--

window.onload = init;
function init(){
document.cookie = 'RCCLICK= ;expires=Fri, 27 Jul 2001 02:47:11 UTC ;path=/';
var a = document.getElementsByTagName('body');
for (var i=0;a[i];i++){if(a[i].addEventListener){a[i].addEventListener('click',recclick,true);}
else {a[i].attachEvent('onclick',recclick);}}
}

function recclick(e){
var s,y,x=0;if(e.pageX){x=e.pageX;y=e.pageY;if(e.clientY){s=y-e.clientY;}}
else if(e.clientX){x=e.clientX+document.body.scrollLeft;s=document.body.scrollTop;y=e.clientY+s;}
document.cookie = 'RCCLICK=X'+x+'Y'+y+'S'+s+'P'+encodeURI(window.location.href)+' ;path=/';
}

function Go(theForm, hasOld,cat_id) {
	var key = theForm.options[document.orderform.orderselect.selectedIndex].value;
	if(hasOld) {
		var showold = theForm.showold.value;
	}

	// set the correct href
	if (key == "popular") {
		var ref = 'reviews.php?id=' + cat_id + '&level=items&sort=popular';
		if(hasOld){ref += '&showold=' + showold;}
		location.href = ref;
	} else if (key == "name") {
		var ref = 'reviews.php?id=' + cat_id + '&level=items&sort=name';
		if(hasOld){ref += '&showold=' + showold;}
		location.href = ref;
	} else if(key == "price") {
		var ref = 'reviews.php?id=' + cat_id + '&level=items&sort=price';
		if(hasOld){ref += '&showold=' + showold;}		
		location.href = ref;
	} else 	if (key == "rating") {
		var ref = 'reviews.php?id=' + cat_id + '&level=items&sort=rank';
		if(hasOld){ref += '&showold=' + showold;}		
		location.href = ref;
	} 
}

function getById(id) {
   return document.getElementById?document.getElementById(id):(document.all?document.all(id):null);
}

function addbookmark(host,url,title){
  var bookmarkurl="http://" + host + url;
  var bookmarktitle="ReviewCentre.de: " + title;
  if (document.all)
  window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function hideDiv(id) {
	getById(id).style.visibility = "hidden";
	getById(id).style.display = "none";
}

function showDiv(id) {
	getById(id).style.visibility = "visible";
	getById(id).style.display = "inline";
}

//used for redirect in a new window//
function goN($url){
  window.open($url, '_blank','');
 return false;	
}

//decide wheh=ther or not to display the images
function showImage(cat_id, sort, Img){
	var ref = 'reviews.php?id=' + cat_id + '&level=items&sort='+sort+'&page=0';
	if(Img=='1') ref += '&categShowImg=1';
	else ref += '&categShowImg=-1';		
	location.href = ref;

}



// Links to the page given by a splitted URL.
// The arguments are the tokens forming the splitted URL.
function noslink(){
   var url = '';	
   for (i = 0; i < arguments.length; i++) { 
      url = url + arguments[i];
   }
	document.location.href=url;
}
function noslinknw() {
	var url = '';
	for (i = 0; i < arguments.length; i++) {
		url = url + arguments[i];
	}
	var win = window.open(url);
	win.focus();
}
function uenosln(url) {
	u = new String(url);
	u = u.replace(/%3D/g,"=");
	u = u.replace(/%26/g,"&");
	u = u.replace(/%3F/g,"?");
	u = u.replace(/%2F/g,"/");
	u = u.replace(/%2C/g,",");
	return u;
}
function goTo($link){
  window.location =  $link;
}
function onBrowseSubmit(theForm) {
  var categ=theForm.browse_menu.options[theForm.browse_menu.selectedIndex].value;
   if(categ== "-1"){
 window.alert("Please select a category from the drop down menus");
     return false;
   }
}
// repeated in rcGB
function fillSelectFromArray(selectCtrl, itemArray, defaultItem, goodPrompt, badPrompt) {
  var i, j;
  var prompt;
// empty existing items
  
  for (i = selectCtrl.options.length; i >= 0; i--) {
    selectCtrl.options[i] = null; 
  }
  prompt = (itemArray != null) ? goodPrompt : badPrompt;
  if (prompt == null) {
    j = 0;
  }
  else {
    selectCtrl.options[0] = new Option(prompt);
    j = 1;
  }
  if (itemArray != null) {
    // add new items
    for (i = 0; i < itemArray.length; i++) {
      selectCtrl.options[j] = new Option(itemArray[i][0]);
      if (itemArray[i][1] != null) {
	selectCtrl.options[j].value = itemArray[i][1]; 
	if(defaultItem>0 && defaultItem==i ) {	 
	  selectCtrl.options[j].selected = true;
	}
      }
      j++;
    }
    // select first item (prompt) for sub list
    if(defaultItem>0) {}
    else{
      selectCtrl.options[0].selected = true;
    }
  }  
}

//-- banner -//
var bdv = null;
var bn_rn = new String (Math.random()); 
var clk_count = 0;
function bnc(nm) {
	if(nm != null && nm.length > 0 && nm.charAt(0) != '_') {
		clk_count++;
		im = new Image();
		im.src = '/bnc_'+nm+'.gif?i='+bn_rn+'.'+clk_count;
	}
}
function bnd(nm) {
    if(nm != null && nm.length > 0 && nm.charAt(0) != '_') {
	clk_count++;
	imd = new Image();
	imd.src = '/bnd_'+nm+'.gif?i='+bn_rn+'.'+clk_count;
    }
}
//-- end banner --//

//-->
