/* ** Blätterkatalog Integration Script ** ********************************* ** ** 1) addToCart(artno, shopsessionid) ** Wird bei Linktyp "Artikel in Warenkorb legen" ** aufgerufen. ** ** ** 2) blaetterkatalogflip(newPage) ** Blättert auf die gegebene Seite ** Wird bei Linktyp "Gehe zu Seite" verwendet. ** ** TODO: Kann optional verwendet werden ** um mittels ** ** Gehe zu Seite 5 ** ** den Blätterkatalog umzublättern. ** (Beispiel: Auf Kapitel-Startseite blättern) ** ** 3) gotoURL(myURL) ** Wird bei Linktyp "Externer Link" und ** von addToCart aufgerufen ** */ /** */ function addToCart(artno, shopsessionid) { var destinationURL = ''; var artno_array = artno.split("/"); var type = artno_array[0]; var type_id = artno_array[1].split("=")[1]; switch( type ){ case "world": destinationURL = 'http://www.ratioform.de/webshop/business.exe/center/url_stack_id_prev=3/category_wrapper.ipm/type=world/type_id='+type_id; break; case "category": destinationURL = 'http://www.ratioform.de/webshop/business.exe/center/url_stack_id_prev=3/category_wrapper.ipm/type=category/type_id='+type_id; break; case "product": destinationURL = 'http://www.ratioform.de/webshop/business.exe/center/url_stack_id_prev=3/objectView/main.ipm/obj=catalog_item/product_id='+type_id; break; default: alert('Type \''+type+'\' unknown!'); return; } //var destinationURL = shopBase + shopURL + artno + shopSessionIDParameterName + shopsessionid + shopURLPostfix; if (shopDebug) alert("ShopSessionID: "+shopsessionid+"\nArtikel "+artno+" in Detailansicht Shop aufrufen\n\nSHOP URL: "+destinationURL); if (!shopDebug) gotoURL(destinationURL); } /** * blättert auf die entsprechende seite um * setzt voraus, dass der blätterkatalog in * dem fenster noch geladen ist */ function blaetterkatalogflip(newPage) { flashCommand('jump_to_id', newPage) } /** * sprint zu einer URL * Ziel: Shop-Fenster */ function gotoURL( myURL ) { if (myURL.indexOf("mailto:")!=-1) { location.href=myURL; return; } try { if ( typeof( opener ) == "undefined" || typeof( opener ) == "unknown" || typeof( opener.name ) == "undefined" || typeof( opener.name ) == "unknown" ) { if ( shopFenster.closed ) { shopFenster = window.open( myURL, "shop", "" ); shopFenster.focus(); } else { shopFenster.location.href=myURL; shopFenster.focus(); } } else { opener.location.href = myURL; opener.blatterkatalogPopup = window; opener.focus(); } } catch ( Exception ) { if( opener && !opener.closed ) { opener.location.href = myURL; opener.focus(); } else { try { if ( shopFenster.closed ) { shopFenster = window.open( myURL, "shop", "" ); shopFenster.focus(); } else { shopFenster.location.href = myURL; shopFenster.focus(); } } catch ( Exception ) { shopFenster = window.open( myURL, "shop", "" ); shopFenster.focus(); } } } } /** * getFlashPath() ermittelt das Flash-Objekt */ function getFlashPath() { if ( document.all ) { //ie return document.bkflash; } else { //safari var ffilm = document.getElementById( "bkflash" ); try { flashfilm.SetVariable( "tst", "1" ); } catch ( Exception ) { //firefox ffilm = document.embeds["bkflash"]; } return ffilm; } } ///////////////////////////////////// // Funktion zum externen Aufruf der Flash-Commands // id => 'jump_to_id' // par => pageid // aufruf mit z.b. flashCommand('jump_to_id', 5) ///////////////////////////////////// function flashCommand( id, par ) { try { var movie = getFlashPath(); movie.SetVariable( "jscommand", id + "|" + par ); } catch( Exception ) { document.getElementById("bkflash").SetVariable( "jscommand", id + "|" + par ); } } function getURLParam( strParamName, defaultBKValue ) { var strReturn = " "; var strHref = window.location.href; var i = strHref.indexOf( strParamName ); if ( i > 0 ) { var j = strHref.indexOf( "=", i + 1 ); if ( j > 0 ) { var endPos = strHref.length; var k = strHref.indexOf( "?", j + 1 ); var l = strHref.indexOf( "&", j + 1 ); if ( k > 0 && l > 0 ) { if ( k < l ) { endPos = k; } else { endPos = l; } } else if ( k > 0 ) { endPos = k; } else if ( l > 0 ) { endPos = l; } strReturn = strHref.substring( j + 1 , endPos ); } } if (strReturn == "" || strReturn == " ") { if (defaultBKValue) { return defaultBKValue; } } return strReturn; } window.onerror = stoperror; function stoperror( a ) { return false; }