// JavaScript Document
function span_txtarea(obj){
	if(document.getElementById){		
	var nd = document.getElementById(obj);	
		if(nd.style.display != 'block'){
			nd.style.display = 'block';				
		}else{
			nd.style.display = 'none';							
		}
	}
}
function Expand_ans(){
		var count=document.frm_new_poll.hcount.value;		
		count++;
		var adh="";		
	  	adh ='<table width="100%"  border="1" style="border-collapse:collapse">'
      	adh+='<tr>'		
        adh+='<td colspan="3"><input name="txt_ans' + count + '" type="text" size="50">'
        adh+='</td>'        
      	adh+='</tr>'     
    	adh+='</table>'	
		
		Expand(adh,'div_ans')
		document.frm_new_poll.hcount.value=count;			
		if(document.frm_new_poll.hscount.value==""){
			document.frm_new_poll.hscount.value=count;
		}
		else{
			document.frm_new_poll.hscount.value+=";" + count;
		}
		return false;
	}
function Expand(adh,obj){				
		var f=document.getElementById(obj);		
		f.insertAdjacentHTML('BeforeEnd',adh);		
		return false;
	}	

function change_image(name_img,image)
{
//alert("gjhdjhg");
name_img.src=image;
name_img.blur();
return false;
}
function setFocus(Field) {
  Field.focus();
  //Field.select();
}

function isNumeric(sText,text) { 
	var ValidChars = "0123456789"+text; 
	var IsNumber=true; var Char; 
	if(isEmpty(sText)){
		IsNumber = false;
	}
	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) { 
			IsNumber = false; 
		} 
	} 
	return IsNumber; 
}

function isEmpty(TextField) {
	if ((TextField.length==0)||(TextField==null)) {
		return true;
	}else { 
		return false; 
	}
}

function trimString (str) {
	str = this != window? this : str;
	return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
