﻿function SelectInit(obj,v){
var sel=document.getElementById(obj);
for(var i=0;i<sel.length;i++){
 if(sel.options[i].text==v){
  sel.selectedIndex=i;
  break;}
}}

function suitImage(img,w,h){
	var image=new Image();
        image.src=img.src;
		var iw=image.width;
		var ih=image.height;
		var iratio=iw/ih;
        if(iw>w){
           iw=w;
		   ih=w/iratio;}
        if(ih>h){
           ih=h;
           iw=h*iratio;}  
		img.width=iw;
		img.height=ih;
}
