
function setCookie (name, value, expires, path, domain, secure) {
      document.cookie = name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
		if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
		offset += search.length;
		end = cookie.indexOf(";", offset)
			if (end == -1) {
			end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
			}
		}
return(setStr);
}
function myurl(a) {
    //var a = location.href;

    if (location.href.search("index.aspx") != -1) {
        //window.location ='http://thelawcollaborative.com';
        window.location = 'http://www.thelawcollaborative.com/';
    }


    else if (location.href.search("index.htm") != -1) {
        //window.location ='http://thelawcollaborative.com';
        window.location = 'http://www.thelawcollaborative.com/';
    }
    else {
        if (a.search('www') == -1) {

            var newurl = ''
            var start, mid, end
            var myCars = a.split('/');
            for (i = 0; i < myCars.length; i++) {
                if (i == 0) {
                    newurl += 'http://www.'
                }
                else if (i == 2) {
                    newurl += 'thelawcollaborative.com'
                }
                else if (i > 2) {
                    newurl += '/' + myCars[i];
                }
            }
            window.location = newurl;
        }
    }
}




