function validate(){

	name = document.getElementById('inputName').value;	
	surname = document.getElementById('inputSurname').value;		
	email = document.getElementById('inputEmailAddress').value;
	
	errmsg = '';
	
	if(name == '')
		errmsg = errmsg + "'Name' field can't be empty.\n"
		
	if(surname == '')
		errmsg = errmsg + "'Surname' field can't be empty.\n"				
		
	if(email == '')
		errmsg = errmsg + "'Email' field can't be empty.\n"
				
		
	if(errmsg != ''){
		alert(errmsg);
		return false;
	}else{
		return true;
	}

}








$(document).ready(function(){
	$('#frm-find input.text').focus( function() {	if ($(this).val() == 'Type in product code...') $(this).val(''); });
	$('#frm-find input.text').blur(  function() {	if ($(this).val() == '') $(this).val('Type in product code...'); });
	
	$('#big1').hide();
	$('#big2').hide();
	$('#big3').hide();
	$('#big4').hide();			
});


function showBox1(){
	
	var isShow = $('#big1').is(":visible");
	
	resetBoxes();
	
	if(!isShow)
	{
		$('#big1').show();
		$('#box1').addClass('gboxon');
	}
	
}

function showBox2(){

	var isShow = $('#big2').is(":visible");

	resetBoxes();
		
	if(!isShow)
	{
		$('#big2').show();
		$('#box2').addClass('gboxon');
	}
	
}

function showBox3(){
	
	var isShow = $('#big3').is(":visible");

	resetBoxes();
		
	if(!isShow)
	{
		$('#big3').show();
		$('#box3').addClass('gboxon');
	}
	
}

function showBox4(){
	var isShow = $('#big4').is(":visible");

	resetBoxes();
		
	if(!isShow)
	{
		$('#big4').show();
		$('#box4').addClass('gboxon');
	}
}


function resetBoxes()
{
	$('#big1').hide();
	$('#big2').hide();
	$('#big3').hide();
	$('#big4').hide();			

	$('#box1').removeClass('gboxon');
	$('#box2').removeClass('gboxon');
	$('#box3').removeClass('gboxon');
	$('#box4').removeClass('gboxon');
	
	$('#box1').addClass('gbox');
	$('#box2').addClass('gbox');
	$('#box3').addClass('gbox');
	$('#box4').addClass('gbox');

}


/*start random image*/
var theImages = new Array()
theImages[0] = '/images/main-ironsteel01.jpg'
theImages[1] = '/images/main-ironsteel02.jpg'
theImages[2] = '/images/main-ironsteel03.jpg'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function ironSteelImage(){
	document.write('<img class="socialmargin" src="'+theImages[whichImage]+'" alt="Iron and Steel" />');
}
/*end random image*/
