/* Copyrighted 2007 - 2010 */
/* Author : Manoj babu.B */
/* Developed @ Arman Infotech Systems, Bangalore , INDIA*/
/* Created on 08-June-2008 */

// Loading the Countries and States using XML

function getCountryCombo(strCountryDef)  {
	
	if (window.ActiveXObject)
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	else if (document.implementation && document.implementation.createDocument) 
		xmlDoc=document.implementation.createDocument("","",null);
	else 
		alert('Your browser cannot handle this script');
	
	xmlDoc.async=false;
	xmlDoc.load("Resources/Scripts/XML/countryDetails.xml");
	var countryCollection = xmlDoc.getElementsByTagName('country');
	var targetCombo = document.getElementById('ddlCountry');
	clearCombo('ddlCountry');

	if(countryCollection.length>0) {
		
		var cnt = 0;
		var cntryName = '';
		for(cnt=0;cnt<countryCollection.length;cnt++) {
			cntryName = countryCollection[cnt].getAttribute("name")
			targetCombo.options[cnt+1] = new Option(cntryName, cntryName, false, false);
		}
	}
	if(strCountryDef !='') {
		targetCombo.value = strCountryDef;
		getStateCombo(strCountryDef)
	}
} //End of getCountryCombo

function getStateCombo(strCountry) {
	if (window.ActiveXObject)
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	else if (document.implementation && document.implementation.createDocument) 
		xmlDoc=document.implementation.createDocument("","",null);
	else 
		alert('Your browser cannot handle this script');
	
	xmlDoc.async=false;
	xmlDoc.load("Resources/Scripts/XML/countryDetails.xml");
	var countryCollection = xmlDoc.getElementsByTagName('country');
	if(countryCollection.length>0) {
		var cnt = 0;
		var stateCollection = '';
		for(cnt=0;cnt<countryCollection.length;cnt++) {
			if(countryCollection[cnt].getAttribute("name") == strCountry) {
				stateCollection = 	countryCollection[cnt].getElementsByTagName('state');
				var targetCombo = document.getElementById('ddlState');
				var stateName = '';
				if(stateCollection.length>0) {
						var st = 0;
						clearCombo('ddlState');
						for(st=0;st<stateCollection.length;st++) {
							stateName = stateCollection[st].getAttribute("name")
							targetCombo.options[st+1] = new Option(stateName, stateName, false, false);
						}
				}	
				break;
			}	
		}
	}

} //End of getStateCombo


// Loading the Countries and States using XML

function getCountryBusinessCombo(strCountryDef)  {
	
	if (window.ActiveXObject)
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	else if (document.implementation && document.implementation.createDocument) 
		xmlDoc=document.implementation.createDocument("","",null);
	else 
		alert('Your browser cannot handle this script');
	
	xmlDoc.async=false;
	xmlDoc.load("Resources/Scripts/XML/countryDetails.xml");
	var countryCollection = xmlDoc.getElementsByTagName('country');
	var targetCombo = document.getElementById('ddlBCountry');
	clearCombo('ddlBCountry');

	if(countryCollection.length>0) {
		
		var cnt = 0;
		var cntryName = '';
		for(cnt=0;cnt<countryCollection.length;cnt++) {
			cntryName = countryCollection[cnt].getAttribute("name")
			targetCombo.options[cnt+1] = new Option(cntryName, cntryName, false, false);
		}
	}
	if(strCountryDef !='') {
		targetCombo.value = strCountryDef;
		getStateBusinessCombo(strCountryDef)
	}
} //End of getCountryCombo

function getStateBusinessCombo(strCountry) {
	if (window.ActiveXObject)
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	else if (document.implementation && document.implementation.createDocument) 
		xmlDoc=document.implementation.createDocument("","",null);
	else 
		alert('Your browser cannot handle this script');
	
	xmlDoc.async=false;
	xmlDoc.load("Resources/Scripts/XML/countryDetails.xml");
	var countryCollection = xmlDoc.getElementsByTagName('country');
	if(countryCollection.length>0) {
		var cnt = 0;
		var stateCollection = '';
		for(cnt=0;cnt<countryCollection.length;cnt++) {
			if(countryCollection[cnt].getAttribute("name") == strCountry) {
				stateCollection = 	countryCollection[cnt].getElementsByTagName('state');
				var targetCombo = document.getElementById('ddlBState');
				var stateName = '';
				if(stateCollection.length>0) {
						var st = 0;
						clearCombo('ddlBState');
						for(st=0;st<stateCollection.length;st++) {
							stateName = stateCollection[st].getAttribute("name")
							targetCombo.options[st+1] = new Option(stateName, stateName, false, false);
						}
				}	
				break;
			}	
		}
	}

} //End of getStateCombo


/*
* Clears the Drop Down Values Except the First Option
* @Parameter is Drop Down list ID
*/
function clearCombo(cntrlName) {
		var targetCombo = document.getElementById(cntrlName);
		for(var j=targetCombo.length;j>0;j--)
			targetCombo.options[j] = null;
} //End of clearCombo


// Loading the Area of Interest using XML
function getAreaInterestCombo(strAreaDef)  {
	
	if (window.ActiveXObject)
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	else if (document.implementation && document.implementation.createDocument) 
		xmlDoc=document.implementation.createDocument("","",null);
	else 
		alert('Your browser cannot handle this script');
	
	xmlDoc.async=false;
	xmlDoc.load("Resources/Scripts/XML/AreaInterest.xml");
	var AreaCollection = xmlDoc.getElementsByTagName('Area');
	var targetCombo = document.getElementById('ddlInterest');
	clearCombo('ddlInterest');

	if(AreaCollection.length>0) {
		
		var cnt = 0;
		var cntryName = '';
		for(cnt=0;cnt<AreaCollection.length;cnt++) {
			AreaName = AreaCollection[cnt].getAttribute("name")
			targetCombo.options[cnt+1] = new Option(AreaName, AreaName, false, false);
		}
	}
	if(strAreaDef !='') {
		targetCombo.value = strAreaDef;
		getSkillsCombo(strAreaDef)
	}
} //End of getCountryCombo


function getSkillsCombo(strArea) {
	if (window.ActiveXObject)
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	else if (document.implementation && document.implementation.createDocument) 
		xmlDoc=document.implementation.createDocument("","",null);
	else 
		alert('Your browser cannot handle this script');
	
	xmlDoc.async=false;
	xmlDoc.load("Resources/Scripts/XML/AreaInterest.xml");
	var AreaCollection = xmlDoc.getElementsByTagName('Area');
	if(AreaCollection.length>0) {
		var cnt = 0;
		var skillCollection = '';
		for(cnt=0;cnt<AreaCollection.length;cnt++) {
			if(AreaCollection[cnt].getAttribute("name") == strArea) {
				skillCollection = 	AreaCollection[cnt].getElementsByTagName('skill');
				var targetCombo = document.getElementById('ddlSkills');
				var stateName = '';
				if(skillCollection.length>0) {
						var st = 0;
						clearCombo('ddlSkills');
						for(st=0;st<skillCollection.length;st++) {
							skillName = skillCollection[st].getAttribute("name")
							targetCombo.options[st+0] = new Option(skillName, skillName, false, false);
						}
				}	
				break;
			}	
		}
	}

} //End of getSkillsCombo

function CopyFields(){
	var txtBAddress = document.getElementById('txtBAddress');
	var txtBCity = document.getElementById('txtBCity');
	var ddlBCountry = document.getElementById('ddlBCountry');
	var ddlBState = document.getElementById('ddlBState');
	var txtBZip = document.getElementById('txtBZip');
	var txtBEmail = document.getElementById('txtBEmail');
	var txtBPhone = document.getElementById('txtBPhone');
	var txtBFax = document.getElementById('txtBFax');
	
	var txtAddress = document.getElementById('txtAddress');
	var txtCity = document.getElementById('txtCity');
	var ddlCountry = document.getElementById('ddlCountry');
	var ddlState = document.getElementById('ddlState');
	var txtZip = document.getElementById('txtZip');
	var txtEmail = document.getElementById('txtEmail');
	var txtPhone = document.getElementById('txtPhone');
	var txtFax = document.getElementById('txtFax');
	
	var chkCopyPersonal = document.getElementById('chkCopyPersonal');
	
	if(chkCopyPersonal.checked == true)
	{
		getStateBusinessCombo(ddlCountry.value)
		txtBAddress.value = txtAddress.value;
		txtBCity.value = txtCity.value;
		ddlBCountry.value = ddlCountry.value;
		ddlBState.value = ddlState.value;
		txtBZip.value = txtZip.value;
		txtBEmail.value = txtEmail.value;
		txtBPhone.value = txtPhone.value;
		txtBFax.value = txtFax.value;

	}
	else
	{
		txtBAddress.value = "";
		txtBCity.value = "";
		ddlBCountry.value = "0";
		ddlBState.value = "0";
		clearCombo('ddlBState');
		txtBZip.value = "";
		txtBEmail.value = "";
		txtBPhone.value = "";
		txtBFax.value = "";
	}
}



function createXMLRequest() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer")
        XMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
	else
        XMLHttp = new XMLHttpRequest();
    return XMLHttp;
} //End of createXMLRequest

/*
* Method to validate the Uniqueness
* @Parameter - Value,Table Name,formObject to Submit,Message For non-unique values
*/
function checkUniqueCode(codeValueObject,strCondition,strTableName,formObject,strMessage) {
		var url = "Resources/Lib/codeValidate.php?strTableName="+strTableName+"&strCondition="+strCondition;
		var XMLHttp = createXMLRequest();
		XMLHttp.open('GET', url,true);
		XMLHttp.onreadystatechange = function() {
			if(XMLHttp.readyState == 4)  {
				if(XMLHttp.status == 200)  {
					handleResponse(XMLHttp.responseXML,formObject,codeValueObject,strMessage);
				}
				else  {
					alert('Sorry,Problem Occured in Code Validation!!!');
				}
			}
		};
		XMLHttp.send(null);
} //End of checkUniqueCode

/*
* Method to parse the returned XML
* It'll parse the exactly following XML Document
* <rootNodes>
*	<messages>
*		<value>Invalid/Valid</value>
*	</messages>
* </rootNodes>
*/
function handleResponse(validateXML,formObject,inputObject,strMessage) {
	var rootNodes = validateXML.getElementsByTagName('rootNodes')[0];
	var messageCollection = '';
	var returnResult = '';
	if(rootNodes.childNodes.length>0) {
		messageCollection = rootNodes.childNodes[0];
		returnResult = messageCollection.getElementsByTagName('value')[0].childNodes[0].nodeValue;
		if(returnResult == 'Invalid') { //If Code found in DB and Prompt the user
			alert(strMessage);
			inputObject.value = '';
			inputObject.focus();
			return false;
		}
		else //If Code is not available in DB and Submit the Form for saving the Record
			formObject.submit();
	}
} //End of handleResponse

/*
* Method to Change the inner HTML of an Given Element,
*/
function changeInnerHTML(elemnt,strMsg) {
	if(strMsg)
		document.getElementById(elemnt).innerHTML = strMsg;
	else
		document.getElementById(elemnt).innerHTML = '&nbsp;';
} //End of changeInnerHTML

/*
* Method to Change the location of the Window
*/
function changeLocation(strURL,parentFlag) {
	if(parentFlag)
		parent.document.location.href = strURL;			
	else
		document.location.href = strURL;
} //End of changeLocation

/*
* Method to Change the location of the Window
*/
function changeURL(strURL,parentFlag,alertMsg) {
	if(alertMsg) {
		if(confirm("The Haitian League - \n\n"+alertMsg))  {
			changeLocation(strURL,parentFlag);
		}
		else {
			return false;
		}
	}
	else
		changeLocation(strURL,parentFlag);	
} //End of changeLocation

/*
* Method to remove the Space in the start and end
*/
function Trim(str) {
	return RTrim(LTrim(str));
} //End of Trim

/*
* Method to remove the Space in the start
*/
function LTrim(str){
	if(str==null){
		return null;
	}
	for(var i=0;str.charAt(i)==" ";i++);
		return str.substring(i,str.length);
} //End of LTrim

/*
* Method to remove the Space in the End
*/
function RTrim(str){
	if(str==null){
		return null;
	}
	for(var i=str.length-1;str.charAt(i)==" ";i--);
		return str.substring(0,i+1);
} //End of RTrim

/*
* Clears the Drop Down Values Except the First Option
* @Parameter is Drop Down list ID
*/
function clearCombo(cntrlName) {
		var targetCombo = document.getElementById(cntrlName);
		for(var j=targetCombo.length;j>0;j--)
			targetCombo.options[j] = null;
} //End of clearCombo

// Function to cheak the Availability in hidden/Text Field with Delimter
function checkAvail(srcElemnt,pattern,delimter) {
	var strElemnt = document.getElementById(srcElemnt);
	if(Trim(strElemnt.value).length == 0) //Return when no Value is there
		return false;
	var delimValue = '';
	if(delimter)
		delimValue = delimter;
	else
		delimValue = ',';
	if(strElemnt.value.indexOf(delimValue)<0) {
		if(strElemnt.value == pattern)
			return true;
		else
			return false;
	}
	var strCollection = strElemnt.value.split(delimValue);
	var flag = false;
	var i=0;
	for(i=0;i<(strCollection.length-1);i++) {
		if(Trim(strCollection[i]) == pattern) {
			flag = true;
			break;	
		}
	}
	return flag;
} //End of checkAvail

// Method to Load One DD to the other one.And move the First DD value to hidden Field
function moveAllFromDropDown(sourceDD,targetDD,idHiddenElemnt) {
	var sourceElemnt = document.getElementById(sourceDD);
	var targetElemnt = document.getElementById(targetDD);
	if(sourceElemnt.length == 1) {
		alert('Sorry,No elements are available!');
		return;
	}
	idHiddenElemnt.value = '';
	for(i=0;i<sourceElemnt.length;i++) {
		targetElemnt.options[i] = new Option(sourceElemnt[i].text,sourceElemnt[i].value,false,false);
		idHiddenElemnt.value += sourceElemnt[i].value + ',';
	}
} //End of moveAllFromDD

// Move all the selected elements to Another DD and put it into Hidden
function addToDropDown(sourceDD,targetDD,idElemnt) {
	var sourceElemnt = document.getElementById(sourceDD);
	var targetElemnt = document.getElementById(targetDD);
	var idHiddenElemnt = document.getElementById(idElemnt);
	for(i=0;i<sourceElemnt.length;i++) {
		if(sourceElemnt.options[i].selected == true && sourceElemnt.options[i].value != 0) {
			maxLength = targetElemnt.length;
			targetElemnt.options[maxLength] = new Option(sourceElemnt.options[i].text,sourceElemnt.options[i].value,false,false);
			idHiddenElemnt.value += sourceElemnt.options[i].value + ',';
		}
	}
	
	for(j=(sourceElemnt.length-1);j>0;j--)
		if(sourceElemnt.options[j].selected == true)
			sourceElemnt.options[j] = null;
} //End of addToDropDown

// Move all the selected elements to Another DD and put it into Hidden
function removeFromDropDown(sourceDD,targetDD,idElemnt) {
	var sourceElemnt = document.getElementById(sourceDD);
	var targetElemnt = document.getElementById(targetDD);
	var idHiddenElemnt = document.getElementById(idElemnt);
	for(i=0;i<sourceElemnt.length;i++) {
		if(sourceElemnt.options[i].selected == true && sourceElemnt.options[i].value != 0) {
			maxLength = targetElemnt.length;
			targetElemnt.options[maxLength] = new Option(sourceElemnt.options[i].text,sourceElemnt.options[i].value,false,false);
			var replaceString = sourceElemnt.options[i].value + ',';
			idHiddenElemnt.value = idHiddenElemnt.value.replace(replaceString,' ');
		}
	}
	
	for(j=(sourceElemnt.length-1);j>0;j--)
		if(sourceElemnt.options[j].selected == true)
			sourceElemnt.options[j] = null;
} //End of addToDropDown

function formResetandFocus(frmId,elemnt,alertMsg) {
	if(alertMsg) {
		if(confirm("All unsaved data will be lost!\n\nDo you wish to Clear this form?")) {
			document.getElementById(frmId).reset();
			document.getElementById(elemnt).focus();
		}
	}
	else
		document.getElementById(frmId).reset();
		document.getElementById(elemnt).focus();
} //End of formReset

/*
	Function to check only for Alphabets with  space.
	@Parameter - Event and Flag
*/
function isAlpha(event,spacereq) {
	var keyCod = (navigator.appName.indexOf("Microsoft")!=-1 )? event.keyCode:event.which ;
    var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    if ( spacereq == true )
       valid = " "+valid ;
    var temp = String.fromCharCode(keyCod);
    if (valid.indexOf(temp) == "-1" && keyCod!=0 && keyCod!=8)    {
	   keyCod = 0 ;
	   return false ;
    }
    return true;
}


// function to check whether the entered characters are alpha numeric or not
function isAlphanum(event,spacereq ) {
	var keyCod = (navigator.appName.indexOf("Microsoft")!=-1 )? event.keyCode:event.which ;
    var valid = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    if ( spacereq == true )
       valid = " "+valid ;
    var temp = String.fromCharCode(keyCod);
    if (valid.indexOf(temp) == "-1" && keyCod!=0 && keyCod!=8)    {
	   keyCod = 0 ;
	   return false ;
    }
    return true;
}

// function to check whether the entered characters are alpha numeric spl chars or not
function isAlphanumSpl(event) {
	var keyCod = (navigator.appName.indexOf("Microsoft")!=-1 )? event.keyCode:event.which ;
    var valid = "@#&()[]{}?:;<>\/,0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-. ";
    var temp = String.fromCharCode(keyCod);
    if (valid.indexOf(temp) == "-1" && keyCod!=0 && keyCod!=8)    {
	   keyCod = 0 ;
	   return false ;
    }
    return true;
}

/*
	function to check whether the entered characters are numeric chars or not 
	@Parameters ---
	event    --- input type = event 
	dotreq  --- INPUT TYPE = BOOLEAN
	dotreq == true  --> nummeric with dot
	dotreq == false --> numeric without dot
*/
function isNum(event,dotreq) {
	var keyCod = (navigator.appName.indexOf("Microsoft")!=-1 )? event.keyCode:event.which ;
    var valid = "0123456789";   
    obj = (navigator.appName.indexOf("Microsoft")!=-1 ) ? window.event.srcElement:event ? event.target : null  ;
    if ( dotreq && obj.value.indexOf(".") == -1  )
		valid = valid + '.' ; 
    var temp = String.fromCharCode(keyCod);
    if (valid.indexOf(temp) == "-1" && keyCod!=0 && keyCod!=8)    {
	   keyCod = 0 ;
	   return false ;
    }
    return true;
} //End of isNum

function isNotNull(elemntObject) {
		var strValue = Trim(elemntObject.value);
		if(strValue.length>0)
				return true;
		return false;
} //End of isNotNull

function getSelectedRecords(strHiddenElement) {
	var recColl = document.getElementsByName('recordId');
	var strHiddenElement = document.getElementById(strHiddenElement);
	var lp = 0;
	
	for(lp=0;lp<recColl.length;lp++)
		if(recColl[lp].checked)
			strHiddenElement.value += recColl[lp].value + ',';
			
	if(endsWith(strHiddenElement.value,","))
		strHiddenElement.value = strHiddenElement.value.substring(0,strHiddenElement.value.length-1);
} //End of getSelectedRecords

function checkUnCheck(strSatus) {
	var recColl = document.getElementsByName('recordId');
		for(lp=0;lp<recColl.length;lp++)
			recColl[lp].checked = strSatus;
} //End of checkUnCheck

function endsWith(str, s){
	var reg = new RegExp(s + "$");
	return reg.test(str);
} //End of endsWith


function printPartOfPage(elementId)
{
	 var printContent = document.getElementById(elementId);
	 var windowUrl = 'about:blank';
	 var uniqueName = new Date();
	 var windowName = 'Print' + uniqueName.getTime();
	 var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
	
	 printWindow.document.write(printContent.innerHTML);
	 printWindow.document.close();
	 printWindow.focus();
	 printWindow.print();
	 printWindow.close();
}



function firstFocus(ObjID){
	var Element = document.getElementById(ObjID);
	Element.focus();
	
}
// Function for Date picker
function clickIt(value)
		{
			if (value != null &&  typeof(gfPop) != 'undefined'  &&  typeof(gfPop.fPopCalendar) != 'undefined')
			{
				gfPop.fPopCalendar(value);
			}
				return false;
		}
// Function for opening a pop up window in a new window
function newwindow(w,h,webaddress) 
	{
		var viewimageWin = window.open('New_Window','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=Yes,resizable=yes,copyhistory=no',width='+w+',height='+h');
		viewimageWin.moveTo(screen.availWidth/2-(w/2),screen.availHeight/2-(h/2));
		viewimageWin.focus();
	}
		
		
		function CheckAllSelect(Obj)
			{
				var objhdSelected = document.getElementById('hdSelected');
				objhdSelected.value = "";
				for(i=0;i<Obj.length;i++)
				{
				if(Obj[i].type=="checkbox") 
	   				var is_checked = Obj[i].checked;
	   				if (is_checked  == true)
	   				{
	   					strDuplicate = "False";
	   				}
	   				else
	   				{
	   					Obj[i].checked = true;	
	   					strDuplicate = "True";
	   				}
				}
				GetPeopleCode_List(document.forms[0]);
				
			}

			function UnCheckAll(Obj)
			{
				for(i=0;i<Obj.length;i++)
				{
					if(Obj[i].type=="checkbox") 
	   				Obj[i].checked = false;
				}
				GetPeopleCodeDeselect(document.forms[0]);
			}
			function GetPeopleCodeDeselect(Obj)
			{	
				var objhdSelected = document.getElementById('hdSelected');
				var sText = objhdSelected.value;				
				for(i=0;i<Obj.length;i++)
				{
				if(Obj[i].type=="checkbox" && Obj[i].checked) 
					sText =  Obj[i].value + ",";				   
				}

				var fldLength = document.forms[0].elements.length ;
				for(var i=0; i<fldLength; i++)
				{
					var fld = document.forms[0].elements[i];
					var fldName = fld.name ;
					if(fldName.indexOf('cmpcheck')!=-1)
					{
						sText = sText.replace("," + fld.value + ",", ",");
					}
				}
				objhdSelected.value=sText;							
			}			
			
function GetPeopleCode(Obj)
{
	var sText = "";
	for(i=0;i<Obj.length;i++)
	{
		if(Obj[i].type=="checkbox" && Obj[i].checked) 
			sText += "," + Obj[i].value;			   
	}
	sText = sText.substring(1,sText.Length);
	document.getElementById('hdTotalLinks').value=sText;	
}


function GetPeopleCode_List(Obj)
{	
	var itemExist
	var sText = document.getElementById('hdSelected').value;
	if (strDuplicate == "True")
	{		
		for(i=0;i<Obj.length;i++)
		{
			if(Obj[i].type=="checkbox") 
				if (Obj[i].value != 'on')
				{						
					var is_checked = Obj[i].checked
					if (is_checked  == true)
					{
							if(sText=="")
								sText += "," + Obj[i].value + ",";
							else
								sText += Obj[i].value + ",";
					}
				}		   
		}
	}
	 document.getElementById('hdSelected').value=sText;				
}

var strDuplicate;
function GetSelected(objChk)
{
	var objChkValue;
	var arrChkValue;
	var objhdSelectedValue;
	var objhdSelectedText;
	
	objChkValue = objChk.value;
	
	arrChkValue = objChkValue.split("|");
	
	objhdSelectedValue = document.getElementById('hdSelected').value;
	if(objChk.checked)
	{
		if(objhdSelectedValue == "")
		{
			objhdSelectedValue = "," + arrChkValue[0] + ",";
		}
		else
		{
			objhdSelectedValue = objhdSelectedValue + arrChkValue[0] + ",";
		}
	}
	else
	{
		objhdSelectedValue = objhdSelectedValue.replace("," + arrChkValue[0] + ",", ",");
	}
	
	document.getElementById('hdSelected').value = objhdSelectedValue;
}
