// JavaScript Document

// Sterling Commerce Lead Tracking Functions

// Get Varibles from URL and put in an array.
var passed = location.search;
passed = (passed)? passed.substring(1):"";
var parts = passed.split('&')
var parms = new Array();
for (var i=0;i<parts.length;i++) {
  var nameValue = parts[i].split('=');
  if (nameValue[0]) parms[nameValue[0]] = unescape(nameValue[1]);
}
	
function getParm(name) {
  return (parms[name])?parms[name]:"";
} 

function getCookie (name) {
    var dcookie = document.cookie; 
    var cname = name + "=";
    var clen = dcookie.length;
    var cbegin = 0;
        while (cbegin < clen) {
        var vbegin = cbegin + cname.length;
            if (dcookie.substring(cbegin, vbegin) == cname) { 
            var vend = dcookie.indexOf (";", vbegin);
                if (vend == -1) vend = clen;
            return unescape(dcookie.substring(vbegin, vend));
            }
        cbegin = dcookie.indexOf(" ", cbegin) + 1;
            if (cbegin == 0) break;
        }
    return null;
    }

function getDomainWithoutSub() {
	var noSubDomainStart = document.location.hostname.indexOf('.');
	if (noSubDomainStart !== -1) {
		var noSubDomain = document.location.hostname.substring(noSubDomainStart, document.location.hostname.length);
	}
	return noSubDomain;
}
function setCookie (name, value, expires) {
	if (!expires) expires = new Date();
	var nsd = getDomainWithoutSub();
  document.cookie = name + "="+escape (value)+"; expires="+expires.toGMTString()+"; path=/; domain="+nsd;
}

function deleteCookie(name, path, domain) {
	if (getCookie(name)) document.cookie = name + "=" + ((path)? ";path=" + path : "") +	((domain)? ";domain=" + domain : "" ) +	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

var unreserved = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.~";
var reserved = "!*'();:@&=+$,/?%#[]";
var allowed = unreserved + reserved;
var hexchars = "0123456789ABCDEFabcdef";

// This function returns a percent sign followed by two hexadecimal digits.
// Input is a decimal value not greater than 255.
function gethex(decimal) {
  return "%" + hexchars.charAt(decimal >> 4) + hexchars.charAt(decimal & 0xF);
}

// Encodes a String to UFT-8
function URLEncode(decoded)
{
  // Clear output field:
  
  // Some variables:
  var decoded;
  var encoded = "";


    for (var i = 0; i < decoded.length; i++ ) {
      var ch = decoded.charAt(i);
      // Check if character is an unreserved character:
      if (unreserved.indexOf(ch) != -1) {
        encoded = encoded + ch;
      } else {

        var charcode = decoded.charCodeAt(i);

        if (charcode < 128) {
          encoded = encoded + gethex(charcode);
        }

        if (charcode > 127 && charcode < 2048) {
          encoded = encoded + gethex((charcode >> 6) | 0xC0);
          encoded = encoded + gethex((charcode & 0x3F) | 0x80);
        }

        if (charcode > 2047 && charcode < 65536) {
          encoded = encoded + gethex((charcode >> 12) | 0xE0);
          encoded = encoded + gethex(((charcode >> 6) & 0x3F) | 0x80);
          encoded = encoded + gethex((charcode & 0x3F) | 0x80);
        }

        if (charcode > 65535) {
           encoded = encoded + gethex((charcode >> 18) | 0xF0);
          encoded = encoded + gethex(((charcode >> 12) & 0x3F) | 0x80);
          encoded = encoded + gethex(((charcode >> 6) & 0x3F) | 0x80);
          encoded = encoded + gethex((charcode & 0x3F) | 0x80);
        }

      }

    }  // end of for ...

      return encoded;
}

// Get GET() variable
var Source = getParm('Source');
var Keyword = getParm('Keyword');
var sci_usr_id = getParm('sci_usr_id');

// Location of Resource Library
var ResourceLib = "www%2Esterlingcommerce%2Ecom%2Fapps%2Fcollaterallibrary%2Fexternal%2FDownloadFile%2Easp%3ffil%3d";

// Source is not in URL check if there is a source cookie. If there is a value set a cookie
if(Source == "") {
	Source = getCookie('sci_source_id');
}
else {

	var expdate = new Date ();
	expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 1));
	setCookie ("sci_source_id", Source, expdate);	
}

// keyword is not in URL check if there is a source cookie. If there is a value set a cookie
if(Keyword == "") {
	Keyword = getCookie('sci_keyword');
}
else {
	var expdate = new Date ();
	expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 1));
	setCookie ("sci_keyword", Keyword, expdate);	
}

// sci user is not in URL so check if there is a source cookie. If there is a value set a cookie
if(sci_usr_id == "") {
	sci_usr_id = getCookie('sci_usr_id');
}
else {
	var expdate = new Date ();
	expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 365));
	setCookie ("sci_usr_id", sci_usr_id, expdate);	
}

function getCollateralv1(Siteext, FormTitle, CollateralID, Ref, CallToAction) {
	
	var CallToAction, FormTitle, Comp_URL, FormURL, Ref, Siteext, CollateralID;

	
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

   // If the Collateral Id is not numeric the function assumes that it is an abosolute URL
   
   for (i = 0; i < CollateralID.length && IsNumber == true; i++) 
      { 
      Char = CollateralID.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
		 Comp_URL = CollateralID;
         }
	  }  
        
        FormURL = "http://www.sterlingcommerce." + Siteext + "/form/new/";
		
	if (Siteext != "com") {
                if (getCookie('sci_usr_id')) { 
		    FormURL = "http://www.sterlingcommerce." + Siteext + "/form/registered/";
		    sci_usr_id = getCookie('sci_usr_id');	
		}
		else {
			FormURL = "http://www.sterlingcommerce." + Siteext + "/form/new/";
		}
	}
		
	var URL = FormURL + "?formtitle=" + URLEncode(FormTitle) + "&Source=" + Source + "&ref=" +  Ref + "&Keyword=" + Keyword + "&Comp_URL=" + URLEncode(Comp_URL) + "&CallToAction=" + URLEncode(CallToAction) + "&FormSubmitResult=" + sci_usr_id;
	
	MM_openBrWindow(URL,'SCIFORM','scrollbars=yes,width=660,height=660,resizable=yes');

}


function getCollateral(Siteext, FormTitle, CollateralID, Ref, CallToAction, AssetCode, ActivityCode) {
	
	var CallToAction, FormTitle, Comp_URL, FormURL, Ref, Siteext, CollateralID;

	sci_usr_id = getCookie('sci_usr_id');
	
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

   // If the Collateral Id is not numeric the function assumes that it is an abosolute URL
   
   Comp_URL = "www.sterlingcommerce.com/apps/collaterallibrary/external/DownloadFile.asp?fil=" + CollateralID;
   
   for (i = 0; i < CollateralID.length && IsNumber == true; i++) 
      { 
      Char = CollateralID.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
		 Comp_URL = CollateralID;
         }
	  }  

//	FormURL = "http://www.sterlingcommerce." + Siteext + "/form/new/";
	FormURL = "http://www.sterlingcommerce.com/quickforms/USDownload.aspx";
	
	var URL = FormURL + "?formtitle=" + URLEncode(FormTitle) + "&Source=" + Source + "&ref=" +  Ref + "&Keyword=" + Keyword + "&Comp_URL=http://" + URLEncode(Comp_URL) + "&CallToAction=" + URLEncode(CallToAction) + "&AssetCode=" + AssetCode + "&ActivityCode=" + ActivityCode;
	
	MM_openBrWindow(URL,'SCIFORM','scrollbars=yes,width=500,height=500,resizable=yes');

}

//--------------------------- Image Rotator (AKA Bug Rotator) ----------------------------//
//call by using:
//document.write(geteRotateItem("[name of the item collection]"));
function getRotateItem ( collectionName )
{
    var items = eval (collectionName);
    var index = new Date().getSeconds() % items.length;
    return '<a href=\"javascript:goToRotateItem(' + index + ',\'' + collectionName +'\');\"><img src=\"' + items[index][1] + '\" border="0" alt=\"' + items[index][2] + '\"></a>';
}

function goToRotateItem(index, collectionName )
{
    var items = eval (collectionName);
    if(items[index][0][1] == 1)
        getCollateral.apply ( this, items[index][0][0] );
    else if( items[index][0][1] == 2 )
    	window.open ( items[index][0][0][0], items[index][0][0][1], items[index][0][0][2] );
    else
        window.location.href = items[index][0][0];
}

function getResource(FormTitle, Comp_URL, Ref) {
	
	var ResourceLib, FormTitle, Comp_URL, FormURL, Ref;
	
	sci_usr_id = getCookie('sci_usr_id');
	
	if(sci_usr_id == "") {
		FormURL = "http://www.sterlingcommerce." + siteext + "/af/new/";
		}
	else {
		FormURL = "http://www.sterlingcommerce." + siteext + "/af/returning/";
	}
	
	
	document.location.href = FormURL + "?formtitle=" + escape(FormTitle) + "&Comp_URL=" + Comp_URL + "&Source=" + Source + "&ref=" + Ref + "&Keyword=" + Keyword + "&FormSubmitResult=" + sci_usr_id;
}


function callForm(FormTitle,FormURL, Ref) {
	
	var  FormTitle, FormURL, Ref;

	var URL = FormURL + "?formtitle=" + escape(FormTitle) + "&Source=" + Source + "&ref=" +  escape(Ref) + "&Keyword=" + Keyword;
	MM_openBrWindow(URL,'SCIFORM','scrollbars=yes,width=635,height=650');

}


// END LEAD TRACKING FUNCTIONS


var strBaseUrl = "http://" + window.location.hostname//"http://scidotdeva";
var strAppsUrl = "http://" + window.location.hostname//"http://scidotdeva";

if (strBaseUrl =="http://sterlingcommerce.resultspage.com")
	{
	strBaseUrl = "http://www.SterlingCommerce.com";
	}
if (strAppsUrl =="http://sterlingcommerce.resultspage.com")
	{
	strAppsUrl = "http://www.SterlingCommerce.com";
	}


if (strBaseUrl == "http://scidotdeva")
	{
	strBaseUrl = "http://scidotdeva";
	}


//This part is the new part

//------------------------------ Search Form Function ------------------------------//
function checkValid() {
	if(document.formsearch.CiRestriction.value == ''){
		alert("Please type your keywords.");
		return false;
	}
	var reg2 = /[,|~|{|[|}|!|#|$|%|^|*|(|)|=|<|>|?|'|;|||]/;	
	 
	if ( reg2.test(document.formsearch.CiRestriction.value)){
		alert("Non alphanumeric characters are not allowed.");
		return false;	
	 }
    var str = document.formsearch.CiRestriction.value;
 
	 if  (str.indexOf(']')> -1){
		alert("Non alphanumeric characters are not allowed.");
		return false;
	}	
	if  (str.indexOf('\\')> -1){
		alert("Non alphanumeric characters are not allowed.");
		return false;
	}		
	if  (str.indexOf('\/')> -1){
		alert("Non alphanumeric characters are not allowed.");
		return false;
	}
	if  (str.indexOf(' ')== 0){
		alert("A space is not allowed as the first character.");
		return false;
	}	
	if  (str.indexOf(' ')== 1 &&  str.indexOf(' ',2)== 3){
		alert("A search string can not contain that many single chacters in a row.");
		return false;
	}				
	if (str.length == 3 && str.indexOf(' ')== 1){
		alert("Not enough valid alphanumeric characters to search on.");
		return false;
	}			
	if  (str.indexOf('__')> -1){
		alert("Non alphanumeric characters are not allowed.");
		return false;
	}	
	if (str.length==3 && str.indexOf('_')== 0 && str.lastIndexOf('_')== 2  ){
		alert("You search string must contain at least three alphanumeric characters.");
		return false;
	}		
	if (str.length<3){
		alert("You search string must contain at least three alphanumeric characters.");
		return false;
		}else{
		openNewWindow('/query_dev.idq?CiRestriction=' + document.getElementById("CiRestriction").value + '','Search','500','500');
		return true;
	}
}
//------------------------------ Education Include -----------------------------------//
function educationInclude()
{
	var strCode = "";
	strCode +="<table width=\"140\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"bug\"><tr>";
	strCode +="<td width=\"9\"><img src=\"" + strBaseUrl + "/images/bug/sBug_top_l.gif\" width=\"9\" height=\"9\" border=\"0\"></td>";
    strCode +="<td width=\"122\" background=\"" + strBaseUrl + "/images/bug/sBug_top_tile.gif\"><img src=\"" + strBaseUrl + "/images/bug/sBug_top_tile.gif\" width=\"4\" height=\"9\" border=\"0\"></td>";
    strCode +="<td width=\"9\"><img src=\"" + strBaseUrl + "/images/bug/sBug_top_r.gif\" width=\"9\" height=\"9\" border=\"0\"></td>";
	strCode +="</tr><tr>";
    strCode +="<td background=\"" + strBaseUrl + "/images/bug/sBug_ltitle.gif\"><img src=\"" + strBaseUrl + "/images/bug/sBug_ltitle.gif\" width=\"9\" height=\"28\" border=\"0\">";
    strCode +="<td height=\"28\" bgcolor=\"#EEEEEE\" class=\"bugTitle\"><p>Quick Links</p></td>";
    strCode +="<td width=\"9\" background=\"" + strBaseUrl + "/images/bug/sBug_rtitle.gif\"><img src=\"" + strBaseUrl + "/images/bug/sBug_rtitle.gif\" width=\"9\" height=\"28\"></td>";
	strCode +="</tr><tr>";
    strCode +="<td background=\"" + strBaseUrl + "/images/bug/sBug_l.gif\"></td>";
    strCode +="<td class=\"bug\">";
    strCode +="<img src=\"" + strBaseUrl + "/images/bullet_greyArrow.gif\" width=\"7\" height=\"7\" border=\"0\"><a href=\"whats_new.html\"> What&rsquo;s New</a><br>";
    strCode +="<img src=\"" + strBaseUrl + "/images/bullet_greyArrow.gif\" width=\"7\" height=\"7\" border=\"0\"><a href=\"/Services/Education/training_tracks.html\"> Training Tracks</a><br>";
	strCode +="<img src=\"" + strBaseUrl + "/images/bullet_greyArrow.gif\" width=\"7\" height=\"7\" border=\"0\"><a href=\"http://education.sterlingcommerce.com/Courses/CalendarShell.asp\"> Course Calendar</a><br>";
    strCode +="<img src=\"" + strBaseUrl + "/images/bullet_greyArrow.gif\" width=\"7\" height=\"7\" border=\"0\"><a href=\"/PDF/Services/education/Educ_Catalog.pdf\" target=_blank> Course Catalog</a><br>";
    strCode +="<img src=\"" + strBaseUrl + "/images/bullet_greyArrow.gif\" width=\"7\" height=\"7\" border=\"0\"><a href=\"/Services/Education/trng_centers.html\"> Training Centers</a><br>";	
    strCode +="<img src=\"" + strBaseUrl + "/images/bullet_greyArrow.gif\" width=\"7\" height=\"7\" border=\"0\"><a href=\"/Services/Education/contact.html\"> Contact Us </a><br>";
    strCode +="</td>";
    strCode +="<td background=\"" + strBaseUrl + "/images/bug/sBug_r.gif\">&nbsp;</td>";
	strCode +="</tr><tr>";
    strCode +="<td><img src=\"" + strBaseUrl + "/images/bug/sBug_bottom_l.gif\" width=\"9\" height=\"12\" border=\"0\"></td>";
    strCode +="<td background=\"" + strBaseUrl + "/images/bug/sBug_bottom_tile.gif\"><img src=\"" + strBaseUrl + "/images/bug/sBug_bottom_tile.gif\" width=\"4\" height=\"12\" border=\"0\"></td>";
    strCode +="<td><img src=\"" + strBaseUrl + "/images/bug/sBug_bottom_r.gif\" width=\"9\" height=\"12\" border=\"0\"></td>";
	strCode +="</tr></table>";
	document.write(strCode);
	strCode="";

}
//------------------------------- HEADER N FOOTER ------------------------------------//	
function buildHeader(){
	var header = "";
	header += "<form  name=\"searchform\" method=\"get\" action=\"http://sterlingcommerce.resultspage.com/search\">";
	header += "	  <table width=\"760\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
	header += "        <tr>";
	header += "          <td><A HREF=\"/\" class=\"footer\"><img src=\"/images/layout/logo.gif\" width=\"151\" height=\"42\" BORDER=\"0\"></A></td>";
	header += "          <td width=\"574\"><table width=\"574\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	header += "              <tr>";
	header += "                <td width=\"5\"><img src=\"/images/layout/superheader_left.gif\" width=\"5\" height=\"40\"></td>";
	header += "                <td height=\"40\" align=\"right\" valign=\"middle\" background=\"/images/layout/superheader_bg.gif\"><div class=\"footer\"><a href=\"http://customer.sterlingcommerce.com\" class=\"footer\">Customer Center and Support</a> | <a href=\"" + strBaseUrl + "/about/global-sites\" class=\"footer\">Global Sites</a> | <a href=\"" + strBaseUrl + "/about/partners/\" class=\"footer\">Partners</a> | <a href=\"" + strBaseUrl + "/about/resource-center/\" class=\"footer\">Resource Center</a> |";
	header += "<input type=\"hidden\" name=\"p\" value=\"Q\">"
	header += "<input type=\"hidden\" name=\"ts\" value=\"custom\">"
	header += "                        <input class=\"searchBox\" type=\"text\"  size=\"20\" value=\"Search\" name=\"w\" id=\"search\" >";
	header += "                </div></td>";
	header += "                <td align=\"right\" valign=\"middle\" background=\"/images/layout/superheader_bg.gif\"><INPUT name=\"Search\" type=\"image\" src=\"" + strBaseUrl + "/images/layout/searchGo.gif\" WIDTH=\"21\" HEIGHT=\"21\" BORDER=\"0\"></td>";
	header += "                <td width=\"5\"><img src=\"/images/layout/superheader_right.gif\" width=\"5\" height=\"40\"></td>";
	header += "              </tr>";
	header += "          </table></td>";
	header += "        </tr>";
	header += "      </table>";
	header += "	  </form>";
	document.write (header);
}

function buildFormHeader(){
	var header = "";

	header += "<table width=\"760\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";

	header += "<tr>";
	header += "<td><A HREF=\"/\" ><img src=\"/images/layout/logo.gif\" width=\"151\" height=\"42\" BORDER=\"0\"></A></td>";
	header += "<td width=\"574\"><table width=\"574\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	header += "<tr>";
	header += "<td width=\"5\"><img src=\"/images/layout/superheader_left.gif\" width=\"5\" height=\"40\"></td>";
	header += "<td height=\"40\" align=\"right\" valign=\"middle\" background=\"/images/layout/superheader_bg.gif\"><div class=\"footer\">&nbsp;";
	header += "</div></td>";
	header += "<td width=\"5\"><img src=\"/images/layout/superheader_right.gif\" width=\"5\" height=\"40\"></td>";
	header += "</tr>";
	header += "</table></td>";
	header += "</tr></table>";
	document.write (header);

}

function pageTop()
	{
	var strText = "";
strText += "<tr valign=\"top\">";
strText += "  <td height=\"54\" colspan=\"3\">";
  document.write(strText);

 buildHeader();
strText = "";
strText += "</td></tr>";
strText += "<tr><td height=\"32\" colspan=\"3\">";
  document.write(strText);
    buildNav();
strText = "";
strText += "</td></tr>";
document.write(strText);
}





function buildHeaderSmall(){
	var header = "";
	header += "<table width=\"480\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	header += "<tr>";
	header += "<td width=\"5\"><img src=\"/images/layout/superheader_left.gif\" width=\"5\" height=\"40\"></td>";
	header += "<td height=\"40\" align=\"right\" valign=\"middle\" background=\"/images/layout/superheader_bg.gif\" class=\"footer\">&nbsp;";
	header += "</td>";
	header += "<td width=\"5\"><img src=\"/images/layout/superheader_right.gif\" width=\"5\" height=\"40\"></td>";
	header += "</tr>";
	header += "</table>";
	document.write (header);
}



function buildHeaderPopup(){
	var header = "";
	header += "<table width=\"480\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	header += "<tr>";
	header += "<td width=\"5\"><img src=\"/images/layout/superheader_left.gif\" width=\"5\" height=\"40\"></td>";
	header += "<td height=\"40\" align=\"right\" valign=\"middle\" background=\"/images/layout/superheader_bg.gif\" class=\"footer\"><a href=\"#\" onclick=\"javascript: window.opener.document.location.href='/'\">Home</a> | <a href=\"javascript:openNewWindow('" + strBaseUrl + "/about/contact','Contact',500,500);\">Contact</a> |";
	header += "</td>";
	header += "<td width=\"5\"><img src=\"/images/layout/superheader_right.gif\" width=\"5\" height=\"40\"></td>";
	header += "</tr>";
	header += "</table>";
	document.write (header);
}


function buildFooter(){
        var currentTime = new Date()
        var year = currentTime.getFullYear()
	var text = "";
	text += "<table width=\"760\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
	text += "          <tr>";
	text += "            <td width=\"8\"><img src=\"/images/layout/footerLeftCol_white.gif\" width=\"8\" height=\"30\"></td>";
	text += "            <td width=\"472\" align=\"left\" background=\"/images/layout/footerBg.gif\"><div class=\"footer\"><a href=\"" + strBaseUrl + "/About/Contact\" class=\"footer\">Contact</a> | <a href=\"" + strBaseUrl + "/About/Careers/\" class=\"footer\">Careers</a> | <a href=\"" + strBaseUrl + "/sitemap.html\" class=\"footer\">Sitemap</a> | <a href=\"" + strBaseUrl + "/contact/Privacy_Usage.html\" class=\"footer\">Privacy Policy</a> | <a href=\"" + strBaseUrl + "/contact/termsofuse.html\" class=\"footer\">Terms of Use</a></div></td>";
	text += "            <td width=\"272\" background=\"/images/layout/footerBg.gif\"><div class=\"footer\">";
	text += "              <div align=\"right\">&copy;&nbsp; " + year + " Sterling Commerce. All Rights Reserved</div>";
	text += "            </div></td>";
	text += "            <td width=\"8\"><img src=\"/images/layout/footerRightCol_white.gif\" width=\"8\" height=\"30\"></td>";
	text += "          </tr>";
	text += "      </table>";
	document.write (text);
}



function buildFooterSmall()
	{
        var currentTime = new Date()
        var year = currentTime.getFullYear()
	var text = "";
	text += "<span align=\"right\" class=\"smallText\">&copy; " + year + " Sterling Commerce. All Rights Reserved</span>";
	document.write (text);
	}


//------------------------------- MENU SYSTEM ------------------------------------//	

var menuTimer=0;

function setTimer() {
	menuTimer=setTimeout("hideAll()",500);
}

function clrTimer() {
	clearTimeout(menuTimer);
}
function hideAll() { 
	hideLayer('dd1','dd2','dd3','dd4','dd5'); 
	clrTimer();
}	
function showLayer() {
	hideAll();
	var n=showLayer.arguments.length; 
	for (var i=0; i<n; i++) { 
		if (document.getElementById(showLayer.arguments[i])) 
		{	
			var lyr = document.getElementById(showLayer.arguments[i]).style;
			if(lyr) { 
				lyr.visibility="visible";
			}
		} 
	} 
} 
function hideLayer() { 
	var n=hideLayer.arguments.length; 
	for (var i=0; i<n; i++) { 
		if (document.getElementById(hideLayer.arguments[i])) 
		{
			var lyr = document.getElementById(hideLayer.arguments[i]).style; 
			if(lyr) { 
				lyr.visibility = "hidden";
			} 
		}
	} 
}

function buildSubmenus(){
	var myText = "";
	myText += "<div id=\"dropdowns\">";
//Submenu 1
	myText += "<div id=\"dd1\"><ul>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/communications-media/home/\">Communications</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"distribution-logistics/home/\">Distribution and Logistics</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/financial-services/home/\">Financial Services</a></li>";
	myText += "<li><li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/government/home/\">Government</a></li></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/manufacturing/home/\">Manufacturing</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/retail/home/\">Retail</a></li>";
	myText += "</ul></div>";
//Submenu 2
	myText += "<div id=\"dd2\"><ul>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/business-integration-suite/\">Sterling Business Integration Suite</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/network/\">Sterling Collaboration Network</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/integration/\">Sterling Integration Solutions</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/managed-file-transfer/\">Sterling Managed File Transfer</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/selling-fulfillment-suite/\">Sterling Selling and Fulfillment Suite</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/multi-channel-fulfillment/\">Sterling Multi-Channel Fulfillment</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/multi-channel-selling/\">Sterling Multi-Channel Selling</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/total-payments/\">Sterling Total Payments</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/all-products/\">All Products</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/products/standards-and-certification/\">Standards and Certification</a></li>";
	myText += "</ul></div>";
//Submneu3
	myText += "<div id=\"dd3\"><ul>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"http://customer.sterlingcommerce.com\">Customer Support</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"http://education.sterlingcommerce.com\">Education</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/services/implementation-services/\">Implementation Services</a></li>"; 
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/services/managed-services/\">Managed Services</a></li>";
	myText += "</ul></div>";
//Submenu4
	myText += "<div id=\"dd4\"><ul>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/customers/by-industry/\">By Industry</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/customers/by-product/\">By Product</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/customers/by-region/\">By Region</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/customers/customer-reference-program/\">Customer Reference Program</a></li>";	
myText += "</ul></div>";
//Submenu5
	myText += "<div id=\"dd5\"><ul>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/about-us/\">About Us</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/analyst-research/\">Analyst Research</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/careers/\">Careers</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/events/\">Events and Webcasts</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/executive-profiles/\">Executive Profiles</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/news/\">Newsroom</a></li>";
	myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/office-locations/\">Office Locations</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/partners/\">Partners</a></li>";
    myText += "<li><a onmouseover=\"clrTimer()\" onmouseout=\"setTimer()\" href=\"/about/resource-center/\">Resource Center</a></li>";
	myText += "</ul></div>";
	myText += "</div>";
	document.write(myText);
}

function buildNav(){
	var nav = "";
nav += "<table width=\"760\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"menuText\"><tr>";
nav += "      <td width=\"5\"><img src=\"/images/layout/mainMenuLeftCol.gif\" width=\"5\" height=\"25\"></td>";
nav += "      <td width=\"148\" align=\"center\" valign=\"middle\" background=\"/images/layout/mainMenuBg.gif\"><a href=\"" + strBaseUrl + "/Industries/\" onmouseover=\"clrTimer();showLayer('dd1')\" onmouseout=\"setTimer()\"> Industries</a></td>";
nav += "      <td width=\"2\"><img src=\"/images/layout/mainMenuDivider.gif\" width=\"2\" height=\"25\"></td>";
nav += "      <td width=\"148\" align=\"center\" valign=\"middle\" background=\"/images/layout/mainMenuBg.gif\"><a href=\"" + strBaseUrl + "/Products/\" onmouseover=\"clrTimer();showLayer('dd2')\" onmouseout=\"setTimer()\">Products</a></td>";
nav += "      <td width=\"2\"><img src=\"/images/layout/mainMenuDivider.gif\" width=\"2\" height=\"25\"></td>";
nav += "      <td width=\"148\" align=\"center\" valign=\"middle\" background=\"/images/layout/mainMenuBg.gif\"><a href=\"" + strBaseUrl + "/Services/\" onmouseover=\"clrTimer();showLayer('dd3')\" onmouseout=\"setTimer()\">Services</a></td>";
nav += "      <td width=\"2\"><img src=\"/images/layout/mainMenuDivider.gif\" width=\"2\" height=\"25\"></td>";
nav += "      <td width=\"148\" align=\"center\" valign=\"middle\" background=\"/images/layout/mainMenuBg.gif\"><a href=\"" + strBaseUrl + "/Customers/\" onmouseover=\"clrTimer();showLayer('dd4')\" onmouseout=\"setTimer()\">Customers</a></td>";
nav += "      <td width=\"2\"><img src=\"/images/layout/mainMenuDivider.gif\" width=\"2\" height=\"25\"></td>";
nav += "      <td width=\"147\" align=\"center\" valign=\"middle\" background=\"/images/layout/mainMenuBg.gif\"><a href=\"" + strBaseUrl + "/About/\" onmouseover=\"clrTimer();showLayer('dd5')\" onmouseout=\"setTimer()\">About</a></td>";
nav += "      <td width=\"4\"><img src=\"/images/layout/mainMenuRightCol.gif\" width=\"4\" height=\"25\"></td>";
nav += "    </tr></table>";
document.write (nav)
}
//------------------------------- BANNER ------------------------------------//	


function ShowThePicture()
	{
		var banners = new Array()
		banners[0]="<img src=\"/images/home/home_banner.jpg\" width=\"760\" height=\"208\" border=\"0\" usemap=\"#BannerMap\"><map name=\"BannerMap\"><area shape=\"rect\" coords=\"14,144,106,162\" href=\"/About/MagicQuadrant.html\"></map>"
		banners[1]="<embed src=\"/media/misc/gis4/gis4.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"760\" height=\"208\" name=\"animation\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">"
		banners[2]="<img src=\"/images/home/home_banner.jpg\" width=\"760\" height=\"208\" border=\"0\" usemap=\"#BannerMap\"><map name=\"BannerMap\"><area shape=\"rect\" coords=\"14,144,106,162\" href=\"/About/MagicQuadrant.html\"></map>"
		banners[3]="<embed src=\"/media/misc/gis4/gis4.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"760\" height=\"208\" name=\"animation\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">"

		var Image;
		var nr;
	
		while(Image == null){
			nr = Math.round(4 * Math.random());
			Image = banners[nr]
		}
	
		document.write("" + Image + "")
	}



function buildHomeBanner()
	{
	ShowThePicture();
	}


//function buildHomeBanner()
//	{
//	var banner="";
//	//--------------------for STATIC banners--------------------//
//	//banner += "<img src=\"/images/home/home_banner.jpg\" width=\"760\" height=\"208\" border=\"0\" usemap=\"#BannerMap\">";
//	//banner += "<map name=\"BannerMap\">";
//	//banner += "<area shape=\"rect\" coords=\"14,144,106,162\" href=\"/About/MagicQuadrant.html\"></map>";
//	//--------------------for FLASH banners--------------------//
//	banner += "<embed src=\"/media/misc/gis4/gis4.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"760\" height=\"208\" name=\"animation\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">";
//	document.write (banner);
//	}






//------------------------------- Generic Functions ------------------------------------//	
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openNewWindow(myURL, myTitle, myWidth, myHeight)
	{
	window.open(myURL,myTitle,'toolbar=no,width=' + myWidth + ',height=' + myHeight + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,copyhistory=no,alwaysraised=yes');
	}



function openNewWindowEMEA(myURL, myTitle, myWidth, myHeight)
	{
		if(confirm("You are being redirected to the US site. Is this ok?"))
		{
		window.open(myURL,myTitle,'toolbar=no,width=' + myWidth + ',height=' + myHeight + ',directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,location=no,copyhistory=no,alwaysraised=yes');
		}
	}

function gotodotcom(myURL)
	{
		window.open(myURL,'sciwin','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,resizable=yes,menubars=yes,width=1000,height=800');
	}



function openContactWindow() {
        var version = parseInt(navigator.appVersion);
        if (version >= 4)
        var openContactWindow = window.open('" + strBaseUrl + "/contact/index.asp','Contact','width=500,height=500,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubars=no'); 
}

function openEMEA() {
        var version = parseInt(navigator.appVersion);
        if (version >= 4)
        var openContactWindow = window.open('/apps/forms/PrivacyNotice.html','Notice','width=500,height=500,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubars=no'); 
}



function stripSpaces(mystring)
		{
			x = mystring;
			while (x.substring(0,1) == ' ') x = x.substring(1);
			while (x.substring(x.length-1,x.length) == ' ') x = x.substring(0,x.length-1);
			return x;
		}
		
		// embed the flash swf
function writeFlashTag(movieName, width, height, baseVersion, bgColor) {
    document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + baseVersion + ',0,0,0" width="' + width + '" height="' + height + '">\n<param name="movie" value="' + movieName + '">\n<param name="bgcolor" value="' + bgColor + '">\n<param name="quality" value="high"><param name="wmode" value="transparent"><param name="menu" value="false">\n');
    document.write ('<embed src="' + movieName + '" TYPE="application/x-shockwave-flash" wmode="transparent" menu="false" quality="high" bgcolor="' + bgColor + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width=' + width + ' height=' + height + '> </embed>\n</object>');
    return;
}	
		// embed the flash swf
function writeFlashTagSolid(movieName, width, height, baseVersion, bgColor) {
    document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + baseVersion + ',0,0,0" width="' + width + '" height="' + height + '">\n<param name="movie" value="' + movieName + '">\n<param name="bgcolor" value="' + bgColor + '">\n<param name="quality" value="high"><param name="menu" value="false">\n');
    document.write ('<embed src="' + movieName + '" TYPE="application/x-shockwave-flash" menu="false" quality="high" bgcolor="' + bgColor + '" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width=' + width + ' height=' + height + '> </embed>\n</object>');
    return;
}	

function writeFlashTagLanguage(movieName, width, height, baseVersion, language) {
    document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + baseVersion + ',0,0,0" width="' + width + '" height="' + height + '">\n<param name="movie" value="' + movieName + '">\n<param name="FlashVars" value="' + language + '">\n<param name="quality" value="high"><param name="wmode" value="transparent"><param name="menu" value="false">\n');
    document.write ('<embed src="' + movieName + '" TYPE="application/x-shockwave-flash" wmode="transparent" menu="false" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" FlashVars=' + language + ' width=' + width + ' height=' + height + '> </embed>\n</object>');
    return;
}


function SpotLight(){
var axel = Math.random()+"";
var a = axel * 10000000000000;
document.write('<img src="http://ad.doubleclick.net/activity;src=1166245;type=sterl472;cat=sterl721;ord=1;num='+ a + '?" width="1" height="1" border="0" />');
}


/*************************** Tab Switching *********************************************/
var undef;
function switchTabFirstLevel(tabToShow, firstTabNo){
	//Find li of pressed tab 
	var ulArray = document.getElementsByTagName('ul');
	for (var i=0; i<ulArray.length; i++) {
		if(ulArray[i].className == 'tabsfirstlevel clearfix') {
			var liArray = ulArray[i].getElementsByTagName('li');
			for(t=0; t<liArray.length; t++){
				var activeIndex = liArray[t].className.indexOf('_a');
				if(t == (parseInt(tabToShow))-1){
					if (activeIndex != -1) {
						continue;
					} else {
						liArray[t].className = liArray[t].className+"_a";
					}
				} else {
					if (activeIndex != -1) {
						liArray[t].className = liArray[t].className.substring(0,activeIndex);
					}
				}
			}
		}		
	}

	var layername = "tabFirstLevelWeCanToggle" + tabToShow;
	//Count Number of Tabs
	var numerOfTabs = 0;
	for (var loop = 0; loop < document.getElementsByTagName('div').length; loop++) {
	var DivIdName = "document.getElementsByTagName('DIV')[" + loop + "].id";
		if (eval(DivIdName) && eval(DivIdName).indexOf('tabFirstLevelWeCanToggle') != -1){
		numerOfTabs++
		}
	}
	
	//Make Visible/Invisible
	for (var loop=1; loop <= numerOfTabs; loop++) {
	var currentTabId = 'tabFirstLevelWeCanToggle' + loop;
	var currentTabDisplay = "document.getElementById('" + currentTabId + "').style.display";
		if (loop == tabToShow) {
			eval(currentTabDisplay + " = 'block'");
		} else {
			eval(currentTabDisplay + " = 'none'");
		}
	}
	switchTab(firstTabNo);
}

function switchTab(tabToShow){
	var liArray, tabArray	= new Array();
	//Find li of pressed tab
	liArray = document.getElementsByTagName('li');
	for (var i=0; i<liArray.length; i++) {
		if(liArray[i].className == 'tab' || liArray[i].className == 'tab_a') {
			tabArray.push(liArray[i]);
		} 
	}
	for(t=0; t<tabArray.length; t++){
		var activeIndex = tabArray[t].className.indexOf('_a');
		if(t == (parseInt(tabToShow))-1){
			if (activeIndex != -1) {
				continue;
			} else {
				tabArray[t].className = tabArray[t].className+"_a";
			}
		} else {
			if (activeIndex != -1) {
				tabArray[t].className = tabArray[t].className.substring(0,activeIndex);
			}
		}
	}

	var layername = "tabWeCanToggle" + tabToShow;
	//Count Number of Tabs
	var numerOfTabs = 0;
	for (var loop = 0; loop < document.getElementsByTagName('div').length; loop++) {
	var DivIdName = "document.getElementsByTagName('DIV')[" + loop + "].id";
		if (eval(DivIdName) && eval(DivIdName).indexOf('tabWeCanToggle') != -1){
		numerOfTabs++
		}
	}
	
	//Make Visible/Invisible
	for (var loop=1; loop <= numerOfTabs; loop++) {
	var currentTabId = 'tabWeCanToggle' + loop;
	var currentTabDisplay = "document.getElementById('" + currentTabId + "').style.display";
		if (loop == tabToShow) {
			eval(currentTabDisplay + " = 'block'");
		} else {
			eval(currentTabDisplay + " = 'none'");
		}
	}
}
/*************************** END Tab Switching *********************************************/
//addthis code
function addthisjsloader() {
	addthis_pub  = 'ahowett';
	addthis_logo = 'http://www.sterlingcommerce.com/global/uk/b2b-outsourcing/i/logo_sci_bwb.gif';
	addthis_options = 'favorites, email, digg, delicious, google, more';
	document.write('<script src="http://s7.addthis.com/js/152/addthis_widget.js" type="text/javascript"><\/script>');
}
document.write( "<script src=\"/includes/RailBugs.js\" type=\"text/javascript\"></script>" );





// START /products/business-integration-suite/business-integration-suite-ads SCRIPT

function QueryString(key) 
{ 
var value = null; 
for (var i=0;i<QueryString.keys.length;i++) 
{ 
if (QueryString.keys[i]==key) 
{ 
value = QueryString.values[i]; 
break; 
} 
} 
return value; 
} 
QueryString.keys = new Array(); 
QueryString.values = new Array(); 

function QueryString_parse() 
{ 
var query = window.location.search.substring(1); 
var pairs = query.split("&"); 

for (var i=0;i<pairs.length;i++) 
{ 
var pos = pairs[i].indexOf('='); 
if (pos >= 0) 
{ 
var argname = pairs[i].substring(0,pos); 
var value = pairs[i].substring(pos+1); 
QueryString.keys[QueryString.keys.length] = argname; 
QueryString.values[QueryString.values.length] = value; 
} 
} 
} 
QueryString_parse(); 

function makeURL (URL,Source,Data)
{
	myURL = "<a href=\"http://webapps.sterlingcommerce.com/process?URL=" + URL + "&Source=" + Source + "&Data=" + Data + "\" target=_blank style=\"text-decoration:none\">";
	return myURL;
}

// END

/*************************** Google Analytics Code *************************************/
document.write( "<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\"></script>" );
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
function getDomainEnd()
{
	var domainStart = document.location.hostname.lastIndexOf('.',document.location.hostname.length);
	if (domainStart !== -1) {
		var domain = document.location.hostname.substring(domainStart+1, document.location.hostname.length);
		return domain;
	}
}
var pageTracker;
function writega()
{
	var domainStr = '';
	domainStr = getDomainEnd();
	switch (domainStr)
	{
		case 'com':
			pageTracker = _gat._getTracker("UA-2268542-2"); // If .com
			pageTracker._setDomainName(".sterlingcommerce.com");
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'uk':
			pageTracker = _gat._getTracker("UA-5140965-1"); // If .co.uk
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'se':
			pageTracker = _gat._getTracker("UA-5325768-1"); // IF .se
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'es':
			pageTracker = _gat._getTracker("UA-5295339-3"); // If .es
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'it':
			pageTracker = _gat._getTracker("UA-5295339-2"); // If .it
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'de':
			pageTracker = _gat._getTracker("UA-5325754-1"); // If .de
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'fr':
			pageTracker = _gat._getTracker("UA-5295303-1"); // If .fr
			pageTracker._initData();
			pageTracker._trackPageview();
			break;
		case 'nl':
			pageTracker = _gat._getTracker("UA-5140965-2");
			pageTracker._initData();
			pageTracker._trackPageview();			
			break;
		default:
			return true;
	}
}

addLoadEvent(writega);
/*************************** Google Analytics Code *************************************/
var cv = getCookie("com.vtrenz.iMAWebCookie");
var rwcv = getCookie("vtrenzRewritten");
if ((cv != null) && (rwcv == null)) {
	var vtrenzFlag = true;
}

function vtrenzReWrite() {
	cv = getCookie("com.vtrenz.iMAWebCookie");
	deleteCookie("com.vtrenz.iMAWebCookie");
	expdate = new Date;
	expdate.setTime (expdate.getTime() + (1000 * 60 * 60 * 24 * 1000));
	setCookie ('com.vtrenz.iMAWebCookie', cv, expdate);
	setCookie ('vtrenzRewritten', 'yes', expdate);
}
if (vtrenzFlag) {
	addLoadEvent(vtrenzReWrite);
} 
