function clearBox(box) {
	if(box.value==box.defaultValue) {
		box.value = "";
	}
}

function showhide(objId, show) {
	if(document.getElementById)	{//gecko(NN6, Moz, FF) and IE 5+
		obj = document.getElementById(objId);
		obj.style.visibility = show ? 'visible' : 'hidden';
	} else if(document.all)	{// IE 4
		document.all[objId].style.visibility = show ? "visible" : "hidden";
	}
}

/*
* PHP Serialize
* Morten Amundsen
* mor10am@gmail.com
*/
function php_serialize(obj)
{
    var string = '';
    var count;

    if (typeof(obj) == 'object') {
        if (obj instanceof Array) {
            string = 'a:';
            tmpstring = '';
            count = 0;
            for (var key in obj) {
//            for (var key = 0; key < obj.length; key++) {
                tmpstring += php_serialize(key);
                tmpstring += php_serialize(obj[key]);
                count++;
            }
            string += count + ':{';
            string += tmpstring;
            string += '}';
        } else if (obj instanceof Object) {
            classname = obj.toString();

            if (classname == '[object Object]') {
                classname = 'StdClass';
            }

            string = 'O:' + classname.length + ':"' + classname + '":';
            tmpstring = '';
            count = 0;
            for (var key in obj) {
                tmpstring += php_serialize(key);
                if (obj[key]) {
                    tmpstring += php_serialize(obj[key]);
                } else {
                    tmpstring += php_serialize('');
                }
                count++;
            }
            string += count + ':{' + tmpstring + '}';
        }
    } else if ((typeof(obj) == 'string') && (obj == ''+parseInt(obj))) {
// Number is disguised as a string, we will send it as a number
        if (obj - Math.floor(obj) != 0) {
            string += 'd:' + obj + ';';
        } else {
            string += 'i:' + obj + ';';
        }      
    } else {
        switch (typeof(obj)) {
            case 'number':
                if (obj - Math.floor(obj) != 0) {
                    string += 'd:' + obj + ';';
                } else {
                    string += 'i:' + obj + ';';
                }
                break;
            case 'string':
                string += 's:' + obj.length + ':"' + obj + '";';
                break;
            case 'boolean':
                if (obj) {
                    string += 'b:1;';
                } else {
                    string += 'b:0;';
                }
                break;
        }
    }

    return string;
}