function show_iduser()
{
var list=document.all.type;
var listtext=list.options[list.selectedIndex].text;

if(listtext == 'main')
{
document.all.iduser.disabled = true;	
}else
{
document.all.iduser.disabled = false;		
}
}


function validation()
{
//var name = document.all.name.value;
//var email = document.all.email.value;
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;

if(!(name == ""))
{
if(!(email == ""))
{

}else
{
alert("Required Your truth email address!");
}

}else
{
alert("Fill your Username");
}

if (!(name == "") && !(email == "") )
{
document.all.login.disabled = false;
}
else
{
document.all.login.disabled = true;
} 
}


function ubah(){
document.all.login.disabled = false;

}

function validation1()
{
//var name = document.all.fname.value;
//var email = document.all.email.value;
//var iduser = document.all.iduser.value;
var name = document.getElementById("name").value;
var email = document.getElementById("email").value;
var iduser = document.getElementById("iduser").value;
if(!(name == ""))
{
if(!(email == ""))
{
if(!(iduser == ""))
{
}else
{
alert("Required ID");
}	
	
}else
{
alert("Required Your truth email address!");
}

}else
{
alert("Fill your Firstname");
}

if (!(name == "") && !(email == "")&& !(iduser == ""))
{
document.all.signup.disabled = false;
}
else
{
document.all.signup.disabled = true;
} 
}


function ubah1(){
document.all.signup.disabled = false;

}

function putiduser()
{
var str=document.all.name.value;

document.all.iduser.value = str;
}

//---------------------------

function validation2()
{

var email = document.all.cemail.value;
var name = document.all.cname.value;

if(!(name == ""))
{
if(!(email == ""))
{

}else
{
alert("Required truth email address!");
}
}else
{
alert("Fill you first name!");
}

if (!(email == "") && !(name == "") )
{
document.all.send.disabled = false;
}
else
{
document.all.send.disabled = true;
} 
}


function ubah2(){
document.all.send.disabled = false;

}


function validanswer()
{
var tddoc1=document.all.na;
var tddoc2=document.all.nb;
var tddoc3=document.all.nc;
var tddoc4=document.all.nd;
var tddoc5=document.all.ne;
var tddoc6=document.all.nf;
var tddoc7=document.all.ng;
var tddoc8=document.all.nh;
var tddoc9=document.all.ni;
var tddoc10=document.all.nj;
var tddoc11=document.all.nk;
var tddoc12=document.all.nl;
var tddoc13=document.all.nm;
var tddoc14=document.all.nn;
var tddoc15=document.all.no;
var tddoc16=document.all.np;
var tddoc17=document.all.nq;
var tddoc18=document.all.nr;
var tddoc19=document.all.ns;
var tddoc20=document.all.nt;
var str="";
var nilai1=tddoc1.options[tddoc1.selectedIndex].text;
var nilai2=tddoc2.options[tddoc2.selectedIndex].text;
var nilai3=tddoc3.options[tddoc3.selectedIndex].text;
var nilai4=tddoc4.options[tddoc4.selectedIndex].text;
var nilai5=tddoc5.options[tddoc5.selectedIndex].text;
var nilai6=tddoc6.options[tddoc6.selectedIndex].text;
var nilai7=tddoc7.options[tddoc7.selectedIndex].text;
var nilai8=tddoc8.options[tddoc8.selectedIndex].text;
var nilai9=tddoc9.options[tddoc9.selectedIndex].text;
var nilai10=tddoc10.options[tddoc10.selectedIndex].text;
var nilai11=tddoc11.options[tddoc11.selectedIndex].text;
var nilai12=tddoc12.options[tddoc12.selectedIndex].text;
var nilai13=tddoc13.options[tddoc13.selectedIndex].text;
var nilai14=tddoc14.options[tddoc14.selectedIndex].text;
var nilai15=tddoc15.options[tddoc15.selectedIndex].text;
var nilai16=tddoc16.options[tddoc16.selectedIndex].text;
var nilai17=tddoc17.options[tddoc17.selectedIndex].text;
var nilai18=tddoc18.options[tddoc18.selectedIndex].text;
var nilai19=tddoc19.options[tddoc19.selectedIndex].text;
var nilai20=tddoc20.options[tddoc20.selectedIndex].text;
if(nilai1 == "Give Value..")
str=str+"Please anwer question no 1!"+"\n";
if(nilai2 == "Give Value..")
str=str+"Please anwer question no 2!"+"\n";
if(nilai3 == "Give Value..")
str=str+"Please anwer question no 3!"+"\n";
if(nilai4 == "Give Value..")
str=str+"Please anwer question no 4!"+"\n";
if(nilai5 == "Give Value..")
str=str+"Please anwer question no 5!"+"\n";
if(nilai6 == "Give Value..")
str=str+"Please anwer question no 6!"+"\n";
if(nilai7 == "Give Value..")
str=str+"Please anwer question no 7!"+"\n";
if(nilai8 == "Give Value..")
str=str+"Please anwer question no 8!"+"\n";
if(nilai9 == "Give Value..")
str=str+"Please anwer question no 9!"+"\n";
if(nilai10 == "Give Value..")
str=str+"Please anwer question no 10!"+"\n";
if(nilai11 == "Give Value..")
str=str+"Please anwer question no 11!"+"\n";
if(nilai12 == "Give Value..")
str=str+"Please anwer question no 12!"+"\n";
if(nilai13 == "Give Value..")
str=str+"Please anwer question no 13!"+"\n";
if(nilai14 == "Give Value..")
str=str+"Please anwer question no 14!"+"\n";
if(nilai15 == "Give Value..")
str=str+"Please anwer question no 15!"+"\n";
if(nilai16 == "Give Value..")
str=str+"Please anwer question no 16!"+"\n";
if(nilai17 == "Give Value..")
str=str+"Please anwer question no 17!"+"\n";
if(nilai18 == "Give Value..")
str=str+"Please anwer question no 18!"+"\n";
if(nilai19 == "Give Value..")
str=str+"Please anwer question no 19!"+"\n";
if(nilai20 == "Give Value..")
str=str+"Please anwer question no 20!"+"\n";

if(!(str == ""))
{
alert(str);	
return false;
}else
{
return true;	
}

}



function validinvite()
{
var name=document.all.iv_name.value;
var email=document.all.iv_email.value;

if(name == "" )
{
	alert("Please enter your name!");
return false;	
}

if(email == "")
{
	alert("Please enter your correct email address!");
return false;	
}

return true;
}

//--------------------------------------------------------------------------------

function iv_function(str,dd,linking)
{
alert(str);	
location.href="form_invitation.php?iduser="+linking;
}

function display_input()
{
//var startinput=	document.getElementById("form_input").innerHTML;
var startinput="";
var jum = document.fr_invite.elements["iv_name[]"].length;
if(jum == undefined)
{
jum=1;
}

//var nilai;
var detect=1;
var nama="";
var email="";
var obj_type;
var tipe="";
var arrtype= new Array("Superior","Peer","Subordinate");
//var type;
if(jum == 1){
nama = document.fr_invite.elements["iv_name[]"].value;
email=document.fr_invite.elements["iv_email[]"].value;
if( nama == "" || email == "")
{
	detect = 0;
}

obj_type=document.fr_invite.elements["iv_type[]"];
tipe=obj_type.options[obj_type.selectedIndex].text;

startinput += "<input type='text' name='iv_name[]' size='20' value='"+nama+"'>&nbsp;<input type='text' name='iv_email[]' size='30' value='"+email+"'>&nbsp;<select name='iv_type[]'>";
for(var j=0;j< 3;j++)
{
if(arrtype[j] == tipe){	

startinput +="<option value='"+arrtype[j].toLowerCase()+"' selected>"+arrtype[j]+"</option>";
}else
{
startinput +="<option value='"+arrtype[j].toLowerCase()+"'>"+arrtype[j]+"</option>";
}//end if

}//end for
startinput +="</select><br>";

}else
{
for(var i=0;i < jum;i++)
{
nama = document.fr_invite.elements["iv_name[]"][i].value;
email = document.fr_invite.elements["iv_email[]"][i].value;
if( nama == "" || email == "")
{
	detect = 0;
}

obj_type=document.fr_invite.elements["iv_type[]"][i];
tipe=obj_type.options[obj_type.selectedIndex].text;

startinput += "<input type='text' name='iv_name[]' size='20' value='"+nama+"'>&nbsp;<input type='text' name='iv_email[]' size='30' value='"+email+"'>&nbsp;<select name='iv_type[]'>";

for(var j=0;j< 3;j++)
{
if(arrtype[j] == tipe){	
startinput +="<option value='"+arrtype[j].toLowerCase()+"' selected>"+arrtype[j]+"</option>";
}else
{
startinput +="<option value='"+arrtype[j].toLowerCase()+"'>"+arrtype[j]+"</option>";
}//end if

}//end for
startinput +="</select><br>";


}//end for

}//jum 1
if(detect == 1){
document.getElementById("form_input").innerHTML=startinput+"<input type='text' name='iv_name[]' size='20'>&nbsp;<input type='text' name='iv_email[]' size='30'>&nbsp;<select name='iv_type[]'><option value='superior'>Superior</option><option value='peer'>Peer</option><option value='subordinate'>Subordinate</option></select><br>";
}else
{
	document.getElementById("form_input").innerHTML=startinput;
}//end detect

}

