function getNewUrl(url) {
	if (window.location.href.toLowerCase().indexOf('php')==-1) {
		newURL = window.location.protocol + "//" + window.location.host + window.location.pathname + url;
	} else {
		pathArray = window.location.pathname.split( '/' );
		newPathname = "";
		for ( i = 0; i<pathArray.length; i++ ) {
			if (pathArray[i].toLowerCase().indexOf('php')==-1) {
				newPathname += pathArray[i]+"/";
			}
		}
		newURL = window.location.protocol + "//" + window.location.host + newPathname + url;
	}
	return newURL;
}

function redirect(url) {
	window.location.href = getNewUrl(url);
}


function openPopup(strPage, width, height) {
	if (!width)
	var width = 700;
	if (!height)
	var height = 600;
	newURL = getNewUrl('popups.php?p='+strPage);
//	if (window.showModalDialog) {
//		window.showModalDialog(newURL,"popup", "dialogWidth:"+width+"px;dialogHeight:"+height+"px");
//	} else {
		window.open(newURL,'popup', 'height='+height+',width='+width+',toolbar=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=no,modal=yes');
//	}
}

function showHide(id)
	{
	var thesection = document.getElementById(id)
	
	if(thesection.style.display=="none")
		thesection.style.display="block";
	else
		thesection.style.display="none";
	}