function getBaseURL(link) {

	var url = location.href;  // entire url including querystring - also: window.location.href;
	var baseURL = url.substring(0, url.indexOf('/', 14));


	if (baseURL.indexOf('http://localhost') != -1) {
		// Base Url for localhost
		var url = location.href;  // window.location.href;
		var pathname = location.pathname;  // window.location.pathname;
		var index1 = url.indexOf(pathname);
		var index2 = url.indexOf("/", index1 + 1);
		var baseLocalUrl = url.substr(0, index2);
		
		if(link == 1) {
			window.location = baseLocalUrl + "/";
		} else {
			return baseLocalUrl + "/";
		}
		
	} else {
		
		// Root Url for domain name
		if(link == 1) {
			window.location = baseURL + "/";
		} else {
			return baseURL + "/";
		}
		
	}

}

//---------------------------------
function toggle(id) {
	if(document.getElementById(id).style.display == 'none') {
		document.getElementById(id).style.display = 'block';
	} else {
		document.getElementById(id).style.display = 'none';
	}
}

//---------------------------------
function setCookie(c_name,value,exdays) {

	var exdate=new Date();
	exdate.setDate(exdate.getDate() + exdays);
	var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
	
	document.cookie=c_name + "=" + c_value;
}










