function ge(nm){if(document.all){return document.all[nm];} else {return document.getElementById(nm);}}

function smodels(){
	var vendorselect=ge('vendorselect');
	var modelselect=ge('modelselect');
	
	if(modelselect && vendorselect){
		for(var u=modelselect.options.length-1;u>=0;u--){ modelselect.options[u]=null; }
		var new_option=document.createElement('OPTION');
		modelselect.options.add(new_option);
		new_option.innerHTML='Все модели';
		new_option.value=0;
		
		for(var u=0;u<vendors[vendorselect.value].length;u++){
			var new_option=document.createElement('OPTION');
			modelselect.options.add(new_option);
			new_option.innerHTML=vendors[vendorselect.value][u][1];
			new_option.value=vendors[vendorselect.value][u][0];
		}    	
	
	}
}

function ord_smodels(){
	var vendorselect=ge('ord_vendor');
	var modelselect=ge('ord_model');
	
	if(modelselect && vendorselect){
		for(var u=modelselect.options.length-1;u>=0;u--){ modelselect.options[u]=null; }
		var new_option=document.createElement('OPTION');
		modelselect.options.add(new_option);
		new_option.innerHTML='Модель телефона';
		new_option.value=0;
		
		for(var u=0;u<vendors[vendorselect.value].length;u++){
			var new_option=document.createElement('OPTION');
			modelselect.options.add(new_option);
			new_option.innerHTML=vendors[vendorselect.value][u][1];
			new_option.value=vendors[vendorselect.value][u][0];
		}    	
	
	}
}

function play_sound(u){
	
	var agt=navigator.userAgent.toLowerCase();
	var hei=150;
	var wid=300;
	if(agt.indexOf("opera")!=-1 || agt.indexOf("opera/")!=-1){ hei=143; }
	else if(agt.indexOf("firefox")!=-1 || agt.indexOf("firefox/")!=-1){ hei=145; }
	var wh=screen.availHeight;
	var ww=screen.availWidth;
	var x=Math.round((ww-wid)/2);
	var y=Math.round((wh-hei)/2-100);
	
	window.open(u,"playsound","height="+hei+",width="+wid+",top="+y+",left="+x+",directories=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0");

	return false;
}

function showcontent(ctp,ctid,vnd,mdl){
	
	var hei=700;
	var wid=610;
	var wh=screen.availHeight;
	var ww=screen.availWidth;
	var x=Math.round((ww-wid)/2);
	var y=Math.round((wh-hei)/2);
	
	window.open("/popcontent/"+ctp+"/"+ctid+"/"+vnd+"/"+mdl,"showcontent","height="+hei+",width="+wid+",top="+y+",left="+x+",directories=0,location=0,menubar=0,resizable=1,scrollbars=yes,status=0,toolbar=0");

	return false;
}
