function win_open( url, w, h) {
	window.open( url,'mywindow','width='+w+',height='+h+',toolbar=no, location=no,directories=no,status=no,menubar=yes,scrollbars=yes,copyhistory=yes, resizable=yes');
}

	function clearOption(selectId){
		if(selectId=='option6'){document.getElementById(selectId).innerHTML="";}
		else{
		var ie = (document.all && !window.opera);
		var safari = navigator.userAgent.indexOf("Safari") != -1;
		if ( safari) {
			//*
			opt = document.getElementById(selectId);
			var cnt = opt.options.length;
			for( i=0; i<cnt; i++) {
				// opt[0]=null;
				opt.remove( 0);
			}
			//*/
		}
		else {
			document.getElementById(selectId).options.length=0;
		}
		}
	}    
	
	function addOption(selectId, txt, val,check){
		if(selectId=='option6'){
			if(val!=0){
			objRadio=createRadioElement('variant[6]',txt,val,check);
			document.getElementById(selectId).appendChild(objRadio);
			label=document.createTextNode(txt);
			document.getElementById(selectId).appendChild(label);
			document.getElementById(selectId).appendChild(document.createElement('br'));
			document.getElementById(selectId).setAttribute('style', 'border:none; margin:0; padding:0;');
			}
		}
		else{
		var safari = navigator.userAgent.indexOf("Safari") != -1;
		if ( safari) {
			var objOption = document.createElement('option');
			objOption.value = val;
			objOption.text = txt;
			document.getElementById(selectId).add(objOption);
		}
		else {
			//var objOption = new Option(txt, val);
			var objOption = document.createElement('option');
			objOption.value = val;
			objOption.text = txt;
			document.getElementById(selectId).options.add(objOption);
		}
		}
	}
	function addRadio(selectId, txt, val){
		var safari = navigator.userAgent.indexOf("Safari") != -1;
		if ( safari) {
			var objOption = document.createElement('option');
			objOption.value = val;
			objOption.text = txt;
			document.getElementById(selectId).add(objOption);
		}
		else {
			//var objOption = new Option(txt, val);
			var objOption = document.createElement('option');
			objOption.value = val;
			objOption.text = txt;
			document.getElementById(selectId).options.add(objOption);
		}
        
	}

	function setSelected(selectId, val){
		if(selectId!='option6'){
        opt = document.getElementById(selectId).options;
		for( i=0; i<opt.length; i++) {
			if (val == opt[i].value) {
				opt.selectedIndex = i;
			}
		}
		}
	}
	
	function addAssign(id,modify,data){
		elem=document.getElementById(id);
		switch(modify){
		case 'innerHTML': elem.innerHTML=data;break;
		case 'value': elem.value=data;break;
		case 'disabled': elem.disabled=data;break;
		default: break;
		}
	}
	function createRadioElement( name, txt,val, checked ) {
	    var radioInput;
	    try {
	        var radioHtml = '<input type="radio" name="' + name + 'value="' + val +'"';
	        if ( checked ) {
	            radioHtml += ' checked="checked"';
	        }
	        radioHtml += '/>';
	        radioInput = document.createElement(radioHtml);
	    } catch( err ) {
	        radioInput = document.createElement('input');
	        radioInput.setAttribute('type', 'radio');
	        radioInput.setAttribute('name', name);
	        radioInput.setAttribute('value', val);
	        if ( checked ) {
	            radioInput.setAttribute('checked', 'checked');
	        }
	    }

	    return radioInput;
	}

