function isOdd(num) {
  return (num % 2);
}

function buildHTML(tag, properties, text){
	if (!tag) {tag = '';}
	text = text ? text : false;
	properties = properties ? properties : false;
	
	if (tag != 'img' && text){
		el = properties ? '<'+tag+' '+properties+'>'+text+'</'+tag+'>' : '<'+tag+'>'+text+'</'+tag+'>';
	} else if (tag == 'img' || tag == 'input') {
		el = properties ? '<'+tag+' '+properties+' />' : '<'+tag+' />';
	} else if (text == false) {
		el = properties ? '<'+tag+' '+properties+'> </'+tag+'>' : '<'+tag+'> </'+tag+'>';
	}
	
	return el;
}

function getQueryVariable(variable) {
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");
        if (pair[0] == variable) {return pair[1];}
    }
} 

function twoDigit(num){
	if (num < 10) {
		num = '0' + num.toString();	
	}
	
	return num;
}