<!--

function open_window(url)
{
 var newwindow;

 newwindow=window.open(url,'', 'scrollbars=yes, resizable=yes, status=1,toolbar=1, location=1, menubar=1');
 newwindow.moveTo(200,100);
 if (window.focus) {newwindow.focus()}
}

function removeSpaces(string) {
 var tstring = "";

 string = '' + string;
 splitstring = string.split(" ");
 for(l = 0; l < splitstring.length; l++) tstring += splitstring[l];

 return tstring;
}

function D_Parse(Str)
{

 var MAX_ID_LENGTH = 10;
 var i = 0;
 var j = 0;
 var error = 0;
 var pid;
 var str_url = "imvu:PeerReview?mcg=0&pid=";

 Str = removeSpaces(Str);

 var Str_length = Str.length;

 if (Str_length > MAX_ID_LENGTH){
	 /*modo URL */
	 
	 /* identifico pid */
	  j = (Str.indexOf('='));
	  k = (Str.indexOf('&'));

	  if (j==0){  /* caso ninguno ocurre */
		   str_url = "Invalid URL"; /* error */
	   } else {
	
		  if(k>0){
		  	pid = Str.substr(j+1,k-j-1);	  
		  } else {
		  	pid = Str.substr(j+1);		  
		  }

		 /*chequeo pid */
		   if ((pid.length < MAX_ID_LENGTH+1) && (pid.length > 0)){
		   	str_url = str_url + pid; /* construyo url */
		   } else {
		   	str_url = "Invalid URL"; /*error */
		   }
	  }
 } else {
 
	 /* modo PID */
	 
	  if( (!isNaN(Str)) && (Str_length < MAX_ID_LENGTH+1) && (Str_length>0)){
	   str_url = str_url + Str;
	  } else {
	    str_url = "Invalid PID"; /* error */
	  }

 }

 return str_url;
}

function View(Obj){

  var D_Str = Obj.Strng.value;

  d_url = D_Parse(D_Str);


  if (d_url.length < 20){
   alert(d_url); //caso error
  } else {
   open_window(d_url);
  }

}
-->
