
function appear(content, value) {
   
		if (typeof value == 'undefined') value = 0;
		if (value > 1) return;
		var property = content.filters ? 'filter' : 'opacity';
		content.style[property] = content.filters ? 'alpha(opacity=' + value*100 + ')' : value;
		setTimeout(function () {appear(content, value + .1)} , 100);
}

function hideShow(divObj, no){
	var winObj = document.getElementById(divObj);
	/*for(var i=1;i<=12;i++){
		if(i!=no)document.getElementById(divObj+i).style.display="none";
	}*/
	
if(winObj.style.display=="none"){
	winObj.style.display="";
	appear(winObj);

}
else
	winObj.style.display="none";

	   
}
function hideShowAll(divObj, no, state){
	for(var i=1;i<=no;i++){
		if(state)		
			document.getElementById(divObj+i).style.display="";
		else
			document.getElementById(divObj+i).style.display="none";
	}
}

function hideShowProfile(objName, state, textfield){
	//alert(textfield);
	if(document.getElementById(objName)!=null){
		document.getElementById(objName).style.display  = state;
		if(textfield!=null && state=='none'){
			if(textfield.type=="select-one"){
				textfield.selectedIndex=1;
				return;
			}
			if(state==""){if(textfield.value=="0")textfield.value="";}
			else{
				if(trim(textfield.value)=="")textfield.value="0";
			}
		}
	}
	
}

/* This method to set a value to select box*/
function setSelectBoxValue(selectObj, value){
		//default set it to 0
		selectObj.selectedIndex = 0;
		var result = false;
		
		for(var i=0;selectObj!=null&&i<selectObj.length;i++){
			if(selectObj.options[i].value==value){
				selectObj.selectedIndex = i;
				result = true;
			}
		}
		return result;
}


/* This method takes form obj and return the form variable names & values as query string*/
function getQueryString(formName){
	// Set up data variable
	var formdata = "";
	
	// Loop through form fields
	for (i=0; i < formName.length; i++)formdata = formdata + formName.elements[i].name + "=" + escape(formName.elements[i].value) + "&";
	
	return formdata;
}

/* This variable indicates whether the User logged out normal or not. */
var open_signout_window="true";

/** 
 * This function will be called whenever this page is Unloaded. 
 * This function is to close all the child windows and to make it signout.
 */
function openSignoutWindow(contextPath)
{
	if(open_signout_window =="true"){
		window.open(contextPath+"/MemberSignout.do?exit=yes","_blank","toolbar=0,menubar=0,scrollbars=1,status=0,height=50,width=300,top=100,left=100");
	}
}
