// C IS FOR COOKIE
var Cookie = {
  get: function(name) {
    var name = escape(name) + '='
    if (document.cookie.indexOf(name) >= 0) {
      var cookies = document.cookie.split(/\s*;\s*/)
      for (var i = 0; i < cookies.length; i++) {
        if (cookies[i].indexOf(name) == 0)
          return unescape(cookies[i].substring(name.length, cookies[i].length))
      }
    }
    return null
  },

  set: function(name, value, options) {
    var newcookie = [escape(name) + "=" + escape(value)]
    if (options) {
      if (options.expires) newcookie.push("expires=" + options.expires.toGMTString())
      if (options.path)    newcookie.push("path=" + options.path)
      if (options.domain)  newcookie.push("domain=" + options.domain)
      if (options.secure)  newcookie.push("secure")
    }
    document.cookie = newcookie.join('; ')
  }
}

function explode(separator, string) {

	var list = new Array();

	if (separator == null) return false;
	if (string == null) return false;

	var currentStringPosition = 0;
	while (currentStringPosition<string.length) {
		var nextIndex = string.indexOf(separator, currentStringPosition);
		if (nextIndex == -1) break;
		var word = string.slice(currentStringPosition, nextIndex);
		list.push(word);
		currentStringPosition = nextIndex+1;
	}
	if (list.length<1) {
		list.push(string);
	} else {
		list.push(string.slice(currentStringPosition, string.length));
	}
	return list;
}

function getBrowser() {
    if ( navigator.userAgent.indexOf("Firefox") != -1 ) { sBrowser = 'firefox'; }
    else {
        sAgent        = navigator.userAgent ;
        iPozAgent     = sAgent.search( "MSIE" ) ;
        sVersionAgent = sAgent.substring(25,33) ;
        if ( sVersionAgent == "MSIE 7.0") {
            sBrowser = 'ie7';
        } else {
            sBrowser = 'ie6';
        }
    }

    return ( sBrowser );
}

function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
if (unicode<48||unicode>57) //if not a number
return false //disable key press
}
}