function writeEmail(user,domain){
    document.write(user + "@" + domain);
}

function noSpam(user,domain) {
    locationstring = "mailto:" + user + "@" + domain;
    window.location = locationstring;
}

function createObject(imgName,imgSrc) {
    eval(imgName+' = new Image()');
    eval(imgName+'.src = "'+imgSrc+'"');
    return imgName;
}

function swapImage(targetName,imgName) {
    eval("document.images['"+targetName+"'].src = "+imgName+".src;")
    return imgName;
}

function verify(sMsg) {
    if (confirm(sMsg)) {
        return true;
    } else {
        return false;
    }
}

function skipPage() {
    with (document.forms['skipper']) {
        var iPage = cursor.options[cursor.selectedIndex].value;
    }
    document.forms['skipper'].submit();
}


function spawnEvil(desktopURL,windowName,width,height) {
     window.open(desktopURL,windowName,'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,width='+width+',height='+height+',resizable=1');
}

function openPreview(sFieldName) {
    tempValue = document.forms[0].elements[sFieldName].value;
    
    if (tempValue == '') {
        alert("You need to attach a file first!");
    } else {
        spawnEvil('../_lib/util/upl_preview.php?src=file:/'+tempValue,'preview',400,300);
    }
}


toolTip = {
	name : "tooltip",
	tip : null,
	offsetX : -5,
	offsetY : -25
};

toolTip.init = function(){
	if(!document.getElementById) return;
	this.tip = document.getElementById(this.name);
	document.onmousemove = function(evt){toolTip.move(evt)};
};

toolTip.move = function(evt){
	if(!this.tip) return;
	var x = 0, y = 0;
	if(document.all){
		x = document.body.scrollLeft;
		y = document.body.scrollTop;
		if(document.documentElement && typeof document.documentElement.scrollLeft != "undefined"){
			x = Math.max(x, document.documentElement.scrollLeft);
			y = Math.max(y, document.documentElement.scrollTop);
		}
		x += window.event.clientX;
		y += window.event.clientY;
	}else{
		x = evt.pageX;
		y = evt.pageY;
	}
	this.tip.style.left = (x+this.offsetX)+"px";
	this.tip.style.top = (y+this.offsetY)+"px";
};

toolTip.show = function(text){
	if(!this.tip) return;
	this.tip.innerHTML = text;
	this.tip.style.visibility = "visible";
	this.tip.style.display = "block";
};

toolTip.hide = function(){
	if(!this.tip) return;
	this.tip.style.visibility = "hidden";
	this.tip.style.display = "none";
	this.tip.innerHTML = "";
};