var counter=0;


function randomImage(randomNum, pageName){
randomNumber = Math.round(Math.random()*randomNum);
handle=document.getElementById(pageName);
handle.id=pageName+randomNumber;
}

function popupform(myform, windowname)
{
	if (! window.focus)return true;
	window.open('', windowname, 'height=700,width=1220,scrollbars=yes');
	myform.target=windowname;
	return true;
}

/*
implementaion of jqury
*/

function firstImage(){
$(document).ready(function() { 
	$('#fader1').innerfade({ 
		speed: 'slow', 
		timeout: 3000, 
		type: 'sequence', 
		containerheight: '305px'
	});
});
clearTimeout(first);
}

function secondImage(){
$(document).ready(function() { 
	$('#fader2').innerfade({ 
		speed: 'slow', 
		timeout: 5000, 
		type: 'sequence', 
		containerheight: '261px'
	});
});
clearTimeout(second);
}

function showHideElement(action,element){
switch(action)
{
	case 'show':
	document.getElementById(element).style.display = 'block';
	break;
	
	case 'hide':
	document.getElementById(element).style.display = 'none';
	break;

	default:
	//do nothing
	break;
}
}

function validateForm(field_list,form_name)
{
	//for(i=0;i<field_list.length;i++)
	//{
		if(document.iris_contact.name.value=='' || document.iris_contact.email.value=='')
		{
			document.getElementById('message').innerHTML = 'Please complete the fields with *';
			return false;
		}
		else
		{
			list ='&form_sent='+document.iris_contact.name.value+'&name='+document.iris_contact.name.value+'&number='+document.iris_contact.number.value+'&email='+document.iris_contact.email.value+'&location='+document.iris_contact.location.value;
			ajax = new pucv_AjaxObjectCreator('notIE','_includes/files/ajax.php','POST',true,list,'ajax.displaySearchResults()','ir_messageResult','sending message');
			ajax.runAjax();
			return false;
		}
	//}
	return false;
}
