// JavaScript Document
function show1() {
	//alert("Value1");
	document.getElementById("profile_popup1").style.display="block"
	}
function hide1() {
	document.getElementById("profile_popup1").style.display="none"
	}
function show2() {
	document.getElementById("profile_popup2").style.display="block"
	}
function hide2() {
	document.getElementById("profile_popup2").style.display="none"
	}
function show3() {
	document.getElementById("profile_popup3").style.display="block"
	}
function hide3() {
	document.getElementById("profile_popup3").style.display="none"
	}
function show4() {
	document.getElementById("profile_popup4").style.display="block"
	}
function hide4() {
	document.getElementById("profile_popup4").style.display="none"
	}
function show5() {
	document.getElementById("profile_popup5").style.display="block"
	}
function hide5() {
	document.getElementById("profile_popup5").style.display="none"
	}
function show6() {
	document.getElementById("profile_popup6").style.display="block"
	}
function hide6() {
	document.getElementById("profile_popup6").style.display="none"
	}
function show7() {
	document.getElementById("profile_popup7").style.display="block"
	}
function hide7() {
	document.getElementById("profile_popup7").style.display="none"
	}
function show8() {
	document.getElementById("profile_popup8").style.display="block"
	}
function hide8() {
	document.getElementById("profile_popup8").style.display="none"
	}
function CountLeft(field, count, max) {
 if (field.value.length > max)
 {
 field.value = field.value.substring(0, max);
 alert("You have reached the maximum description length. Please reduce the description.");
 description.focus();
 document.form1.CharsLeft.innerHTML = "You have reached the maximum description length. Please reduce the description.";
 }
 else
 count.value = max - field.value.length;
 }
function show()
{
var arr1 = <?php echo $str; ?>;
//alert(arr1);
var get = document.getElementById('show1').value;
//alert(get);
var arr2 = new Array();
arr2 = arr1.split(",");
//alert(arr2[0]);
var get2 = new Array();
for(var i=0;i<arr2.length;i++)
{

	var get1 = arr2[i].search(get, "i");
	//alert(get1);
	if(get1==0 && get != '')
	{
	get2.push(arr2[i]);
	//alert(a[i]);
	}
}
while (document.getElementById('myDiv').firstChild)
 {
	document.getElementById('myDiv').removeChild(document.getElementById('myDiv').firstChild);
    }
	
var namediv;
for(var i=0; i<get2.length; i++)
{
	namediv = i;
	namediv = document.createElement('div');
	namediv.id = 'nam'+i;
	namediv.setAttribute('style','float:left; width:250px; height:20px; border-right:solid; border-left:solid; border-bottom:solid;');
	namediv.setAttribute('onclick','dis(this.id)')
	namediv.innerHTML = get2[i];
	document.getElementById('myDiv').appendChild(namediv);
	}

}
function dis(id)
{
document.getElementById('show1').value = document.getElementById(id).innerHTML;
while (document.getElementById('myDiv').firstChild)
 {
	document.getElementById('myDiv').removeChild(document.getElementById('myDiv').firstChild);
    }
}
