function Crest(Identifier, Location, cond1, cond2, cond3, cond4, cond5, maxConds, CookieName, CookieExpiration, FunctionName)
	{
		this.Identifier = Identifier;
		this.Location = Location;
		this.cond1 = cond1;
		this.cond2 = cond2;
		this.cond3 = cond3;
		this.cond4 = cond4;
		this.cond5 = cond5;
		this.maxConds = maxConds;
		this.CookieName = CookieName;
		this.CookieExpiration = CookieExpiration;
		this.FunctionName = FunctionName;
	}


function DoCrest( crestIndex ) {
	var ok = false;
	var ckName	= Crests[crestIndex].CookieName;

	if (ckName == null)	ok = true;
	if ( ckName != null && (getCookie(ckName) == null || getCookie(ckName) == false) ) {		
		ok = true;
		var ckExp	= Crests[crestIndex].CookieExpiration;
		var exp		= new Date();
		var exp2	= exp.getTime() + (ckExp * 1000 * 60 * 60);
		exp.setTime(exp2);
		setCookie ( ckName, 'ok', exp, '/', '.docguide.com', null);
	}
	if (ok) {
		eval(Crests[crestIndex].FunctionName);
		document.write("<br><br>");
	}
}


function ProcessCrests(crestLocation) {
	for( x = 0 ; x < Crests.length ; x ++ ) {
		var maxConditions = Crests[x].maxConds;	
		if ( Crests[x].Location == crestLocation )
			eval ( "ShowCrest" + maxConditions + "(" + x + ")")
	}	
	return false;
}

function ShowCrest0(crestIndex) {
	return DoCrest(crestIndex);	
}
function ShowCrest1(crestIndex) {
	if (eval(Crests[crestIndex].cond1)) {
		return DoCrest(crestIndex);	
	} else {		
		return false;
	} 
}
function ShowCrest2(crestIndex) {
	if (eval(Crests[crestIndex].cond1)) {
	if (eval(Crests[crestIndex].cond2)) {
		return DoCrest(crestIndex);			
	}} 
	return false;  
}
function ShowCrest3(crestIndex) {
	if (eval(Crests[crestIndex].cond1)) {	
	if (eval(Crests[crestIndex].cond2)) {	
	if (eval(Crests[crestIndex].cond3)) {
		return DoCrest(crestIndex);			
	}}}
	return false;  
}
function ShowCrest4(crestIndex) {
	if (eval(Crests[crestIndex].cond1)) {	
	if (eval(Crests[crestIndex].cond2)) {	
	if (eval(Crests[crestIndex].cond3)) {
	if (eval(Crests[crestIndex].cond4)) {
		return DoCrest(crestIndex);			
	}}}}
	return false;  
}
function ShowCrest5(crestIndex) {
	if (eval(Crests[crestIndex].cond1)) {	
	if (eval(Crests[crestIndex].cond2)) {	
	if (eval(Crests[crestIndex].cond3)) {
	if (eval(Crests[crestIndex].cond4)) {
	if (eval(Crests[crestIndex].cond5)) {
		return DoCrest(crestIndex);			
	}}}}}
	return false;  
}


