function printLink(strArr,subj) {
	if(subj == null) {subj ='';}
	document.write('<a class="text" href="mailto:&#' + strArr.join(";&#") + ';?subject=' + subj + '" rel="nofollow">&#' + strArr.join(';&#') + '</a>');
}

function image_swap(img_arr,index,place,swap_time) {
	img=new Image();
	img.src=img_arr[index];
	document.getElementById(place).src=img.src;
	index  ;
	if (index>img_arr.length-1) index=0;
	setTimeout("image_swap(new Array('" + img_arr.join("','") + "')," + index + ",'" + place + "'," + swap_time + ");",swap_time);
}

// GET OBJECT BY ID
function GetObject(obj_id) {return document.getElementById(obj_id);}
function GObj(obj_id) {return document.getElementById(obj_id);}
function gO(obj_id) {return document.getElementById(obj_id);}
 
// Show or Hide element
function setVis(element_id,visible) {			// Show or Hide element
	el=document.getElementById(element_id);
	if(visible == null) visible = el.style.display
	el.style.display = (visible == '') ? 'none' : '';
}

function intoVal(value, mode) {
	mode = (mode != null) ? mode : '';
	switch(mode) {
		case "float": {
			value = ((value + '').replace(",",".")).match(/\-*\d+[.]?\d*/);
			if(value == null) return 0;
			 else return parseFloat(value);
			break;
		}
		default: {				// return integer as default
			value = (value + '').match(/\d+/);
			if(value == null) return 0;
			 else return parseInt(value);
			break;
		}
	} 
}

function in_array(the_needle, the_haystack){
	var the_hay = the_haystack.toString();
	if(the_hay == '') {return false;}
	var the_pattern = new RegExp(the_needle, 'g');
	var matched = the_pattern.test(the_haystack);
	return matched;
}
