function goBack(action, productId){
	if (productId != '')
		document.FRM_PROD.productId.value = productId;
		document.FRM_PROD.action.value = action;
		document.FRM_PROD.command.value = 'back';
		document.FRM_PROD.submit();
}

function showRelDetails(relId){
	document.FRM_PROD.relatedId.value = relId;
	document.FRM_PROD.submit();
}
function confirmDelete(strObject){
	return confirm("Möchten Sie diese(n) " + strObject + " wirklich löschen?");
}

function submitIt(frmName)
{
	var BrowserName = navigator.appName;
	var BrowserVersion = navigator.appVersion;
	
	if( BrowserName.search('Microsoft') == 0 ){
		document.forms[frmName].changeVariant.click();
	}
}

function openPopUp(urlLink)
{
	var Win = window.open(urlLink,"Help", 
	"scrollbars=yes,width=300,height=300"); Win.focus();
}

// Kommentar Bestellung start
function chkTextAreaLength(field, len)
{
	var theField = eval('document.'+field);
	var fieldValue = theField.value;
	if (fieldValue.length >= len)
	{
		theField.value = fieldValue.substr(0,len);
	}
}
// Kommentar Bestellung end

// AGB akzeptiert?
function chkagb()
{
	return true;
}

//
function openagb()
{
	var myurl = "templates/default_shop/de/a_shop_sbc_print.html";
	MeinFenster = window.open(myurl, "AGBs", "width=400,height=500,scrollbars=yes");
	MeinFenster.focus();
}

//
function openOrder(sid)
{
	var myurl = "index.php?action=order2&amp;printView=true&amp;sid="+sid+"";
	MeinFenster = window.open(myurl, "Bestellung", "width=800,height=500,scrollbars=yes");
	MeinFenster.focus();
}

// Product Details
function switch_views(view) {
	switch (view) {
	case 0:
		document.getElementById("tab1").style.visibility = "visible";
		document.getElementById("tab2").style.visibility = "hidden";
		document.getElementById("tab3").style.visibility = "hidden";
		break;
	case 1:
		document.getElementById("tab1").style.visibility = "hidden";
		document.getElementById("tab2").style.visibility = "visible";
		document.getElementById("tab3").style.visibility = "hidden";
		break;
	case 2:
		document.getElementById("tab1").style.visibility = "hidden";
		document.getElementById("tab2").style.visibility = "hidden";
		document.getElementById("tab3").style.visibility = "visible";
		break;
	}
}
//pop up center

function getCenterPosition(pwidth,pheight) {
	var x = (screen.width-pwidth) / 2;
	var y = (screen.height-pheight) / 2;
	var fc_js_pos = ",left="+x+",top="+y+",screenX="+x+",screenY="+y;
	
	return fc_js_pos;
}
function OpenPopUpName(breite,hoehe,pop_name,Ziel) {
	OpenPopUpNamePara(breite,hoehe,pop_name,'',Ziel);
}

function OpenPopUpNamePara(breite,hoehe,pop_name,para,Ziel) {
	var fc_js_pos = getCenterPosition(breite,hoehe);
	
	var options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=auto,status=no,menubar=no,resizable=no"+fc_js_pos;
	if (para == 'scroll') {
		options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no"+fc_js_pos;
	}
	if (para == 'noscroll') {
		options ="width="+breite+",height="+hoehe+",toolbar=no,locationbar=no,directories=no,scrollbars=no,status=no,menubar=no,resizable=no"+fc_js_pos;
	}
	if (para != 'scroll' && para != 'noscroll' && para != '') {
		options = "width=" + breite + ",height=" + hoehe + "," + para + fc_js_pos;
	}

	if 	(pop_name == ''){
		pop_name = 'Popup';	
	}
	
	var newwindow = open(Ziel,pop_name,options);
	if (newwindow != null){
		newwindow.focus();
	}
}
