function LocRedirect() { setcookie("VCountry", "All Countries", time() + 3600, "/", "vazap.com", 0); setcookie("VCurrency", "EUR", time() + 3600, "/", "vazap.com", 0); //window.location = window.location; } $(document).ready(function(){ focused = false; focused1 = false; focused3 = false; $('#dd1').click(function(){focused = true;}); $('#dd1').mouseout(function(){focused = false;}); $('#CountriesDropDown').click(function(){focused = true;}); $('#CountriesDropDown').mouseout(function(){focused = false;}); $('#dd2').click(function(){focused1 = true;}); $('#dd2').mouseout(function(){focused1 = false;}); $('#RegionsDropDown').click(function(){focused1 = true;}); $('#RegionsDropDown').mouseout(function(){focused1 = false;}); $('#dd3').click(function(){focused3 = true;}); $('#dd3').mouseout(function(){focused3 = false;}); $('#CityDropDown').click(function(){focused3 = true;}); $('#CityDropDown').mouseout(function(){focused3 = false;}); $("body").click(function(){ //alert(focused); if (!focused) { $("#CountriesDropDown").hide(); OpenShowHideDropDown = false; } if (!focused1) { $("#RegionsDropDown").hide(); OpenShowHideDropDown1 = false; } if (!focused3) { $("#CityDropDown").hide(); OpenShowHideDropDown2 = false; } }); }); function ShowCity(CityId) { if (isset(document.getElementById('GoogleMap'))) { document.getElementById('GoogleMap').src="/googlemap3.php?CityId="+CityId; } } function getInternetExplorerVersion() { var rv = -1; // Return value assumes failure. if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent; var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); if (re.exec(ua) != null) rv = parseFloat(RegExp.$1); } return rv; } var verB = false; function checkVersion() { var msg = "You're not using Windows Internet Explorer."; var ver = getInternetExplorerVersion(); if (ver > -1) { verB = ver; if (ver >= 8.0) msg = "You're using a recent copy of Windows Internet Explorer." else verB = true; } //alert(msg); } checkVersion(); function checkVersion1() { var msg = "You're not using Windows Internet Explorer."; var ver = getInternetExplorerVersion(); if (ver > -1) { verB = ver; if (ver >= 7.0) msg = "You're using a recent copy of Windows Internet Explorer." else window.location="/update.php"; } //alert(msg); } checkVersion1(); function inappropriate(id1) { $.get("/AJAX/inappropriate.php",{id: id1}, function(data){ csscody.alert("Thank you for your signal."); }); } function ShowCalendar(banner, d) { document.getElementById('dates').innerHTML = ""; document.getElementById('ResMonth').value = ""; $.get("/AJAX/Calendar.php",{id: banner, dat: d, r: 1271249801}, function(data){ document.getElementById('Cal_here').innerHTML = data; }); } function GetMounth(date, date1) { document.getElementById('dates').innerHTML = "Month: "+date; document.getElementById('CMonth').innerHTML = "Month: "+date; document.getElementById('ResMonth').value = date1; } function LoadSousCategories(id1) { if (id1 != 0) { var select = document.SearchAdsModul.search_souscat_dropdown; select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getSousCategories.php",{id: id1}, function(data){ document.getElementById("SubCatConteiner").innerHTML = " "+data; }); } else { var select = document.SearchAdsModul.search_souscat_dropdown; select.options.length = 0; select.options[select.options.length] = new Option("All Subcategories", 0); } } function LoadSousCategories1(id1) { document.getElementById('PutMoreOptions').innerHTML = ""; if (id1 != 0) { var select = document.SearchAdsModul.search_souscat_dropdown; select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getSousCategories.php",{id: id1}, function(data){ document.getElementById("SubCatConteiner").innerHTML = data; }); } else { var select = document.SearchAdsModul.search_souscat_dropdown; select.options.length = 0; select.options[select.options.length] = new Option("Select Categorie", 0); } } function LoadMoreOptions(id1) { if (id1 != 0) { $.get("/AJAX/LoadMoreOptions.php",{id: id1}, function(data){ document.getElementById('PutMoreOptions').innerHTML = data; }); } else { document.getElementById('PutMoreOptions').innerHTML = ''; } } function LoadMoreOptions1(id1) { if (id1 != 0) { $.get("/AJAX/LoadMoreOptions1.php",{id: id1}, function(data){ document.getElementById('PutMoreOptions').innerHTML = data; }); } else { document.getElementById('PutMoreOptions').innerHTML = ''; } } function LoadMoreOptions2(id1) { if (id1 != 0) { $.get("/admin/AJAX/LoadMoreOptions1.php",{id: id1}, function(data){ document.getElementById('PutMoreOptions').innerHTML = data; }); } else { document.getElementById('PutMoreOptions').innerHTML = ''; } } function LoadMoreOptionsSubCat(id1) { if (id1 != 0) { $.get("/AJAX/LoadMoreOptionsSubCat.php",{id: id1}, function(data){ document.getElementById('PutMoreOptions').innerHTML = data; }); } else { LoadMoreOptions(document.getElementById('search_cat_dropdown').value); //document.getElementById('PutMoreOptions').innerHTML = ''; } } function LoadOptions() { if (document.getElementById('AdsCategorie').value!=-1) { $.get("/AJAX/LoadMoreOptions1.php",{id: document.getElementById('AdsSubCategorie').value}, function(data){ document.getElementById('PutMoreOptions').innerHTML = data; if (data=="") document.getElementById('PutMoreOptions').innerHTML = "
Please choose a categorie. If you have already chosen a category there are possibly no options that you can add to your advert.
"; ChangeTab(4, 6); }); } else { csscody.alert("First you have to choose a categorie."); } } function LoadWebSubCategory(id1) { if (id1 != 0) { var select = document.SearchAdsModul.WebSubCategory; select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getWebSousCategories.php",{id: id1}, function(data){ eval("var myJSONObject = "+data); select.options.length = 0; select.options[select.options.length] = new Option("All Subcategories", 0); for (var i in myJSONObject) { select.options[select.options.length] = new Option(myJSONObject[i].cat, myJSONObject[i].id); } }); } else { var select = document.SearchAdsModul.WebSubCategory; select.options.length = 0; select.options[select.options.length] = new Option("All Subcategories", 0); } } function LoadModels(id1) { if (id1 != 0) { var select = document.SearchAdsModul.Model; select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/LoadModels.php",{id: id1}, function(data){ eval("var myJSONObject = "+data); select.options.length = 0; select.options[select.options.length] = new Option("All", 0); for (var i in myJSONObject) { select.options[select.options.length] = new Option(myJSONObject[i].model, myJSONObject[i].id); } }); } else { var select = document.SearchAdsModul.Model; select.options.length = 0; select.options[select.options.length] = new Option("All", 0); } } function LoadCities(id1) { if (id1 != 0) { document.getElementById('GoogleMap').src="/googlemap1.php?CountryId="+id1; document.getElementById('Cities').innerHTML=""; //var select = document.SearchAdsModul.dropdown_City; //select.options.length = 0; //select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getCities.php",{id: id1}, function(data){ document.getElementById('Cities').innerHTML=data; //eval("var myJSONObject = "+data); //select.options.length = 0; //select.options[select.options.length] = new Option("All", 0); //for (var i in myJSONObject) { // select.options[select.options.length] = new Option(myJSONObject[i].city, myJSONObject[i].id); //} }); } else { document.getElementById('Cities').innerHTML=""; //var select = document.SearchAdsModul.dropdown_City; //select.options.length = 0; //select.options[select.options.length] = new Option("Select Region", 0); } } function LoadCities1(id1) { if (id1 != 0) { //var select = document.getElementById("RegCity"); //select.options.length = 0; //select.options[select.options.length] = new Option("Loading...", 0); document.getElementById('Cities').innerHTML=""; $.get("/AJAX/getCities.php",{id: id1}, function(data){ document.getElementById('Cities').innerHTML=data; //eval("var myJSONObject = "+data); //select.options.length = 0; //select.options[select.options.length] = new Option("Cities", 0); //for (var i in myJSONObject) { // select.options[select.options.length] = new Option(myJSONObject[i].city, myJSONObject[i].id); //} }); } else { document.getElementById('Cities').innerHTML=""; //var select = document.getElementById("RegCity"); //select.options.length = 0; //select.options[select.options.length] = new Option("Select Region", 0); } } function LoadCities2(id1) { if (id1 != 0) { var select = document.getElementById("AdvCity"); select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getCities.php",{id: id1}, function(data){ eval("var myJSONObject = "+data); select.options.length = 0; select.options[select.options.length] = new Option("All", 0); for (var i in myJSONObject) { select.options[select.options.length] = new Option(myJSONObject[i].city, myJSONObject[i].id); } }); } else { var select = document.getElementById("AdvCity"); select.options.length = 0; select.options[select.options.length] = new Option("Select Region", 0); document.getElementById('SubmitAllData').submit(); } } function SelCurrency(id1) { setcookie("VCurrency", id1, time() + 3600, "/", "vazap.com", 0); document.getElementById('SubmitAllData').submit(); } function SelCurrency1(id1) { setcookie("VCurrency", id1, time() + 3600, "/", "vazap`.com", 0); } function SelCountry(id1) { setcookie("VCountry", document.getElementById("SelCountry").value, time() + 3600, "/", "vazap.lu", 0); if (isset(document.getElementById('country1'))){ document.getElementById('GoogleMap').src="/googlemap.php?CountryId="+id1; //document.getElementById('country1').options[document.getElementById("SelCountry").selectedIndex].selected = true; } if (isset(document.SubmitAllData)) { if (isset(document.SubmitAllData.country)) { document.SubmitAllData.country.value = id1; } if (isset(document.SubmitAllData.dropdown_Regions)) { document.SubmitAllData.dropdown_Regions.value = 0; } if (isset(document.SubmitAllData.dropdown_City)) { document.SubmitAllData.dropdown_City.value = 0; } if (isset(document.SubmitAllData.RegCity)) { document.SubmitAllData.RegCity.value = 0; } var loc = window.location.toString(); pos = loc.search('free-ads-'); if (pos!=-1) { document.getElementById('SubmitAllData').action = '/free-ads.html'; } pos = loc.search('WebShops-'); if (pos!=-1) { document.getElementById('SubmitAllData').action = '/Search/WebShops.html'; } document.getElementById('SubmitAllData').submit(); } } function MakeDropDown(id, text) { $("#"+id).dropdownchecklist( {firstItemChecksAll: true, emptyText: text, icon: { placement: 'right', toOpen: 'ui-icon-arrowthick-1-s', toClose: 'ui-icon-arrowthick-1-n' }, maxDropHeight: 150, width: 110 } ); } function LoadRegionsMulti(values) { $("#Hdropdown_Regions").val(""); $("#HRegCity").val(""); var CountryArray = Array(); CountryArray = explode(",", values); $("#Hcountry").val(values); if (CountryArray.length==1) { $('#Regions').empty().append(''); MakeDropDown("dropdown_Regions", "Loading..."); $.get("/AJAX/LoadRegionsMulti.php",{id: CountryArray[0]}, function(data){ $('#Regions').html(data); $("#dropdown_Regions").dropdownchecklist( {firstItemChecksAll: true, emptyText: "", icon: { placement: 'right', toOpen: 'ui-icon-arrowthick-1-s', toClose: 'ui-icon-arrowthick-1-n' }, maxDropHeight: 150, width: 110, onComplete: function(selector) { var values = ""; for( i=0; i < selector.options.length; i++ ) { if (selector.options[i].selected && (selector.options[i].value != "")) { if ( values != "" ) values += ","; values += selector.options[i].value; } } LoadCitiesMulti(values); } } ); }); } else { $('#Regions').empty().append(''); MakeDropDown("dropdown_Regions", ""); } } function LoadCitiesMulti(values) { $("#HRegCity").val(""); var RegionsArray = Array(); RegionsArray = explode(",", values); $("#Hdropdown_Regions").val(values); if (RegionsArray.length==1) { $('#Cities').empty().append(''); MakeDropDown("RegCity", "Loading..."); $.get("/AJAX/LoadCitiesMulti.php",{id: RegionsArray[0]}, function(data){ $('#Cities').html(data); $("#RegCity").dropdownchecklist( {firstItemChecksAll: true, emptyText: "", icon: { placement: 'right', toOpen: 'ui-icon-arrowthick-1-s', toClose: 'ui-icon-arrowthick-1-n' }, maxDropHeight: 150, width: 110, onComplete: function(selector) { var values = ""; for( i=0; i < selector.options.length; i++ ) { if (selector.options[i].selected && (selector.options[i].value != "")) { if ( values != "" ) values += ","; values += selector.options[i].value; } } SelecCity(values); } } ); }); } else { $('#Cities').empty().append(''); MakeDropDown("RegCity", ""); } } function SelecCity(values) { $("#HRegCity").val(values); } function LoadRegions(id1) { document.getElementById('GoogleMap').src="/googlemap.php?CountryId="+id1; //setcookie("VCountry", document.getElementById("country1").options[document.getElementById("country1").selectedIndex].text, time() + 3600, "/", "vazap.com", 0); if (id1 != 0) { //alert("test"); document.getElementById('SelCountry').options[document.getElementById("country1").selectedIndex].selected = true; //alert("test"); setcookie("VCountry", document.getElementById("SelCountry").value, time() + 3600, "/", "vazap.com", 0); //document.getElementById("SelCountry").innerHTML=document.getElementById("country1").options[document.getElementById("country1").selectedIndex].text; document.getElementById("flag").src = "/images/flags/"+Name_ISO[document.getElementById("SelCountry").value]+".jpg"; var select = document.SearchAdsModul.dropdown_Regions; //alert(select.options.length); select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getRegions.php",{id: id1}, function(data){ eval("var myJSONObject = "+data); select.options.length = 0; select.options[select.options.length] = new Option("All", 0); for (var i in myJSONObject) { select.options[select.options.length] = new Option(myJSONObject[i].reg, myJSONObject[i].id); } select = document.SearchAdsModul.RegCity; select.options.length = 0; select.options[select.options.length] = new Option("All", 0); }); } else { document.getElementById('SelCountry').options[0].selected = true; setcookie("VCountry", document.getElementById("SelCountry").value, time() + 3600, "/", "vazap.com", 0); document.getElementById("flag").src = "/images/flags/eu.jpg"; var select = document.SearchAdsModul.dropdown_Regions; select.options.length = 0; select.options[select.options.length] = new Option("All", 0); select = document.SearchAdsModul.RegCity; select.options.length = 0; select.options[select.options.length] = new Option("All", 0); } } function selectOptionByValue(selObj, value){ alert(selObj.options.length); for (options in selObj.options){ if (options.value == value){ options.selected = true; break; } } } function LoadRegions1(id1) { if (id1 != 0) { var select = document.getElementById("RegRegion"); select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getRegions.php",{id: id1}, function(data){ eval("var myJSONObject = "+data); select.options.length = 0; select.options[select.options.length] = new Option("Regions", 0); for (var i in myJSONObject) { select.options[select.options.length] = new Option(myJSONObject[i].reg, myJSONObject[i].id); } }); } else { var select = document.getElementById("RegRegion"); select.options.length = 0; select.options[select.options.length] = new Option("Select Country", 0); } LoadCities1(0); } function LoadRegions2(id1) { if (id1 != 0) { var select = document.getElementById("AdvRegion"); select.options.length = 0; select.options[select.options.length] = new Option("Loading...", 0); $.get("/AJAX/getRegions.php",{id: id1}, function(data){ eval("var myJSONObject = "+data); select.options.length = 0; select.options[select.options.length] = new Option("All", 0); for (var i in myJSONObject) { select.options[select.options.length] = new Option(myJSONObject[i].reg, myJSONObject[i].id); } }); } else { var select = document.getElementById("AdvRegion"); select.options.length = 0; select.options[select.options.length] = new Option("Select Country", 0); } } function ChangeTab(id, count) { for (i=1; i<=count; i++) { document.getElementById("Stab"+i).className = "tab_menu_item tab"; document.getElementById("filter_tab"+i).style.display = "none"; } document.getElementById("Stab"+id).className = "tab_menu_item tab_selected"; document.getElementById("filter_tab"+id).style.display = "block"; } function isEmail(obj) { if (obj.value.indexOf(" ") + "" == "-1" && obj.value.indexOf("@") + "" != "-1" && (obj.value.lastIndexOf(".") > obj.value.indexOf("@")) && obj.value != "") return true; else return false; } function CheckRegisterForm() { if (!isEmail(document.getElementById("RegEmail"))) {csscody.alert("You must enter valid E-Mail."); document.getElementById("RegEmail").focus(); return} if (document.getElementById("RegPass").value=="") {csscody.alert("You must enter password."); document.getElementById("RegPass").focus(); return} if (document.getElementById("RegPass").value!=document.getElementById("RegPass2").value) {csscody.alert("Confirmation password is incorrect."); document.getElementById("RegPass2").focus(); return} if (document.getElementById("RegLang").value=="0") {csscody.alert("Choose your language please."); document.getElementById("RegPass").focus(); return} if (document.getElementById("RegFirstName").value=="") {csscody.alert("You must enter First name."); document.getElementById("RegFirstName").focus(); return} if (document.getElementById("RegLastName").value=="") {csscody.alert("You must enter Last name."); document.getElementById("RegLastName").focus(); return} if (document.getElementById("RegAddress").value=="") {csscody.alert("You must enter address."); document.getElementById("RegAddress").focus(); return} if (document.getElementById("RegZip").value=="") {csscody.alert("Enter ZIP code of your address please."); document.getElementById("RegZip").focus(); return} if (document.getElementById("RegCity").value==0) {csscody.alert("You must enter city."); document.getElementById("RegCity").focus(); return} if (document.getElementById("RegCountry").value==0) {csscody.alert("You must enter country."); document.getElementById("RegCountry").focus(); return} if (document.getElementById("RegCap").value=="") {csscody.alert("You must enter security code and continue."); document.getElementById("RegCap").focus(); return} CheckforRegistredMail(document.getElementById("RegEmail").value); //document.getElementById("RegForm").submit(); } function CheckforRegistredMail(email1) { $.get("/AJAX/CheckforRegistredMail.php",{mail: email1}, function(data){ if (trim(data) == "yes") { csscody.alert("This email address already exists.") } else { CreateWebShop2(); } }); } function CreateWebShop2() { if (document.getElementById("WebShopName").value=="") {csscody.alert("Enter WebShop name please."); document.getElementById("WebShopName").focus(); return} if (document.getElementById("WebCategory").value=="0") {csscody.alert("Please select one category for your WebShop"); document.getElementById("WebCategory").focus(); return} if (document.getElementById("WebSubCategory").value=="0") {csscody.alert("Select sub-category please."); document.getElementById("WebSubCategory").focus(); return} CheckWebShopName2(); } function CheckWebShopName2() { $.get("/AJAX/CheckWebShopName.php",{name: document.getElementById("WebShopName").value}, function(data){ if (trim(data)!="0") { csscody.alert("A WebShop with this name does already exist."); } else { document.getElementById('RegForm').submit(); } }); } function CheckUpdateForm() { if (!isEmail(document.getElementById("RegEmail"))) {csscody.alert("Enter valid e-mail please."); document.getElementById("RegEmail").focus(); return} if (document.getElementById("RegPass").value!="") { if (document.getElementById("RegPass").value!=document.getElementById("RegPass2").value) {csscody.alert("Confirmation password is incorrect."); document.getElementById("RegPass2").focus(); return} } if (document.getElementById("RegLang").value=="0") {csscody.alert("Choose your language please."); document.getElementById("RegPass").focus(); return} if (document.getElementById("RegFirstName").value=="") {csscody.alert("You must enter First name."); document.getElementById("RegFirstName").focus(); return} if (document.getElementById("RegLastName").value=="") {csscody.alert("You must enter Last name."); document.getElementById("RegLastName").focus(); return} if (document.getElementById("RegAddress").value=="") {csscody.alert("You must enter address."); document.getElementById("RegAddress").focus(); return} if (document.getElementById("RegZip").value=="") {csscody.alert("Enter ZIP code of your address please."); document.getElementById("RegZip").focus(); return} if (document.getElementById("RegCity").value==0) {csscody.alert("You must enter country."); document.getElementById("RegCity").focus(); return} if (document.getElementById("RegCountry").value==0) {csscody.alert("Enter your country please."); document.getElementById("RegCountry").focus(); return} document.getElementById("RegForm").submit(); } function VazapLogin() { if (!isEmail(document.getElementById("LogEmail"))) {csscody.alert("Enter valid e-mail please."); document.getElementById("LogEmail").focus(); return} if (document.getElementById("LogPassword").value=="") {csscody.alert("Enter password please. "); document.getElementById("LogPassword").focus(); return} CheckAcount(); } function CheckAcount() { $.get("/AJAX/CheckAcount.php",{mail: document.getElementById("LogEmail").value, pass: document.getElementById("LogPassword").value}, function(data){ if (trim(data)=="0") { csscody.alert("Your e-mail address or your password are not correct."); } else { document.getElementById('LoginForm').submit(); } }); } function CheckForgottenPassword() { $.get("/AJAX/CheckForgottenPassword.php",{mail: document.getElementById("RegEmail").value}, function(data){ csscody.alert(data); }); } function CreateWebShop() { if (document.getElementById("WebShopName").value=="") {csscody.alert("Enter WebShop name please."); document.getElementById("WebShopName").focus(); return} if (document.getElementById("WebCategory").value=="0") {csscody.alert("Please select one category for your WebShop"); document.getElementById("WebCategory").focus(); return} if (document.getElementById("WebSubCategory").value=="0") {csscody.alert("Select sub-category please."); document.getElementById("WebSubCategory").focus(); return} CheckWebShopName(); } function CheckWebShopName() { $.get("/AJAX/CheckWebShopName.php",{name: document.getElementById("WebShopName").value}, function(data){ if (trim(data)!="0") { csscody.alert("A WebShop with this name does already exist."); } else { document.getElementById('CreateWebShopForm').submit(); } }); } function SaveWebShop(oldname) { if (document.getElementById("WebShopName").value=="") {csscody.alert("Enter WebShop name please."); document.getElementById("WebShopName").focus(); return} if (document.getElementById("WebCategory").value=="0") {csscody.alert("Please select one category for your WebShop"); document.getElementById("WebCategory").focus(); return} if (document.getElementById("WebSubCategory").value=="0") {csscody.alert("Select sub-category please."); document.getElementById("WebSubCategory").focus(); return} CheckWebShopName1(oldname); } function CheckWebShopName1(oldname) { $.get("/AJAX/CheckWebShopName.php",{name: document.getElementById("WebShopName").value}, function(data){ if ((data>0)&&(oldname!=document.getElementById("WebShopName").value)) { csscody.alert("A WebShop with this name does already exist."); } else { document.getElementById('EditWebShopForm').submit(); } }); } var CurOpenDesc = ''; function OpenDesc(lan) { if (CurOpenDesc!="") { document.getElementById("Desc_"+CurOpenDesc).style.display = "none"; } document.getElementById("Desc_"+lan).style.display = "block"; CurOpenDesc = lan; } function OpenMoreOptions() { if ((document.getElementById('MoreOptions').style.display == "block")||(document.getElementById('MoreOptions').style.display == "")) { document.getElementById('MoreOptions').style.display = "none"; document.getElementById('OpenedMoreOptions').value=0; } else { document.getElementById('MoreOptions').style.display = "block"; document.getElementById('OpenedMoreOptions').value=1; } } function OpenMoreOptions1() { document.getElementById('MoreOptions').style.display = "block"; document.getElementById('OpenedMoreOptions').value=1; } function ChangeLanguage(lan) { newdomain = lan+".vazap.com"; newlocation = str_replace(window.location.hostname, newdomain, window.location); document.getElementById('SubmitAllData').action = newlocation; document.getElementById('SubmitAllData').submit(); } function SelectCategory(SubCatId, CatId, Categories) { document.getElementById('AdsCategorie').value = CatId; document.getElementById('AdsSubCategorie').value = SubCatId; document.getElementById('CategoriesText').innerHTML = ""+Categories+""; LoadOptions(); } function CheckFormAddAds() { //alert(getCookie("captcha")); if (document.getElementById('AdsTitle').value=="") { csscody.alert("Please insert a title for the ad."); //ChangeTab(1, 6); document.getElementById('AdsTitle').focus(); return } //alert(strpos(document.getElementById('AdsTitle').value, ".bg")); if ((strpos(document.getElementById('AdsTitle').value, "www")!==false)||(strpos(document.getElementById('AdsTitle').value, ".com")!==false)||(strpos(document.getElementById('AdsTitle').value, ".org")!==false)||(strpos(document.getElementById('AdsTitle').value, ".net")!==false)||(strpos(document.getElementById('AdsTitle').value, ".fr")!==false)||(strpos(document.getElementById('AdsTitle').value, ".lu")!==false)||(strpos(document.getElementById('AdsTitle').value, ".pt")!==false)||(strpos(document.getElementById('AdsTitle').value, ".es")!==false)||(strpos(document.getElementById('AdsTitle').value, ".de")!==false)||(strpos(document.getElementById('AdsTitle').value, ".eu")!==false)||(strpos(document.getElementById('AdsTitle').value, ".bg")!==false)||(strpos(document.getElementById('AdsTitle').value, ".pl")!==false)||(strpos(document.getElementById('AdsTitle').value, ".be")!==false)||(strpos(document.getElementById('AdsTitle').value, ".it")!==false)||(strpos(document.getElementById('AdsTitle').value, "http")!==false)) { csscody.alert("Please, remove all URLs from the title."); //ChangeTab(1, 6); document.getElementById('AdsTitle').focus(); return } if (document.getElementById('search_souscat_dropdown').value=="0") { csscody.alert("Please choose a category for the ad."); //ChangeTab(3, 6); return } if (document.getElementById('RegCity').value == "0") { csscody.alert("Please choose Country, Region and City for the ad."); //ChangeTab(1, 6); document.getElementById('RegCountry').focus(); return } if (document.getElementById('AdsAdvertise').value == "") { csscody.alert("Please enter Advertiser name."); //ChangeTab(1, 6); document.getElementById('AdsAdvertise').focus(); return } if (document.getElementById('AdvMail').value == "0") { csscody.alert("Please enter Advertiser e-mail."); //ChangeTab(1, 6); document.getElementById('AdvMail').focus(); return } if (document.getElementById('RegCap').value=="") { csscody.alert("You must enter security code and continue."); document.getElementById('RegCap').focus(); return } if (getCookie("captcha")!=md5(document.getElementById('RegCap').value)) { csscody.alert("Your security code is invalid."); document.getElementById('RegCap').focus(); return } document.getElementById('AddAdsForm').submit(); } function CheckFormAddAds2() { //alert(getCookie("captcha")); if (document.getElementById('AdsTitle').value=="") { csscody.alert("Please insert a title for the ad."); ChangeTab(1, 6); document.getElementById('AdsTitle').focus(); return } //alert(strpos(document.getElementById('AdsTitle').value, "www")); if ((strpos(document.getElementById('AdsTitle').value, "www")!==false)||(strpos(document.getElementById('AdsTitle').value, ".com")!==false)||(strpos(document.getElementById('AdsTitle').value, ".org")!==false)||(strpos(document.getElementById('AdsTitle').value, ".net")!==false)||(strpos(document.getElementById('AdsTitle').value, ".fr")!==false)||(strpos(document.getElementById('AdsTitle').value, ".lu")!==false)||(strpos(document.getElementById('AdsTitle').value, ".pt")!==false)||(strpos(document.getElementById('AdsTitle').value, ".es")!==false)||(strpos(document.getElementById('AdsTitle').value, ".de")!==false)||(strpos(document.getElementById('AdsTitle').value, ".eu")!==false)||(strpos(document.getElementById('AdsTitle').value, ".bg")!==false)||(strpos(document.getElementById('AdsTitle').value, ".pl")!==false)||(strpos(document.getElementById('AdsTitle').value, ".be")!==false)||(strpos(document.getElementById('AdsTitle').value, ".it")!==false)||(strpos(document.getElementById('AdsTitle').value, "http")!==false)) { csscody.alert("Please, remove all URLs from the title."); //ChangeTab(1, 6); document.getElementById('AdsTitle').focus(); return } if ((document.getElementById('search_souscat_dropdown').value=="-1")||(document.getElementById('search_souscat_dropdown').value=="0")) { csscody.alert("Please choose a category for the ad."); ChangeTab(3, 6); return } if (document.getElementById('RegCity').value == "0") { csscody.alert("Please choose Country, Region and City for the ad."); ChangeTab(1, 6); document.getElementById('RegCountry').focus(); return } document.getElementById('AddAdsForm').submit(); } function CheckContactForm() { if (document.getElementById('LastName').value=="") { csscody.alert("You must enter Last name."); document.getElementById('LastName').focus(); return } if (document.getElementById('FirstName').value=="") { csscody.alert("You must enter First name."); document.getElementById('FirstName').focus(); return } if (!isEmail(document.getElementById("CMail"))) { csscody.alert("You must enter valid E-Mail."); document.getElementById("CMail").focus(); return } if (document.getElementById('SecCode').value=="") { csscody.alert("You must enter security code and continue."); document.getElementById('SecCode').focus(); return } if (document.getElementById('Mes').value=="") { csscody.alert("You must enter message."); document.getElementById('Mes').focus(); return } if (getCookie("captcha")!=md5(document.getElementById('SecCode').value)) { csscody.alert("Your security code is invalid."); document.getElementById('SecCode').focus(); return } document.getElementById('ContactForm').submit(); } function CheckBannerForm() { if (!(document.ContactForm.banner_type[0].checked||document.ContactForm.banner_type[1].checked||document.ContactForm.banner_type[2].checked||document.ContactForm.banner_type[3].checked)) { csscody.alert("You must choose type of the banner."); return false; } if (document.getElementById('ResMonth').value=="") { csscody.alert("You must choose the date."); return false; } if (document.getElementById('LastName').value=="") { csscody.alert("You must enter Last name."); document.getElementById('LastName').focus(); return false; } if (document.getElementById('FirstName').value=="") { csscody.alert("You must enter First name."); document.getElementById('FirstName').focus(); return false; } if (!isEmail(document.getElementById("CMail"))) { csscody.alert("You must enter valid E-Mail."); document.getElementById("CMail").focus(); return false; } if (document.getElementById('SecCode').value=="") { csscody.alert("You must enter security code and continue."); document.getElementById('SecCode').focus(); return false; } if (getCookie("captcha")!=md5(document.getElementById('SecCode').value)) { csscody.alert("Your security code is invalid."); document.getElementById('SecCode').focus(); return false; } document.getElementById('ContactForm').action = "/SendBanner.php"; document.getElementById('ContactForm').submit(); } function CheckFormAddAds1() { //alert(getCookie("captcha")); if (document.getElementById('AdsTitle').value=="") { csscody.alert("Please insert a title for the ad."); ChangeTab(1, 6); document.getElementById('AdsTitle').focus(); return } if (document.getElementById('AdsSubCategorie').value=="-1") { csscody.alert("Please choose a category for the ad."); ChangeTab(3, 6); return } if (document.getElementById('RegCity').value == "0") { csscody.alert("Please choose Country, Region and City for the ad."); ChangeTab(1, 6); document.getElementById('RegCountry').focus(); return } document.getElementById('AddAdsForm').submit(); } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } var ImageCount = 1; function AddImageMore() { if (ImageCount<15) { ImageCount++; document.getElementById("AdImages_"+ImageCount).style.display = ""; } } function GoBackToSearch() { document.getElementById('GoBack').submit(); } function OrderBy(val) { if (isset(document.getElementById('sortby'))) { document.getElementById('sortby').value=val; // alert(document.getElementById('sortby').value); } else { var el = document.createElement('input'); el.setAttribute('id', 'sortby'); el.setAttribute('name', 'sortby'); el.setAttribute('type', 'text'); el.setAttribute('value', val); document.getElementById('SubmitAllData').appendChild(el); } if (isset(document.getElementById('GoBack'))) { document.getElementById('SubmitAllData').removeChild(document.getElementById('GoBack')); } //document.getElementById('SubmitAllData').action = 'free-ads.html'; document.getElementById('SubmitAllData').submit(); } function OrderBy1(val) { var el = document.createElement('input'); el.setAttribute('id', 'sortby'); el.setAttribute('name', 'sortby'); el.setAttribute('type', 'text'); el.setAttribute('value', val); document.getElementById('SubmitAllData').appendChild(el); if (isset(document.getElementById('GoBack'))) { document.getElementById('SubmitAllData').removeChild(document.getElementById('GoBack')); } document.getElementById('SubmitAllData').action = '/MyAds.html'; document.getElementById('SubmitAllData').submit(); } function SelectAll() { for (i=1; i<=SelectCount; i++) { document.getElementById('Check_'+i).checked="checked"; } } function DeselectAll() { for (i=1; i<=SelectCount; i++) { document.getElementById('Check_'+i).checked=""; } } var List = ""; function Extend() { List = ""; for (i=1; i<=SelectCount; i++) { if (document.getElementById('Check_'+i).checked==true) { List = List+document.getElementById('Check_'+i).value+", " } } if (List == "" ) { csscody.alert("Select ads first"); } else { csscody.select('Choose extended period (from now):'); } } function ExtendPeriod(Period) { List = List.slice(0, -2); $.get("/AJAX/ExtendAds.php",{Period: Period, ids: List}, function(data){ document.getElementById('SubmitAllData').submit(); }); //List = List.slice(0, -2) //alert(List); } function RemoveAds() { List = ""; for (i=1; i<=SelectCount; i++) { if (document.getElementById('Check_'+i).checked==true) { List = List+document.getElementById('Check_'+i).value+", " } } if (List == "" ) { csscody.alert("Select ads first"); } else { csscody.confirm("Are you sure to delete selected ads.", "DeleteAds()"); } } function DeleteAds() { List = List.slice(0, -2); $.get("/AJAX/DeleteAds.php",{ids: List}, function(data){ //alert(data); document.getElementById('SubmitAllData').submit(); window.location = "/MyAds.html"; }); } function CheckEdit() { k = 0; id = -1; for (i=1; i<=SelectCount; i++) { if (document.getElementById('Check_'+i).checked==true) { k++; id=document.getElementById('Check_'+i).value; } } if (k!=1) { csscody.alert("You must select one ad."); } else { window.location="/Edit-Ad-"+id+".html"; } } function numbersonly(myfield, e, dec) { var key; var keychar; if (window.event) key = window.event.keyCode; else if (e) key = e.which; else return true; keychar = String.fromCharCode(key); // control keys if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) ) return true; // numbers else if ((("0123456789.").indexOf(keychar) > -1)) return true; // decimal point jump else if (dec && (keychar == ".")) { myfield.form.elements[dec].focus(); return false; } else return false; } function VIP(id) { document.ToPayPal.adid.value = id; document.getElementById("return").value = 'http://www.vazap.com/return.php?adid='+base64_encode(id); document.ToPayPal.submit(); } function HomePage() { k = 0; id = -1; for (i=1; i<=SelectCount; i++) { if (document.getElementById('Check_'+i).checked==true) { k++; id=document.getElementById('Check_'+i).value; } } if (k!=1) { csscody.alert("You must select one ad."); } else { document.ToPayPal.adid.value = id; document.getElementById("return").value = 'http://www.vazap.com/return.php?adid='+base64_encode(id); document.ToPayPal.submit(); } }