function initInputs()
{
	var inputs = document.getElementsByTagName("input");
	for (var i = 0; i < inputs.length; i++ )
	{
		if(inputs[i].type == "text" || inputs[i].type == "password")
		{
			inputs[i].valueHtml = inputs[i].value;
			inputs[i].onfocus = function ()
			{
				if(this.valueHtml == this.value)
					this.value = "";
			}
			inputs[i].onblur = function ()
			{
				this.value != ""? this.value = this.value: this.value = this.valueHtml;
			}
		}
	}
}
function initTextareas()
{
	textareas = document.getElementsByTagName("textarea");
	if (textareas)
	{
		for (var i = 0, length = textareas.length; i < length; i++)
		{
			if (textareas[i].title != "")
			{
				textareas[i].value = textareas[i].title;
				textareas[i].onfocus = function()
				{
					if (this.value == this.title) this.value = "";
				}
				textareas[i].onblur = function()
				{
					if (this.value == "") this.value = this.title;
				}
			}
		}
	}
}


if (window.addEventListener)
{
	window.addEventListener("load", initInputs, false);
	window.addEventListener("load", initTextareas, false);
}
else if (window.attachEvent)
{
	window.attachEvent("onload", initInputs);
	window.attachEvent("onload", initTextareas);
}

jQuery(document).ready(function($) {

	$('.photo-main').cycle({
		fx:'fade',
		timeout:5125,
		speed:625,
		sync:1,
		delay:5125
	});
	
	$('.photo-sidebar').cycle({
		fx:'fade',
		timeout:5125,
		speed:625,
		sync:1,
		delay: 5125
	});

	// run this first so containers for cycle below are set.
	$("#featured .holder .item .link:last-child").css({'margin-right': '0'});

	$(".highlight .items li:first-child").css({'margin-top': '10px'});
	
	$("#featured .holder").cycle({
		fx:     'fade', 
		speed:  'fast', 
		timeout: 9999, 
		next:   '#nextslide', 
		prev:   '#prevslide' 
	});
	
	//$("#featured .holder .item:nth-child(4) a img").css({'width':'172px'});
	
	$('a[rel^="external"],a[rel$="external"]').attr({target:"_blank"});

});
