﻿// JScript File
//open popup
function OpenPopup(url, width, height, scrollbars, resizable) {
	if (window.pageTracker)
		pageTracker._trackPageview(url);

	var width = width;
	var height = height;
	var left = (screen.width - width) / 2;
	var top = (screen.height - height) / 2;
	var params = 'width=' + width + ', height=' + height;
	params += ', top=' + top + ', left=' + left;
	params += ', directories=no';
	params += ', location=no';
	params += ', menubar=no';
	params += ', resizable='+ resizable;
	params += ', scrollbars=' + scrollbars;
	params += ', status=no';
	params += ', toolbar=no';
	newwin = window.open(url, 'windowname5', params);
	if (window.focus) { newwin.focus() }
	return false;
}


//embed flash object in way that it works without activation
function embedFlash(name, width, height) {
    document.write('<object type=\"application/x-shockwave-flash\" data=\"' + name + '\"' +
	'								 width=\"' + width + '\" height=\"' + height + '\">' +
	'									<param name=\"movie\" value=\"' + name + '\" />' +
	'									<param name=\"quality\" value=\"high\"/>' +
	'									<param name=\"scale\" value=\"exactfit\"/>' +
	'								</object>');

}


function ResizeWindow(w, h) {
    if (parseInt(navigator.appVersion) > 3) {
        if (navigator.appName == "Netscape") {
            top.outerWidth = w;
            top.outerHeight = h;
        }
        else top.resizeTo(w, h);
    }
   }
 function getSilverlightVersion() {
   	var version = '';
   	var container = null;

   	try {
   		var control = null;
   		if (window.ActiveXObject) {
   			control = new ActiveXObject('AgControl.AgControl');
   		}
   		else {
   			if (navigator.plugins['Silverlight Plug-In']) {
   				container = document.createElement('div');
   				document.body.appendChild(container);
   				container.innerHTML = '<embed type="application/x-silverlight" src="data:," />';
   				control = container.childNodes[0];
   			}
   		}
   		if (control) {
   			if (control.isVersionSupported('4.0')) { version = 'Silverlight/4.0'; }
   			else if (control.isVersionSupported('3.0')) { version = 'Silverlight/3.0'; }
   			else if (control.isVersionSupported('2.0')) { version = 'Silverlight/2.0'; }
   			else if (control.isVersionSupported('1.0')) { version = 'Silverlight/1.0'; }
   		}
   	}
   	catch (e) { }

   	if (container) {
   		document.body.removeChild(container);
   	}
   	return version;
   }
  
 function trackClick(url) {
 	if (window.pageTracker)
 		pageTracker._trackPageview(url);
 }
