// HARDCODED GLOBALS
_ARK_HOVER_COLOR = "#DCC18C";
_ARK_COLD_COLOR1 = "#EEEEEE";

_ARK_TEASER_HOVER_COLOR = "#999999";
_ARK_TEASER_COLD_COLOR = "#000000";
_ARK_TEASER_TEXT_COLD_COLOR = "#999999";
_ARK_TEASER_TEXT_HOT_COLOR = "#000000";

function ark_preload_img(imgpath){
	pic= new Image(); 
	pic.src=imgpath;
}


// Husserie UI
	// mouse in
	function onHusserieMouseIn(evObj){
		$(this).css("background-color", _ARK_HOVER_COLOR);
		//$(this).children(".views-field-title span a").css("background-color", _ARK_HOVER_COLOR);
	}
	
	// mouse out
	function onHusserieMouseOut(evObj){
		$(this).css("background-color", _ARK_COLD_COLOR1);
		//$(this).children(".views-field-title span a").css("background-color", _ARK_COLD_COLOR1);
	}

	
// Hustyper UI
	// mouse in
	function onHustypMouseIn(evObj){
		$(this).css("background-color", _ARK_HOVER_COLOR);
	}
	
	// mouse out
	function onHustypMouseOut(evObj){
		$(this).css("background-color", _ARK_COLD_COLOR1);
	}
	
// Hustyper UI
	// mouse in
	function onTeaserMouseIn(evObj){
		$(this).children(".views-field-title").css("background-color", _ARK_TEASER_HOVER_COLOR);
		$(this).children(".views-field-teaser").css("color", _ARK_TEASER_TEXT_HOT_COLOR);
		$(this).children("img").css("opacity", "0.5");
		$(this).children("img").css("-moz-opacity", "0.5");
	}
	
	// mouse out
	function onTeaserMouseOut(evObj){
		$(this).children(".views-field-title").css("background-color", _ARK_TEASER_COLD_COLOR);
		$(this).children(".views-field-teaser").css("color", _ARK_TEASER_TEXT_COLD_COLOR);
		$(this).children("img").css("opacity", "none");
		$(this).children("img").css("-moz-opacity", "none");
	}
	
	// Skriver ut medskickad sida via iframe 
	// KRÄVER jQuery
	// KRÄVER jQuery.simpleMOdal -> http://www.ericmmartin.com/projects/simplemodal/
	function printHus(printPath, villa){
		var frameName = "printframe";
		var frameID = "#"+frameName;
		var msg=document.createElement('P');
		$(msg).text("Skapar utskrift för "+villa+"...");
		
		$.modal("<h1 style='color:#fff'>Skapar utskrift för "+villa+"...</h1>", {
			opacity:80,
			overlayCss: {backgroundColor:"#000"}
		});

		
		if(!document.getElementById(frameName)){
			var iframe=document.createElement('IFRAME');
			
			$(iframe).attr('style','position:absolute;width:0px;height:0px;left:-500px;top:-500px;');
			//$(iframe).attr('style','width:600px;height:200px');
			$(iframe).attr('id',frameName);
			$(iframe).attr('name',frameName);

			$(iframe).load(function() {
  				//alert("loaded");
				//this.focus();
				//document.getElementById('printframe').print();
				window.frames[frameName].focus();
				window.frames[frameName].print();
				$.modal.close();
				//document.body.removeChild(iframe);
			});
		
			$(iframe).appendTo("body");
		}

		$(frameID).attr('src',printPath);
		//iframe.src = printPath;
	
	}
