function setBGMotiv(cgibin,color,sid) {
	var myAjax = new Ajax.Request(cgibin + '?html=ajax/setbgmotiv.vsl&color=' + color + '&ID=' + sid, {
		method:'get',
		asynchronous: false,
		onComplete: function(transport){
			// do Something
		},
		onFailure: function(){
			// do Something
		}
	});
}

function setBgImg(cgibin,BG_Id,sid) {
	var myAjax = new Ajax.Request(cgibin + '?html=ajax/setbgimage.vsl&BACK_GROUND_ID='+ BG_Id +'&ID=' + sid, {
		method:'get',
		asynchronous: false,
		onComplete: function(transport){
			// do Something
		},
		onFailure: function(){
			// do Something
		}
	});
}

			// Funktion zur Referenzierung von Div-Layern mit Zugriff auf CSS-Eigenschaften
function setBgImage(cgibin,img_id,field) {
	document.getElementById('bg_layer').style.backgroundColor = '';
	document.getElementById(field).value = img_id;
	setBgImg(cgibin,img_id,thisSID);
}

function div_ref_style(cgibin,id) {
	bgC = id;
	elem = document.getElementById('bg_layer');
	if(document.getElementById('background_image')) document.getElementById('background_image').src="space.gif";
	elem.style.backgroundColor = '#' +id;
	var motiv_lay = document.getElementById('motiv_lay');
	var bg_area_width = parseInt($('bg_area').offsetWidth/2);
	var motiv_width = parseInt(motiv_lay.offsetWidth/2);
	var bg_area_height = parseInt(motiv_lay.offsetHeight + 100);
	
	if($('motiv_pos_layer')) {
		var marginTop = ($('motiv_pos_layer').offsetTop) ? $('motiv_pos_layer').offsetTop : 0;
		motiv_lay.style.marginTop = parseInt(50-marginTop)+"px";
		motiv_lay.style.right = bg_area_width + "px";
	}
	
	// check Bildhoehe 
	if(bg_area_height < 650) bg_area_height = 650;
	$('bg_area').style.height = bg_area_height + "px";
	
	motiv_lay.style.marginLeft = "-" + motiv_width + "px";
	setBGMotiv(cgibin,id,thisSID);

}

function displayWindow(url, width, height) {
	var winname;
	d = new Date;
	t = d.getTime();
	winname = window.open(url ,"Window" + t,'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=1,menubar=no,status=no' );
	winname.moveTo((screen.width-width)/2,(screen.height-height)/2);
}

function displayWindow2(url, width, height) { 
	var winname;
	d = new Date;
	t = d.getTime();
	winname = window.open(url ,"Window" + t,'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=yes,menubar=no,status=no,resizable=no' );
	winname.moveTo((screen.width-width)/2,(screen.height-height)/2); 
}

function zoomPicture(url) {
	width = screen.width;
	height = screen.height;
	displayWindow(url + '&bgc=' + bgC, width, height);
}

function fade_me (id,way) {
	if(way == 'in' ) document.getElementById(id).src = 'images/shop-pics/' + id + '.png';
	if(way == 'out' ) document.getElementById(id).src = 'images/shop-pics/' + id + '_out.png';
}

// tooltip script
function showTT(id) {
	var tooltip = $(id);
	tooltip.style.display = "block";
}

function hideTT() {
	tooltip.style.display = "none";
}