﻿// JScript File

function AlternateItem(obj, bg, txt){
    obj.innerHTML = txt;
    try{
        if (bg.length > 0)
            obj.style.background = "url(\"" + bg + "\") repeat-x";
        else
            obj.style.background = "inherit";
        
    }
    catch (ex){
        return false;
    }
}

function GotoUrl(href, target_win) {
	try {
		if (target_win) {
			target_win.location = href;
		}
		else {
			window.location = href;
		}
	}
	catch (ex) {
		return false;
	}
}

function ReloadWindow(target_win) {
	try {
		if (target_win) {
			target_win.location.reload();
		}
		else {
			window.location.reload();
		}
	} 
	catch (ex) {
		return false;
	}
}

function PreviewWorkfile(image, title, summary){
    try{
        var _image = document.getElementById("workfile_image");
        _image.innerHTML = "<img src=\"" + image + "\" height=\"120\" width=\"160\"/>";
        var _summary = document.getElementById("workfile_summary");
        _summary.innerHTML = "<div class=\"mainpage_content_title\">" + title + "</div><div class=\"mainpage_content_summary\">" + summary + "</div>";
    }
    catch (ex) {
        return false;
    }
}