// JavaScript Document
function openselection() {
	document.getElementById("popup").style.display="block";
}

function valput(selTopTxt) {
	document.getElementById("subName").value = selTopTxt.innerHTML;
	document.getElementById("popup").style.display="none";
}

function valput1(selTopTxt) {
	var x = document.getElementById('newtopic').value;
	if(x != 'Custom Topic') {
		document.getElementById("subName").value = document.getElementById('newtopic').value;
		document.getElementById("popup").style.display="none";
	}
}

function clearTxt(target) {
	if((target.value == 'Name') || (target.value == 'Email') || (target.value == 'Deadline') || (target.value == '00:00 AM/PM') || (target.value == 'TimeZone (PST, CST, GMT)') || (target.value == 'Comments') || (target.value == 'Upload')) {
		target.value = "";
	}
	var sdfe = document.getElementById('popup');
	if(target.value == "Custom Topic") {
		target.value = "";
	}/* else if(sdfe.style.display == 'block') {
		sdfe.style.display = "none";
	}*/
}

function closepopup() {
	document.getElementById("popup").style.display="none";
}

function revTxt(revertTxt) {
	if(revertTxt.value == "") {
		revertTxt.value = revertTxt.defaultValue;
	}
}

function moreUploads(ab) {
	var x = ab.offsetLeft, y = ab.offsetTop, z = document.getElementById('div_fileupload');
	// z.style.top = (y+10+'px');
	z.style.left = '400px';
	z.style.textAlign = 'right';
	z.style.display = 'block';
}

function close_moreUploads() {
	 document.getElementById('div_fileupload').style.display = 'none';
}
 
function testVal(tets) {
	 var s = tets.value;
	 document.getElementById('dummyFile').value = s;
}
 
function onoffTab(tabName) {
	var fin = document.getElementById('finTab');
	var acc = document.getElementById('accTab');
	var eco = document.getElementById('ecoTab');
	var pro = document.getElementById('proTab');
	var oth = document.getElementById('othTab');
	var val = tabName;
	if(val == 1) {
		fin.style.display = "block";
		document.getElementById('afin').style.borderBottomWidth = "0";
		document.getElementById('afin').style.background = "none";
		document.getElementById('afin').style.color = "#FFF";
		acc.style.display = "none";
		document.getElementById('aacc').style.borderBottomWidth = "1px";
		document.getElementById('aacc').style.background = "#ccc";
		document.getElementById('aacc').style.color = "#333";
		eco.style.display = "none";
		document.getElementById('aeco').style.borderBottomWidth = "1px";
		document.getElementById('aeco').style.background = "#ccc";
		document.getElementById('aeco').style.color = "#333";
		pro.style.display = "none";
		document.getElementById('apro').style.borderBottomWidth = "1px";
		document.getElementById('apro').style.background = "#ccc";
		document.getElementById('apro').style.color = "#333";
		oth.style.display = "none";
		document.getElementById('aoth').style.borderBottomWidth = "1px";
		document.getElementById('aoth').style.background = "#ccc";
		document.getElementById('aoth').style.color = "#333";
	} else if(tabName == 2) {
		fin.style.display = "none";
		document.getElementById('afin').style.borderBottomWidth = "1px";
		document.getElementById('afin').style.background = "#ccc";
		document.getElementById('afin').style.color = "#333";
		acc.style.display = "block";
		document.getElementById('aacc').style.borderBottomWidth = "0";
		document.getElementById('aacc').style.background = "none";
		document.getElementById('aacc').style.color = "#FFF";
		eco.style.display = "none";
		document.getElementById('aeco').style.borderBottomWidth = "1px";
		document.getElementById('aeco').style.background = "#ccc";
		document.getElementById('aeco').style.color = "#333";
		pro.style.display = "none";
		document.getElementById('apro').style.borderBottomWidth = "1px";
		document.getElementById('apro').style.background = "#ccc";
		document.getElementById('apro').style.color = "#333";
		oth.style.display = "none";
		document.getElementById('aoth').style.borderBottomWidth = "1px";
		document.getElementById('aoth').style.background = "#ccc";
		document.getElementById('aoth').style.color = "#333";
	} else if(tabName == 3) {
		fin.style.display = "none";
		document.getElementById('afin').style.borderBottomWidth = "1px";
		document.getElementById('afin').style.background = "#ccc";
		document.getElementById('afin').style.color = "#333";
		acc.style.display = "none";
		document.getElementById('aacc').style.borderBottomWidth = "1px";
		document.getElementById('aacc').style.background = "#ccc";
		document.getElementById('aacc').style.color = "#333";
		eco.style.display = "block";
		document.getElementById('aeco').style.borderBottomWidth = "0";
		document.getElementById('aeco').style.background = "none";
		document.getElementById('aeco').style.color = "#FFF";
		pro.style.display = "none";
		document.getElementById('apro').style.borderBottomWidth = "1px";
		document.getElementById('apro').style.background = "#ccc";
		document.getElementById('apro').style.color = "#333";
		oth.style.display = "none";
		document.getElementById('aoth').style.borderBottomWidth = "1px";
		document.getElementById('aoth').style.background = "#ccc";
		document.getElementById('aoth').style.color = "#333";
	} else if(tabName == 4) {
		fin.style.display = "none";
		document.getElementById('afin').style.borderBottomWidth = "1px";
		document.getElementById('afin').style.background = "#ccc";
		document.getElementById('afin').style.color = "#333";
		acc.style.display = "none";
		document.getElementById('aacc').style.borderBottomWidth = "1px";
		document.getElementById('aacc').style.background = "#ccc";
		document.getElementById('aacc').style.color = "#333";
		eco.style.display = "none";
		document.getElementById('aeco').style.borderBottomWidth = "1px";
		document.getElementById('aeco').style.background = "#ccc";
		document.getElementById('aeco').style.color = "#333";
		pro.style.display = "block";
		document.getElementById('apro').style.borderBottomWidth = "0";
		document.getElementById('apro').style.background = "none";
		document.getElementById('apro').style.color = "#FFF";
		oth.style.display = "none";
		document.getElementById('aoth').style.borderBottomWidth = "1px";
		document.getElementById('aoth').style.background = "#ccc";
		document.getElementById('aoth').style.color = "#333";
	} else if(tabName == 5) {
		fin.style.display = "none";
		document.getElementById('afin').style.borderBottomWidth = "1px";
		document.getElementById('afin').style.background = "#ccc";
		document.getElementById('afin').style.color = "#333";
		acc.style.display = "none";
		document.getElementById('aacc').style.borderBottomWidth = "1px";
		document.getElementById('aacc').style.background = "#ccc";
		document.getElementById('aacc').style.color = "#333";
		eco.style.display = "none";
		document.getElementById('aeco').style.borderBottomWidth = "1px";
		document.getElementById('aeco').style.background = "#ccc";
		document.getElementById('aeco').style.color = "#333";
		pro.style.display = "none";
		document.getElementById('apro').style.borderBottomWidth = "1px";
		document.getElementById('apro').style.background = "#ccc";
		document.getElementById('apro').style.color = "#333";
		oth.style.display = "block";
		document.getElementById('aoth').style.borderBottomWidth = "0";
		document.getElementById('aoth').style.background = "none";
		document.getElementById('aoth').style.color = "#FFF";
	}
}

function Validate()
{

 if (document.getElementById("name").value=="Name" || !isValidName(document.getElementById("name").value))
 {
 alert("Enter Valid Name!");
 //document.getElementById("aName").value="";
 document.getElementById("name").select();
 return false;
 }
 else if (document.getElementById("email").value=="Email" || !isValidEmail(document.getElementById("email").value))
 {
 alert("Enter Valid Email");
 //document.getElementById("aName2").value="";
 document.getElementById("email").select();
 return false;
 }

 else if (document.getElementById("phone").value=="Deadline Date" )
 {
 alert("Deadline Date");
 //document.getElementById("aPhone").value="";TimeZone (PST, CST, GMT)
 document.getElementById("phone").select();
 return false;
 }
 else if (document.getElementById("time").value=="00:00 AM/PM" )
 {
 alert("Enter Time");
 //document.getElementById("aPhone").value="";TimeZone (PST, CST, GMT)
 document.getElementById("time").select();
 return false;
 }

 else if (document.getElementById("time_zone").value=="TimeZone (PST, CST, GMT)" )
 {
 alert("Enter TimeZone");
 //document.getElementById("aPhone").value="";TimeZone (PST, CST, GMT)
 document.getElementById("time_zone").select();
 return false;
 }
 else if(document.getElementById("subName").value == "Select Topic") {
	 alert("Select your topic");
	 document.getElementById("subName").select();
	 return false;
 }

 else
 {
 //document.finance.submit();
 return true;
 }
} 
