var $ic = 0;
function goleft() {
	if ($ic>0) {
		$ic-=4;
		$('#bscroll').animate({
    		left: "-" + ($ic*202)
  		}, 500, function() { });
	}
}
function goright() {
	if ($ic<1) {
		$ic+=4;
		$('#bscroll').animate({
    		left: -($ic*202)
  		}, 500, function() { });
	}
}
function setBlogSelect() {
	if ($('#bselect').val()) {
		try {
			var $url = window.location.href.replace(/http:\/\//,"").split(".");
			if ($url[0]!="www"&&$url[0]!="kind-in") {
				$('#bselect').val($url[0]);
			}
			$('#bselect').change(function () {
				var $ut = window.location.href.replace(/http:\/\//,"").split(".");
				if ($('#bselect').val()!=$ut[0]) {
					window.location.href = "http://" + $('#bselect').val() + ".kind-in.de";
				}
			});
		} catch(e) { }
	}
}
function insertAd() {
	try {
		var $scr = $('#c_adwrapper').html();
		var $ent = document.getElementsByClassName("entry");
		$('#c_adwrapper').html("");
		if ($ent[0]) {
			$ent[0].innerHTML += '<div class="adwrapper">' + $scr + '</div>';
		}
	} catch(e) { }
}
function removeImageParagraphs() {
	try {
		var $imc = $('#hc_right').children('p').children('img');
		$('#hc_right').children('p').children('img').parent().remove();
		$('#hc_right').prepend($imc);
	} catch(e) { }
}
$(document).ready(function() {
	setBlogSelect();
	insertAd();
	removeImageParagraphs();
});

