function initialize()
{
	if (navigator.appName == 'Microsoft Internet Explorer')
	{
		fixPng();
	}
}

function fixPng() {
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	
	if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
	{
		for(var i=0; i<document.images.length; i++)
		{
			var img = document.images[i];
			var imgName = img.src.toUpperCase();
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
			{
				var imgID = (img.id) ? "id='" + img.id + "' " : "";
				var imgClass = (img.className) ? "class='" + img.className + "' " : "";
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
				var imgStyle = "display:inline-block;" + img.style.cssText ;
				if (img.align == "left") imgStyle = "float:left;" + imgStyle;
				if (img.align == "right") imgStyle = "float:right;" + imgStyle;
				if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
				var strNewHTML = "<span " + imgID + imgClass + imgTitle
				+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
				+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				+ "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
				img.outerHTML = strNewHTML;
				i = i-1;
			}
		}
	}
}

function imgWindow(fileName, w, h) {
	window.open('http://posnation.com/graphics/00000001/'+fileName, 'image', 'resizable=1,width='+w+',height='+h+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2);
}

function popupWindow(url, w, h) {
	window.open(url, 'popup', 'resizable=1,width='+w+',height='+h+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2);
}

function bigPopupWindow(url, w, h) {
	window.open(url, 'popup', 'resizable=1,scrollbars=1,width='+w+',height='+h+',left='+(screen.width-w)/2+',top='+(screen.height-h)/2);
}

function addBookmark(title, url) {
  if (window.sidebar) { // firefox
  	window.sidebar.addPanel(title, url, "");
  }
  else if(window.opera && window.print) { // opera
  	var elem = document.createElement('a');
  	elem.setAttribute('href',url);
  	elem.setAttribute('title',title);
  	elem.setAttribute('rel','sidebar');
  	elem.click();
  } 
  else if(document.all) { // ie
  	window.external.AddFavorite(url, title);
  }
}

// Hide or display an element
function toggleDisplay(eid, displayStyle) {
	displayStyle = displayStyle || 'block';
	document.getElementById(eid).style.display =
  	(document.getElementById(eid).style.display == 'none') ? displayStyle : 'none';
}

// Return the width and height of the inside of the browser window
function getWindowDimensions() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {  //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {  //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {  //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ];
}

// Return the horizontal and vertical scroll values
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {  //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {  //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {  //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

// Display an element centered in the browser window
function displayCentered(eid) {
	var theElement = document.getElementById(eid);
	var winDim = getWindowDimensions();
  var scrolls = getScrollXY();
 	theElement.style.left = ((winDim[0] - parseInt(theElement.style.width)) / 2 + scrolls[0]) + 'px';
  theElement.style.top = ((winDim[1] - parseInt(theElement.style.height)) / 2 + scrolls[1]) + 'px';
  theElement.style.display = 'block';
}

// Hitslink tracking script
wa_account="cetinc"; wa_location=213;
wa_pageName=location.pathname;  // you can customize the page name here
document.cookie='__support_check=1';wa_hp='http';
wa_rf=document.referrer;wa_sr=window.location.search;
if(top.window.location==document.referrer
|| (document.referrer == '' && top.window.location != ''))
{wa_rf=top.document.referrer;wa_sr=top.window.location.search}
wa_tz=new Date();if(location.href.substr(0,6).toLowerCase()=='https:')
wa_hp='https';wa_data='&an='+escape(navigator.appName)+ 
'&sr='+escape(wa_sr)+'&ck='+document.cookie.length+
'&rf='+escape(wa_rf)+'&sl='+escape(navigator.systemLanguage)+
'&av='+escape(navigator.appVersion)+'&l='+escape(navigator.language)+
'&pf='+escape(navigator.platform)+'&pg='+escape(wa_pageName);
wa_data=wa_data+'&cd='+
screen.colorDepth+'&rs='+escape(screen.width+ ' x '+screen.height)+
'&tz='+wa_tz.getTimezoneOffset()+'&je='+ navigator.javaEnabled();
wa_img=new Image();wa_img.src=wa_hp+'://counter.hitslink.com/statistics.asp'+
'?v=1&s='+wa_location+'&acct='+wa_account+wa_data+'&tks='+wa_tz.getTime();
document.getElementById('wa_u').src=wa_hp+'://counter.hitslink.com/track.js';
// End hitslink tracking script
