function combine(){
var delimiter, numArgs, combination, i;
combination="";
delimiter="|";
numArgs=combine.arguments.length;
if (numArgs>1) {
    for (i=0; i<numArgs; i++) {
	combination=combination+combine.arguments[i]+delimiter;
    }
}

return combination.substring(0, combination.length-1);
}

function breakdown(combination){
var delimiter, start, end, count;
broken=new Object();
delimiter="|";
start=end=0;
count=1;
end=combination.indexOf(delimiter,end)
while ((end) && (end>-1)){
    broken[count]=combination.substring(start,end);
    count++;
    start=end+1;  
    end=combination.indexOf(delimiter,start) 
}
broken[count]=combination.substring(start,combination.length);
broken[0]=count+1;
return broken;
}

function ReadCookie(name){
var allCookie, CookieVal, length,start,end;
cookieVal="";
name=name+"=";  //append equals to avoid false matches.
allCookie=document.cookie;
length=allCookie.length;
if (length>0) {//no cookies - user is probably incinerating cookies.
    start=allCookie.indexOf(name,0)
    if (start!=-1) {//if string appeared - otherwise cookie wasn't set.
	start+=name.length;
	end=allCookie.indexOf(";",start);
	if (end==-1) {end=length;}
	cookieVal=unescape(allCookie.substring(start,end));
    }
}
return(cookieVal);
}

function WriteCookie(name,value,expires,domain,path,secure){
var CookieVal,CookError;
CookieVal=CookError="";
if (name) {
CookieVal=CookieVal+escape(name)+"=";
    if (value) {
    CookieVal=CookieVal+escape(value);
	if (expires) {
	CookieVal=CookieVal+"; expires="+expires.toGMTString();
	}
	if (domain){
	CookieVal=CookieVal+"; domain="+domain;
	}
	if (path) {
	CookieVal=CookieVal+"; path="+path;
	}
	if (secure) {
	CookieVal=CookieVal+"; secure";
	}
    }
    else {CookError=CookError+"Value failure";}//need valid value
}
else {CookError=CookError+"Name failure";}//need valid name
if (!CookError) {
    document.cookie=CookieVal;//sets cookie
    if (value != ReadCookie(name)) //checks to make sure it worked
	{CookError="Write failure";}
    
}
return CookError;
}
