/* $Change: 2075428 $ $DateTime: 2007/10/22 14:38:08 $ $Revision: #19 $ */

/*******************************************************************
*
* File    : callme.js
* Created : November 9, 2004
* Creator : Jeremy Brown
* Purpose : Creates various display formats for the Large Call Me feature.
* Revised : October 28, 2005
* Replaced Language DADS with utf8
***********************************************************************/
/* Launches Call Me Window with appropriate DAD */
function openNewWindow(URL){
	var strReplaceAll = URL;
	var intIndexOfMatch = strReplaceAll.indexOf( "&" );
	 
	// Loop over the string value replacing out each matching
	// substring.
	while (intIndexOfMatch != -1)
	{
		// Relace out the current instance.
		strReplaceAll = strReplaceAll.replace( "&", "%26" )
	
		// Get the index of any next matching substring.
		intIndexOfMatch = strReplaceAll.indexOf( "&" );
	}
    var parent_url = URL
    var amp = '&'
    NewWindow=window.open("https://sine.ni.com/apps/utf8/nicc.call_me?p_action=call&p_form_id=CALLME&p_url=" + strReplaceAll , "awindow", "width=825,height=600,scrollbars=1, resizable=1");}
    function get_url(URL){
    alert (URL)
}

/* Determines lang value */
var contentLanguage = document.getElementsByTagName("html")[0].lang;
var callmelang = 'en';
var globalLanguage = (contentLanguage != 'undefined') ? contentLanguage : callmelang;

var title = 'Questions?';
var content = 'Get real-time assistance now!';

/* Establishes Language and Country Specific content for the Generic Call Me function. Content with a DAD other than 'we' should be supplied here as special characters */
if (globalLanguage == 'en') {title = 'Questions?'; content = 'Get real-time assistance now!'}
if (globalLanguage == 'de' || globalLanguage == 'de-DE' || globalLanguage == 'de-AT'){title = 'Fragen?'; content = 'Wir rufen sofort zurück!'}
if (globalLanguage == 'de-NL'){title = 'Vragen?'; content = 'Gebruik de GRATIS terugbelservice!'}
if (globalLanguage == 'de-CH'){title = 'Fragen?'; content = 'Wir rufen sofort zurück!'}
if (globalLanguage == 'es'){title = '¿Preguntas?'; content = 'Haga clic aquí, llene el formulario y un representante técnico le llamará dentro de dos horas.'}
if (globalLanguage == 'es-MX'){title = '¿Preguntas?'; content = 'Haga clic aquí, llene el formulario y un representante técnico le llamará dentro de dos horas.'}
if (globalLanguage == 'es-ES'){title = '¿Tiene alguna pregunta?'; content = '¡Le llamaremos en pocos minutos!'}
if (globalLanguage == 'fi'){title = 'Kysymyksi?'; content = 'Saat apua saman tien!'}
if (globalLanguage == 'sv'){title = 'Frågor?'; content = 'Vi hjälper dig direkt!'}
if (globalLanguage == 'pt'){title = 'Dúvidas?'; content = 'Obtenha ajuda imediata!'}
if (globalLanguage == 'fr' || globalLanguage == 'fr-FR' || globalLanguage == 'fr-CH'){title = 'Des questions commerciales ?'; content = 'Nous vous contactons dans quelques minutes.'}
if (globalLanguage == 'fr-LU' || globalLanguage == 'fr-BE'){title = 'Des Questions?'; content = 'Utilisez notre service de rappel Gratuit'}
if (globalLanguage == 'de-LU' || globalLanguage == 'de-BE'){title = 'Vragen?'; content = 'Gebruik de GRATIS terugbelservice'}
if (globalLanguage == 'it'){title = 'Domande?'; content = 'Richiedi assistenza in tempo reale!'}
if (globalLanguage == 'zh-CN'){title = '&#24744;&#26377;&#20160;&#20040;&#38382;&#39064;?'; content = '&#31435;&#21363;&#30003;&#35831;NI&#30340;&#23454;&#26102;&#24110;&#21161;&#65281;'}
if (globalLanguage == 'zh-TW'){title = '&#26377;&#20219;&#20309;&#37197;&#32622;&#31995;&#32113;&#30340;&#21839;&#38988;&#21966;?'; content = '&#25353;&#36889;&#35041;&#21487;&#24471;&#37559;&#21806;&#21069;&#30340;&#21363;&#26178;&#22238;&#35206;'}
if (globalLanguage == 'ru'){title = '&#1045;&#1089;&#1090;&#1100; &#1074;&#1086;&#1087;&#1088;&#1086;&#1089;&#1099;?'; content = '&#1054;&#1073;&#1088;&#1072;&#1090;&#1080;&#1090;&#1077;&#1089;&#1100; &#1079;&#1072; &#1087;&#1088;&#1103;&#1084;&#1086;&#1081; &#1090;&#1077;&#1093;&#1085;&#1080;&#1095;&#1077;&#1089;&#1082;&#1086;&#1081; &#1087;&#1086;&#1076;&#1076;&#1077;&#1088;&#1078;&#1082;&#1086;&#1081; &#1089;&#1077;&#1081;&#1095;&#1072;&#1089;!'}
if (globalLanguage == 'ja'){title = '&#12372;&#36074;&#21839;&#12399;&#20170;&#12377;&#12368;LIVE&#12504;&#12523;&#12503;&#12408;&#65281;'; content = '&#12486;&#12463;&#12491;&#12459;&#12523;&#12450;&#12489;&#12496;&#12452;&#12470;&#12540;&#12364;&#12372;&#36899;&#32097;&#12356;&#12383;&#12375;&#12414;&#12377;&#12290;'}
if (globalLanguage == 'ko'){title = 'Call me now!'; content = '&#49892;&#49884;&#44036;&#51204;&#54868;&#49345;&#45812;&#51012; &#48155;&#51004;&#49901;&#49884;&#50724;'}

/* Builds the Generic|Original version of Call Me (operator icon & "Questions? Get LIVE help now" or some variant text) */
function generic_callme()
{
    if(globalLanguage == 'ko')
    {
        document.writeln ('<table border="0" cellspacing="0" cellpadding="0" width="98%">');
        document.writeln ('  <tr valign="top">');
        document.writeln ('    <td width="30"><a href="javascript:openNewWindow(window.location.href);"><img src="/images/global/us/callme.gif" width="30" height="32" border="0" alt=""></a></td>');
        document.write ('    <td valign="middle" style="padding-left:5px;"><a href="javascript:openNewWindow(window.location.href);"><strong>');
        document.write(title);
        document.write ('</strong></a>');
        document.write (' ');
        document.write(content);
        document.write ('</td>');
        document.writeln ('  </tr>');
        document.writeln ('</table>');
    }
	else if(globalLanguage == 'ja')
    {
        document.writeln ('<table border="0" cellspacing="0" cellpadding="0" width="98%">');
        document.writeln ('  <tr valign="top">');
        document.writeln ('    <td width="30"><a href="javascript:openNewWindow(window.location.href);"><img src="/images/global/us/callme.gif" width="30" height="32" border="0" alt=""></a></td>');
        document.write ('    <td valign="middle" style="padding-left:5px;"><span style="color: #bb0000;"><strong>');
        document.write(title);
        document.write ('</strong></span><br><a href="javascript:openNewWindow(window.location.href);" style="text-decoration: none;">');
        document.write(content);
        document.write ('</a></td>');
        document.writeln ('  </tr>');
        document.writeln ('</table>');
    }
    else
    {
        document.writeln ('<table border="0" cellspacing="0" cellpadding="0" width="98%">');
        document.writeln ('  <tr valign="top">');
        document.writeln ('    <td width="30"><a href="javascript:openNewWindow(window.location.href);"><img src="/images/global/us/callme.gif" width="30" height="32" border="0" alt=""></a></td>');
        document.write ('    <td valign="middle" style="padding-left:5px;"><span style="color: #bb0000;"><strong>');
        document.write(title);
        document.write ('</strong></span>');
        document.write (' <a href="javascript:openNewWindow(window.location.href);" style="text-decoration: none;">');
        document.write(content);
        document.write ('</a></td>');
        document.writeln ('  </tr>');
        document.writeln ('</table>');
    }
}

