function populateForm()
{
	var customFieldContainer = document.getElementById('lightbox');
	var fields = customFieldContainer.getElementsByTagName('input');
	for (var i=0;i<fields.length;i++)
	{
	//alert(fields[i].name);
		if(fields[i].name.indexOf("$Name") > 0 && fields[i].value == "")
		{
			fields[i].value = "Full Name";
			fields[i].onblur=function(){OnBlurElm(this, "Full Name");};	
			fields[i].onfocus=function(){OnFocusElm(this, "Full Name");};				
		}
		else if(fields[i].name.indexOf("$Email") > 0  && fields[i].value == "")
		{
			fields[i].value = "Email";
			fields[i].onblur=function(){OnBlurElm(this, "Email");};	
			fields[i].onfocus=function(){OnFocusElm(this, "Email");};	
		}
		else if(fields[i].name.indexOf("$Phone") > 0  && fields[i].value == "")
		{
			fields[i].value = "Phone number";
			fields[i].onblur=function(){OnBlurElm(this, "Phone number");};	
			fields[i].onfocus=function(){OnFocusElm(this, "Phone number");};	
		}
		else if(fields[i].name.indexOf("$Suburb") > 0 && fields[i].value == "")
		{
			fields[i].value = "Pickup Suburb";	
			fields[i].onblur=function(){OnBlurElm(this, "Pickup Suburb");};	
			fields[i].onfocus=function(){OnFocusElm(this, "Pickup Suburb");};	
		}			
	}
	fields = customFieldContainer.getElementsByTagName('textarea');
	for (var i=0;i<fields.length;i++)
	{
		if(fields[i].name.indexOf("$Enquiry") > 0  && fields[i].value == "")
		{
			fields[i].value = "List the type and quantity of your items";		
			fields[i].onblur=function(){OnBlurElm(this, "List the type and quantity of your items");};	
			fields[i].onfocus=function(){OnFocusElm(this, "List the type and quantity of your items");};	
		}
	}
}

function OnFocusElm(elm, defText)
{
	//alert(elm.value);
	if(elm.value == defText)
		elm.value='';
		//this.focus();
		//this.select();
}

function OnBlurElm(elm, defText)
{
//	alert("dd");
	if(elm.value=='')
		elm.value=defText;
}

function initMenu()
{
	var nodes = document.getElementById("menuElem").getElementsByTagName("li");
	for (var i=0; i<nodes.length; i++)
	{
		nodes[i].onmouseover = function()
		{
			this.className += " hover";
		}
		nodes[i].onmouseout = function()
		{
			this.className = this.className.replace(" hover", "");
		}
	}
}
if (document.all && !window.opera) attachEvent("onload", initMenu);

jQuery(document).ready(function () {
    $('a.collection').fancybox({
        'showCloseButton': true,
        'autoDimensions': false,
        'padding': 0,
        'width': 451,
        'height': 451
    });
});

$(document).ready(function () {
    var form = $('form:first');
    $('#fancybox-tmp').appendTo(form);
    $('#fancybox-loading').appendTo(form);
    $('#fancybox-overlay').appendTo(form);
    $('#fancybox-wrap').appendTo(form);
});


