function overlayImgZoom(id, headline, img, width){
  $('#'+id+' > .jqmWindow').jqm({
  	onShow:function(h){
			$('#' + id+' > .jqmWindow').html('<div class="jqmWrap"><div class="jqmHeader"><div class="jqmClose"><!--close--></div>'+ headline +'</div><div class="jqmContent"><img class="imgBlock" src="'+ img +'" alt="" /></div></div>');
	    $('.jqmWrap').css('width',parseInt(width)+20+'px');
	    h.w.show();
    }
	});
}

//show Box position=relative top=0
function showBoxPosRelTop0(selector) {
    if (document.getElementById(selector)) {
        document.getElementById(selector).style.position = "relative";
        document.getElementById(selector).style.top = "0";
    }
}


//overlayFunction
function showOverlayiFrame(headline, iframeUrl, iframeWidth, iframeHeight) {
	$('.jqmWindow').jqm({
		onShow: function (h) {
			$('.jqmWindow')
				.html(
					'<div class="jqmWrap"><div class="jqmHeader"><div class="jqmClose"><!--close--></div>'
					+ headline
					+ '</div><div class="jqmContent"><div id="iframe_001">'
					+ '<iframe name="servicefunction" src="'
					+ iframeUrl 
					+ '" width="'
					+ iframeWidth
					+ '" height="'
					+ iframeHeight
					+ '" marginwidth="0" marginheight="0" align="top" frameborder="no" scrolling="auto" style="overflow-x: hidden;"></iframe>'
					+ '</div></div></div>');
			$('.jqmWrap').css('width',
				parseInt(iframeWidth) + 20 + 'px');
			h.w.show();
		}
	});
	$('.jqmWindow').jqmShow();

	return false;
}

function showOverlayiFrameWithContent(headline, iframeUrl, iframeWidth, iframeHeight, content) {
	$('.jqmWindow').jqm({
		onShow: function (h) {
			$('.jqmWindow')
				.html(
					'<div class="jqmWrap"><div class="jqmHeader"><div class="jqmClose"><!--close--></div>'
					+ headline
					+ '</div><div class="jqmContent"><div id="iframe_001">'
					+ '<iframe name="servicefunction" src="'
					+ iframeUrl 
					+ '" width="'
					+ iframeWidth
					+ '" height="'
					+ iframeHeight
					+ '" marginwidth="0" marginheight="0" align="top" frameborder="no" scrolling="auto" style="overflow-x: hidden;"></iframe>'
					+ content
					+ '</div></div></div>');
			$('.jqmWrap').css('width',
				parseInt(iframeWidth) + 20 + 'px');
			h.w.show();
		}
	});
	$('.jqmWindow').jqmShow();
}


function switchNewsticker(id) {
	if (id == 'undefinded') {
		id = 1;
	}
	id = parseInt(id);

	next = ((id+1) < newstickerIdArr.length) ? (id+1) : 0;

	$('#newsticker li[id="' + newstickerIdArr[id] + '"]').fadeOut('slow', function () {
		$('#newsticker li[id="' + newstickerIdArr[next] + '"]').fadeIn('slow');
	});

	window.setTimeout("switchNewsticker('" + next + "')", 5000);
}


function changeBackground(id) {
	$().ready(function () {
		$("body").css("background-image", "url('" + backgroundArr[id]["img"] + "')");
		$("body").css("background-color", backgroundArr[id]["color"]);

		$("meta[property='og:title']").attr('content', metaArr[id]["title"]);
		$("meta[property='og:image']").attr('content', metaArr[id]["image"]);
		$("meta[property='og:description']").attr('content', metaArr[id]["description"]);
	});
	return true;
}


var newstickerIdArr = new Array();
$().ready(function () {

	$('.jqmClose').live('click', function () {
		$('.jqmWindow').jqmHide();
	});

	if ($('#newsticker')) {
		var ntIdCounter = 0;
		$('#newsticker .news ul li').each(function (index, value) {
			newstickerIdArr[index] = $(this).attr('id');
			ntIdCounter = index;
		});

		if (newstickerIdArr.length > 1) {
			window.setTimeout("switchNewsticker()", 5000);
		}
	}

});

/*
function dcsMultiTrack() {
	if (arguments.length % 2 == 0) {
		for (var b = 0; b < arguments.length; b += 2) {
			alert(arguments[b + 1]);
			if (arguments[b].indexOf("WT.") == 0) {
				WT[arguments[b].substring(3)] = arguments[b + 1];
			} else {
				if (arguments[b].indexOf("DCS.") == 0) {
					DCS[arguments[b].substring(4)] = arguments[b + 1];
				} else {
					if (arguments[b].indexOf("DCSext.") == 0) {
						DCSext[arguments[b].substring(7)] = arguments[b + 1];
					}
				}
			}
		}

		var a = new Date();
		DCS.dcsdat = a.getTime();
		dcsFunc("dcsCookie");
		_ed.multi_starter();
		delete _ed.proto; dcsTag();
	} 
}*/
