// JavaScript Document

function showWorkList(){
	document.getElementById('workList').style.visibility ='visible';
}

function hideWorkList(){
	document.getElementById('workList').style.visibility ='hidden';
	
}
window.onload = function(){
	// Hide or show the WorkList if user directly key in the URL
	var QueryString = location.href.substring ( location.href.indexOf ( "#" ) );
	if(QueryString == "#work"){
		showWorkList();
	}
	else if (QueryString == "#who" || QueryString == "#services" || QueryString == "#contact"){
		hideWorkList();
	}
	else{
		showWorkList();
	}
	
	featuredcontentslider.init({
		id: "slider1",  //id of main slider DIV
		contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
		toc: "markup",  //Valid values: "#increment", "markup", ["label1", "label2", etc]
		nextprev: ["", ""],  //labels for "prev" and "next" links. Set to "" to hide.
		revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
		enablefade: [true, 0.2],  //[true/false, fadedegree]
		autorotate: [false, 3000],  //[true/false, pausetime]
		onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
			//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
			//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
		}
	})
	
	featuredcontentslider.init({
		id: "slider2",  //id of main slider DIV
		contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
		toc: "markup",  //Valid values: "#increment", "markup", ["label1", "label2", etc]
		nextprev: ["", ""],  //labels for "prev" and "next" links. Set to "" to hide.
		revealtype: "click", //Behavior of pagination links to reveal the slides: "click" or "mouseover"
		enablefade: [true, 0.2],  //[true/false, fadedegree]
		autorotate: [false, 3000],  //[true/false, pausetime]
		onChange: function(previndex, curindex){  //event handler fired whenever script changes slide
			//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
			//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
		}
	})
}

function validate_form() 
{
	valid = true;

	if ( document.formContact.name.value == "" )
    {
        alert ( "Please fill in the 'Your Name' box." );
        valid = false;
    }
	
	else if ( document.formContact.company.value == "" )
    {
        alert ( "Please fill in the 'Company' box." );
        valid = false;
    }
	else if (document.formContact.email.value == "" )
    {
        alert ( "Please fill in the 'Your Email' box." );
        valid = false;
    }
	
	else if ( document.formContact.enquiry.value == "" )
    {
        alert ( "Please fill in the 'Enquiry' box." );
        valid = false;
    }
	
	else 
	{
		alert("Thank you. Your information has been submitted.")
		document.formContact.submit();
	}
	
	return valid;
  
}

