var blogPathArray = window.location.pathname.split("/");
if (blogPathArray[1] == "") {
	blogPathArray[1] = "ccd";
}

var blogURL = "http://" + window.location.hostname + "/" + blogPathArray[1];

var link = new Array;
link[0] = blogURL + "/pressemitteilungen.html";

if (blogPathArray[1] == "ccd") {
	link[1] = "http://" + window.location.hostname + "/ccr/pressemitteilungen.html";
	link[2] = "http://" + window.location.hostname + "/gda/pressemitteilungen.html";
	link[3] = "http://" + window.location.hostname + "/mo/pressemitteilungen.html";
	link[4] = "http://" + window.location.hostname + "/e206/pressemitteilungen.html";
}

var blogTypes = new Array;
blogTypes[0] = blogURL + "/presse_fotos.html";
var pressepics = blogTypes[0];
if (blogPathArray[1] == "ccd") {
	var rand = Math.random() * 3;
	var zufallsZahl = Math.round(rand);
	blogTypes[0] = "http://" + window.location.hostname + "/ccr/presse_fotos.html";
	blogTypes[1] = "http://" + window.location.hostname + "/ccd/presse_fotos.html";
	blogTypes[2] = "http://" + window.location.hostname + "/mo/presse_fotos.html";
	blogTypes[3] = "http://" + window.location.hostname + "/e206/presse_fotos.html";

	var pressepics = blogTypes[zufallsZahl];
}

var internalUrl = window.location.hostname;
var addr;
var ajx;
var cajx = 0;
var mcajx = 0;
var tmp = new Date();
var timeyearsplitter = tmp+" cc";
var thisyear = timeyearsplitter.split(" ");
thisyear[3] = '2010';
var stringToSearch;
var stringTemp;
var cpage = window.location;
var mdescr;
var mkey;
var mtitle;
var amountOfPressPics = 6;
var breakpage = 10; /* ctrl+F! */
var curpager = 0;
var categories = new Array;

$().ready(function() {
	$(".img").pngfix({repeatMethod:"crop"});
	
	$("#nrtitle img").pngfix();
	
	var cpage2 = window.location.href;
	if ($(".rtext").length > 0) {
		if (categories.length > 0) {
			if (categories.match("presse-fotos")) {
				$("#midColumn").addClass("presse-fotos");
			} else {
				$("#midColumn").addClass("pressemitteilungen");
			}
		}
	}
	
	if (cpage2.match("presse-fotos")) {
		$("#midColumn").addClass("presse-fotos");
	}
	if (cpage2.match("pressemitteilung")) {
		$("#midColumn").addClass("pressemitteilungen");
	}
	if (blogPathArray[2] == "presse-fotos") {
		pics = $("#midColumn #contentcollection img");
		pics.attr("height", "42");
		pics.attr("width", "65");
	}

	if (ytTypeListPresent) {
		setTimeout("loadPreviewChannels()", 250);
	}

	mdescr = $("meta[name=keywords]").attr("content");
	mkey = $("meta[name=description]").attr("content");
	mtitle = $("title").text();

	$("#social_wong").attr("href", "http://www.mister-wong.com/addurl/?bm_url=" + cpage + "&bm_description=" + mtitle + "");
	$("#social_digg").attr("href", "http://bookmarks.yahoo.com/toolbar/savebm?u=" + cpage + "&t=" + mtitle + "");
	$("#social_blinklist").attr("href", "http://blinklist.com/blink?t=" + mtitle + "&u=" + cpage + "");
	$("#social_delicious").attr("href", "http://delicious.com/save?url=" + cpage + "&title=" + mtitle + "");
	$("#social_diigo").attr("href", "http://www.diigo.com/post?url=" + cpage + "&title=" + mtitle + "");
	$("#social_google").attr("href", "http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=" + cpage + "&title=" + mtitle + "");
	$("#social_linkarena").attr("href", "http://www.linkarena.com/bookmarks/addlink/?url=" + cpage + "&title=" + mtitle + "");
	$("#social_yigg").attr("href", "http://yigg.de/neu?exturl=" + cpage + "&exttitle=" + mtitle + "");
	$("#social_webnews").attr("href", "http://www.webnews.de/einstellen?url=" + cpage + "&title=" + mtitle + "");
	$("#social_facebook").attr("href", "http://www.facebook.com/share.php?u=" + cpage);
	$("#social_tweet").attr("href", "http://twitter.com/home/?status=Currently%20reading:%20" + cpage + "%20" + mtitle + "");

	if ($("#netiquette").length > 0) {
		$("#netiquette").hide();
		$(".cnetiquette").load("/ccd/netiquette.html #midColumn div.rtext");
	}

	if ($("#datenschutz").length > 0) {
		$("#datenschutz").hide();
		$(".cdatenschutz").load("/ccd/datenschutz.html #midColumn div.rtext");
	}

	if ($("#loadContainer").length > 0) {
		$("#loadContainer").html('<div id="loadingContainer4" class="hide"></div><div id="loadingContainer5" class="hide"></div>');

		if ($("#collector").length > 0) {
			$(".h_pressemitteilungen").show();
			$("#loadContainer").append('<div id="loadingLinkMain"><ul></ul></div>');
			var getamtns = 0;
			for ( var cli = 0; cli < link.length; cli++) {
				$("#loadContainer").append('<div id="loadingLink' + cli + '"></div>');
				$("#loadingLink" + cli).load(link[cli] + "?" + tmp.getTime() + " #contentcollection ul", function(data) {
					for ( var cli2 = 0; cli2 < link.length; cli2++) {
						$("#loadingLink" + cli2 + " ul li").appendTo("#loadingLinkMain ul");
					}
					cajx++;
					getamtns++;
					if (getamtns >= link.length) {
						collectPr(getamtns);
					}
				});
			}
		}

		if ($("#ppics").length > 0) {
			$("#ppics").load(pressepics + "?" + tmp.getTime() + " #contentcollection ul", function(data) {
				setTimeout("collectPresspics()", 50);
			});
		}

		if ($("#medienecho").length > 0) {
			collectMes();
		}
	}

	// Google Search
  $("#qs").click(function() {
      var q = $("#q").val();
      if (q !="Suchbegriff(e) eingeben" && q !="") {
window.location.href = blogURL+'/gsa.html?q='+q;         
      }   
  });     


   $('#q').keyup(function(e) {
       if(e.keyCode == 13) {
         $("#qs").click();
         }
         });	
	// [End] Google Search

	$("#slide img").not(".active").fadeTo("fast", 0.4);
	$("#slide a").hover(function() {
		$(this).find("img").not(".active").fadeTo("fast", 1);
	}, function() {
		$(this).find("img").not(".active").fadeTo("fast", 0.4);
	});
	$("a").click(function() {
		addr = $(this).attr("href");
		if (addr.match("http://") && !($(this).hasClass("btn"))) {

			window.location.href = "#top";

			$("#overlay .trans").height(($("#mainframe").height() + 160));
			$("#overlay .wrapper").css("width", "340px");
			
			if($.support.opacity==false){
				$(".obrd").remove();
				$("#overlay .container").css("border", "1px solid #cc0000");
			}
			
			uri_temp = addr.substring(0, 35);      

			if (!uri_temp.match("coca-cola-gmbh.de") && !uri_temp.match(internalUrl) && !specialAddr(addr)) {
				window.scrollTo(0, 0);
				if ($("#playerContainer").length > 0) {
					$("#playerContainer").hide();
				}
				if($("select").length > 0){
					$("select").hide();
				}
				$("#overlay .options").show();
				$("#overlay .content").show();
				$("#overlay").fadeIn();
				$("#overlay .trans").fadeTo("fast", 0.65);
				$("#overlay .content p.date").html("Sie &ouml;ffnen nach Best�tigung die folgende Seite:<br />&quot;" + addr + "&quot;");
				$("#overlay .layer").fadeTo(0.7);

				if ($(".btn_ok").length > 0) {
					$(".btn_ok").attr("href", addr);
					$(".btn_ok").attr("target", "_blank");				
				}
				
				return false;
			} else {
				return true;
			}
		}

		return true;
	});

	if($(".btn_ok").length > 0) {
		$(".btn_ok").click(function(){
			$("#overlay").fadeOut("fast", function() {
				$("#overlay .cnetiquette").hide();
				$("#overlay .cdatenschutz").hide();
				$("#overlay .content").hide();
				$("#overlay .options").hide();
			});
	
			if ($("#playerContainer").length > 0) {
				$("#playerContainer").show();
			}
			if($("select").length > 0){
				$("select").show();
			}
		});
	}
	
	if ($("a[rel=netiquette]").length > 0) {
		$("a[rel=netiquette]").click(function() {
			$("#overlay .trans").height(($("#mainframe").height() + 160));
			$("#overlay .wrapper").css("width", "800px");
			$(".cnetiquette").show();
			$("#overlay").fadeIn();
			$("#overlay .trans").fadeTo("fast", 0.65);
			$("#overlay .layer").fadeTo(0.7);
		});
	}

	if ($("a[rel=datenschutz]").length > 0) {
		$("a[rel=datenschutz]").click(function() {
			$("#overlay .trans").height(($("#mainframe").height() + 160));
			$("#overlay .wrapper").css("width", "800px");
			$(".cdatenschutz").show();
			$("#overlay").fadeIn();
			$("#overlay .trans").fadeTo("fast", 0.65);
			$("#overlay .layer").fadeTo(0.7);
		});
	}

	if ($("a.top").length > 0) {
		$("#header").append('<a name="top" id="top"></a>');
	}

	if ($(".btn_ok").length > 0) {	
	}
	if ($(".btn_abort").length > 0) {
		$(".btn_abort").click(function() {
			$("#overlay").fadeOut();
			if ($("#playerContainer").length > 0) {
				$("#playerContainer").show();
			}
			return false;
		});
	}
	if ($(".btn_no").length > 0) {
		$(".btn_no").click(function() {
			$("#overlay").fadeOut();
			if ($("#playerContainer").length > 0) {
				$("#playerContainer").show();
			}
			return false;
		});
	}
	if ($(".btn_accept").length > 0) {

	}
	if ($(".btn_deny").length > 0) {
		$(".btn_deny").click(function() {
			$("#overlay").fadeOut();
			if ($("#playerContainer").length > 0) {
				$("#playerContainer").show();
			}
			return false;
		});
	}
	if ($(".icn_close").length > 0) {
		$(".icn_close").click(function() {
			$("#overlay").fadeOut("fast", function() {
				$("#overlay .cnetiquette").hide();
				$("#overlay .cdatenschutz").hide();
				$("#overlay .content").hide();
				$("#overlay .options").hide();
			});

			if ($("#playerContainer").length > 0) {
				$("#playerContainer").show();
			}
			return false;
		});
	}

	if ($(".tabs").length > 0) {

		$(".tabs li").click(function() {
			$("#tab li").removeClass("active");
			$("#contentcollection ul").hide();
			$(this).addClass("active");
			$("#studien_" + $(this).text()).show();
			setTimeout("updateTab()", 50);
		});
		$(".tabs li").hover(function() {
			$(this).addClass("live");
		}, function() {
			$(".tabs li").removeClass("live");
		});
		
		setTimeout("setCurrentTab()", 150);
		
		for ( var cc = 0; cc < $(".tabs li").length; cc++) {
			if (cc == 0) {
				if ($("#studien_" + $(".tabs li:first").text() + " li").length > 0) {
					$(".tabs li:first").addClass("checked");
				} else {
					$(".tabs li:first").hide();
					$(".tabs li:first").addClass("checked");
				}
			} else {
				if ($("#studien_" + $(".tabs li:last.checked").next("li").text() + " li").length > 0) {
					$(".tabs li.checked:last").next("li").addClass("checked");
				} else {
					$(".tabs li.checked:last").next("li").hide();
					$(".tabs li.checked:last").next("li").addClass("checked");
				}
			}
		}
	}

	if ($("#qyear").length > 0) {
		$("#qyear").change(function() {
			if ($("#qyear").val() != "") {
				$("#contentcollection ul li").removeClass("visible");
				$("#contentcollection ul li").removeClass("ysucc");
				$("#contentcollection ul li").removeClass("ycheck");
				$("#contentcollection ul li").removeClass("yfail");
				$("#contentcollection ul li").show();
				checkYear();
			} else {
				$("#contentcollection ul li").addClass("visible");
				$("#contentcollection ul li").removeClass("ycheck");
				$("#contentcollection ul li").removeClass("ysucc");
				$("#contentcollection ul li").removeClass("yfail");
				$("#contentcollection ul li").show();
				setTimeout("updatePulldown()", 50);
			}
		});
	}
	if ($("#qickCat").length > 0) {
		$("#qickCat").change(function() {
			window.location.href = ($("#qickCat").val());
		});

		$("#qickCat").val(window.location.href);
	}

	if ($("#cloud-presse_fotos").length > 0) {
		$("#cloud-presse_fotos").hide();
	}
	if ($("#cloud-pressemitteilungen").length > 0) {
		$("#cloud-pressemitteilungen").hide();
	}
	if ($("#contentcollection ul li").length > 0) {

		if ($("#pageForward").length > 0) {
			if ($("#tab").length > 0) {
				updateTab();
				$("#pageForward").click(function() {
					if ($("#contentcollection ul#studien_" + $("#tab li.active").text() + " li").length > (curpager + breakpage)) {
						curpager = curpager + breakpage;
						$("#contentcollection ul#studien_" + $("#tab li.active").text() + " li").show();
						$("#contentcollection ul#studien_" + $("#tab li.active").text() + " li:gt(" + (curpager + breakpage - 1) + ")").hide();
						$("#contentcollection ul#studien_" + $("#tab li.active").text() + " li:lt(" + (curpager) + ")").hide();
						$("#pageBack").show();
						if ($("#contentcollection ul#studien_" + $("#tab li.active").text() + " li").length <= (curpager + breakpage)) {
							$("#pageForward").hide();
						}

						return false;
					} else {
						return false;
					}
				});

				$("#pageBack").click(function() {
					if (!((curpager - breakpage) < 0)) {
						curpager = curpager - breakpage;
						$("#contentcollection ul#studien_" + $("#tab li.active").text() + " li").show();
						$("#contentcollection ul#studien_" + $("#tab li.active").text() + " li:gt(" + (curpager + breakpage - 1) + ")").hide();
						$("#contentcollection ul#studien_" + $("#tab li.active").text() + " li:lt(" + (curpager) + ")").hide();
						if (curpager <= 0) {
							$("#pageBack").hide();
						}
						$("#pageForward").show();

						return false;
					} else {
						return false;
					}
				});
			} else {
				if ($("#fakten").length > 0) {

					$("#contentcollection ul li").addClass("visible");
					$("#contentcollection ul li").show();

					updatePulldown();

					$("#pageForward").click(function() {
						if ($("#contentcollection ul li.visible").length > (curpager + breakpage)) {
							curpager = curpager + breakpage;
							$("#contentcollection ul li.visible").show();
							$("#contentcollection ul li.visible:gt(" + (curpager + breakpage - 1) + ")").hide();
							$("#contentcollection ul li.visible:lt(" + (curpager) + ")").hide();

							$("#pageBack").show();
							if ($("#contentcollection ul li.visible").length <= (curpager + breakpage)) {
								$("#pageForward").hide();
							}

							return false;
						} else {
							return false;
						}
					});
					$("#pageBack").click(function() {
						if (!((curpager - breakpage) < 0)) {
							curpager = curpager - breakpage;
							$("#contentcollection ul li.visible").show();
							$("#contentcollection ul li.visible:gt(" + (curpager + breakpage - 1) + ")").hide();
							$("#contentcollection ul li.visible:lt(" + (curpager) + ")").hide();

							if (curpager <= 0) {
								$("#pageBack").hide();
							}
							$("#pageForward").show();

							return false;
						} else {
							return false;
						}
					});

				} else {
					if ($("#contentcollection ul li").length > 0) {
						$("#contentcollection ul li").addClass("visible");
						updatePulldown();

						$("#pageForward").click(function() {
							if ($("#contentcollection ul li.visible").length > (curpager + breakpage + 1)) {
								curpager = curpager + breakpage;
								$("#contentcollection ul li.visible").show();
								$("#contentcollection ul li.visible:gt(" + (curpager + breakpage - 1) + ")").hide();
								$("#contentcollection ul li.visible:lt(" + (curpager) + ")").hide();

								$("#pageBack").show();
								if ($("#contentcollection ul li.visible").length < (curpager + breakpage + 1)) {
									$("#pageForward").hide();
								}

								return false;
							} else {
								return false;
							}
						});
						$("#pageBack").click(function() {
							if (!((curpager - breakpage - 1) < 0)) {
								curpager = curpager - breakpage;
								$("#contentcollection ul li.visible").show();
								$("#contentcollection ul li.visible:gt(" + (curpager + breakpage - 1) + ")").hide();
								$("#contentcollection ul li.visible:lt(" + (curpager) + ")").hide();

								if (curpager <= 0) {
									$("#pageBack").hide();
								}
								$("#pageForward").show();

								return false;
							} else {
								return false;
							}
						});
					}
				}
			}
		}
	}
});

function setCurrentTab() {
	$(".t"+thisyear[3]).addClass("active");
	$("#contentcollection ul#studien_" + $(".tabs li.active").text()).show();
}

function checkYear() {
	var yearchec;
	for ( var cc = 0; cc < $("#contentcollection ul li").length; cc++) {
		if (cc == 0) {
			yearchec = $("#contentcollection ul li:first").find("span").text();

			if (yearchec.match($("#qyear").val())) {
				$("#contentcollection ul li:first").addClass("ycheck");
				$("#contentcollection ul li:first").addClass("visible");
				$("#contentcollection ul li:first").addClass("ysucc");
				$("#contentcollection ul li:first").show();
			} else {
				$("#contentcollection ul li:first").addClass("yfail");
				$("#contentcollection ul li:first").addClass("ycheck");
				$("#contentcollection ul li:first").hide();
			}
		} else {
			yearchec = $("#contentcollection ul li.ycheck:last").next("li").find("span").text();

			if (yearchec.match($("#qyear").val())) {
				$("#contentcollection ul li.ycheck:last").next("li").addClass("visible");
				$("#contentcollection ul li.ycheck:last").next("li").addClass("ysucc");
				$("#contentcollection ul li.ycheck:last").next("li").addClass("ycheck");
				$("#contentcollection ul li.ycheck:last").show();
			} else {
				$("#contentcollection ul li.ycheck:last").next("li").hide();
				$("#contentcollection ul li.ycheck:last").next("li").addClass("yfail");
				$("#contentcollection ul li.ycheck:last").next("li").addClass("ycheck");
			}
		}
	}

	setTimeout("updatePulldown()", 50);
}

function updatePulldown() {
	$("#contentcollection ul li.visible").show();
	breakpage = 10;
	curpager = 0;
	$("#pageBack").hide();
	if ($("#contentcollection ul li.visible").length <= (curpager + breakpage)) {
		$("#pageForward").hide();
	}
	$("#contentcollection ul li.visible:gt(" + (curpager + breakpage - 1) + ")").hide();
}

function updateTab() {
	$("#contentcollection ul#studien_" + $(".tabs li.active").text() + " li").show();
	breakpage = 10;
	curpager = 0;
	$("#pageBack").hide();
	if ($("#contentcollection ul#studien_" + $(".tabs li.active").text() + " li").length <= (curpager + breakpage)) {
		$("#pageForward").hide();
	}
	$("#contentcollection ul#studien_" + $(".tabs li.active").text() + " li:gt(" + (breakpage - 1) + ")").hide();
}

function collectPresspics() {

	$("#loadingContainer4 ul>li").tsort("h2", {
		order : "rand"
	});

	$("#loadingContainer4 li img").appendTo("#ppics ul");
	// $("#ppics ul img").wrap('<a href="' + pressepics + '"></a>');

	$("#ppics ul li:gt(" + (amountOfPressPics - 1) + ")").remove();

	$("#loadingContainer4").remove();
	if ($("#collector").length < 1) {
		$("#loadingContainer0, #loadingContainer1, #loadingContainer2, #loadingContainer3").remove();
	}
}

function collectMes() {
	var cc = 0;
	for (cc = 0; cc < $("#medienecho ul li").length; cc++) {
		var datestring = new Array;
		var date = new Array;
		if (cc == 0) {
			stringToSearch = $("#medienecho ul li:first").find("h1").text();
			$("#medienecho ul li:first").addClass("checked");

			date = $("#medienecho ul li:first").find("span").text().split(".");
			var datetoshow = (date[2])+(date[1])+(date[0]);
			datetoshow = datetoshow.replace(/[^0-9]/g, "");
			
			$("#medienecho ul li:first").append("<h6>" + (datetoshow) + "</h6>")
		} else {
			stringTemp = $("#medienecho ul li.checked:last").next("li").find("h1").text();

			if (stringToSearch.match(stringTemp) != null) {
				$("#medienecho ul li.checked:last").next("li").addClass("remove");
				$("#medienecho ul li.checked:last").next("li").addClass("checked");
			} else {
				stringToSearch = stringToSearch + " - " + $("#medienecho ul li.checked:last").next("li").find("h1").text();

				date = $("#medienecho ul li.checked:last").next("li").find("span").text().split(".");
				var datetoshow = (date[2])+(date[1])+(date[0]);
				datetoshow = datetoshow.replace(/[^0-9]/g, "");
				
				$("#medienecho ul li.checked:last").next("li").append("<h6>" + (datetoshow) + "</h6>")
				$("#medienecho ul li.checked:last").next("li").addClass("checked");
			}
			if (cc == ($("#medienecho ul li").length - 1)) {
				setTimeout("placeMe()", 50);
			}
		}
	}
}

function placeMe() {

	$(".remove").remove();

	$("#medienecho ul li").removeClass("hideit");
	$("#medienecho ul li:gt(9)").not(".hide").remove();

	$("#medienecho ul>li").tsort("h6", {
		order : "desc"
	});

	$("#medienecho h6").hide();
	$("#medienecho ul").show();
	$("#medienecho").removeClass("loading");

}

function collectPr(div) {
	if (cajx >= link.length) {
		setTimeout("collectDups()", 50);
	}
}

function collectDups() {
	var cc = 0;

	for (cc = 0; cc < $("#loadingLinkMain ul li").length; cc++) {
		var datestring = new Array;
		var date = new Array;
		if (cc == 0) {
			stringToSearch = $("#loadingLinkMain ul li:first").find("h1").text();
			$("#loadingLinkMain ul li:first").addClass("checked");

			datestring = $("#loadingLinkMain ul li:first").find("span").text().split(" ");
			date = datestring[0].split(".");
			var timestring = datestring[1].split(":");
			var datetoshow = (date[2])+(date[1])+(date[0])+(timestring[0])+(timestring[1]);
			datetoshow = datetoshow.replace(/[^0-9]/g, "");
			
			$("#loadingLinkMain ul li:first").append("<h6>" + (datetoshow) + "</h6>")
		} else {
			stringTemp = $("#loadingLinkMain ul li.checked:last").next("li").find("h1").text();

			if (stringToSearch.match(stringTemp) != null) {
				$("#loadingLinkMain ul li.checked:last").next("li").addClass("remove");
				$("#loadingLinkMain ul li.checked:last").next("li").addClass("checked");
			} else {
				stringToSearch = stringToSearch + " - " + $("#loadingLinkMain ul li.checked:last").next("li").find("h1").text();

				datestring = $("#loadingLinkMain ul li.checked:last").next("li").find("span").text().split(" ");
				date = datestring[0].split(".");
				var timestring = datestring[1].split(":");
				var datetoshow = (date[2])+(date[1])+(date[0])+(timestring[0])+(timestring[1]);
				datetoshow = datetoshow.replace(/[^0-9]/g, "");
				$("#loadingLinkMain ul li.checked:last").next("li").append("<h6>"+(datetoshow)+"</h6>")
				$("#loadingLinkMain ul li.checked:last").next("li").addClass("checked");
			}
		}
		if (cc == ($("#loadingLinkMain ul li").length - 1)) {
			setTimeout("placePr()", 500);
		}
	}
}

function placePr() {

	$(".remove").remove();

	$("#loadingLinkMain ul li").removeClass("hideit");
	$("#loadingLinkMain .hide").remove();
	$("#loadingLinkMain ul li:gt(34)").remove();

	$("#loadingLinkMain ul>li").tsort("h6", {
		order : "desc"
	});

	$("#loadingLinkMain ul").appendTo("#collector");

	$("#collector ul>li").tsort("h6", {
		order : "desc"
	});

	$("#collector").removeClass("loading");
	$("#collector h6").hide();

	$("#loadingLinkMain").remove();

	for ( var cli = 0; cli < link.length; cli++) {
		$('#loadingLink' + cli).remove();
	}
}

function specialAddr(addr) {
    var arr = new Array();
    
        arr[arr.length] = "http://www.studivz.net/mezzomixlovers";
    
        arr[arr.length] = "http://www.ganz-deutschland-aufklaeren.de/";
    
        arr[arr.length] = "http://www.studivz.net/Search/ResultGroups/name/cokefridge";
    
        arr[arr.length] = "http://www.schuelervz.net/coca-cola";
    
        arr[arr.length] = "http://www.meinvz.net/coca-cola";
    
        arr[arr.length] = "http://www.studivz.net/coca-cola";
    
        arr[arr.length] = "http://www.fanta.de/";
    
        arr[arr.length] = "http://www.mezzomix.de/";
    
        arr[arr.length] = "http://www.expedition206.com/";
    
        arr[arr.length] = "http://www.missionolympic.de/";
    
        arr[arr.length] = "http://www.cokefridge.de/";
    
        arr[arr.length] = "http://www.coke.de/";
    
        arr[arr.length] = "http://www.cokelight.de/";
    
        arr[arr.length] = "http://www.cokezero.de/";
    
        arr[arr.length] = "http://www.apollinaris.de";
    
        arr[arr.length] = "http://www.sprite.de/ ";
    
        arr[arr.length] = "http://www.nestea-nation.de/";
    
        arr[arr.length] = "http://www.bonaqa.de/";
    
        arr[arr.length] = "http://www.flickr.com/groups/expedition206";
    
        arr[arr.length] = "http://www.flickr.com/photos/cokemusiceditor";
    
        arr[arr.length] = "http://www.myspace.com/cokemusic";
    
        arr[arr.length] = "http://www.facebook.com/manuel.kalb";
    
        arr[arr.length] = "http://www.facebook.com/coke.de";
    
        arr[arr.length] = "http://www.facebook.com/home.php?filter=lf#/cokezero.de?ref=ts";
    
        arr[arr.length] = "http://www.facebook.com/home.php?filter=lf#/cokelight.de?ref=ts";
    
        arr[arr.length] = "http://www.facebook.com/cocacola?ref=ts&__a=1&_fb_iframe_path=%2Fcoca-cola";
    
        arr[arr.length] = "http://www.cceag.de";
    
        arr[arr.length] = "http://www.lastfm.de/group/Coca-Cola%2520Soundwave%2520Discovery%2520Tour?ac=coca-cola%20soundwave";
    
        arr[arr.length] = "http://www.facebook.com/cocacola?ref=ts&__a=1&_fb_iframe_path=%2Fcoca-cola";
    
    
    var matchResult = false;
    jQuery.each( arr, function(index, item){    
        if (item==addr) {
          matchResult = true;               
        }      
     });     
     return matchResult;
}

function ytReady() {
	$("#midColumn div a").click(function() {

		addr = $(this).attr("href");
		if (addr.match("http://") && !($(this).hasClass("btn"))) {

			window.location.href = "#top";

			$("#overlay .trans").height(($("#mainframe").height() + 160));
			$("#overlay .wrapper").css("width", "340px");

			if($.support.opacity==false){
				$(".obrd").remove();
				$("#overlay .container").css("border", "1px solid #cc0000");
			}
			
			if (!addr.match("coca-cola-gmbh.de") && !addr.match(internalUrl) && !addr.match("javascript:")) {
				/* Externe Seite */

				if ($("#playerContainer").length > 0) {
					$("#playerContainer").hide();
				}
				
				
				$("#overlay .options").show();
				$("#overlay .content").show();
				$("#overlay").fadeIn();
				$("#overlay .trans").fadeTo("fast", 0.65);
				$("#overlay .content p.date").html("Sie &ouml;ffnen nach Best�tigung die folgende Seite:<br />&quot;" + addr + "&quot;");
				$("#overlay .layer").fadeTo(0.7);

				if ($(".btn_ok").length > 0) {
					$(".btn_ok").attr("href", addr);
					$(".btn_ok").attr("target", "_blank");
				}

				return false;
			} else {
				/* Coke intern */
				return true;
			}
		}
		return true;
	});
}

function imageFallback(obj) {
	$(obj).attr("src", blogURL + "/teaser_bilder/pressemitteilungen/default.jpg");
}

function imageFallbackAlt(obj, src) {
	$(obj).attr("src", "http://newsroom.coca-cola-gmbh.de/ccd/teaser_bilder/" + src);
}

function openPlayerPage(page) {
	window.location = page;
}

function fixDate(d) {
	yyyy = d.substr(0, 4);
	MM = d.substr(5, 2);
	dd = d.substr(8, 2);
	return dd + '.' + MM + '.' + yyyy;
}

function createPreviewList1(data, channel) {
	createPreviewDiv(data, channel, 'yt_prev_1');
}

function createPreviewList2(data, channel) {
	createPreviewDiv(data, channel, 'yt_prev_2');
}

function loadPreviewChannels() {
	$.getJSON("http://gdata.youtube.com/feeds/users/" + yts_channels_array[0] + "/uploads?alt=json-in-script&format=5&&max-results=10&callback=?", function(data) {
		createPreviewList1(data, yts_channels_array[0]);
	});

	$.getJSON("http://gdata.youtube.com/feeds/users/" + yts_channels_array[1] + "/uploads?alt=json-in-script&format=5&&max-results=10&callback=?", function(data) {
		createPreviewList2(data, yts_channels_array[1]);
	});
}

function containsInArray(a, elem) {
	for (i = 0; i < a.length; i++) {
		var result = false;
		if (a[i] == elem) {
			result = true;
			break;
		}
	}
	return result;
}

function createPreviewDiv(data, channel, elem) {
	var a = new Array();
	var feed = data.feed;
	var entries = feed.entry || [];
	var html = [ '<ul class="', elem, '">' ];
	var k = 2;

	if (entries.length == 1) {
		k = 1;
	}
	if (entries.length == 0) {
		k = 0;
	}

	for ( var i = 0; i < k; i++) {
		var randomnumber = Math.floor(Math.random() * entries.length);

		while (containsInArray(a, randomnumber) == true) {
			randomnumber = Math.floor(Math.random() * entries.length)
		}
		a[a.length] = randomnumber;
		var publishedDate = fixDate(entries[randomnumber].published.$t);
		var entry = entries[randomnumber];
		var thumbnailUrl = entries[randomnumber].media$group.media$thumbnail[0].url;
		var url = entries[randomnumber].id.$t;
		html.push('<li><a href="javascript:openPlayerPage(\'', blogURL, '/yt.html?channel=', channel, '&feedId=', url, '\')">');
		html.push('<img src="', thumbnailUrl, '" width="99" height="62" vspace="0" border="0" /></a>');
		html.push('<div><a href="javascript:openPlayerPage(\'', blogURL, '/yt.html?channel=', channel, '&feedId=', url, '\')"><span class="pi"><span><img src="/ccd/img/icon_play.png" /></span></span></a></div></li>');
	}
	html.push('</ul>');
	html.push('<br style="clear: left;"/>');
	document.getElementById(elem).innerHTML = html.join('');
	
	$("img").pngfix();
}
<!-- ph=1 -->
<!-- nhm:from_kauri -->
