
var bookmarkurl="http://www.0906webcam.nl"
var bookmarktitel="0906 Webcam / Webcamsex betalen via een 0906 sexlijn!"
function favo(){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitel)
}
function loadPage(list){
location.href=list.options[list.selectedIndex].value
}
function maxWindow(url, name, width, height) { features = 'scrollbars=1,resizable=1,menubar=0,toolbar=0,location=0,status=0,top=0,left=0,screenX=0,screenY=0,'; if (window.screen) { aw = screen.availWidth; ah = screen.availHeight; features = features+'width='+(aw-20)+',height='+(ah-38); } else { features = features+'width='+width+',height='+height; } window.open(url, name, features); }

var gateway = "http://cams.dnxlive.com/webservices/gateway.php";
function getFavorites() {
  $.getJSON(gateway + "?task=getAllPreferences&jsoncallback=?",
    function(data) {
      if($.isArray(data.favorites)) {
        $.get("http://www.0906webcam.nl/favos.php?favorites=" + data.favorites,
          function(htmldata) {
            $("#accounts").html(htmldata);	
	});
      }
      else {
        $("#accounts").html("No favorites found");
      }
  });
}



function getAllFavorites() {
  $.getJSON(gateway + "?task=getAllPreferences&jsoncallback=?",
    function(data) {
      if($.isArray(data.favorites)) {
        $.get("http://www.0906webcam.nl/all_favos.php?favorites=" + data.favorites,
          function(htmldata) {
            $("#accounts_all").html(htmldata);	
	});
      }
      else {
        $("#accounts_all").html("No favorites found");
      }
  });
}





function addToFavorites(account) {
$.getJSON(gateway + "?task=addToFavorites&account=" + account + "&jsoncallback=?",
function(data) {
getFavorites();
getAllFavorites();
$("#accounts").html("Loading");
});
}
function removeFromFavorites(account) {
$.getJSON(gateway + "?task=removeFromFavorites&account=" + account +
"&jsoncallback=?", function(data) {
getFavorites();
getAllFavorites();
$("#accounts").html("Loading");
});
}
function getSearchCategories() {
$.getJSON(gateway + "?task=getAllPreferences&jsoncallback=?",
function(data) {
var txt = "";
if($.isArray(data.search_criteria.sex)) {
jQuery.each(data.search_criteria.sex, function(i, value) {
if(i > 0) txt += "\n";
txt += value;
});
}
else {
txt = "No categories found";
}
$("textarea#search_output").val(txt);
});
}
function setCategories(cat) {
$.getJSON(gateway + "?task=updateSearchCriteria&sex=" + cat + "&jsoncallback=?",
function(data) {
alert("setCategories result: " + data.status);
});
}
function getLanguage() {
$.getJSON(gateway + "?task=getAllPreferences&response_format=json&jsoncallback=?",
function(data) {
var txt = "";

if(data.preferences.language != null) {
txt = data.preferences.language;
}
else {
txt = "No language found";
}
$("textarea#language_output").val(txt);
});
}
function setLanguage(lang) {
$.getJSON(gateway + "?task=updatePreferences&language=" + lang + "&jsoncallback=?",
function(data) {
alert("setLanguage result: " + data.status);
});
}

