	$(function() {
	// run the currently selected effect
	function runEffect() {
	// get effect type from
	var selectedEffect = $( "#effectTypes" ).val();
	// most effect types need no options passed by default
	var options = {};
	// some effects have required parameters
	if ( selectedEffect === "scale" ) {
	options = { percent: 100 };
	} else if ( selectedEffect === "size" ) {
	options = { to: { width: 280, height: 185 } };
	}
	// run the effect
	$( "#effect" ).show( 'drop', options, 500, callback );
	};
	//callback function to bring a hidden box back
	function callback() {
	$(this).click(function() {
	$( "#effect:visible" ).removeAttr( "style" );
	});
	};
	// set effect from select menu value
	$( "#button" ).click(function() {
	runEffect() ;
	return false;
	});
	$( "#effect" ).hide();
	});
	/* <![CDATA[ */
	function externalLinks() {
	links = document.getElementsByTagName("a");
	for (i=0; i<links.length; i++) {
	link = links[i];
	if (link.getAttribute("href") && link.getAttribute("rel") == "external")
	link.target = "_blank";
	}
	}
	window.onload = externalLinks;
	/* ]]> */
	function smoothChange(id)
	{
	setTimeout(function(){changePhoto(id)},3000);
	}
	function changePhoto(id)
	{
	//var id="photoframe";
	var el=document.getElementById(id);
	var num=el.name.substring(3);
	if(num>5){num=0;}
	var dir="/media/img/sponsored/";
	el.src=dir+id+(num*1+1)+'.png';
	el.name=id+(num*1+1);
	}
