function addEvent( obj, evType, fn ) {
  if ( obj.addEventListener ) {
    obj.addEventListener(evType, fn, true);
    return true;
  } else if ( obj.attachEvent ) {
    var r = obj.attachEvent( "on"+evType, fn );
    return r;
  } else {
    return false;
  }
}

function getElementsByClass( searchClass, node, tag ) {
	var classElements = new Array();
	if ( node == null ) node = document;
	if ( tag == null ) tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;<br />
		}
	}
	return classElements;
}

function getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function getRandom( minNum , maxNum )
{
  if (Math.random && Math.round)
  {
    var ranNum = Math.round( Math.random() * ( parseFloat(maxNum) - parseFloat(minNum) ) );
    ranNum += minNum;
    return ranNum;
  }
  else
  {
  today= new Date();
  hours= today.getHours();
  mins=   today.getMinutes();
  secn=  today.getSeconds();
  if (hours==19) hours=18;
  var ranNum= (((hours+1)*(mins+1)*secn)%(parseFloat(maxNum) - parseFloat(minNum)))+parseFloat(minNum);
  return ranNum;
  }
}




