// JS-Sammlung für Q-Dorf.de


//pretty pic-popup

$(document).ready(function() {
	$("a[rel^='pretty']").prettyPhoto();});

//counter

/*$(function () {
	$('#defaultCountdown').countdown({until: new Date(2011, 0, 21, 20, 00, 00)}); 

});*/

//js-slider

//popunder
/*
var popunder="http://www.q-dorf.de/media/player/video_player.php"

//specify popunder window features
//set 1 to enable a particular feature, 0 to disable
var winfeatures="width=400,height=490,scrollbars=0,resizable=0,toolbar=0,location=1,menubar=0,status=1,directories=0"

//Pop-under only once per browser session? (0=no, 1=yes)
//Specifying 0 will cause popunder to load every time page is loaded
var once_per_session=1


function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie exists
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
         end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
      }
   }
  return returnvalue;
}

function loadornot(){
if (get_cookie('popunder')==''){
loadpopunder()
document.cookie="popunder=yes"
}
}

function loadpopunder(){
win2=window.open(popunder,"",winfeatures)
win2.blur()
window.focus()
}

if (once_per_session==0)
loadpopunder()
else
loadornot()
*/

//topslider

// Set up our options for the slideshow...
var myOptions = {
    noImages: 8, // Number of images
    path: "/img/slider/", // Relative path with trailing slash.
    links: { // Should the images link anywhere? if no links are required at all then this option can be omitted.
		1:"http://www.q-dorf.de/Programm/2012-02-03_berlin_bunny_night.html#oben",
		2:"http://www.q-dorf.de/Programm/2012-02-04_galaktika.html#oben",
		3:"http://www.q-dorf.de/",
		4:"http://www.q-dorf.de/Birthday.html",
		5:"http://www.q-dorf.de/Woche/Dienstag.html",
		6:"http://www.q-dorf.de/Programm/2012-02-10_sex_in_the_city_nights.html#oben",
		7:"http://www.q-dorf.de/Programm/2012-02-11_galaktika.html#oben",
		8:"http://www.q-dorf.de/"
		
    },
    linksOpen:'sameWindow', // How to open links? sameWindow or newWindow.
    timerInterval: 3500, // 6500 = 6.5 seconds
    randomise: false // Start with random image? true=yes/false=no
};

// Initiate the Easy Slides plugin, assigning it to your contaner DIV...
$('#top').easySlides(myOptions);


///JSON - NEWSLETTER

 function xhr(method, url, data, cb, apply_para) {
  method = method.toLowerCase();
  var req;
  req = new XMLHttpRequest();
  req.open(method, url + (data && method == 'get' ? '?' + data : ''), true);
  req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  if (method == 'post') {
      req.setRequestHeader("Method", "POST " + url + " HTTP/1.1");
      req.setRequestHeader("Content-Length", data.length);
  }
  req.onreadystatechange = function() {
      if (req.readyState == 4 && req.status == 200) {
		  document.getElementById('info_box').style.display='block';
		  document.getElementById('info_box_overlay').style.display='block';
              if (cb) {
              cb.apply(null, [req].concat(apply_para));
          }
      }
  }
  req.send(data);
}
 
 
 
