function getHeaderImage(section,amount) {
	return section+(Math.floor(Math.random()*amount+1))+".jpg";
}
function verifyLoggin() {
	var loginForm = document.getElementById("FrmLogin");
	
	var requiredMessage ="";
	var validateMessage = "";
	var fullMessage ="";
	
	if(loginForm.username.value == "") {
		requiredMessage += "* Enter Username.\n";
	}
	if(loginForm.password.value == "") {
		requiredMessage += "* Enter Paswword.\n";
	}
	if (requiredMessage != "") {
		fullMessage += "These fields are required:\n"+requiredMessage;
	}
	
	if (fullMessage != "") {
		alert(fullMessage);
	} else {
		//alert(theForm.submit);
		loginForm.submit();
	}
}

function selectTechnicalQuery() {
	/*var categorySelect = document.getElemenetById(id);*/
	var tableRowId = document.getElementById('category').value;
	var tableRowShowInformation = document.getElementById("categorySubName");
	var tableRowShowDropDowns = document.getElementById("showSelectBoxes");
	if(tableRowId == "1") {
		tableRowShowInformation.innerHTML = "";
		tableRowShowDropDowns.innerHTML = "";
	}
	if(tableRowId == "2") {
		tableRowShowInformation.innerHTML = "Codes of Good Practice 2007 :";
		tableRowShowDropDowns.innerHTML = "<select name='codes' id='codes' onchange='checkQueryNum()'><option value='Code 100 Ownership'>Code 100 - Ownership</option><option value='Code 200 Management Control'>Code 200 - Management Control</option><option value='Code 300 Employment Equity'>Code 300 - Employment Equity</option><option value='Code 400 Skills Development'>Code 400 - Skills Development</option><option value='Code 500 Preferential Procurement'>Code 500 - Preferential Procurement</option><option value='Code 600 Enterprise Development'>Code 600 - Enterprise Development</option><option value='Code 700 Socio-Economic Development'>Code 700 - Socio-Economic Development</option><option value='Code 800 Qualifies Small Enterprises'>Code 800 - Qualifies Small Enterprises</option><option value='Statement 801 Ownership'>Statement 801 - Ownership</option><option value='Statement 802 Management Control'>Statement 802 - Management Control</option><option value='Statement 803  Employment Equity'>Statement 803 - Employment Equity</option><option value='Statement 804 Skills Development'>Statement 804 - Skills Development</option><option value='Statement 805 Preferential Procurement'>Statement 805 - Preferential Procurement</option><option value='Statement 806 Enterprise Development'>Statement 806 - Enterprise Development</option><option value='Statement 807 Socio-Economic Development'>Statement 807 - Socio-Economic Development</option></select>";
		//poorman_toggle('codes'); 
		//alert("Codes...");
	}
	if(tableRowId == "3") {
		tableRowShowInformation.innerHTML = "The dti Verification Manual :";
		tableRowShowDropDowns.innerHTML = "<select name='verification_guide' id='verification_guide' onchange='checkQueryVerificationManual()'><option value='Definitions pg5'>Definitions - pg 5</option><option value='Scope of Application of this Manual pg7'>Scope of Application of this Manual - pg 7</option><option value='Purpose of Verification, Effective Date and Objective pg 8'>Purpose of Verification, Effective Date and Objective - pg 8</option><option value='Standards of Ethical Conduct and Requirements pg 9'>Standards of Ethical Conduct and Requirements - pg 9</option><option value='Quality Control pg 11'>Quality Control - pg 11</option><option value='Agreeing on Terms of Engagement pg 12'>Agreeing on Terms of Engagement - pg 12</option><option value='Outsourcing pg 13'>Outsourcing - pg 13</option><option value='Guidelines for Performing Verification pg 14'>Guidelines for Performing Verification – pg 14</option><option value='Professional Scepticism Due Diligence pg 20'>Professional Scepticism / Due Diligence - pg 20</option><option value='Materiality and Verification Risk pg 21'>Materiality and Verification Risk - pg 21</option><option value='Sampling pg 22'>Sampling - pg 22</option><option value='Evidence pg 23'>Evidence - pg 23</option><option value='Fronting pg 24'>Fronting - pg 24</option><option value='Documentation pg 25'>Documentation - pg 25</option><option value='Reporting Requirements and Appendices Certificates pg 26'>Reporting Requirements and Appendices - Certificates - pg 26</option><option value='Other Reporting Responsibilities, Withdrawing from the Verification and Minimum Procedures pg 27'>Other Reporting Responsibilities, Withdrawing from the Verification and Minimum Procedures - pg 27</option><option value='Methodology for Verification: Ownership pg 37'>Methodology for Verification: Ownership – pg 37</option><option value='Methodology for Verification: Management Control pg 53'>Methodology for Verification: Management Control – pg 53</option><option value='Methodology for Verification: Employment Equity pg 56'>Methodology for Verification: Employment Equity – pg 56</option><option value='Methodology for Verification: Skills Development pg 60'>Methodology for Verification: Skills Development – pg 60</option><option value='Methodology for Verification: Preferential Procurement pg 64'>Methodology for Verification: Preferential Procurement – pg 64</option><option value='Methodology for Verification: Enterprise Development pg 68'>Methodology for Verification: Enterprise Development – pg 68</option><option value='Methodology for Verification Socio-Economic Development pg 71'>Methodology for Verification: Socio-Economic Development – pg 71</option></select>";
	}
	if(tableRowId == "4") {
		tableRowShowInformation.innerHTML = "Dti Interpretive Guide :";
		tableRowShowDropDowns.innerHTML = "<select name='interpertive_guide' id='interpertive_guide' onchange='checkQueryInterpertiveGuide()'><option value='Code 100 Ownership'>Code 100 - Ownership</option><option value='Statement 100 General Ownership Scorecard And The Recognition Of Ownership Arising From The Sale Of Equity Instruments '>Statement 100 - General Ownership Scorecard And The Recognition Of Ownership Arising From The Sale Of Equity Instruments</option><option value='Statement 102 Recognition Of Ownership Contributions Arising From Qualifying Ownership Transactions'>Statement 102 - Recognition Of Ownership Contributions Arising From Qualifying Ownership Transactions </option><option value='Statement 103 Recognition Of Equity Equivalents For Multinationals'>Statement 103 - Recognition Of Equity Equivalents For Multinationals</option><option value='Code 200 Management Control'>Code 200 - Management Control</option><option value='Code 300 Employment Equity'>Code 300 - Employment Equity</option><option value='Code 400 Skills Development'>Code 400 - Skills Development</option><option value='Code 500 Preferential Procurement'>Code 500 - Preferential Procurement</option><option value='Code 600 Enterprise Procurement'>Code 600 - Enterprise Procurement</option><option value='Code 700 Socio-Economic Development'>Code 700 - Socio-Economic Development</option><option value='Code 800 Qualifying Small Enterprise Scorecard'>Code 800 - Qualifying Small Enterprise Scorecard</option><option value='Statement 801 Ownership For QSE'>Statement 801 - Ownership For QSE</option><option value='Statement 802 General Recognition Of Management Control For QSE'>Statement 802 - General Recognition Of Management Control For QSE</option><option value='Statement 803 Employment Equity For QSE'>Statement 803 - Employment Equity For QSE</option><option value='Statement 804 Skills Development For QSE'>Statement 804 - Skills Development For QSE</option><option value='Statement 805 Preferential Procurement For QSE'>Statement 805 - Preferential Procurement For QSE</option><option value='Statement 806 Enterprise Development For QSE'>Statement 806 - Enterprise Development For QSE</option><option value='Statement 807 Socio Economic Development'>Statement 807 - Socio-Economic Development For QSE</option></select>";
	}
	/*if(tableRowId == "2") {
		tableRowShowInformation.innerHTML = "<tr><td>Codes</td><td><?php getTechnicalCodes(); ?></td></tr>";
	}*/
}


function poorman_toggle(id) { 
	var tr = document.getElementById(id); 
	if (tr==null) { 
		return;
	} 
	var bExpand = tr.style.display == ''; 
	tr.style.display = (bExpand ? 'none' : ''); 
} 

function checkQueryNum() {
	var getCodeId = document.getElementById("codes").value;
	var getCodeName = "codes";
	var QueryNumber = window.open("includes/technical_queries/popup.php?code_id="+getCodeId+"&name="+getCodeName+"","QueryNumber","width=300,height=30,status=0,scrollbars=0")
	QueryNumber.moveTo(600,400);
}
function checkQueryVerificationManual() {
	var getCodeId = document.getElementById("verification_guide").value;
	var getCodeName = "verification_guide";
	var QueryNumber = window.open("includes/technical_queries/popup.php?code_id="+getCodeId+"&name="+getCodeName+"","QueryNumber","width=300,height=30,status=0,scrollbars=0")
	QueryNumber.moveTo(600,400);
}
function checkQueryInterpertiveGuide() {
	var getCodeId = document.getElementById("interpertive_guide").value;
	var getCodeName = "interpertive_guide";
	var QueryNumber = window.open("includes/technical_queries/popup.php?code_id="+getCodeId+"&name="+getCodeName+"","QueryNumber","width=300,height=30,status=0,scrollbars=0")
	QueryNumber.moveTo(600,400);
}



//===================================SLIDER
function slider(id) { 
	var tr = document.getElementById(id); 
	if (tr==null) { 
		return;
	} 
	var bExpand = tr.style.display == ''; 
	tr.style.display = (bExpand ? 'none' : ''); 
}

function codes100Ownership() { 
	slider('codes_100_ownership');  
}
function codes200managementControl() {
	slider('codes_200_manegement_control'); 
}
function codes_300_employment_equity() {
	slider('codes_300_employment_equity'); 
}
function codes_400() {
	slider('codes_400'); 
}
function codes_500() {
	slider('codes_500'); 
}
function codes_600() {
	slider('codes_600'); 
}
function codes_700() {
	slider('codes_700'); 
}
function codes_800() {
	slider('codes_800'); 
}
function codes_801() {
	slider('codes_801'); 
}
function codes_802() {
	slider('codes_802'); 
}
function codes_803() {
	slider('codes_803'); 
}
function codes_804() {
	slider('codes_804'); 
}
function codes_805() {
	slider('codes_805'); 
}
function codes_806() {
	slider('codes_806'); 
}
function codes_807() {
	slider('codes_807'); 
}
function codes_808() {
	slider('codes_808'); 
}
function codes_809() {
	slider('codes_809'); 
}
function codes_810() {
	slider('codes_810'); 
}
function codes_811() {
	slider('codes_811'); 
}

function codes_900() {
	slider('codes_900'); 
}

function codes_1000() {
	slider('codes_1000'); 
}

function codes_1001() {
	slider('codes_1001'); 
}

function codes_1002() {
	slider('codes_1002'); 
}

function codes_1003() {
	slider('codes_1003'); 
}

function codes_1004() {
	slider('codes_1004'); 
}

function codes_1005() {
	slider('codes_1005'); 
}

function codes_1008() {
	slider('codes_1008'); 
}

function codes_1009() {
	slider('codes_1009'); 
}

function general() {
	slider('general'); 
}
function codes_1006() {
	slider('1006');
}
function codes_vrM2() {
	slider('vrM2');
}
function codes_vrM3() {
	slider('vrM3');
}
function codes_vrM4() {
	slider('vrM4');
}
function codes_vrM5() {
	slider('vrM5');
}
function codes_vrM6() {
	slider('vrM6');
}
function codes_vrM7() {
	slider('vrM7');
}

/*==================================================*/

function verificationManualCategory() {
	slider('verification_manual_row');  
}

function interpretiveGuideCategory() {
	slider('interpretive_guide_row');  
}

function fullMemberGauteng() {
	slider('fullmemberGauteng');  
}

function fullMemberKZN() {
	slider('fullmemberKZN');  
}

function fullMemberEasternCape() {
	slider('fullMemberEC');  
}

function fullMemberWesternCape() {
	slider('fullMemberWesternCape');  
}

function fullMemberNorthernCape() {
	slider('fullMemberNorthernCape');  
}

function fullMemberNorthWest() {
	slider('fullMemberNorthWest');  
}

function fullMemberMpumalanga() {
	slider('fullMemberMpumalanga');  
}

function fullMemberFreeState() {
	slider('fullMemberFreeState');  
}

function fullMemberLimpopo() {
	slider('fullMemberLimpopo');  
}

function bee_consultants() {
	slider('bee_consultants');  
}

function corporates() {
	slider('corporates');  
}


var add_question_0 = new Image(121,14);
add_question.src = 'images/add_a_question0.gif';
var add_question_1 = new Image(121,14);
add_question_1.src = 'images/add_a_question1.gif';

function SwapImage(objectname,objectnewstate) {
	var imageobj = document.getElementById(objectname);
	imageobj.src = this[objectnewstate].src;
}
