function Dialog(what) {
	var URL = "";
	var pos;

	if (document.execCommand) {
		if (what == "SaveAs") {
			document.execCommand(what,null);
		} else if (what == "Print") {
			window.print();
		} else if (what == "Email") {
			URL = location.href;
			pos = URL.indexOf("enlargedview");

			if (pos > 0) {
				URL += "&f=e"
			}

			window.location.href = "mailto:?SUBJECT=Rock Miracle Products You Might Want to See&BODY=" + escape(URL);
		}
	} else {
		alert('Feature available only in Internet Exlorer 4.0 and later.');
	}
}

function openwin(url, winname, width, height, scrollable)
{

	var left = Math.floor( (screen.width - width) / 2);
	var top = Math.floor( (screen.height - height) / 2);
	var winParams = "top=" + top + ",left=" + left + ",height=" + height + ",width=" + width;
	var newwin = window.open(url,winname,"scrollbars="+scrollable+",menubar=no,resizable=no,toolbar=no,location=no,status=no,"+winParams); 

	if (window.focus) {
		newwin.focus();
	}
	
}

function loadparent(url, closeSelf)
{
	self.opener.location = url;
	if (closeSelf)
		self.close();
}

function btnSearch_Click()
{

	document.frmSearch.submit();
	return false;

}

function UCase(object)
{
	object.value = object.value.toUpperCase();
}

function LCase(object)
{
	object.value = object.value.toLowerCase();
	
}

function submitenter (myfield,e)
{
	var keycode;

	if (window.event)
		keycode = window.event.keyCode;

	else
	{
		if (e)
			keycode = e.which;
		else
			return true;
	}

	if (keycode == 13)
	{
		myfield.form.submit();
		return false;
	}
	else
		return true;

}

function embedVideo (videoFile)
{
	document.write ('<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="320"HEIGHT="256" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
	document.write ('<PARAM name="SRC" VALUE="' + videoFile + '">\n');
	document.write ('<PARAM name="AUTOPLAY" VALUE="true">\n');
	document.write ('<PARAM name="CONTROLLER" VALUE="true">\n');
	document.write ('<EMBED SRC="demo/demo1.mpg" WIDTH="320" HEIGHT="256" AUTOPLAY="true" CONTROLLER="true" PLUGINSPAGE="http://www.apple.com/quicktime/download/">\n');
	document.write ('</EMBED></OBJECT>\n');

}
