/* http://javascript.internet.com
Created by: Will Bontrager :: http://www.bontragerconnection.com/ */

var Lucky = new Array();

var FeelLuckyCookieName = "FeelLuckyCookie";

var NewWindow = "y";

Lucky[0] = "Ada perselingkuhan dalam keluargamu.mp3";
Lucky[1] = "Allah membenci aborsi.mp3";
Lucky[2] = "Anak-anak korban perceraian.mp3";
Lucky[3] = "Anak-anak yang terikat dosa seks.mp3";
Lucky[4] = "Ada perselingkuhan dalam keluargamu.mp3";
Lucky[5] = "Arti hidup.mp3";
Lucky[6] = "Bebas dari belenggu dosa.mp3";
Lucky[7] = "Belenggu kemarahan.mp3";
Lucky[8] = "Bukan hamba tetapi sahabat.mp3";
Lucky[9] = "Dikhianati kekasih.mp3";
Lucky[10] = "Ditipu habis-habisan.mp3";
Lucky[11] = "Hamil di luar nikah.mp3";
Lucky[12] = "Jangan bunuh diri.mp3";
Lucky[13] = "Jangan jual Yesusmu.mp3";
Lucky[14] = "Kalvari.mp3";
Lucky[15] = "Kau berharga di mata Tuhan.mp3";
Lucky[16] = "Kehilangan orang yang dicintai.mp3";
Lucky[17] = "Korban seks dalam keluarga.mp3";
Lucky[18] = "Krisis ini terlalu berat bagiku.mp3";
Lucky[19] = "Lepas dari belenggu perdukunan.mp3";
Lucky[20] = "Mengampuni dan melupakan.mp3";
Lucky[21] = "Mengapa menjauh dari Tuhan.mp3";
Lucky[22] = "Mengapa takut kiamat.mp3";
Lucky[23] = "Mengapa takut mati.mp3";
Lucky[24] = "Mujizat masih berlangsung.mp3";
Lucky[25] = "Perangkap internet.mp3";
Lucky[26] = "Perangkap puber kedua.mp3";
Lucky[27] = "Pergaulan bebas menghancurkan hidupku.mp3";
Lucky[28] = "Rumah tanggamu di ambang perceraian.mp3";
Lucky[29] = "Sampai kapan diperbudak narkoba.mp3";
Lucky[30] = "Terobosan finansial.mp3";
Lucky[31] = "Tuhan merindukanmu.mp3";
Lucky[32] = "Tuhanlah Gembalaku.mp3";
Lucky[33] = "Yesus kekasih hatiku.mp3";
Lucky[34] = "Korban modernisme.mp3";
Lucky[35] = "Adakah berhala dalam hidupmu.mp3";
Lucky[36] = "Belenggu kesia-siaan.mp3";
Lucky[37] = "Cemas akan masa depan.mp3";
Lucky[38] = "Rahasia komitmen.mp3";
Lucky[39] = "Kumpulkanlah harta di surga.mp3";
Lucky[40] = "Membentuk anak yang mencintai Tuhan.mp3";

var TabChar = String.fromCharCode(9);
var CurrentCookie = '';
function GetLuckyCookie() {
  var cookiecontent = '';
  if(document.cookie.length > 0) {
  	 var cookiename = FeelLuckyCookieName + '=';
  	 var cookiebegin = document.cookie.indexOf(cookiename);
  	 var cookieend = 0;
  	 if(cookiebegin > -1) {
     	cookiebegin  += cookiename.length;
     	cookieend = document.cookie.indexOf(";",cookiebegin);
     	if(cookieend < cookiebegin) { cookieend = document.cookie.length; }
     	cookiecontent = document.cookie.substring(cookiebegin,cookieend);
    }
  }
  return cookiecontent;
}

function PutLuckyCookie(value) {
  if(CurrentCookie.length > 0) { value = CurrentCookie + TabChar + value; }
  value = escape(value);
  document.cookie = FeelLuckyCookieName + "=" + value;
}

function YesMakeMeLucky() { 
  CurrentCookie = GetLuckyCookie();
  CurrentCookie = unescape(CurrentCookie);
  if(CurrentCookie == '.') { CurrentCookie = ''; }
  var LuckyVisitedList = CurrentCookie.split(TabChar);
  if(LuckyVisitedList.length >= Lucky.length) {
   	document.cookie = FeelLuckyCookieName + "=.";
   	CurrentCookie = '';
   	LuckyVisitedList = Array();
  }
  for(var i = 0; i < LuckyVisitedList.length; i++) { Lucky[LuckyVisitedList[i]] = ''; }
  var LuckyL = new Array();
  for(var i = 0; i < Lucky.length; i++) {
   	if(Lucky[i].length > 0) { LuckyL.push('' + i + TabChar + Lucky[i]); }
  }
  var LuckyDestinationNumber = 0;
  if(LuckyL.length > 1) { LuckyDestinationNumber = Math.ceil((Math.random() * LuckyL.length) - 1); }
  var LuckyNumberPlace = new Array();
  LuckyNumberPlace = LuckyL[LuckyDestinationNumber].split(TabChar);
  PutLuckyCookie(LuckyNumberPlace[0]);
  NewWindow = NewWindow.toLowerCase();
  if(NewWindow.substr(0,1) == "y") { window.open(LuckyNumberPlace[1]); }
  else { document.location = LuckyNumberPlace[1]; }
}
