function checkHelp(searchString) {

    if(searchString.length<3) {
        alert("Bitte gib mindestens drei Zeichen ein.");
        return false;
    } else {
        return true;
    }
}

// ------------------------------------------------------------------

function setRandom(){
   return Math.round(Math.random()*(122-48))+48;
}

// ------------------------------------------------------------------

function randomString(z){

  var chars = new Array();
  var x=0;
  var y=0;

  while(chars.length!=z){
      var num =  setRandom();
      if((num>47 && num<58) || (num>65 && num<91) || (num>96 && num<123)){
          if((num>47 && num<58)&&(x<2)){
              chars.push(String.fromCharCode(num));
              x++;
          }else if(y<z-2){
              chars.push(String.fromCharCode(num));
              y++;
          }
      }
  }

  return chars.join('');
}

// ------------------------------------------------------------------

function popUp(url, width, height, options) {

    if(options=="") options = "location=no,menubar=0,scrollbars=no,status=no,toolbar=no";

    newWindow = window.open(url, randomString(6), 'height=' + height + ',width=' + width + ',' + options);
	newWindow.focus();
	return true;
}

// ------------------------------------------------------------------

function showPreviewImages(url,id){
    if (document.getElementById){
    	if ("" == url) {
    		document.getElementById(id).src="http://images.handy.de/de/handy/games/defaultGametitle.jpg";
    	} else {
         document.getElementById(id).src=url;
        }
    }
}

// ------------------------------------------------------------------



        function showPreviewImage(url,id){
            if (document.getElementById){
                document.getElementById(id).src=url;
            }
        }

        function hideLayer(id){
            if (document.getElementById)
                document.getElementById(id).style.visibility="hidden";
        }

        function showLayer(id){
            if (document.getElementById)
                document.getElementById(id).style.visibility="visible";
        }
     

// ------------------------------------------------------------------

	function send_url() {
		var index = document.forms['HandsetChange'].manufacturersDropDown.selectedIndex;		          
		var url = document.forms['HandsetChange'].manufacturersDropDown.options[index].value;;
		window.location.href = url;
	}
	
// ------------------------------------------------------------------

//	function openTrailer (file) {
//	  trailerwindow = window.open("/trailer/trailer.jsp?file=" + file, "trailer", "width=620,height=460,left=100,top=200");
//	  trailerwindow.focus();
//	}

	function openTrailer (file, trailerPreviewPicUrl) {
	  trailerwindow = window.open("/trailer/trailer.jsp?file=" + file + "&previewPicUrl=" + trailerPreviewPicUrl, "trailer", "width=620,height=460");
	  trailerwindow.focus();
	}
