//Lavalamp function
var globalErr = 1;
jQuery(document).ready(function() 
{
	
	jQuery(".lightbox").lightbox({fixedNavigation:true});
	
   if(jQuery("#lavalamp_menu"))
   {
		jQuery("#lavalamp_menu").lavaLamp
		({
			fx: "backout", 
			speed: 700,
			click: function(event, menuItem) {	return false; }
		});
   }
   

	
	
 
   
   // Contact Form Submit Form Validations
   jQuery("#contactSubmit").click(function()
		{
			submitContactForm();
		});
   
   
	   /* script for onmouseover nextprevious links */
   
   	/*	jQuery(".next_previous_links").animate({top:"0px"},100);
		
		jQuery(".gallery_container").mouseover(function()
		{
				jQuery(".next_previous_links").animate({top:"-35px"},{ queue: false, duration: 500 });
		});
		jQuery(".gallery_container").mouseout(function()
		{
				jQuery(".next_previous_links").animate({top:"0px"},{ queue: false, duration: 500 });
		});
		
		slideNewsImages();
		*/
		
 });


function submitContactForm()
{
		w3isEmpty("contactName");
		w3isEmpty("contactSurname");
		w3isEmpty("contactCompany");
		w3isEmpty("contactPhone");
		w3isEmpty("contactEmail");
		w3isEmpty("contactComments");
		
		w3isEmail("contactEmail");
		
		if (globalErr==1)
		{
			document.getElementById("contactErrorMessage").style.display ="none";
			document.getElementById("contactFormLoader").style.display ="block";
			
			contactName 	= w3Trim(document.getElementById("contactName").value);
			contactSurname	= w3Trim(document.getElementById("contactSurname").value);
			contactCompany	= w3Trim(document.getElementById("contactCompany").value);
			contactPhone	= w3Trim(document.getElementById("contactPhone").value);
			contactEmail	= w3Trim(document.getElementById("contactEmail").value);
			contactComments	= w3Trim(document.getElementById("contactComments").value);
			contactSubmit	= w3Trim(document.getElementById("contactSubmit").value);
			jQuery.ajax(
			{    
				type: "post", 
				url: "_includes/contactSendMail.php", 
				data: { contactName:contactName,
						contactSurname:contactSurname,
						contactCompany:contactCompany,
						contactPhone:contactPhone,
						contactEmail:contactEmail,
						contactComments:contactComments,
						contactSubmit:contactSubmit
					  },
				success: function(msg)
				{ 		
					document.getElementById("contactFormLoader").style.display ="none";
					document.getElementById("contactFormMessage").style.display ="block";
					
					document.getElementById("contactName").value ="";
					document.getElementById("contactSurname").value ="";
					document.getElementById("contactCompany").value ="";
					document.getElementById("contactPhone").value ="";
					document.getElementById("contactEmail").value ="";
					document.getElementById("contactComments").value ="";
					
	
				 } 
	
			 });// End of Request 	
	
		}
		else
		{
			document.getElementById("contactErrorMessage").style.display ="block";
			
		}
	
		globalErr = "1"; // reset to no error

		
}


function showform(id)
{
	document.getElementById(id).style.display="block";
}

function hideform(id)
{
	document.getElementById(id).style.display="none";
}
if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) 
	{
	window.attachEvent("onload", alphaBackgrounds);
	}

function alphaBackgrounds()
{
var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
for (i=0; i<document.all.length; i++)
	{
	var cls=document.all[i].className;
	if(cls.indexOf("trans_png")==-1)
	{
	}
	else
	{
	var bg = document.all[i].currentStyle.backgroundImage;
	if (itsAllGood && bg)
		{
		if (bg.match(/\.png/i) != null)
			{
			var mypng = bg.substring(5,bg.length-2);
			document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='scale')";
			document.all[i].style.backgroundImage = "url('')"; // change this to your own gif
			}
		}
	}

	}
}


