if(location.href.indexOf('shop.php') == -1  && location.href.indexOf('https://') != -1)
	{
		location.href	=	location.href.replace(/https:\/\//,'http://');
	}

var currentAboDetail = "";	

function changeImageFromParent(uri,_this)
	{/*{{{*/
		if (!uri) return false;

		if (_this && _this.firstChild && _this.firstChild.tagName && _this.firstChild.tagName.toLowerCase) //DOM ?
			{
				if (_this.firstChild.tagName.toLowerCase() == 'img') // <img... ?
				_this.firstChild.src = uri;//set src="...">
				return true;
			}

		//IE 4+ (?)
		if (!window || !window.event || !window.event.srcElement || !window.event.srcElement.tagName) return false;
		if (window.event.srcElement.tagName.toLowerCase() != 'img') return false;
		window.event.srcElement.src = uri;
		return true;
	}/*}}}*/
function changeImageFromSubmit(uri,_this)
	{/*{{{*/
		if (uri && _this && _this.src) _this.src = uri;
	}/*}}}*/
function shoppingAboDetails(id) 
{/*{{{*/

	if (id == currentAboDetail) {
		document.getElementById(id).style.display = 'none';
		currentAboDetail = "";
	} else {
		if (currentAboDetail != "" && document.getElementById(currentAboDetail)) {
			document.getElementById(currentAboDetail).style.display = 'none';
		}
		
		if (document.getElementById(id)) {
			document.getElementById(id).style.display = 'block';
			currentAboDetail	=	id;
		}
	}

}/*}}}*/
function openWin(uri,w,h,l,t,_options)
{/*{{{*/
	if (!uri) return false;
	if (!w) w=400;
	if (!h) h=500;
	if (!l) l=10;
	if (!t) t=10;
	if (!_options)	_options='scrollbars=no,resizable=1,status=1';
	window.open(uri,"_blank","width="+w+",height="+h+",left="+l+",top="+t+","+_options) 
}/*}}}*/

function SO_onOptionsChange(dom_id,m_dom_id,price)
	{/*{{{*/
		if(window.SO_productOptionPriceDiff && window.SO_productOptionPriceDiff[dom_id]) 				
			{
				var s_dom_id;
				for(s_dom_id in SO_productOptionPriceDiff[dom_id])
					{
						if(SO_productOptionPriceDiff[dom_id][s_dom_id][document.getElementById(s_dom_id).value])
							{
								price	+=	SO_productOptionPriceDiff[dom_id][s_dom_id][document.getElementById(s_dom_id).value];
							}
					}
			}

		if(document.getElementById(m_dom_id) && document.getElementById(m_dom_id).value)
			{
				price	=	price*parseInt(document.getElementById(m_dom_id).value);
			}


		if(document.getElementById(dom_id)) document.getElementById(dom_id).innerHTML	=	SO_number_format(price,2,',','');


	}/*}}}*/
function SO_registerProductOptionPriceDiff(dom_id,	s_dom_id,	option_value,	o_price)
	{/*{{{*/
		if(!window.SO_productOptionPriceDiff)						window.SO_productOptionPriceDiff					=	new Array();
		if(!window.SO_productOptionPriceDiff[dom_id])				window.SO_productOptionPriceDiff[dom_id]			=	new Array();
		if(!window.SO_productOptionPriceDiff[dom_id][s_dom_id])		window.SO_productOptionPriceDiff[dom_id][s_dom_id]	=	new Array();
		
		window.SO_productOptionPriceDiff[dom_id][s_dom_id][option_value]	=	o_price;
	}/*}}}*/
function SO_sf_insubmit(msg,dom_id)
	{/*{{{*/
		if(document.getElementById(dom_id))
			{
				document.getElementById(dom_id).innerHTML	=	msg;
				window.SO_CURRENT_AJAX_STATUS_ELEMENT		=	document.getElementById(dom_id);
			}
		return true;//always!!!
	}/*}}}*/
function SO_number_format (number, decimals, dec_point, thousands_sep)
	{/*{{{*/
		  var exponent = "";
		  var numberstr = number.toString ();
		  var eindex = numberstr.indexOf ("e");
		  if (eindex > -1)
		  {
			exponent = numberstr.substring (eindex);
			number = parseFloat (numberstr.substring (0, eindex));
		  }
		  
		  if (decimals != null)
		  {
			var temp = Math.pow (10, decimals);
			number = Math.round (number * temp) / temp;
		  }
		  var sign = number < 0 ? "-" : "";
		  var integer = (number > 0 ? 
			  Math.floor (number) : Math.abs (Math.ceil (number))).toString ();
		  
		  var fractional = number.toString ().substring (integer.length + sign.length);
		  dec_point = dec_point != null ? dec_point : ".";
		  fractional = decimals != null && decimals > 0 || fractional.length > 1 ? 
					   (dec_point + fractional.substring (1)) : "";
		  if (decimals != null && decimals > 0)
		  {
			for (i = fractional.length - 1, z = decimals; i < z; ++i)
			  fractional += "0";
		  }
		  
		  thousands_sep = (thousands_sep != dec_point || fractional.length == 0) ? 
						  thousands_sep : null;
		  if (thousands_sep != null && thousands_sep != "")
		  {
			for (i = integer.length - 3; i > 0; i -= 3)
			  integer = integer.substring (0 , i) + thousands_sep + integer.substring (i);
		  }
		  
		  return sign + integer + fractional + exponent;
	}/*}}}*/
	
// Gewinnspiel PopUp
//	function start_gewinnspiel() {
//		popUpwin = window.open('/de/gewinnspiel/','raffle','toolbar=no,menubar=no,scrollbars=0,status=no,width=600,height=660,top=50,left=50');
//		popUpwin.focus();
//		}
	
	function start_gewinnspiel_2007() {
		popUpwin = window.open('/de/gewinnspiel_2007/','raffle_2007','toolbar=no,menubar=no,scrollbars=0,status=no,width=600,height=660,top=50,left=50');
		popUpwin.focus();
	}

	function gewinner() {
		popUpwin = window.open('/de/gewinnspiel/gewinner.php','raffle','toolbar=no,menubar=no,scrollbars=0,status=no,width=600,height=550,top=50,left=50');
		popUpwin.focus();
	}

	
	// EN Gewinnspiel PopUp
	
	
	function en_start_gewinnspiel_2007() {
		popUpwin = window.open('/en/gewinnspiel_2007/','raffle_2007','toolbar=no,menubar=no,scrollbars=0,status=no,width=600,height=660,top=50,left=50');
		popUpwin.focus();
	}
	
	
//	function en_start_gewinnspiel() {
//		popUpwin = window.open('/en/gewinnspiel/','raffle','toolbar=no,menubar=no,scrollbars=0,status=no,width=600,height=660,top=50,left=50');
//		popUpwin.focus();
//	}

	function en_gewinner() {
		popUpwin = window.open('/en/gewinnspiel/gewinner.php','raffle','toolbar=no,menubar=no,scrollbars=0,status=no,width=600,height=550,top=50,left=50');
		popUpwin.focus();
	}


	function Fensterweite()
		{//{{{
			if (window.innerWidth) return window.innerWidth+20;
			else if (document.body && document.body.offsetWidth) return document.body.offsetWidth;
			else return 0;
		}//}}}

	function checkResize() 
		{//{{{
			cwidth = Fensterweite();

			if (cwidth < 925) 
				{

					if (document.getElementById("main")) 
						{
							document.getElementById("main").style.left 			= '0px';
							document.getElementById("main").style.marginLeft 	= '0px';
						}
				} 
					else 
				{
					if (document.getElementById("main")) 
						{
							document.getElementById("main").style.left 			= '50%';
							document.getElementById("main").style.marginLeft 	= '-462px';
						}
				}
		}//}}}

