function findPhone(ArgManufacturer,ArgAltManufacturer){
	var endchar= " ";
	var extracted = new Array();
	var parsedmodel;
	String.prototype.replaceAll = function(find, replace) {
		var str = this;
		while (str.indexOf(find) > -1) {
			str = str.replace(find, replace);
		}
		return str;
	}
	for (i=0; i<PhonesInfoArray.length; i++){
		if ((PhonesInfoArray[i][0] == ArgManufacturer)&&(PhonesInfoArray[i][2]!=="-")){
			extracted[extracted.length]=new Array (PhonesInfoArray[i][0],PhonesInfoArray[i][1],PhonesInfoArray[i][2]);
		}
	}
	for (i=0; i<PhonesInfoArray.length; i++){
		if ((PhonesInfoArray[i][0] == ArgAltManufacturer)&&(PhonesInfoArray[i][2]!=="-")){
			extracted[extracted.length]=new Array (PhonesInfoArray[i][0],PhonesInfoArray[i][1],PhonesInfoArray[i][2]);
		}
	}
	for (i=0; i<extracted.length;i++){
		if (i==(extracted.length-1)){
			endchar=" ";
		}
		else{
			endchar=", ";
		}
		parsedmodel=extracted[i][1].replaceAll("/",", ");
		document.write (parsedmodel+endchar);
	}
}

function ShowMobilesByCompany(SetPlatform, ArrComps){
	var endchar=", ";
	var parsedmodel;
	var blnfound=false;
	var endblock=false;
	var j=0;
	var k=0;
	var extracted=new Array();
	var filteredphones=new Array();
	for (i=0;i<ArrComps.length;i++){
		while ((j<=PhonesInfoArray.length)&&(!blnfound)){
			if (PhonesInfoArray[j][0]==ArrComps[i]){
				k=j;
				while ((k<=PhonesInfoArray.length)&&(!endblock)){
					if (ArrComps[i]!==PhonesInfoArray[k][0]){
						endblock=true;
					}
					else{
						extracted[extracted.length]=PhonesInfoArray[k];
						k++;
					}
				}
			blnfound=true;
			}
			j++;
		}
		j=0;
		k=0;
		blnfound=false;
		endblock=false;
	}
	for (i=0;i<extracted.length;i++){
		if ((extracted[i][2]!=="-")&&(extracted[i][3]==SetPlatform)){
			filteredphones[filteredphones.length]=extracted[i];
		}
	}
	for (i=0;i<filteredphones.length;i++){
		if (((i>1)&&(filteredphones[i][0]!==filteredphones[i-1][0]))||(i==0)){
			document.writeln ("<strong>"+filteredphones[i][0]+":</strong>");
		}
		if (i==filteredphones.length-1){
			endchar="";
		}
		parsedmodel=filteredphones[i][1];
		parsedmodel=parsedmodel+endchar;
		document.write (parsedmodel);
	}
}

function ShowMobilesByCompanyNG (SetPlatform, ArrComps){
var VendorsList = new Array();
var i=0;
var j=0;
var len=0;
var sModels="";
var sVendor="";
	for (i=0;i<ArrComps.length;i++)
		VendorsList[VendorsList.length] = new Array(ArrComps[i], new Array());
	

	for (i=0;i<PhonesInfoArray.length;i++){
		for (j=0;j<VendorsList.length;j++){   // â® IndexOf ¥®å®â  äã­ªæ¨î ¯¨á âì ;)
			if ((PhonesInfoArray[i][0] == VendorsList[j][0])&&(PhonesInfoArray[i][3]==SetPlatform)){
				len = VendorsList[j][1].length;
				VendorsList[j][1][len] = PhonesInfoArray[i][1];
			}	
		}
	}
	for (i=0;i<VendorsList.length;i++)
		if (VendorsList[i][1].length > 0)
		{
			document.write("<b>"+VendorsList[i][0]+"</b>: ");
			sModels = VendorsList[i][1].toString();
			sModels = sModels.replace(/,/gi,", ");
			document.write(sModels+"; ");
		}
}

function ShowMobilesByPlatform (ArgManufacturer,Platform){
	var endchar= " ";
	var extracted = new Array();
	var parsedmodel;
		String.prototype.replaceAll = function(find, replace) {
		var str = this;
		while (str.indexOf(find) > -1) {
			str = str.replace(find, replace);
		}
		return str;
	}
	for (i=0; i<PhonesInfoArray.length; i++){
		if (((PhonesInfoArray[i][0] == ArgManufacturer)&&(PhonesInfoArray[i][2]!=="-"))&&(PhonesInfoArray[i][4]==Platform)){
			extracted[extracted.length]=new Array (PhonesInfoArray[i][0],PhonesInfoArray[i][1],PhonesInfoArray[i][2]);
		}
	}
	for (i=0; i<extracted.length;i++){
		if (i==(extracted.length-1)){
			endchar=" ";
		}
		else{
			endchar=", ";
		}
		parsedmodel=extracted[i][1].replaceAll("/",", ");
		document.write (parsedmodel+endchar);
}
}

function ShowMobilesByPlatformVer (ArgManufacturer,Platform,Version){
	var endchar= " ";
	var extracted = new Array();
	var parsedmodel;
		String.prototype.replaceAll = function(find, replace) {
		var str = this;
		while (str.indexOf(find) > -1) {
			str = str.replace(find, replace);
		}
		return str;
	}
	for (i=0; i<PhonesInfoArray.length; i++){
		if (((PhonesInfoArray[i][0] == ArgManufacturer)&&(PhonesInfoArray[i][2]!=="-"))&&((PhonesInfoArray[i][4]==Platform)&&(PhonesInfoArray[i][6]==Version))){
			extracted[extracted.length]=new Array (PhonesInfoArray[i][0],PhonesInfoArray[i][1],PhonesInfoArray[i][2]);
		}
	}
	for (i=0; i<extracted.length;i++){
		if (i==(extracted.length-1)){
			endchar=" ";
		}
		else{
			endchar=", ";
		}
		parsedmodel=extracted[i][1].replaceAll("/",", ");
		document.write (parsedmodel+endchar);
	}
}

function GetMobilesByPlatform (ArgManufacturer2,Platform2){
	var extracted2 = new Array();
	var filtered2 = new Array();
		String.prototype.replaceAll = function(find, replace) {
		var str = this;
		while (str.indexOf(find) > -1) {
			str = str.replace(find, replace);
		}
		return str;
	}
	for (i=0; i<PhonesInfoArray.length; i++){
		if (((PhonesInfoArray[i][0] == ArgManufacturer2)&&(PhonesInfoArray[i][2]!=="-"))&&(PhonesInfoArray[i][4]==Platform2)){
			extracted2[extracted2.length]=new Array (PhonesInfoArray[i][0],PhonesInfoArray[i][1],PhonesInfoArray[i][2]);
		}
	}
	for (i=0; i<extracted2.length;i++){
		extracted2[i][1]=extracted2[i][1].replaceAll("/",", ");
		filtered2[i]=extracted2[i][1].replaceAll(" ","&nbsp;");
}
	return filtered2;
}


/*function GetCompsByPlatform (ArgPlatform){
	var j;
	var k=0;
	var count=0;
	var blnfound=false;
	var endblock=false;
	var ArrComps = new Array();
	var extracted = new Array();
	for (i=0;i<PhonesInfoArray.length;i++){
		if ((((i>0)&&(PhonesInfoArray[i][0]!==PhonesInfoArray[i-1][0]))||(i==0))&&((PhonesInfoArray[i][4]==ArgPlatform)&&(PhonesInfoArray[i][0]!=="Windows Mobile"))){
			ArrComps[j]=PhonesInfoArray[i][0];
			j=ArrComps.length;
		}
	}
	return ArrComps;
}*/

function GetCompsByPlatform (ArgPlatform){
	var j=0;
	var ArrComps = new Array();
	var filtered = new Array();
	for (i=0;i<PhonesInfoArray.length;i++){
		if ((PhonesInfoArray[i][4]==ArgPlatform)&&(PhonesInfoArray[i][0]!=="Windows Mobile")){
			filtered[filtered.length]=PhonesInfoArray[i][0];
		}
	}
	for (i=0;i<filtered.length;i++){
		ArrComps[j]=filtered[i];
		if ((i<(filtered.length-1))&&(filtered[i]!==filtered[i+1])){
			j++;
		}
	}
	return ArrComps;
}

function AllPlatform(ArgPlatform,Commit){
	var endchar=", ";
	var parsedmodel;
	var delim="</td></tr><tr><td style=\"text-align:center;font-weight:bold;background:#F2F2F2;\">";
	var Models=new Array();
	var CompMans=new Array();
	var Manufacturer;
	CompMans=GetCompsByPlatform(ArgPlatform);
	for (ndx=0;ndx<CompMans.length;ndx++){
		Models[ndx]=new Array();
		Manufacturer=CompMans[ndx];
		Models[ndx]=GetMobilesByPlatform(Manufacturer,ArgPlatform);
		document.write ("<strong>"+Manufacturer+"</strong>&nbsp;</td><td style=\"text-align:center;padding:7px;\">");
		document.write (Commit+"</td><td style=\"padding:7px;\">");
		endchar=", ";
		for (mc=0;mc<Models[ndx].length;mc++){
			if (mc==(Models[ndx].length-1)){
				endchar="";
			}
			parsedmodel=Models[ndx][mc]+endchar;
			document.write (parsedmodel);
			parsedmodel="";
		}
		/*document.write (Models[ndx]);*/
		if (ndx<(CompMans.length-1)){
			document.write (delim);
		}
	}
	
}

/*Êîïèÿ ïðîöåäóðû AllPlatform äëÿ âûâîäà â âèäå ñïèñêà äëÿ âñòàâêè â Help */
function AllPlatformList(ArgPlatform,Commit){
	var endchar=", ";
	var parsedmodel;
	var delim="</li><li>";
	var Models=new Array();
	var CompMans=new Array();
	var Manufacturer;
	CompMans=GetCompsByPlatform(ArgPlatform);
	for (ndx=0;ndx<CompMans.length;ndx++){
		Models[ndx]=new Array();
		Manufacturer=CompMans[ndx];
		Models[ndx]=GetMobilesByPlatform(Manufacturer,ArgPlatform);
		document.write (Manufacturer+": ");
		endchar=", ";
		for (mc=0;mc<Models[ndx].length;mc++){
			if (mc==(Models[ndx].length-1)){
				endchar="";
			}
			parsedmodel=Models[ndx][mc]+endchar;
			document.write (parsedmodel);
			parsedmodel="";
		}
		/*document.write (Models[ndx]);*/
		if (ndx<(CompMans.length-1)){
			document.write (delim);
		}
	}
	
}