function isblank(s){//returns true if the element is blank
	for(var i=0; i<s.length; i++){
		var c=s.charAt(i);
		if((c!=' ') && (c!='') && (c!='\n')) return false;
	}
	return true;
}
function get_element(elm){
	if(document.all){
		if(document.all[elm]) var el=document.all[elm];
		else return false;
	}	
	else if(document.getElementById){
		if(document.getElementById(elm)) var el=document.getElementById(elm);
		else return false;
	}
	return el;
}
function preload(url){
	var im = new Image();
	im.src=url;
}
function mtc_loop(){
	setTimeout("fade_in_mtc()",5000);
	setTimeout("fade_out_mtc()",10000);
	setTimeout("mtc_loop()",10000);	
}
var txt_mtc=new Array(); 
function mtc_fade(){
	txt_mtc[0]="Did you know that 1200 children every year are injured as a result of a fire in the UK alone?";
	txt_mtc[1]="It will be soon EU law that all rental properties have basic fire protection.";
	txt_mtc[2]="Carbon Monoxide gas is odourless, colourless and tasteless.";

	txt_mtc[3]="In the UK on average 50 people a year are killed from this invisible gas.";
	txt_mtc[4]="In Spain it is the responsibility of the owner of the property to make sure all gas appliances are in correct working order.";
	txt_mtc[5]="Mijas fire station receives 400 to 500 calls yearly.";
	txt_mtc[6]="Malaga province receives up to 5000 calls yearly.";
	txt_mtc[7]="In some cases insurance companies will refuse a claim if there was not basic fire protection in a rented property.";
	txt_mtc[8]="Holiday rental properties are in one of the highest categories to be at risk from an incident.";
	txt_mtc[9]="Any form of a fuel burning heater is a potential carbon monoxide poisoning risk if you do not have a Co detector.";
	mtc_loop();
}
var mtc_fade_speed=20;
var mtc_current=1;
var mtc_f_step=0;
function fade_in_mtc(){
	mtc_f_step++;
	if(mtc_f_step>25){
		mtc_f_step=25;
		var tx1=get_element("mtc_text_bottom");
		mtc_current++;
		if(mtc_current==txt_mtc.length) mtc_current=0;
		tx1.innerHTML=txt_mtc[mtc_current];
	}
	else{
		var tx2=get_element("mtc_text_top");
		tx2.className="fade_"+mtc_f_step;
		setTimeout("fade_in_mtc()",mtc_fade_speed);
	}
}
function fade_out_mtc(){
	mtc_f_step--;
	if(mtc_f_step<0){
		mtc_f_step=0;
		var tx1=get_element("mtc_text_top");
		mtc_current++;
		if(mtc_current==txt_mtc.length) mtc_current=0;
		tx1.innerHTML=txt_mtc[mtc_current];
	}
	else{
		var tx2=get_element("mtc_text_top");
		tx2.className="fade_"+mtc_f_step;
		setTimeout("fade_out_mtc()",mtc_fade_speed);
	}
}
