var overaktiv = 0;
var last = "start_news";
window.onresize = theresize;

function check_iphone () {
	if ( navigator.userAgent.match(/iPhone/i) ) {
		iamiphone = true;
	} else {
		iamiphone = false;
	}
}
// /* !bookmark the resize */
function theresize(bwidth,bheight) {
    var ymax=screen.availHeight;
    var xmax=screen.availWidth;

//    self.moveTo(0,0);
//    window.resizeTo(xmax,ymax);
//
	var x,y;
    if (self.innerHeight) // all except Explorer
	{
				x = self.innerWidth;
				y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
				// Explorer 6 Strict Mode
	{
				x = document.documentElement.clientWidth;
				y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
				x = document.body.clientWidth;
				y = document.body.clientHeight;
	}
//
    xyarrays = new Array();
    xyarrays[0] =  x;
    xyarrays[1] =  y;
    xyarrays[2] =  xmax;
    xyarrays[3] =  ymax;

	//    
    // GROESSENSPEZIFISCHE ÄNDERUNGEN
	if (x>1100 && x<=1400) {
		$("#center").css({"width" : "90%"});
	} else if (x>1400 && x<1920 ) {
		$("#center").css({"width" : "80%"});
	} else if (x>=1920) {
		$("#center").css({"width" : "1525px"}); // 1960
	} else if (x<=980) {
		$("#center").css({
			"width":"980px",
			"padding":"0 20px"
		});
	} else {
		$("#center").css({
			"width":"980px"
		});
	}

	// IF IE
	if (ie) {
		var cw = $("#center").width();
		var m = cw % 50;
		$("#center").css({"width": ""+(cw-m) + "px"});
	}
//alert( $("#center").width());

	if (y>=800) {
		$(".showroomlinks li").css({ "height":"auto"});
		$(".showroomlinks li a img").css({ "width": "auto", "height": "auto" });
	}
	if (y<800) {
		$(".showroomlinks li").css({ "height":"12%"});
		$(".showroomlinks li a img").css({ "width": "75%", "height": "80%" });
	}
	if (y<700) {$(".showroomlinks li a img").css({ "width": "60%", "height": "70%" });}
	if (y<600) {$(".showroomlinks li a img").css({"width": "50%","height": "60%" });}


	


   //return xyarrays;
}
//
// /* !bookmark LOAD FLASH */
//
function loadflash(wen, templatepath,fileandid) {
//alert(fileandid);
//alert(templatepath);
/*
if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', '100%',
			'height', '100%',
			'src', fileandid,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', fileandid,
			'bgcolor', '',
			'name', fileandid,
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', wen,
			'salign', '',
			'flashvars', 'templatepath=' + templatepath
			); //end AC code
	}
	*/
}

function loadinto(whom, whereto, highlight) {
/*
	var wt = "#" + whereto;
	var lo = "#loader_" + whereto;
	var w = "#" + highlight;
	$(w).addClass("active");
	$(last).removeClass("active");
	last = w;
//	$(this).addClass("active");
	
	$(wt).hide("fast", function() {
	    $(lo).show('slow', function(){
	    	$(wt).load(whom + "?ajax=ajax", function() {
	    		$(lo).hide('fast',function() {
	    			$(wt).show('slow')
//	    			$("#kommissionrechtespalte").animate({opacity:1},1000);
//	    			oldperson ="0";
//	    			done = 0
	    		});
	    	});
	    });
	});
	*/
}

/*
function doClip(what) {
      $("#rightboxcontent").fadeOut(500, function () {
        $("#rightboxcontent").load("_flv/" + what + ".php", function () {
            $("#rightboxcontent").fadeIn(500);
        })

      });
      return false;
}
function doStuffLeft(what) {
      $("#leftboxcontent").fadeOut(10, function () {
        $("#leftboxcontent").load(what, function () {
            $("#leftboxcontent").fadeIn(500);
        })
      });
      return false;
}
*/
function resetlinks() {
	$(".post p a img").parent().addClass("bildlink");
//	alert(me);
}

function jqll() {
	// JQUERY LAZY LOAD
	$("img").lazyload({
		placeholder : "http://www.digital-noises.com/blog/wp-content/themes/digitalv2/_grfx/floatlogo.png",       
		effect      : "fadeIn"
	});
}

function menuenicer() {
	var first = 1;
	$("#menu .menu li").each(function () {
		if (first!=1)
			$(this).prepend("<li> | </li>");
		first = 0;	
	});
}


jQuery(document).ready(function(){
	jqll();
	theresize();
	resetlinks();
	menuenicer();
	doLoade("a"+loadethis+".jpg",1);
   $().mousemove(function(e){
        var tx =e.pageX-810;
        var ty =e.pageY-120;
//        $('#thepreviewfloater').css({left:tx+"px", top:ty+"px" });
   }); 
   $().mousedown(function(e){
        doLoad(0,0);
   }); 

})
function doLoad(what, onoff) {
	//alert(what);
    if (onoff) {
        $("#wirsindshowroom").css({backgroundImage: "url('./dn_start/bilder/" + what +"')"}); 
    } else {
       // $("#wirsindshowroom").css({display:"none"});
    }
}

function doLoade(what, onoff) {
    if (onoff) {
        $("#erstelltenshowroom").css({backgroundImage: "url('./dn_start/bilder/" + what +"')"}); 
//        $("#backg").css({background: "url('./dn_start/bilder/" + what +"')"}); 

    } else {
        //$("#erstelltenshowroom").css({display:"none"});
    }
}
/*
function loadcontent(wen) {
    if (wen=="bbpress/") {
        $("#content").load(wen + ""); 
    } else {
        $("#content").load(wen + "&ajax=ajax");
    }
    
}
*/


