
//*****Used to get a substring between the two substrings of Pre and Post*****
function getStringInBetween(theString, Pre, Post)
{
	theString = theString + Post;
	var search =  Pre;
	var RetStr = null;
	var offset = 0;
	var end = 0;
	offset = (theString.indexOf(search));
	if (offset != -1) {
		offset += search.length;
		end = theString.indexOf(Post, offset);
		if (end == -1) {
			end = theString.length;
		}
		RetStr = unescape(theString.substring(offset, end));
	}
	if (RetStr == null)
		RetStr = "";
	return (RetStr);
}


function setCookie(name, value, expires, path, domain, secure)
{
// Set the new cookie (without www.)
	thedomain = location.hostname;
	var plats = thedomain.indexOf('.');
	if (plats != -1)
	{
		domain=thedomain.substr(plats);
	}

	document.cookie = name + "=" + escape(value) +
	((expires) ? "; expires=" + expires : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}


function getCookie(Name)
{
	var search = Name + "=";
	var RetStr = null;
	var offset = 0;
	var end = 0;
	offset = (document.cookie.indexOf(search));
	if (offset != -1) {
		offset += search.length;
		end = document.cookie.indexOf(";", offset);
		if (end == -1) {
			end = document.cookie.length;
		}
		RetStr = unescape(document.cookie.substring(offset, end));
	}
	if (RetStr == null)
		RetStr = "";		
	return (RetStr);
}


function SPCheck()
{
	var SPString = navigator.appMinorVersion.toLowerCase();
	return SPString.charAt( SPString.indexOf('sp') + 2 );
}
