
var strSearchText = 'Suchtext ...';

if(!jq) {
	var jq = jQuery.noConflict();
}

jq(function() {
	jq('form#searchform').submit(function() {
		if(jq('input#s').val() == strSearchText || jq('input#s').val() == '') {
			return false;
		} else {
			return true;
		}
	});

	if(jq('input#s').val() == '') {
		jq('input#s').val(strSearchText);
	}

	jq('input#s').click(function() {
		if(jq(this).val() == strSearchText) {
			jq(this).val('');
		}
	}).blur(function() {
		if(jq(this).val() == '') {
			jq(this).val(strSearchText);
		}
	});

	jq('.target-blank').attr('target', '_blank');

	/**
	 * remove ad-notice, if container is empty
	 *
	 * count number of anchors per banner container => if none available (obviously noscript gets hidden), hide background
	 */

	// for skyscraper
	if(jq('div.banner-skyscraper a').length < 1) {
		jq(this).addClass('hideBackground');
	}

	// left container
	if(jq('div.banner-container:first-child a').length < 1) {
		jq(this).addClass('hideBackground');
	}

	// right container
	if(jq('div.banner-container:last-child a').length < 1) {
		jq(this).addClass('hideBackground');
	}

	/**
	 * Anti IE-PNG fuck up-fix
	 */

	if(jq.browser.msie) {
		var strLogoURL = jq('div#logo img').attr('src');
		jq('div#logo img').attr('src', strLogoURL.replace(/.png/g, '.gif'));
	}
});
