function viihde_kerro() {
	var kerropopup = window.open('http://spotti.mtv3.fi/kerro.shtml?' + escape(window.location.href),'kerropopup','width=250,height=160,resizable=no,location=no,menubar=no,toolbar=no,titlebar=no,personalbar=no,personalbar=no,directories=no,fullscreen=no');
	kerropopup.focus();
	} 
	
	jQuery(document).ready(function(){
	
	jQuery(".artikkelinapit .nappi_facebook a").click(function() {
	jQuery(this).blur();
	var jaa = window.open('http://www.facebook.com/sharer.php?u=' + escape(window.location.href) ,'popup','width=640,height=480,resizable=no,location=no,menubar=no,toolbar=no,titlebar=no,personalbar=no,personalbar=no,directories=no,fullscreen=no');
	jaa.focus();
	return false;
	});
	
	jQuery(".artikkelinapit .nappi_kerro a").click(function() {
	viihde_kerro();
	return false;
	});
	
	//jos ollaan apupakissa
	if(getParameterByName('id')=='9592')
	{
		$(".w480").css('width', '350px');
		$("img[src='/ServiceServlet?id=680363&layout=as_is']").parent().css({'float': 'right', 'position': 'relative', 'width': '412px'});
		var htmlTV = $("a[href$='/site/sub/index.jsp?page=kampanjakoostin&media=tv']").parent().html();
		var htmlWeb = $("a[href$='/site/sub/index.jsp?page=kampanjakoostin&media=web']").parent().html();
		$("a[href$='/site/sub/index.jsp?page=kampanjakoostin&media=tv']").parent().remove();
		$("a[href$='/site/sub/index.jsp?page=kampanjakoostin&media=web']").parent().remove();
		$("img[src='/ServiceServlet?id=680363&layout=as_is']").parent().append(htmlTV);
		$("img[src='/ServiceServlet?id=680363&layout=as_is']").parent().append(htmlWeb);
		$("a[href$='/site/sub/index.jsp?page=kampanjakoostin&media=tv']").css({
			'position': 'absolute',
			'top': '56px',
			'left': '70px'
		});
		$("a[href$='/site/sub/index.jsp?page=kampanjakoostin&media=web']").css({
			'position': 'absolute',
			'top': '88px',
			'left': '70px'
		});
	}
	
	});

function getParameterByName( name )
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	var results = regex.exec( window.location.href );
	if( results == null )
		return "";
	else
		return decodeURIComponent(results[1].replace(/\+/g, " "));
}

