// Common Javascript file for SpectrumControl.com

// PrintPage:	Print the current page
// args:		none
function PrintPage() {
	window.print();
}

// SavePage:	Open the SaveAs dialog to save the current page
// args:		none
function SavePage(){
	document.execCommand('SaveAs', null, 'rfq.htm');
}

// SendMessage:	Open a window with the Email Contact form
// args:		pmsid - Unique identifier for the PMS
//				PageName - Name of current page
function SendEmail(pmsid,PageName) {
	var newlocation = "/specmail.asp?cn=" + pmsid + "&pr=" + PageName;
	EmailWindow = window.open(newlocation, "emailwin", "width=550,height=550,top=0,left=0,resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no,directories=no");
	EmailWindow.focus();
}

// popupkey:	Open a window displaying a key to the catalog icons
// args:		none
function popupkey(){
	keywindow = window.open('/catalog/toolbox_key.asp', 'key', 'width=280,height=310,top=20,left=20,resizable=no,scrollbars=no,status=no,toolbar=no,menubar=no,location=no,directories=no');
	keywindow.focus();
}

// ChangeStyle : toggle the mouseover and mouseout styles
function ChangeStyle(obj, newStyle) { 
	obj.className=newStyle; 
} 

//ReviewImage:	Open a new window to display a larger copy of the image
//sImg:			Image File Name
function ReviewImage(sImg){
	ImageWindow = window.open('/picreview.asp?img=' + sImg, "imagewin", "width=400,height=400,top=0,left=0,resizable=yes,scrollbars=no,status=no,toolbar=no,menubar=no,location=no,directories=no");
	ImageWindow.focus();
}