﻿//these scripts must be run immediately
var newWindow = null;

function popUpWin(url, type, strWidth, strHeight){
        closeWin();
        if (type == "fullScreen"){
                strWidth = screen.availWidth - 10;
                strHeight = screen.availHeight - 160;
        }
        var tools="";
        if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=20,left=0, status=1, statusbar=1"; 
        if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+ strHeight+",left=0,top=20, status=1, statusbar=1"; 
        if (type == "noscroll") tools = "toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+ strHeight+",left=0,top=20, status=1, statusbar=1"; 		
        newWindow = window.open(url, 'newWin', tools);
        newWindow.focus();
}
function closeWin(){
        if (newWindow != null){
                if(!newWindow.closed)
                        newWindow.close();
        }
}

//---------------------------------------------------------------------------
// Add-event for elements
//---------------------------------------------------------------------------

function addEvent(elm, evType, fn, useCapture)
{
	if(elm.addEventListener)
	{
		elm.addEventListener(evType, fn, useCapture);
		return true;
	}
	else if (elm.attachEvent)
	{
		var r = elm.attachEvent('on' + evType, fn);
		return r;
	}
	else
	{
		elm['on' + evType] = fn;
	}
}

function initProductAndApply()
{
	hideH3Tags();
}

function hideH3Tags()
{
	var allDivs = document.getElementsByTagName("div");
	
	for(var i = 0; i < allDivs.length;i++)
	{
		if(allDivs[i].className == "optionalArticleContent")
		{
			if(allDivs[i].innerHTML.length < 85)
			{
				allDivs[i].style.display = "none";
			}
		}
	}
}