/* jScrollPane 1.2.3 */
(function($){$.event.special.mousewheel={setup:function(){var handler=$.event.special.mousewheel.handler;if($.browser.mozilla)$(this).bind('mousemove.mousewheel',function(event){$.data(this,'mwcursorposdata',{pageX:event.pageX,pageY:event.pageY,clientX:event.clientX,clientY:event.clientY})});if(this.addEventListener)this.addEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else this.onmousewheel=handler},teardown:function(){var handler=$.event.special.mousewheel.handler;$(this).unbind('mousemove.mousewheel');if(this.removeEventListener)this.removeEventListener(($.browser.mozilla?'DOMMouseScroll':'mousewheel'),handler,false);else this.onmousewheel=function(){};$.removeData(this,'mwcursorposdata')},handler:function(event){var args=Array.prototype.slice.call(arguments,1);event=$.event.fix(event||window.event);$.extend(event,$.data(this,'mwcursorposdata')||{});var delta=0,returnValue=true;if(event.wheelDelta)delta=event.wheelDelta/120;if(event.detail)delta=-event.detail/3;if($.browser.opera)delta=-event.wheelDelta;event.data=event.data||{};event.type="mousewheel";args.unshift(delta);args.unshift(event);return $.event.handle.apply(this,args)}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})})(jQuery);
jQuery(function($){var eventName='emchange';$.em=$.extend({version:'1.0',delay:200,element:$('<div />').css({left:'-100em',position:'absolute',width:'100em'}).prependTo('body')[0],action:function(){var currentWidth=$.em.element.offsetWidth/100;if(currentWidth!=$.em.current){$.em.previous=$.em.current;$.em.current=currentWidth;$.event.trigger(eventName,[$.em.current,$.em.previous])}}},$.em);$.fn[eventName]=function(fn){return fn?this.bind(eventName,fn):this.trigger(eventName)};$.em.current=$.em.element.offsetWidth/100;$.em.iid=setInterval($.em.action,$.em.delay)});
(function(A){A.jScrollPane={active:[]};A.fn.jScrollPane=function(C){C=A.extend({},A.fn.jScrollPane.defaults,C);var B=function(){return false};return this.each(function(){var O=A(this);O.css("overflow","hidden");var X=this;if(A(this).parent().is(".jScrollPaneContainer")){var Ac=C.maintainPosition?O.position().top:0;var L=A(this).parent();var d=L.innerWidth();var Ad=L.outerHeight();var M=Ad;A(">.jScrollPaneTrack, >.jScrollArrowUp, >.jScrollArrowDown",L).remove();O.css({top:0})}else{var Ac=0;this.originalPadding=O.css("paddingTop")+" "+O.css("paddingRight")+" "+O.css("paddingBottom")+" "+O.css("paddingLeft");this.originalSidePaddingTotal=(parseInt(O.css("paddingLeft"))||0)+(parseInt(O.css("paddingRight"))||0);var d=O.innerWidth();var Ad=O.innerHeight();var M=Ad;O.wrap(A("<div></div>").attr({className:"jScrollPaneContainer"}).css({height:Ad+"px",width:d+"px"}));A(document).bind("emchange",function(Ae,Af,p){O.jScrollPane(C)})}if(C.reinitialiseOnImageLoad){var N=A.data(X,"jScrollPaneImagesToLoad")||A("img",O);var G=[];if(N.length){N.each(function(p,Ae){A(this).bind("load",function(){if(A.inArray(p,G)==-1){G.push(Ae);N=A.grep(N,function(Ag,Af){return Ag!=Ae});A.data(X,"jScrollPaneImagesToLoad",N);C.reinitialiseOnImageLoad=false;O.jScrollPane(C)}}).each(function(Af,Ag){if(this.complete||this.complete===undefined){this.src=this.src}})})}}var o=this.originalSidePaddingTotal;var l={height:"auto",width:d-C.scrollbarWidth-C.scrollbarMargin-o+"px"};if(C.scrollbarOnLeft){l.paddingLeft=C.scrollbarMargin+C.scrollbarWidth+"px"}else{l.paddingRight=C.scrollbarMargin+"px"}O.css(l);var m=O.outerHeight();var i=Ad/m;if(i<0.99){var H=O.parent();H.append(A("<div></div>").attr({className:"jScrollPaneTrack"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDrag"}).css({width:C.scrollbarWidth+"px"}).append(A("<div></div>").attr({className:"jScrollPaneDragTop"}).css({width:C.scrollbarWidth+"px"}),A("<div></div>").attr({className:"jScrollPaneDragBottom"}).css({width:C.scrollbarWidth+"px"}))));var z=A(">.jScrollPaneTrack",H);var P=A(">.jScrollPaneTrack .jScrollPaneDrag",H);if(C.showArrows){var g;var Ab;var S;var r;var j=function(){if(r>4||r%4==0){y(u+Ab*b)}r++};var K=function(p){A("html").unbind("mouseup",K);g.removeClass("jScrollActiveArrowButton");clearInterval(S)};var Z=function(){A("html").bind("mouseup",K);g.addClass("jScrollActiveArrowButton");r=0;j();S=setInterval(j,100)};H.append(A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowUp"}).css({width:C.scrollbarWidth+"px"}).html("Scroll up").bind("mousedown",function(){g=A(this);Ab=-1;Z();this.blur();return false}).bind("click",B),A("<a></a>").attr({href:"javascript:;",className:"jScrollArrowDown"}).css({width:C.scrollbarWidth+"px"}).html("Scroll down").bind("mousedown",function(){g=A(this);Ab=1;Z();this.blur();return false}).bind("click",B));var Q=A(">.jScrollArrowUp",H);var J=A(">.jScrollArrowDown",H);if(C.arrowSize){M=Ad-C.arrowSize-C.arrowSize;z.css({height:M+"px",top:C.arrowSize+"px"})}else{var s=Q.height();C.arrowSize=s;M=Ad-s-J.height();z.css({height:M+"px",top:s+"px"})}}var w=A(this).css({position:"absolute",overflow:"visible"});var D;var Y;var b;var u=0;var V=i*Ad/2;var a=function(Ae,Ag){var Af=Ag=="X"?"Left":"Top";return Ae["page"+Ag]||(Ae["client"+Ag]+(document.documentElement["scroll"+Af]||document.body["scroll"+Af]))||0};var f=function(){return false};var v=function(){n();D=P.offset(false);D.top-=u;Y=M-P[0].offsetHeight;b=2*C.wheelSpeed*Y/m};var E=function(p){v();V=a(p,"Y")-u-D.top;A("html").bind("mouseup",T).bind("mousemove",h);if(A.browser.msie){A("html").bind("dragstart",f).bind("selectstart",f)}return false};var T=function(){A("html").unbind("mouseup",T).unbind("mousemove",h);V=i*Ad/2;if(A.browser.msie){A("html").unbind("dragstart",f).unbind("selectstart",f)}};var y=function(Ae){Ae=Ae<0?0:(Ae>Y?Y:Ae);u=Ae;P.css({top:Ae+"px"});var Af=Ae/Y;w.css({top:((Ad-m)*Af)+"px"});O.trigger("scroll");if(C.showArrows){Q[Ae==0?"addClass":"removeClass"]("disabled");J[Ae==Y?"addClass":"removeClass"]("disabled")}};var h=function(p){y(a(p,"Y")-D.top-V)};var q=Math.max(Math.min(i*(Ad-C.arrowSize*2),C.dragMaxHeight),C.dragMinHeight);P.css({height:q+"px"}).bind("mousedown",E);var k;var R;var I;var t=function(){if(R>8||R%4==0){y((u-((u-I)/2)))}R++};var Aa=function(){clearInterval(k);A("html").unbind("mouseup",Aa).unbind("mousemove",e)};var e=function(p){I=a(p,"Y")-D.top-V};var U=function(p){v();e(p);R=0;A("html").bind("mouseup",Aa).bind("mousemove",e);k=setInterval(t,100);t()};z.bind("mousedown",U);H.bind("mousewheel",function(Ae,Ag){v();n();var Af=u;y(u-Ag*b);var p=Af!=u;return !p});var F;var W;function c(){var p=(F-u)/C.animateStep;if(p>1||p<-1){y(u+p)}else{y(F);n()}}var n=function(){if(W){clearInterval(W);delete F}};var x=function(Af,p){if(typeof Af=="string"){$e=A(Af,O);if(!$e.length){return}Af=$e.offset().top-O.offset().top}H.scrollTop(0);n();var Ae=-Af/(Ad-m)*Y;if(p||!C.animateTo){y(Ae)}else{F=Ae;W=setInterval(c,C.animateInterval)}};O[0].scrollTo=x;O[0].scrollBy=function(Ae){var p=-parseInt(w.css("top"))||0;x(p+Ae)};v();x(-Ac,true);A("*",this).bind("focus",function(Ah){var Ag=A(this);var Aj=0;while(Ag[0]!=O[0]){Aj+=Ag.position().top;Ag=Ag.offsetParent()}var p=-parseInt(w.css("top"))||0;var Ai=p+Ad;var Af=Aj>p&&Aj<Ai;if(!Af){var Ae=Aj-C.scrollbarMargin;if(Aj>p){Ae+=A(this).height()+15+C.scrollbarMargin-Ad}x(Ae)}});if(location.hash){x(location.hash)}A(document).bind("click",function(Ae){$target=A(Ae.target);if($target.is("a")){var p=$target.attr("href");if(p.substr(0,1)=="#"){x(p)}}});A.jScrollPane.active.push(O[0])}else{O.css({height:Ad+"px",width:d-this.originalSidePaddingTotal+"px",padding:this.originalPadding});O.parent().unbind("mousewheel")}})};A.fn.jScrollPane.defaults={scrollbarWidth:10,scrollbarMargin:5,wheelSpeed:18,showArrows:false,arrowSize:0,animateTo:false,dragMinHeight:1,dragMaxHeight:99999,animateInterval:100,animateStep:3,maintainPosition:true,scrollbarOnLeft:false,reinitialiseOnImageLoad:false};A(window).bind("unload",function(){var C=A.jScrollPane.active;for(var B=0;B<C.length;B++){C[B].scrollTo=C[B].scrollBy=null}})})(jQuery);

/* Footer Positioning ******************************************************/
(function($){$.fn.positionFooter=function(center){var element=this;var originalPosition=$(element).offset();var originalTopPosition=originalPosition.top;positionTheFooter();$(window).bind("resize",function(){positionTheFooter()});function positionTheFooter(){var elementPosition=$(element).offset();var elementPaddingTop=$(element).css("padding-top");var elementPaddingBottom=$(element).css("padding-bottom");var elementPaddingleft=$(element).css("padding-left");var elementPaddingRight=$(element).css("padding-right");var elementHeight=$(element).height();var elementWidth=$(element).width();var windowHeight=$(window).height();var windowWidth=$(window).width();elementPaddingTop=elementPaddingTop.replace(/px/,"");elementPaddingBottom=elementPaddingBottom.replace(/px/,"");elementPaddingleft=elementPaddingleft.replace(/px/,"");elementPaddingRight=elementPaddingRight.replace(/px/,"");var newPosition=(parseInt(windowHeight)-(parseInt(elementHeight)+(parseInt(elementPaddingTop)+parseInt(elementPaddingBottom))));var currentPosition=elementPosition.top-(parseInt(elementHeight)+(parseInt(elementPaddingTop)+parseInt(elementPaddingBottom)));if(originalTopPosition<windowHeight){$(element).css({"position":"absolute","top":newPosition});if(center==true){$(element).css({"left":windowWidth/2-(((elementWidth+parseInt(elementPaddingleft)+parseInt(elementPaddingRight))/2))})}}if(newPosition<=originalTopPosition){$(element).css({"position":"absolute","top":originalTopPosition});if(center==true){$(element).css({"left":windowWidth/2-(((elementWidth+parseInt(elementPaddingleft)+parseInt(elementPaddingRight))/2))})}}}}})(jQuery);

/* Delay *******************************************************************/
jQuery.fn.delay = function(time,func){return this.each(function(){setTimeout(func,time);});};

/* Cookie ******************************************************************/
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires='; expires='+date.toUTCString()}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}}return cookieValue}};

/* Init Vars ***************************************************************/
var cookieoptions = { path: '/', expires: 1 };
var currentPosition = 0; 
var currentVolume = 70;
var atmo_mute_status = false;
var atmo_clicked_status = false;
if($.cookie('kemper_atmo') == 1) {
    currentVolume = 0;
    atmo_mute_status = true;
    atmo_clicked_status = true;
}
var films_visited = null;
var gallery_visited = null;

function createAtmoPlayer()
{
    var flashvars = {
        file:"/music/atmo", 
        autostart:"true",
        stretching:"fill",
        icons:"false",
        controlbar:"none",
        repeat:"always",
        shuffle:true,
        volume:currentVolume,
        id:"atmo"
    }
    var params = {
        allowfullscreen:"false",
        allowscriptaccess:"always",
        wmode: "window",
        menu: "false"
    }
    var attributes = {
        id:"atmo",
        name:"atmo"
    }
    swfobject.embedSWF("/assets/mediaplayer/player.swf", "atmo_player_placeholder", "1", "1", "9.0.115", false, flashvars, params, attributes);
}

function createVideoPlayer(theFile) {
    muteAtmoPlayer();
    var flashvars = {
        file:theFile,
        autostart:"true",
        link:"javascript:playerCloser();",
        linktarget:"_self",
        displayclick:"link",
        stretching:"fill",
        icons:"false",
        controlbar:"over",
        skin:"/assets/mediaplayer/overlay"
    }
    var params = {
        allowfullscreen:"true", 
        allowscriptaccess:"always",
        wmode: "window",
        menu: "false"
    }
    var attributes = {
        id:"video_player",
        name:"video_player"
    }
    swfobject.embedSWF("/assets/mediaplayer/player.swf", "showreel_container", "300", "196", "9.0.115", false, flashvars, params, attributes);
}
function muteAtmoPlayer(){
    if(atmo_mute_status == false) {
        $(this).delay(100,function(){
            document.atmo.sendEvent('VOLUME', 70);
            $(this).delay(100,function(){
                document.atmo.sendEvent('VOLUME', 65);
                $(this).delay(100,function(){
                    document.atmo.sendEvent('VOLUME', 50);
                    $(this).delay(100,function(){
                        document.atmo.sendEvent('VOLUME', 45);
                        $(this).delay(100,function(){
                            document.atmo.sendEvent('VOLUME', 40);
                            $(this).delay(100,function(){
                                document.atmo.sendEvent('VOLUME', 35);
                                $(this).delay(100,function(){
                                    document.atmo.sendEvent('VOLUME', 30);
                                    $(this).delay(100,function(){
                                        document.atmo.sendEvent('VOLUME', 25);
                                        $(this).delay(100,function(){
                                            document.atmo.sendEvent('VOLUME', 20);
                                            $(this).delay(100,function(){
                                                document.atmo.sendEvent('VOLUME', 10);
                                                $(this).delay(100,function(){
                                                    document.atmo.sendEvent('VOLUME', 5);
                                                    $(this).delay(100,function(){
                                                        document.atmo.sendEvent('VOLUME', 0);
                                                            atmo_mute_status = true;
                                                    });
                                                });
                                            });
                                        });
                                    });
                                });
                            });
                        });
                    });
                });
            });
        });
        atmo_mute_status = true;
        $("#muteplayer").hide();
        $("a#unmuteplayer").show();
        atmo_mute_status = true;
    }
}
function unmuteAtmoPlayer(){
    if(atmo_mute_status == true) {
        $(this).delay(100,function(){
            document.atmo.sendEvent('VOLUME', 5);
            $(this).delay(100,function(){
                document.atmo.sendEvent('VOLUME', 10);
                $(this).delay(100,function(){
                    document.atmo.sendEvent('VOLUME', 15);
                    $(this).delay(100,function(){
                        document.atmo.sendEvent('VOLUME', 20);
                        $(this).delay(100,function(){
                            document.atmo.sendEvent('VOLUME', 30);
                            $(this).delay(100,function(){
                                document.atmo.sendEvent('VOLUME', 40);
                                $(this).delay(100,function(){
                                    document.atmo.sendEvent('VOLUME', 45);
                                    $(this).delay(100,function(){
                                        document.atmo.sendEvent('VOLUME', 50);
                                        $(this).delay(100,function(){
                                            document.atmo.sendEvent('VOLUME', 55);
                                            $(this).delay(100,function(){
                                                document.atmo.sendEvent('VOLUME', 60);
                                                $(this).delay(100,function(){
                                                    document.atmo.sendEvent('VOLUME', 65);
                                                    $(this).delay(100,function(){
                                                        document.atmo.sendEvent('VOLUME', 90);$(this).delay(100,function(){
                                                            document.atmo.sendEvent('VOLUME', 70);
                                                        });
                                                    });
                                                });
                                            });
                                        });
                                    });
                                });
                            });
                        });
                    });
                });
            });
        });
        $("#unmuteplayer").hide();
        $("a#muteplayer").show();
        atmo_mute_status = false;
        $.cookie('kemper_atmo', null);
    }
}
Shadowbox.loadSkin('classic', '/assets/js/src/skin'); 
$(window).load(function(){
    Shadowbox.init({ skipSetup:true });
    createBackgroundMovie();
});
$(document).ready(function(){
    // $("#footer").positionFooter(true);
        $(window).trigger("resize");
    createAtmoPlayer();
    $("#navigation ul li a").hover(
    function(){
        $(this).animate({color:"#68BFEF",marginLeft:"-13px"},200);
    },
    function(){
        $(this).animate({color:"#FFFFFF",marginLeft:"0"},400);
    });
    if($.cookie('kemper_atmo') == 1) {
        currentVolume = 0;
        $("#muteplayer").hide();
        $("a#unmuteplayer").show();
        atmo_mute_status = true;
        atmo_clicked_status = true;
    }
    $("a#muteplayer").click(function () {
        muteAtmoPlayer();
        atmo_clicked_status = true;
        $.cookie('kemper_atmo', "1", cookieoptions);
        return false;
    });
    $("a#unmuteplayer").click(function () {
        unmuteAtmoPlayer();
        atmo_clicked_status = false;
    });
    $("#menu_imprint").click(function () {
        $("#inside").load($(this).attr("href"));
        if(atmo_clicked_status == false) {
            unmuteAtmoPlayer();
        }
        return false;
    });
    $("#navigation ul li.intlink a").bind("click", function () {
        $("#inside").load($(this).attr("href"));
        if(atmo_clicked_status == false) {
            unmuteAtmoPlayer();
        }
        return false;
    });
    
});
function volumeListener(obj) { 
    currentVolume = obj.percentage; 
    var tmp = document.getElementById("vol");
    if (tmp) { tmp.innerHTML = "volume: " + currentVolume; }
}
function playerCloser() {
    $('#video_player').replaceWith('<div id="showreel_container">' + '</div>');
    $("#closelink").hide();
}
/* MUSIC */
var currentItem = -1;
var previousItem = -1;
var currentLength = 0;
var currentState = 'NONE'; 
var previousState= 'NONE'; 
var linkFlag = false;
var player = null;
function playerReady(thePlayer) {
    player = window.document[thePlayer.id];
    addListeners();
    printPlaylistData();
}
function addListeners() {
    if (player) {
        player.addControllerListener("ITEM", "itemListener");
        player.addModelListener("STATE", "stateListener");
    } else {
        setTimeout("addListeners()",100);
    }
}
function itemListener(obj) {
    if (obj.index != currentItem) {
        previousItem = currentItem;
        currentItem = obj.index;
        setItemStyle(currentItem);
    }
}
function stateListener(obj) {
    currentState = obj.newstate;
    var tmp = document.getElementById("itm" + currentItem);
    if ((currentState != previousState)||(currentItem != previousItem)) {  
        previousState = currentState;
        setItemStyle(currentItem);
    }
}
function mover(obj, idx) { 
    if (idx == currentItem) { obj.className = 'playinghi'; }
    else  { obj.className = 'playlisthi'; }
}
function mout(obj, idx) {
    linkFlag = false;
    if (idx == currentItem) { obj.className = 'playinglo'; }
    else  { obj.className = 'playlistlo'; } 
}
function setItemStyle(idx) {
    var count = getLength(); 
    for(var i=0; i<count; i++) { 
        var tmp = document.getElementById("itm" + i);
        if (tmp) { 
            if(i == idx) {
                if(currentState == 'PLAYING') {
                    tmp.className = 'playinglo';
                    $('.playerstate').text($("tr#itm" + i + " td:first").html());
                    muteAtmoPlayer();
                } else { tmp.className = 'playlisthi'; }
            } else { tmp.className = 'playlistlo'; }
        }
    }
    var tmp = document.getElementById("plstwrapper");
    tmp.scrollTop = idx * 80;
}
function getLength() { currentLength = player.getPlaylist().length; return(currentLength); };
function loadCheckedPlaylistData() {
    if (currentPlaylist) {
        var j = 0;
        var lst = new Array();
        for(var i in currentPlaylist) { 
            if(document.getElementById('cb' + i).checked) {
                lst[j] = {
                    author:currentPlaylist[i].author,
                    description:currentPlaylist[i].description,
                    duration:currentPlaylist[i].duration,
                    file:currentPlaylist[i].file,
                    link:currentPlaylist[i].link,
                    image:currentPlaylist[i].image,
                    start:currentPlaylist[i].start,
                    title:currentPlaylist[i].title,
                    type:currentPlaylist[i].type
                }
                j++;
            }
        }
        if(lst.length > 0) { player.sendEvent('LOAD', lst); }
    }
}
function printPlaylistData() {
    var plst = null;
    plst = player.getPlaylist();
    if (plst) {
        var txt='<table id="yo" class="tblb" cellPadding="2" width="380">'; 
        for(var i in plst) {
            txt+='<tr id="itm' + i + '" onclick="if(! linkFlag) player.sendEvent(\'ITEM\',' + i + ');" ';
            txt+='class="playlistlo" onmouseover="mover(this, ' + i + ')" onmouseout="mout(this, ' + i + ')">';
            txt+='<td style="width:250px">'+ plst[i].title +'</td>';
            txt+='<td style="width:60px">'+ plst[i].link +'</td>';
            txt+='<td>'+ plst[i].author +'</td>';
            txt+='</tr>';
        }
        txt+='</table>';
        var tmp = document.getElementById("plstDat");
        if (tmp) {
            tmp.innerHTML = txt;
            $('.scroll-pane').jScrollPane();
            $("#filter").keyup(function () {
                var filter = $(this).val();
                $("#yo tr").hide();
                $("#yo tr > td").each(function () {
                    if ($(this).text().search(new RegExp(filter, "i")) < 0) {
                    } else {
                        $(this).parent().show();
                    }
                });
            });
        }
    } else {
        setTimeout("printPlaylistData()",100);
    }
}
function createMusicPlayer(theFile, theAutostart) {
    var flashvars = {
        file:theFile,  
        autostart:theAutostart, 
        shuffle:false, 
        repeat:"list",
        skin:"/assets/test/stylish.swf"
    }
    var params = {
        allowfullscreen:"false", 
        allowscriptaccess:"always",
        wmode:"transparent"
    }
    var attributes = {
        id:"player1",  
        name:"player1"
    }
    swfobject.embedSWF("/assets/test/player.swf", "placeholder1", "400", "30", "9.0.115", false, flashvars, params, attributes);
}
function createBackgroundMovie() {
    var params = {
        allowfullscreen:"false", 
        allowscriptaccess:"always",
        wmode:"transparent"
    }
    var attributes = {
        id:"kloop",  
        name:"kloop"
    }
    swfobject.embedSWF("/assets/swf/loop/loop.swf", "bgplaceholder", "900", "500", "9.0.115", false, null, params, attributes);
}
function initMusic() {
    createMusicPlayer('/music/playlist', false);
}
function initContactForm(){
    $('#cform').bind('submit', function() {
        $(this).ajaxSubmit({
            target: '#output'
        });
        return false; // <-- important!
    });
}