function Popup(myUrl,popType) {
	var winName='flames';
	var winTop=50;
	var winLeft=50;
	var d = new Date();
	var winTime = d.getUTCHours()+'_'+d.getUTCMinutes()+'_'+d.getUTCSeconds();

	switch (popType) {
		case 0:   // new window (store)
	  	pop = window.open(myUrl,winName+winTime,'width=700,height=520,top=' + winTop + ',left=' + winLeft + ',toolbar=yes,scrollbars=yes,resizable=yes,location=yes,menubar=yes,directories=no,status=yes,copyhistory=no');
		break
		case 1:   // technopromo
	  	pop = window.open(myUrl,winName+winTime,'width=915,height=680,top=' + winTop + ',left=' + winLeft + ',toolbar=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,status=yes,copyhistory=no');
		break
		case 2:   // help
	  	pop = window.open(myUrl,winName+winTime,'width=472,height=420,top=' + winTop + ',left=' + winLeft + ',toolbar=no,scrollbars=yes,resizable=yes,location=no,menubar=no,directories=no,status=yes,copyhistory=no');
		break
	}

	pop.focus();

}

/*
 * Quick function to try displaying a flash5 or later animation
 * Returns 1 if flash displayed, or 0 if not (to allow caller to handle)
 */

var vb_flash_check = 0;
function get_flash_version(flash_required)
    {
    flash_version = 0;
    if (navigator.mimeTypes)
	{
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if (plugin)
	    flash_version = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1));
	}

    if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 &&
					navigator.userAgent.indexOf("Win") >= 0)
	{
	document.writeln("<scr" + "ipt language=\"VBScript\"\>");
	document.writeln("on error resume next");
	document.writeln("vb_flash_check = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash."+ flash_required + "\")))");
	document.writeln("</scr" + "ipt>");
	if(vb_flash_check) // Should really check flash version
	    flash_version = flash_required;
	}
    return flash_version;
    }

function flashTry(flash_required) {
    var flash_version = 0;

	  if (parseInt(navigator.appVersion.substring(0,1)) > 2) {
			flash_version = get_flash_version(flash_required);
		}
    if (flash_version >= flash_required) {
			return true;
		} else {
			return false;
		}
}		

function fObject(fID,fFile,fWidth,fHeight) {
	var fHTML = "";
	fHTML+="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\""+fWidth+"\" height=\""+fHeight+"\" id=\""+fID+"\" align=\"middle\">";
	fHTML+="<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	fHTML+="<param name=\"movie\" value=\"prgstore/"+fFile+".swf\" />";
	fHTML+="<param name=\"menu\" value=\"false\" />";
	fHTML+="<param name=\"quality\" value=\"high\" />";
	fHTML+="<param name=\"bgcolor\" value=\"#ffffff\" />";
	fHTML+="<embed src=\"/prgstore/masthead.swf\" menu=\"false\" quality=\"high\" bgcolor=\"#ffffff\" width=\""+fWidth+"\" height=\""+fHeight+"\" name=\""+fID+"\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
	fHTML+="</object>";	
	document.write(fHTML);
}



// checks existence of ID in markup
function checkID(idName) {
	if (document.getElementById(idName)) {
		return true;
	} else {
		return false;
	}
}

// focuses on element
function focusMe(idName) {
	if (checkID(idName)){
		document.getElementById(idName).focus();
	}
}

// submit an element
function submitMe(idName) {
	if (checkID(idName)) {
		document.getElementById(idName).submit();
	}
}

// submit an element
function resetMe(idName) {
	if (checkID(idName)) {
		document.getElementById(idName).reset();
	}
}

// sets the href of a value
function hrefMe(idName,h) {
	if (checkID(idName)) {
		document.getElementById(idName).href=h;
	}
}

// clears an element
function clearMe(t,val) {
	if (t.value==val) {
		t.value = '';
	}
}

// gives INNERHTML to an element
function htmlMe(idName,h) {
	if (checkID(idName)) {
		document.getElementById(idName).innerHTML = h;
	}
}

//gets the value
function getValue(idName) {
 if (checkID(idName)) {
 		return document.getElementById(idName).value;
	}
}

//gets the value
function getHTML(idName) {
 if (checkID(idName)) {
 		return document.getElementById(idName).innerHTML;
	}
}
// gives value to an ID
function valueMe(idName,val) {
	if (checkID(idName)){
		document.getElementById(idName).value=val;
	}
}

// gets the class
function getClassName(idName) {
 if (checkID(idName)) {
 		return document.getElementById(idName).className;
	}
}

// shows a html block
function showMe(idName) {
	if (checkID(idName)) {
		document.getElementById(idName).style.display="block";
	}
}

// shows a html block
function showMe2(idName) {
	if (checkID(idName)) {
		document.getElementById(idName).style.display="inline";
	}
}

// hides a html block
function hideMe(idName) {
	if (checkID(idName)) {
		document.getElementById(idName).style.display="none";
	}
}

// changes a stylesheet class to a specified ID
function changeClass(idName,toClass) {
	if (checkID(idName)) {
		document.getElementById(idName).className=toClass;
	}
}
