// Contenido Set content by checkbox 
function cms_checkbox_selecter(cCurrentContainer,htmlid) {
	
	newvalue = 0; 
	
	if(document.getElementById('cms_checkbox_selecter_'+cCurrentContainer+'_'+htmlid).checked == true) { 
		newvalue = "1"; 
	}
	aEditdata['HTML_2_'+htmlid] = newvalue;
}

function cms_select_selecter(cCurrentContainer,htmlid,selectid) {
	
	newvalue = document.getElementById(selectid).options[document.getElementById(selectid).selectedIndex].value; 
	
	aEditdata['HTML_2_'+htmlid] = newvalue;
}

function setnavi() {
navigationul = document.getElementById("nav").getElementsByTagName("li");
ulscount =  navigationul.length;

for( i=0; i< ulscount; i++) {

	if(navigationul[i].className == 'limiddle' ||navigationul[i].className ==  'activepath limiddle') {
		var killa = navigationul[i];
		var thisli= killa.getElementsByTagName("li");
		var thisul= killa.getElementsByTagName("ul");
			
		ParOffsetLeft = navigationul[i].offsetLeft;
		DivOffsetLeft = document.getElementById("content").offsetLeft;
		ParToDiv = ParOffsetLeft - DivOffsetLeft;
		
		// USE FOR RIGHT FLOW  offset to divcontain - width ob ul - 490(center) -3 (padding/margin) + parent elementwidth
		//offset to divcontain - (width ob ul/2) - 490(center) -3 (padding/margin) + (parent elementwidth/2)
		Elmargin = ParToDiv - (thisul[0].offsetWidth/2)-490-3+(navigationul[i].offsetWidth/2);			
				
		thisul[0].style.marginLeft = Elmargin+'px';

	}
	//alert(navigationul[i].innerHTML);
	
}

//document.getElementById('mydiv1').offsetWidth
}

function change_image(url) {
	document.getElementById("produkt_detail_image").innerHTML = '<img src="'+url+'" >';
}

function change_video(url) {
	document.getElementById("produkt_detail_image").innerHTML = '<object width="586" height="360"><param name="movie" value="http://www.youtube.com/v/{youtubeID}&amp;hl=en&amp;fs=1&amp;rel=0&amp;autoplay=1" />            </param>            <param name="allowFullScreen" value="true" />            </param>            <param name="allowscriptaccess" value="always" />            <param name="WMode" value="Transparent" />            <param name="autoplay" value="1" />            </param>            <embed src="http://www.youtube.com/v/'+url+'&amp;hl=en&amp;fs=1&amp;rel=0&amp;autoplay=1"             width="586" height="360" type="application/x-shockwave-flash" allowscriptaccess="always"             allowfullscreen="true" movie="http://www.youtube.com/v/'+url+'&amp;hl=en&amp;fs=1&amp;rel=0&amp;autoplay=1"             wmode="Transparent" autoplay="1"></embed>      </object> ';
	
	var mylink = location.href;
	mylink = mylink.replace("#top","");
	
	location.href=mylink+'#top';
}

function openFancyBox2(href) {
	document.getElementById("inptinput2").value = document.getElementById("inptinput").value;
	$.fancybox({
'autoDimensions'  : 'true',
	'overlayColor': 	'#000',
	'type': 'inline',
	'href' : href
	});
}

function check_show_link() {
	if(document.getElementById('typeselect').options[document.getElementById('typeselect').selectedIndex].value == '2') {
		document.getElementById('admin_events_link').style.display = 'block';
	} else {
		document.getElementById('admin_events_link').style.display = 'none';
	}
}
