


//common javascript code
function BookmarkPage(pageName, url)
{
 if (window.sidebar) { // Mozilla Firefox Bookmark
 window.sidebar.addPanel(pageName, url, '');
 } else if( window.external ) { // IE Favorite
 window.external.AddFavorite(url, pageName); }
 else if(window.opera && window.print) { // Opera Hotlist
 return true; }
 else {
 alert("Sorry! Your browser doesn't support this function.");
 }
}

//set selected news item on rotator
function selectNewsItem(index) {
	//display selected image
	SLIDES.goto_slide(index);
	SLIDES.pause();
}

//plays or pauses the rotator
function playPauseToggle() {
	if (SLIDES.timeoutid == 0) {
		SLIDES.play();
	}
	else {
		SLIDES.pause();
	}
}

//show next news item on rotator
function selectNextNewsItem() {
	SLIDES.next();
	SLIDES.pause();
}

//show previous news item on rotator
function selectPrevNewsItem() {
	SLIDES.previous();
	SLIDES.pause();
}

//unselect other tabs except for the one specified by the index
function selectTab(elementid, index)
{
	var i = 0;
	var listItem = document.getElementById(elementid + i);
	
	while (listItem != null)
	{
		listItem.setAttribute("class", "");
		listItem.setAttribute("className", "");			//IE specific
		i++;
		listItem = document.getElementById(elementid + i);
	}
	
	listItem = document.getElementById(elementid + index);
	listItem.setAttribute("class", "selected");
	listItem.setAttribute("className", "selected");	
}

function run()
{
}

function popUpWindow(page, window_name, window_width, window_height, window_features) {
	window_features = window_features + ", width="+window_width+", height="+window_height;
	//document.CtrlWindow.close;
	OpenWin = window.open(page, window_name, window_features);
}

function printPopUp(page)
{
    popUpWindow(page, 'Print', 700, 600, 'toolbar=yes,menubar=yes,location=no,scrollbars=yes,resizable=yes');
}

function imageViewer(image, id, type)
{
    popUpWindow('/imageviewer.aspx?id='+id+'&image='+image+'&type='+type, 'Image', 730, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function articleImageViewer(image, id, type)
{
    popUpWindow('/Article/imageviewer.aspx?id='+id+'&image='+image+'&type='+type, 'Image', 1000, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function newsImageViewer(image, id, type)
{
    popUpWindow('/News/imageviewer.aspx?id='+id+'&image='+image+'&type='+type, 'Image', 1000, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function productImageViewer(image, id, type)
{
    popUpWindow('/Products/imageviewer.aspx?id='+id+'&image='+image+'&type='+type, 'Image', 1000, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function photoGalleryImageViewer(image, id, type) {
    popUpWindow('/PhotoGallery/imageviewer.aspx?id=' + id + '&image=' + image + '&type=' + type, 'Image', 1000, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function blogPostImageViewer(image, id, title) {
    popUpWindow('/Blog/imageviewer.aspx?id=' + id + '&image=' + image + '&title=' + title, 'Image', 1000, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

function channelImageViewer(image, id, type, channel)
{
    popUpWindow('/Channel/imageviewer.aspx?id='+id+'&image='+image+'&type='+type+'&channel='+channel, 'Image', 1000, 680, 'toolbar=no,menubar=no,location=no,scrollbars=no,resizable=no');
}

/*************************************************************************
  This code is from Dynamic Web Coding at www.dyn-web.com
  Copyright 2001-4 by Sharon Paine 
  See Terms of Use at www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
function initScrollLayer() {
// Channel Tabs
  // arguments: id of layer containing scrolling layers (clipped layer), id of layer to scroll, 
  // if horizontal scrolling, id of element containing scrolling content (table?)
  var wndo1 = new dw_scrollObj('wn1', 'lyr1', 't1');
  // pass id('s) of scroll area(s) if inside table(s)
  dw_scrollObj.GeckoTableBugFix('wn1'); 
// Channel Box
  var wndo2 = new dw_scrollObj('wn2', 'lyr2', 'imgTbl');
  dw_scrollObj.GeckoTableBugFix('wn2'); 
}
