$(document).ready(function(){
/*    $("a[href=/files/lille/start.htm]").each( function() {
	    $(this).click(function(event) {
        	    event.stopPropagation();
		    window.open("/files/lille/start.htm", "wndNew","width=580,height=550,toolbar=0,location=0,menubar=0,directories=0,scrollbars=0,resizable=0,status=0");
		    return false;
	    });
    });*/
    $('div#portfolio').innerfade({
        speed: 1000,
        timeout: 6000,
        type: 'sequence'
    });
    $('div#portfolio1').innerfade({
        speed: 1000,
        timeout: 8000,
        type: 'sequence'
    });
    $('div#portfolio2').innerfade({
        speed: 1000,
        timeout: 10000,
        type: 'sequence'
    });
    $('div#portfolio3').innerfade({
        speed: 2000,
        timeout: 14000,
        type: 'sequence'
    });
    $('div#text-under').innerfade({
        speed: 2000,
        timeout: 14000,
        type: 'sequence'
        
    });
    $('div.block1').innerfade({
        speed: 3000,
        timeout: 7000,
        type: 'sequence'
    });
    if($("#time_change").length > 0){
        img_id = 2;
        $(this).everyTime(5000, "hide", function() {
            if(img_id == 1){
                img_id = 2;
                $("#time_change div a img").fadeOut( 500, function() {
                    $("#time_change a div span").text("Peter Qvortrup Geisling");
                    $("#time_change div a img").attr("src", "/files/images/plugin_banners/PQG2.png");
                    $("#time_change div a img").attr("onclick", "window.location='/forside/om_hjertekar-sygdomme/pqg/'");
                    $("#time_change div a").attr("href", "/forside/om_hjertekar-sygdomme/pqg/");
                    $("#time_change a").attr("href", "/forside/om_hjertekar-sygdomme/pqg/");
                });
                $("#time_change div a img").fadeIn( 500, function() {});
            } else {
                img_id = 1;
                $("#time_change div a img").fadeOut( 500, function() {
                    $("#time_change a div span").text("Hør Dortes historie");
                    $("#time_change div a img").attr("src", "/files/images/plugin_banners/dortes.jpg?v=1");
                    $("#time_change div a img").attr("onclick", "window.location='/forside/om_hjertekarsygdomme/dortes-historie/'");
                    $("#time_change div a").attr("href", "/forside/om_hjertekarsygdomme/dortes-historie/");
                    $("#time_change a").attr("href", "/forside/om_hjertekarsygdomme/dortes-historie/");
                });
                $("#time_change div a img").fadeIn( 500, function() {});
            }
        });
    }
    if($("#time_change2").length > 0){
        img_id2 = 2;
        $(this).everyTime(5000, "hide", function() {
            if(img_id2 == 1){
                img_id2 = 2;
                $("#time_change2 div a img").fadeOut( 500, function() {
                    $("#time_change2 a div span").text("Det siger kvinder om hjertekarsygdomme");
                    $("#time_change2 div a img").attr("src", "/files/images/plugin_banners/some_pic2.jpg");
                    $("#time_change2 div a img").attr("onclick", "window.location='/forside/om_hjertekarsygdomme/kvinders-viden/'");
                    $("#time_change2 div a").attr("href", "/forside/om_hjertekarsygdomme/kvinders-viden/");

                    $("#time_change2 a").attr("href", "/forside/om_hjertekarsygdomme/kvinders-viden/");
                });                    $("#time_change2 div a img", "#time_change2 div a", "#time_change2 a").unbind('click').click(function(event) {
                       window.location='/forside/om_hjertekarsygdomme/kvinders-viden/';
		    });
                $("#time_change2 div a img").fadeIn( 500, function() {});
            } else {
                img_id2 = 1;
                $("#time_change2 div a img").fadeOut( 500, function() {
                    $("#time_change2 a div span").text("Alderstesten");
                    $("#time_change2 div a img").attr("src", "/files/images/plugin_banners/test_grafik.gif");
//                   $("#time_change2 div a img").attr("onclick", "event.returnValue = false;window.open('/files/lille/start.htm', 'wndNew','width=580,height=550,toolbar=0,location=0,menubar=0,directories=0,scrollbars=0,resizable=0,status=0');return false;");
                    $("#time_change2 div a").attr("href", "/files/lille/start.htm");
// 		    $("#time_change2 div a").attr("onclick", "event.returnValue = false;window.open('/files/lille/start.htm', 'wndNew','width=580,height=550,toolbar=0,location=0,menubar=0,directories=0,scrollbars=0,resizable=0,status=0');return false;");                    
                    $("#time_change2 a").attr("href", "/files/lille/start.htm");
//		    $("#time_change2 a").attr("onclick", "event.returnValue = false;window.open('/files/lille/start.htm', 'wndNew','width=580,height=550,toolbar=0,location=0,menubar=0,directories=0,scrollbars=0,resizable=0,status=0');return false;");                                        
                
                });    $("#time_change2 div a img", "#time_change2 div a", "#time_change2 a").unbind('click').click(function(event) {
	    	        event.stopPropagation();
	                window.open("/files/lille/start.htm", "wndNew","width=580,height=550,toolbar=0,location=0,menubar=0,directories=0,scrollbars=0,resizable=0,status=0");
			return false;
		    });
                $("#time_change2 div a img").fadeIn( 500, function() {});
            }
        });
    }    

});
