function openWin(page, w, h) {
   if (!w) w = 550;
   if (!h) h = 400;
   var newWin = window.open(page, 'newWindow', 'width='+w+',height='+h+',location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes');
   newWin.focus();
   return void(0);
}

function openPrintWin(page, w, h) {
   var strURL = page;
   var strExt = '';
   
   if (strURL.toLowerCase().indexOf('ext=') > 0) {
	   strExt = strURL.substring(strURL.toLowerCase().indexOf('ext='));
	   strURL = strURL.substring(0, strURL.toLowerCase().indexOf('ext='));
	   strExt = strExt.replace(/&/g, '%26');
       strURL = strURL + strExt;
   }
  
   if (!w) w = 550;
   if (!h) h = 400;
   var newWin = window.open(strURL, 'printWindow', 'width='+w+',height='+h+',location=yes,menubar=yes,scrollbars=yes,status=no,toolbar=no,resizable=yes');
   newWin.focus();
   return void(0);
}

function disableLinks() {
	for (var i=0;i<document.links.length;i++) {
		document.links[i].href = '#';
	}
}



/// -- flash functions for frontpages , 15.04.2005

// browser ***************************

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
			&& (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
			&& (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav2 = (is_nav && (is_major == 2));
var is_nav3 = (is_nav && (is_major == 3));
var is_nav4 = (is_nav && (is_major == 4));
var is_nav4up = (is_nav && (is_major >= 4));
var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
					  (agt.indexOf("; nav") != -1)) );
var is_nav6 = (is_nav && (is_major == 5));
var is_nav6up = (is_nav && (is_major >= 5));
var is_gecko = (agt.indexOf('gecko') != -1);


var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie4up  = (is_ie && (is_major >= 4));
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);

var is_opera = (agt.indexOf("opera") != -1);
var is_opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
var is_opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
var is_opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
var is_opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
var is_opera5up = (is_opera && !is_opera2 && !is_opera3 && !is_opera4);

var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);


// required flash version
var requiredVersion = 6;
<!--
var maxVersion = 14;
var actualVersion = 0;
var v_flashInstalled = false;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
jsVersion = 1.1;



for (var x = 2; x <= maxVersion; x++)
{
	eval("var flash" + x + "Installed = false")
}

if (isIE && isWin)
{
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    for (var y = 2; y <= maxVersion; y++)
    {
        eval(document.write('flash'+y+'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+y+'"))) \n'));
    }
    document.write('</SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
}

function detectFlash()
{
    if (navigator.plugins)
    {
        if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]){
            var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
            var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
            var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
            for (var z = 2; z <= maxVersion; z++){
                eval("flash" + z + "Installed = flashVersion == " + z)
            }
        }
    }

    for (var i = 2; i <= maxVersion; i++)
    {
        if (eval("flash" + i + "Installed") == true)
        {
        	actualVersion = i;
        }
    }
    if (actualVersion >= requiredVersion)
    {
        v_flashInstalled = true;
    }
    else 
    {
        v_flashInstalled = false;
    }
}



function writeOutMainBranding(sFlashFile, sPicture, sLink, sLinkEncoded, version, width, height, colspan)
{
	detectFlash();

	if (actualVersion < version || !sFlashFile || is_mac || (!is_ie5up && !is_gecko) )
	{
//			document.write('<a href="'+sLink+'"><img width="'+width+'" height="'+height+'" src="'+sPicture+'" border="0"></a>');
//       	document.write('<a href="'+sLink+'"><img src="'+sPicture+'" border="0"></a>');

//		document.write ('<td colspan="'+ colspan + '" valign="top" style="height: ' + height + 'px; background-image: url(' + sPicture + '); background-repeat: no-repeat;" background="' + sPicture + '">');
//		document.write ('<img src="/inc/images/t.gif" width="1" height="1"></td>');

document.write ('<div id="mainImage"><p><img src="' + sPicture + '" width="955" height="191" alt=""></p></div>');

    }
    else
    {
//		sFlashFile = sFlashFile + "?clickTag=" + sLinkEncoded;

		document.write('<td bgcolor="#ffffff" colspan="' + colspan + '" valign="top" style="height: ' + height + 'px;">');
//		<img src="/inc/images/t.gif" width="1" height="1">
//        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" name="mainbrand" width="'+width+'" height="'+height+'" id="mainbrand"><param name="movie" value="'+sFlashFile+'"><param name="quality" value="high"><param name="menu" value="false"><param name="BGCOLOR" value="#6699ff"><param name=wmode value=transparent><embed src="'+sFlashFile+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="mainbrand" menu="false" bgcolor="#6699ff" wmode="transparent"></embed></object>');
        document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" name="mainbrand" width="'+width+'" height="'+height+'" id="mainbrand"><param name="movie" value="'+sFlashFile+'"><param name="quality" value="high"><param name="menu" value="false"><param name="BGCOLOR" value="#ffffff"><param name=wmode value=transparent><embed src="'+sFlashFile+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="mainbrand" menu="false" bgcolor="#ffffff" wmode="transparent"></embed></object>');
		document.write('</td>');
	}
}



// Google Analytics - Custom measurement functions
// (c) Satama Interactive 2007
// 2007-1-26

// Global variables:
var _uacct = "UA-1338644-1"; //Google Analytics account number
var urchinDownloadExtensions="pdf,zip,rar,gzip,bz2,exe"; // Download extensions in a comma separated list
var urchinDynamicDownloadPaths=""; // Dynamic download paths (example "download.php")
/* Fill in the domain name if measuring subdomains to same account. 
If several domains for same account is necessary, consult the manual */
var urchinDomain="upmraflatac.com";
var urchinCampaign = 0; // Set this value 1 if campaign tracking is used
// Define variable names for campaign URL query string (see documentation for details)
// These three variables need to be defined
var urchinCampaignName="camp";
var urchinCampaignSource="adver";
var urchinCampaignMedium="type";
// Leave the next two values blank if they are not used 
var urchinCampaignTerm="kwd";
var urchinCampaignVersion="version"; 

// Functions start here, no need to edit below this line
var uTarget=""; // Target page, always empty by default

function urchinLockTarget(evt){
	if (evt.preventDefault&&evt.target.href){
		evt.preventDefault();
		uTarget=evt.target.href;
	}
}

function urchinUnlockTarget(evt){
	if (uTarget.length>0){
		window.location=uTarget;
		uTarget="";
	}
}

function urchinEvent(evt,tag){
	var e=evt.target||evt.srcElement;
	while (e.tagName&&(e.tagName!=tag)){
		e=e.parentElement||e.parentNode;
	}
	return e;
}

function urchinEventBind(elem,event,func){
	if ((typeof(window[func])=="function")&&elem){
		if (elem.addEventListener){
			elem.addEventListener(event, window[func], true);
		}
		else if(elem.attachEvent){
			elem.attachEvent("on"+event, window[func]);
		}
	}
}

function urchinTrackFrame(win) {
	urchinEventBind(win.document.body, "click", "urchinLinkTrack");
	urchinEventBind(win.document.body, "click", "urchinFormButton");
	urchinEventBind(win.document.body, "mousedown", "urchinRightClick");
	for (var i = 0; i < win.frames.length; i++) {
		urchinTrackFrame(win.frames[i]);
	}	
}

function urchinTrackFrames() {
	for (var i = 0; i < window.frames.length; i++) {
		urchinTrackFrame(window.frames[i]);
	}	
}

function urchinEventTrack() {
	urchinEventBind(window.document.body, "click", "urchinLinkTrack");
  urchinEventBind(window.document.body, "click", "urchinFormButton");
	urchinEventBind(window.document.body, "mousedown", "urchinRightClick");
	//urchinEventBind(window, "load", "urchinTrackFrames");
}

function urchinRightClick(evt){
	evt=evt||(window.event||"");
	var urchinPageName = "";
	if (evt){
		var btn=evt.which||evt.button;
		if (btn!=1){
			var e=evt.target||evt.srcElement;
			if (urchinCheckProtocol(e)){
				var types=urchinDownloadExtensions;
				if (types.indexOf(e.pathname.substring(e.pathname.lastIndexOf(".")+1,e.pathname.length))!=-1){
					var urchinDownloadPathName=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
					urchinPageName = "/Download" + urchinDownloadPathName;
				}
			}
			// Offsite links
			if(urchinPageName == "")
			{
				if (e.hostname&&!urchinInternalDomain(e.hostname)){
					if (e.protocol&&(e.protocol != "javascript:")) {
						var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
						urchinPageName="/Offsite RightClick/" + e.hostname;
					}
				}
			}
			if(urchinPageName != "") {
				urchinTracker(urchinPageName);
				urchinPageName="";
			}
		}
	}
}

// SATAMA modifications
// Code section for Track form button clicks.
function urchinFormButton(evt){
	evt=evt||(window.event||"");
	if (evt){
		var e=urchinEvent(evt,"INPUT");
		var type=e.type||"";
		if (type&&((type=="submit")||(type=="image"))||((type=="text")&&((evt.which||evt.keyCode)==13))){
			// Use e.form.action if necessary
			urchinPageName = e.form.id;
			urchinTracker("/Form/" + urchinPageName);
			urchinPageName="";
		}
	}
}

function urchinGetContents(e) {
	if (e.nodeType == 3) return e.nodeValue;
	var contents = new Array();
	var i=0;
	while(e.childNodes[i]) {
		contents[contents.length] = urchinGetContents(e.childNodes[i]);
     	i++;
	}
	return contents.join("");
}

function urchinInternalDomain(hostName){
		var Domains=urchinDomain;
    var allDomains=Domains.split(',');
    for (var i=0;i<allDomains.length;i++){
		if (hostName.indexOf(allDomains[i])!=-1){
		       return 1;
		}
    }
    return 0;
}

function urchinCheckProtocol(e){
	return (e.href&&e.protocol&&(e.protocol.indexOf("http")!=-1))?true:false;
}

function urchinLinkTrack(evt){
	var doUrchinLinkTrack = 0;
	var doUrchinMailTrack = 0;
	evt=evt||(window.event||"");
	if (evt){
		var e=urchinEvent(evt,"A");
		
		// Email links
		if (doUrchinLinkTrack == 0) {
			if (e.protocol=="mailto:"){
				//_udl.hostname="";
				urchinPageName="/Email/"+e.href.substring(7)+".email";
				doUrchinLinkTrack = 1;
				doUrchinMailTrack = 1;			
			}
		}
		
		// Static and dynamic download links
		if (doUrchinLinkTrack == 0) {
			if (e.pathname) {
				var doDownloadTrack = false;
				// Check for static download extensions			
				var types=urchinDownloadExtensions;
				doDownloadTrack = (types.indexOf(e.pathname.substring(e.pathname.lastIndexOf(".")+1,e.pathname.length)) >= 0);
				if (!doDownloadTrack) {
					// Check for dynamic download paths
		   			var DLPaths = urchinDynamicDownloadPaths.split(',');
	   				for (var i = 0; i < DLPaths.length; i++) {
		   				if (DLPaths[i].length > 0) {
							if (e.pathname.indexOf(DLPaths[i]) != -1) {
								doDownloadTrack = true;
								break;
							}
						}
					}
				}
				// Request download tracking if necessary
				if (doDownloadTrack) {
					var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
					
          urchinPageName="/Download" + path;
					doUrchinLinkTrack = 1;			
				} 
			}
		}

		// Offsite links
		if (doUrchinLinkTrack == 0) {
			if (e.hostname&&!urchinInternalDomain(e.hostname)){
				if (e.protocol&&(e.protocol != "javascript:")) {
					var path=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
					
					urchinPageName="/Offsite/" + e.hostname;
					doUrchinLinkTrack = 1;
				}
			}
		}
				
		// Send hit if requested
		if (doUrchinLinkTrack != 0) {
			var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
			if(doUrchinMailTrack != 0) {
				urchinTracker(urchinPageName);
				urchinPageName="";
			} else {
				urchinLockTarget(evt);
				urchinTracker(urchinPageName);
				urchinUnlockTarget();
				urchinPageName="";
			}
		}
	}
}

function urchinFunc(func){
	if (typeof(window[func])=="function"){
		window[func]();
	}
}
function urchinRun(urchinPageName,urchinContentGroup) {
	if(urchinDomain != "") {
		var _udn=urchinDomain;
	}
	if(urchinCampaign != 0)
	{
		var _uccn=urchinCampaignName;
		var _ucsr=urchinCampaignSource;;
		var _ucmd=urchinCampaignMedium;
		var _uctr=urchinCampaignTerm;
		var _ucct=urchinCampaignVersion;
	}
	
	if(urchinContentGroup&&urchinContentGroup != "") {
		__utmSetVar(urchinContentGroup);
	} else {
		__utmSetVar("No Group");
	}
	if(urchinPageName != "") {
		urchinTracker(urchinPageName);
	} else {
		urchinTracker();
	}
	urchinEventTrack();
}
