﻿function roll(img,type)
{
		if (type == "on")
			img.src = img.src.replace('_off','_on');
		else if (type == "off")
			img.src = img.src.replace('_on','_off');
}

function openWindow(type,x)
{
    var newwin;
    
    switch(type)
    {
        case "LINK":
            newwin = window.open(x);
            break; 
        case "PDF":
            newwin = window.open("/pdfs/" + x + ".pdf","pdf_download","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,left=150,top=150,alwaysRaised=1");
            break;
        case "UPLOAD":
            newwin = window.open( "upload.aspx?vars=" + x, "upload", "directories=no,location=no,height=300,width=400,top=150,left=50,toolbar=no,menubar=no" );
            break;
        case "FORM_FAQ":
            newwin = window.open("/Admin/tools/forms/faq.aspx?id=" + x + "#" + x, "formFaq", "directories=no,location=no,height=700,width=700,top=150,left=50,toolbar=no,menubar=no,scrollbars=1,resizable=1" );
            break;
    }
    
    newwin.focus();
}

function printPage()
{
    print();
}

function closePage()
{
    window.close();
}

var GetElement;	
function GenerateGetElement()
{
	if (document.getElementById) return function(id) { return document.getElementById(id); }
	else if (document.all) return function(id) { return document.all[id]; }
	else if (document.layers) return function(id) { document.layers[id]; }
}
GetElement = GenerateGetElement();
