var myGlobalObject = new Object(); myGlobalObject.searches = new Array(); myGlobalObject.robjects = new Array(); function prep_array_key_toString(key, value) { return "\n"+key+"|"+value+""; } function prep_array_toString(index, myArray) { if(typeof(myGlobalObject.searches[index]) == "undefined"){ myGlobalObject.searches[index] = ""; } for(x in myArray) { myGlobalObject.searches[index]+= prep_array_key_toString(x, myArray[x]); } return 1; } function prep_array2_key_toString(key, value) { return "\narray|"+key+"|"+value+""; } function prep_array2_toString(index, myArray) { if(typeof(myGlobalObject.searches[index]) == "undefined"){ myGlobalObject.searches[index] = ""; } for(x in myArray) { myGlobalObject.searches[index]+= prep_array2_key_toString(x, myArray[x]); } return 1; } function prep_array3_key_toString(key, key2, value) { return "\narray|"+key+"|"+key2+"|"+value+""; } function prep_array3_toString(index, key2, myArray) { if(typeof(myGlobalObject.searches[index]) == "undefined"){ myGlobalObject.searches[index] = ""; } for(x in myArray) { myGlobalObject.searches[index]+= prep_array3_key_toString(x, key2, myArray[x]); } return 1; } function dojoLoadOffersSearchEngine(index, page, hash, rss) { var vdata;// alert(myGlobalObject.searches[index]); if(typeof(myGlobalObject.searches[index]) != "undefined") { var xhrArgs = { url: "bg/dojoLoadOffersSearchEngine", handleAs: "json", preventCache: true, sync: true, content: {model_array: myGlobalObject.searches[index], page: page, hash: hash, rss: rss}, load: function(data) { //alert(data); vdata = data; }, error: function(error) { alert("An unexpected error occurred: " + error); } } var deferred = dojo.xhrPost(xhrArgs); return vdata; } } dojo.require('dojox.fx.scroll'); dojo.require('dojox.fx'); function dojoLoadSimpleOffersSearchEngine(index, page, hash, rss) { myArray = new Array(); myArray['jsfunc'] = "dojoLoadSimpleOffersSearchEngine"; prep_array_toString(index, myArray); var tmp0000 = dojoLoadOffersSearchEngine(index, page, hash, rss); dojo.style(index,"opacity","0.25"); // hide it var anim1 = dojo.animateProperty({ node: index, delay: 500, properties:{ // fade back in opacity: { end: 0 } } }); var anim2 = dojo.animateProperty({ node: index, delay: 500, onPlay: function(){ // executed when the animation is played dojo.byId(index).innerHTML = tmp0000.html; }, properties:{ // fade back in and make text bigger opacity: { end: 1 } } }); //anim1.play(); anim2.play(); //alert(tmp0000); dojo.byId(index).innerHTML = tmp0000.html; if((index == 'hotoffers' && page != 1) || index == 'fullsearches_result' || index == 'fsearches_result' || index == 'quicksearch_result'){dojox.fx.smoothScroll({node:dojo.byId(index),win:window,duration:400}).play();} } dojo.require("dijit.Dialog"); dojo.require("dijit.form.Form"); dojo.require("dijit.form.ValidationTextBox"); function dojoContactFormProcessing(name, email, topic, text) { if(name != "" && email != "" && topic != "" && text != "") { var xhrArgs = { url: "bg/dojoContactFormProcessing", handleAs: "json", preventCache: true, content: {name: name, email: email, topic: topic, text: text}, load: function(data) { alert(data.msg); if(data.status == 1) { dijit.byId('dojoContact').hide(); } }, error: function(error) { //alert("An unexpected error occurred: " + error); } } var deferred = dojo.xhrPost(xhrArgs); } } function dojoLoadArea(id, divid) { var divid2 = ''; if(id > 0) { if(typeof(divid) == "undefined"){ divid = "searchForm"; } if(divid == 'searchForm') { divid2 = 'opt[2]'; } else if(divid == 'addForm') { divid2 = 'opt[2]'; } else { divid2 = 'QS_2'; } var xhrArgs = { url: "bg/dojoLoadArea", handleAs: "json", preventCache: true, content: {id: id}, load: function(data) { if(data.notnull == 1) { if(divid == 'searchForm') { var rhtml = ''; for(xx in data.result) { if(data.result[xx].value != ""){ rhtml += ' '+data.result[xx].value+'
'; } } dojo.byId('FullSearchAreasHere'+id).style.display = 'block'; dojo.byId('FullSearchAreasHere'+id).innerHTML = rhtml; CSBfleXcroll('FullSearchAreasHere'+id); } else if(divid == 'dojoLoadAreaCont') { var html = ''; //dojo.byId('uselect3').className = "dsf"; dojo.byId('uselect3').className = "uselect"; if(counti > 0){ uselect3 = 0; } else { uselect3 =1; } dojo.byId(divid).innerHTML = html; return true; } else if(divid == 'dojoLoadAreaCont2') { var html = ''; dojo.byId('uselectValue361').innerHTML = html; return true; } else { var yy=document.getElementById(divid); for (var i=0; i < yy.length; i++) { if(yy.elements[i].name == divid2) { xxx = yy.elements[i]; } } xxx.options.length = 0; for(xx in data.result) { var y=document.createElement('option'); y.text=data.result[xx].value; y.value=data.result[xx].key; //var xxx=document.getElementById("addForm"); try { xxx.add(y,null); // standards compliant } catch(ex) { xxx.add(y); // IE only } } } } }, error: function(error) { //alert("An unexpected error occurred: " + error); } } var deferred = dojo.xhrPost(xhrArgs); } } function dojoUserLoginFormProcessing(email, password, type) { if(email != "" && password != "") { var xhrArgs = { url: "bg/dojoUserLoginFormProcessing", handleAs: "json", preventCache: true, content: {password: password, email: email, type: type}, load: function(data) { alert(data.msg); if(data.status == 1) { dijit.byId('dojoUserLogin').hide(); if(type == 0) { window.location='bg/'; } else if(type == 1) { window.location='bg/'; } } }, error: function(error) { //alert("An unexpected error occurred: " + error); } } var deferred = dojo.xhrPost(xhrArgs); } } function hideShowUserLogin(id) { if(id == 1) { dojo.byId('myForm231').style.display = 'block'; dojo.byId('myForm232').style.display = 'none'; dojo.byId('userLoginLink1').className = 'here'; dojo.byId('userLoginLink2').className = ''; } else { dojo.byId('myForm232').style.display = 'block'; dojo.byId('myForm231').style.display = 'none'; dojo.byId('userLoginLink2').className = 'here'; dojo.byId('userLoginLink1').className = ''; } } function dojoIndexOffersSubscribe(email, index) { //myGlobalObject.searches[index] = ""; myArray = new Array(); myArray['subscribe'] = "1"; myArray['subscribe_email'] = email; prep_array_toString(index, myArray); var tmp0000 = dojoLoadOffersSearchEngine(index, '1', '', '0'); dijit.byId('dojoSubscribeEmail').value = ''; dijit.byId('dojoSubscribingForm').hide(); alert('Успешно се абонирахте. Ще бъдете уведомени при наличието на оферти с вашите изисквания.'); } var uselect3 = 1; function uselectMouserOver(id) { var tmpClass = ''; if(uselect3 == 1 && id == 3){ tmpClass = ' unactiveUselect'; } dojo.byId('uselect'+id).className = 'uselect-h'+tmpClass; } function uselectMouserOut(id) { var tmpClass = ''; if(uselect3 == 1 && id == 3){ tmpClass = ' unactiveUselect'; } dojo.byId('uselect'+id).className = 'uselect'+tmpClass; } function uselectOnClick(id, subid, refa) { if(dojo.byId('uselectValue'+id) && dojo.byId('uselect'+id+'_title')) { dojo.byId('uselectValue'+id).value = subid; dojo.byId('uselect'+id+'_title').innerHTML = refa.innerHTML; uselectMouserOut(id); } } function dojoChangeSearchOrder(index, order) { if(order >= 0 && order < 10) { var myArray = new Array(); myArray['orderby'] = order; prep_array_toString(index, myArray); } }