/* * Send Requests to Server */ ringdata = new Array(); var globalprice; function savering(set) { var set = set; if (set == 'new') { var cookieName = $('#hd_name').val(); newId=""; if ( $.cookies.get('hd_' + cookieName) ){ if (confirm('Ein Ring mit diesem Namen existiert bereits. Wollen Sie ihn überschreiben?')){ $.ajax({ url: 'system/gateway/saveconfiguration', async: false, cache: false, dataType: 'json', data: ({save : 'true'}), success: function(data){ if(!(data.id)) { $("#saveUI").hide(); $("#savedUIError").show(); return false; } var cookieName = $('#hd_name').val(); var date = new Date(); date.setTime(date.getTime() + (31 * 24 * 60 * 60 * 1000)); newId=data.id; $.cookies.set('hd_' + cookieName, data.id, { path: '/', expiresAt: date }); $("#saveUI").hide(); $("#savedUI").show(); setTimeout("closeLayer('saveloadlayer')",2500); } }); return (newId); } }else{ $.ajax({ url: 'system/gateway/saveconfiguration', async: false, cache: false, dataType: 'json', data: ({save : 'true'}), success: function(data){ if(!(data.id)) { $("#saveUI").hide(); $("#savedUIError").show(); return false; } var cookieName = $('#hd_name').val(); var date = new Date(); date.setTime(date.getTime() + (31 * 24 * 60 * 60 * 1000)); newId=data.id; $.cookies.set('hd_' + cookieName, data.id, { path: '/', expiresAt: date }); $("#saveUI").hide(); $("#savedUI").show(); setTimeout("closeLayer('saveloadlayer')",2500); } }); return (newId); } } else if (set=="over") { var cookieName = $('#myRings').val(); if (cookieName=="") return false; newId=""; $.ajax({ url: 'system/gateway/saveconfiguration/overwrite/1', async: false, cache: false, dataType: 'json', data: ({save : 'true'}), success: function(data){ if(!(data.id)) { $("#saveUI").hide(); $("#savedUIError").show(); return false; } var cookieName = $('#myRings').val(); var date = new Date(); date.setTime(date.getTime() + (31 * 24 * 60 * 60 * 1000)); newId=data.id; $.cookies.set('hd_' + cookieName, data.id, { path: '/', expiresAt: date }); $("#saveUI").hide(); $("#savedUI").show(); setTimeout("closeLayer('saveloadlayer')",2500); } }); return (newId); } else if (set=="email") { $.ajax({ url: 'system/gateway/saveconfiguration', async: false, cache: false, dataType: 'json', data: ({save : 'true'}), success: function(data){ newId=data.id; } }); setTimeout("closeLayer('saveloadlayer')",2500); return (newId); } else if (set=="facebook") { $.ajax({ url: 'system/gateway/saveconfiguration/overwrite/1', async: false, cache: false, dataType: 'json', data: ({save : 'true', saveType : 'facebook'}), success: function(data){ newId=data.id; } }); setTimeout("closeLayer('saveloadlayer')",2500); return (newId); } } function LoadConfiguration(id) { $.ajax({ url: 'system/gateway/loadconfiguration', async: false, cache: false, data: ({id : id}), success: function(data){ var id = location.href; id = id.split('?meineRinge='); location.href=id[0]; //location.reload(true); return true; } }); } function getPersonalData() { $.ajax({ url: 'system/gateway/getpersonaldata', async: true, cache: false, dataType: 'json', data: ({values : 0}), success: function(data){ ReFillForm(data); } }); } function SavePersonalData(values) { $.ajax({ url: 'system/gateway/savepersonaldata', async: true, cache: false, data: ({values : values}), success: function(data){ if(data == '"true"'){ $('#customerdata #successmessage').fadeIn().delay(3000).fadeOut(); } } }); } function setAcutalSelection(selection) { $.ajax({ url: 'system/gateway/selection', async: false, cache: false, data: ({selection : selection}), success: function(data){ ReloadCollageImage(); UpdatePriceLabel(); return data; } }); } function RemoveThirdRing(gender) { $.ajax({ url: 'system/gateway/remove', async: false, cache: false, data: ({selection : gender}), success: function(data){ ReloadCollageImage(); UpdatePriceLabel(); return data; } }); } function ReInit() { $.ajax({ url: 'system/gateway/reinit', async: false, cache: false, data: ({init : 'do'}), success: function(data){ return data; } }); } function InitConfigurator(type) { $.ajax({ url: 'system/gateway/initconfigurator', async: false, cache: false, data: ({init : type}), success: function(data){ window.location.href = "configurator.php"; return data; } }); } function SetActiveRing(Ring) { $.ajax({ url: 'system/gateway/setactivering', async: false, cache: false, data: ({ring: Ring}) }); } /**/ function testkj(data) { AnalyzeSetData(data); //Bild laden + Price Update /* GetAvalibleItems('femalering','alloy_au',ShowAvailableAlloyAu); GetAvalibleItems('femalering','alloy_pt',ShowAvailableAlloyPt); GetAvalibleItems('femalering','alloy_pd',ShowAvailableAlloyPd); */ } function lade() { /* if(setGender=='pairring'){ GetAvalibleItems('femalering','alloy_au',ShowAvailableAlloyAu); GetAvalibleItems('femalering','alloy_au2',ShowAvailableAlloyAu2); GetAvalibleItems('femalering','alloy_pt',ShowAvailableAlloyPt); GetAvalibleItems('femalering','alloy_pd',ShowAvailableAlloyPd); }else{ GetAvalibleItems(setGender,'alloy_au',ShowAvailableAlloyAu); GetAvalibleItems(setGender,'alloy_au2',ShowAvailableAlloyAu2); GetAvalibleItems(setGender,'alloy_pt',ShowAvailableAlloyPt); GetAvalibleItems(setGender,'alloy_pd',ShowAvailableAlloyPd); } */ } function setze(object,item,value) { SetItemValue(object,item,value,lade); } /**/ function GetAvalibleItems(object,item,functionname) { $.ajax({ url: 'system/gateway/getproperties', async: true, cache: false, dataType: 'json', data: ({item : item, object : object}), success: functionname }); } function GetActiveItem(object,item,functionname) { $.ajax({ url: 'system/gateway/getvalue', async: true, cache: false, dataType: 'json', data: ({item : item, object : object}), success: functionname }); } function SetItemValueDirect(object,item,value,callback) { $.ajax({ url: 'system/gateway/setproberty', async: false, cache: false, dataType: 'json', data: ({item : item, object : object, value : value}), success: callback }); } function SetItemValue(object,item,value,nonreloadimage) { SetItemValueDirect(object, item, value, AnalyzeSetData); } function SetItemValueWithCallback(object, item, value, callback) { SetItemValueDirect(object, item, value, function(data) { AnalyzeSetData(data); callback(data); }); } /** * Callback for SetValue */ function AnalyzeSetData(data) { //huhu = 1234; // alert(data.price.prices.malering); // globalprice = ; UpdatePriceLabel1(data.price); $('#productimage').attr('src','/images/' + data.image.key + '.jpg'); infoscrren = data.infoscreen; if(infoscrren != null){ $.each(infoscrren, function(i,info){ $('