ornek3
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
var sendOmnitureCode = true;
/*** Custom Functions ***/
function s_getQueryParameter(s_param)
{
var regexS = "[?&]"+s_param+"=([^]*)";
var regex = new RegExp( regexS );
var tmpURL = window.location.href;
var results = regex.exec( tmpURL );
if( results == null )
return undefined;
else
return results[1];
}
function removeAjaxAddition(value){
if (value.indexOf("#")>-1){
value=value.substring(0,value.indexOf("#"));
}
return value;
}
function s_addSlashes(s_addslash_params)
{
var result="";
for (var i in s_addslash_params)
{
if (s_addslash_params[i]=="")
break;
result+="/"+s_addslash_params[i];
}
return result.length>0?result.substring(1):"";
}
function s_trimString(val,len)
{
if (val.length > len)
{
tmp_oversize = val.length - len;
return val.substr(0,(val.length/2)-(tmp_oversize/2)-2) + ".." + val.substr((val.length/2)+(tmp_oversize/2));
}
return val;
}
function replaceTurkish(input)
{
var trChars = "ığüşöçİĞÜŞÖÇ";
var ingChars = "igusocIGUSOC";
var output = "";
var lchar = "";
var i = 0
for( i = 0; i < input.length; i++ )
{
lchar = input.charAt(i);
if (trChars.indexOf(lchar) >= 0)
{
output += ingChars.charAt(trChars.indexOf(lchar));
}
else
{
output += lchar;
}
}
return output;
}
function s_sendErrorInfo(errorDetail)
{
// This will send a request to Omniture, i.e. extra cost (same as a page view request)
var s=s_gi(s_account);
s.usePlugins=false;
s.dynamicAccountSelection=true;
s.dynamicAccountList=s_dynamicAccountList;
s.linkTrackVars="prop22,prop21,eVar22";
s.prop21=errorDetail;
s.prop22=errorDetail;
s.eVar22=errorDetail;
s.tl(obj,'o','Validation Error');
s.usePlugins=true;
s.linkTrackVars="";
s.prop21=""
s.prop22=""
s.eVar22=""
}
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
return flashVer;
}
function getSiteName()
{
var splittedTitle = document.title.split("|");
var siteName = "";
if ($.trim(splittedTitle[splittedTitle.length - 1]) === "Garanti Bankası")
{
siteName = "PublicTR";
} else {
siteName = "PublicEN";
}
return siteName;
}
function getPageName()
{
var pageName = GT.nova.getFormattedBreadCrumb();
pageName = replaceTurkish(pageName);
return pageName;
}
function getHistory(){
var tmp = $.cookie("history");
if (tmp===undefined || tmp===null) tmp = "";
if ($.trim(tmp)=="") tmp = [];
else tmp = tmp.split("|||");
var siteHistory = [];
$.each(tmp, function(){
var split = this.split("||");
siteHistory.push({
title: split[0],
url: split[1],
documenttitle: split[2]
});
});
return siteHistory;
}
function getPcName(){
var kioskPCName="";
try
{
var userAgent = navigator.userAgent;
if (userAgent===undefined || userAgent===null) userAgent = "";
var re = new RegExp("![a-zA-Z0-9]+!");
if (userAgent.match(re)) {
kioskPCName = userAgent.match(re)[0];
} else {
kioskPCName = "";
}
if(kioskPCName.length>0)
{
kioskPCName = kioskPCName.replace('!', '');
kioskPCName = kioskPCName.replace('!', '');
}
}
catch(e)
{
kioskPCName = "";
}
return kioskPCName;
}
function getPreviousPageName()
{
var previousPageName = "";
currentHostName = document.location.hostname;
refererHostName = document.referrer;
if (refererHostName !== 'undefined' && refererHostName !== null && refererHostName.indexOf(currentHostName) > 0){
var custHistory = getHistory();
if (custHistory !== 'undefined' && custHistory !== null && custHistory.length >= 2){
previousPageName = custHistory[custHistory.length - 1].documenttitle;
if (previousPageName === GT.nova.getFormattedBreadCrumb()){
previousPageName = custHistory[custHistory.length - 2].documenttitle;
}
}
}
previousPageName = replaceTurkish(previousPageName);
return previousPageName;
}
function getPartialPageName(siteName, breadCrumbList, numberOfBlocks){
var partialPageName = siteName;
if (breadCrumbList !== 'undefined' && breadCrumbList !== null){
if (breadCrumbList.length === 1){
partialPageName += " : ";
partialPageName += $.trim(breadCrumbList[0]);
} else {
for (var j=1 ; j < breadCrumbList.length && j < numberOfBlocks+1; j++) {
partialPageName += " : ";
partialPageName += $.trim(breadCrumbList[j]);
}
}
}
partialPageName = replaceTurkish(partialPageName);
return partialPageName;
}
var omnitureCounter = 0;
function SendOmniture(){
if (GT.data.flash.initialBanner !== null && GT.data.flash.initialBanner !== undefined) {
for(var i = 0; i < GT.data.flash.banners.length; i++) {
s_prop34 = s_prop34+GT.data.flash.banners[i];
if (i < GT.data.flash.banners.length -1 ){
s_prop34 = s_prop34 + ";";
}
}
setPrevDefinedOmniVars();
void(s.t());
} else {
if (omnitureCounter < 5){
setTimeout("SendOmniture()",250);
omnitureCounter++;
} else { // Couldn't set the banner ids within timeout, send the request without banner ids
setPrevDefinedOmniVars();
void(s.t());
}
}
}
function initOmniVars(){
var k;
for(k=1;k<=50;k++){
initOV('prop'+k,"");
initOV('eVar'+k,"");
}
for(k=1;k<=5;k++){
initOV('hier'+k,"");
}
initOV('pName',"");
initOV('events',"");
}
function initOV(name,defaultVal)
{
if(typeof(window['s_'+name])!=UNDEFINED)
{
eval("s_"+name+"=''");
}
}
/*** End Custom Functions ***/
/*** Constants***/
var UNDEFINED = "undefined";
/*** Constants ***/
function customInit(){
/*** Custom Insights configuration ***/
/* var tmpTitle=document.title; */
if (typeof(s_pName) == UNDEFINED){
s_pName = replaceTurkish(getPageName());
}
if (s_trimString(s_pName) === ''){
s_pName = window.location.href.substring(window.location.href.indexOf(document.location.hostname)+document.location.hostname.length);
}
s_prop1="CEE"; // Region
s_prop2="Turkey"; // Country
/**
*
*/
if (typeof(s_prop3) === UNDEFINED || s_prop3 === ''){
s_prop3=getSiteName(); // website name
}
var breadCrumbItemList = GT.utilities.getBreadCrumbItems();
if (s_getQueryParameter('faqName') !== undefined){
var splittedTitle = document.title.split("|");
breadCrumbItemList.push($.trim(splittedTitle[0]));
}
if (typeof(s_prop4) == UNDEFINED){
s_prop4=getPartialPageName(s_prop3,breadCrumbItemList,1); // site section
}
else{
// If s_prop4 isn't equal undefined, it is initialized in a form application and we must concat it with s_prop3
s_prop4=s_prop3 + " : " + s_prop4;
}
if (typeof(s_prop5) == UNDEFINED){
s_prop5=replaceTurkish(getPartialPageName(s_prop3,breadCrumbItemList,2)); // global product category
}
else{
// If s_prop5 isn't equal undefined, it is initialized in a form application and we must concat it with s_prop3
s_prop5=replaceTurkish(s_prop3) + " : " + replaceTurkish(s_prop5);
}
if (typeof(s_prop6) == UNDEFINED){
s_prop6=getPartialPageName(s_prop3,breadCrumbItemList,3); // local product category
}
else{
// If s_prop6 isn't equal undefined, it is initialized in a form application and we must concat it with s_prop3
s_prop6=s_prop3 + " : " + s_prop6;
}
if (typeof(s_prop7) == UNDEFINED){
s_prop7="";
}
s_prop8=s_prop3.substring(6); // If site name changes, this should also change
if (typeof(s_prop9) == UNDEFINED){
s_prop9= s_prop6 + " : " + s_prop8;
}
else{
// If s_prop9 isn't equal undefined, it is initialized in a form application and we must concat it with s_prop3
s_prop9=s_prop3 + " : " + s_prop9;
}
s_prop10=s_trimString(document.location.href,100);
if (typeof(s_prop11) !== UNDEFINED ){
if (s_prop11 !== ''){
s_prop11=s_prop3 + " : " + s_prop11;
}
}
if (typeof(s_prop12) !== UNDEFINED){
if (s_prop12 !== ''){
s_prop12=s_prop3 + " : " + s_prop12;
}
}
if (typeof(s_prop19) == UNDEFINED){
s_prop19=typeof(s_prop19)!=UNDEFINED?s_prop19:"";
}
else{
s_prop19=replaceTurkish(s_prop19);
}
s_prop24=GetSwfVer();
s_prop30="";
if (s_getQueryParameter('oid') !== undefined){
s_prop30=s_getQueryParameter('oid');
}
s_prop32="";
if (s_getQueryParameter('gbid1') !== undefined){
s_prop32=s_getQueryParameter('gbid1') + " : " + s_prop3 + " : " + s_pName;
}
if (typeof(s_prop33) == UNDEFINED){
s_prop33=typeof(s_prop33)!=UNDEFINED?replaceTurkish(s_prop33):"";
}
s_prop34=""; // Will be set after the flash is loaded
s_prop35="";
if (s_getQueryParameter('gbid2') !== undefined){
s_prop35=s_getQueryParameter('gbid2');
var previousPageName = getPreviousPageName();
if (previousPageName !== "")
s_prop35 += " : " + s_prop3 + " : " + previousPageName;
}
s_prop42="";
if (s_getQueryParameter('faqName') !== undefined){
var splittedTitle = document.title.split("|");
if (splittedTitle.length > 0){
var tempFAQName = splittedTitle[0];
var charIndex = tempFAQName.indexOf(":");
tempFAQName = tempFAQName.substring(0,charIndex) + " " + tempFAQName.substring(charIndex);
s_prop42 = s_prop4 + " : " + $.trim(tempFAQName);
}
}
if (typeof(s_prop45) == UNDEFINED){
s_prop45="";
}
if (typeof(s_prop45) !== UNDEFINED){
if (s_prop45 !== ""){
s_prop45=s_prop3 + " : " + s_prop45;
}
}
s_prop46="";
s_prop46 = getPcName();
if(s_prop46 == "")
s_prop47="No";
else
s_prop47="Yes";
s_eVar2=typeof(s_prop2)!=UNDEFINED?s_prop2:"";
s_eVar3=typeof(s_prop3)!=UNDEFINED?s_prop3:"";
s_eVar4=typeof(s_prop8)!=UNDEFINED?s_prop8:"";
s_eVar5=typeof(s_prop4)!=UNDEFINED?s_prop4:"";
s_eVar6=typeof(s_prop5)!=UNDEFINED?s_prop5:"";
s_eVar7=typeof(s_prop6)!=UNDEFINED?s_prop6:"";
s_eVar8=typeof(s_prop19)!=UNDEFINED?s_prop19:"";
s_eVar20=typeof(s_prop20)!=UNDEFINED?s_prop20:"";
s_eVar21=typeof(s_prop21)!=UNDEFINED?s_prop21:"";
s_eVar24=typeof(s_prop24)!=UNDEFINED?s_prop24:"";
s_eVar30=typeof(s_prop30)!=UNDEFINED?s_prop30:"";
s_eVar33=typeof(s_prop33)!=UNDEFINED?s_prop33:"";
s_eVar34=typeof(s_prop34)!=UNDEFINED?s_prop34:"";
s_eVar39=typeof(s_prop39)!=UNDEFINED?s_prop39:"";
s_eVar41=typeof(s_prop41)!=UNDEFINED?s_prop41:"";
s_eVar46=typeof(s_prop46)!=UNDEFINED?s_prop46:s_prop46;
s_eVar47=typeof(s_prop47)!=UNDEFINED?s_prop47:s_prop47;
/*if(s_productType!=""&&s_productCat!="")
s_products=s_productCat+";"+s_productType;
*/
//s_prop22=typeof(s_prop21)!=UNDEFINED?s_prop21:"";
//s_eVar21=typeof(s_prop21)!=UNDEFINED?s_prop21:"";
if (typeof(s_pageState)!=UNDEFINED)
{
switch(s_pageState)
{
case "page not found":
s_pageType="errorPage";
s_pageName="";
break;
case "server error":
s_pName=s_pName+"[error "+s_errorId+"]";
if (s_errorId == "404")
{
s_pageType="errorPage";
s_pageName="";
}
break;
default:
}
}
/*** End Custom Insights configuration ***/
/*** Other Omniture variables ***/
if (typeof(listOfSocialProp3) != UNDEFINED){
//if additional gem_social_tr_forms.js is included in which the above var is defined,
// the account will be set to social with the socialAccount&socialProdAccount vars
// also defined in this .js file.
s_account=socialAccount;
s_prodAccount=socialProdAccount;
}else{
s_account="gemoneydtr";
s_prodAccount="gemoneystrgaranti";
}
s_prodUrls="www.garanti.com.tr,forms.garanti.com.tr";
s_testUrls="yenigaranti.fw.garanti.com.tr,nova.fw.garanti.com.tr,prdnova.fw.garanti.com.tr,tstnovaform.fw.garanti.com.tr,localhost";
s_currencyCode="TRY";
s_linkInternalFilters="javascript:,"+s_testUrls+","+s_prodUrls;
s_dynamicAccountSelection=true;
s_dynamicAccountList=s_prodAccount+"="+s_prodUrls;
s_server=location.host.toLowerCase();
/* Site Section */
s_channel= s_prop2 + ":" + s_prop3;
// PageName Specific code
s_pageName=s_prop3 + " : ";
s_pageName+=s_pName;
s_pageName=s_trimString(s_pageName, 100);
//s_prop9=typeof(s_pageType)!=UNDEFINED?"":s_pageName+"("+s_prop8+")";
/* Hierarchy Variables */
s_hier1=s_addSlashes(new Array(s_prop1,s_prop2,s_prop3,s_prop4,s_prop5,s_prop7,s_pageName));
s_hier2=s_addSlashes(new Array(s_prop1,s_prop2,s_prop3,s_prop5,s_pageName));
s_hier3=s_addSlashes(new Array(s_prop2,s_prop3,s_prop4,s_prop6,s_prop7,s_pageName));
s_hier4=s_pageName; // local hierarchy
s_cookieDomainPeriods=location.host.match(/.(co(m?)|net).(in|sg|ph|tr)/)?3:2;
//s_visitorNamespace="garanti"
s_dc=112
s_trackingServer="webstat.garanti.com.tr"
s_trackingServerSecure="webstats.garanti.com.tr"
s_vmk="483ED314"
}
customInit();
/*** End Other Omniture variables ***/
/*** Custom functions ***/
/* Custom Function - Run plugin functions 10.04.2008'de Nicolas'tan gelen kod ile degistirildi*/
function runLocalOmniturePluginFunctions()
{
s.campaignStackingExpires = 60; //in days
s.campaignStackingCount = 5; //number of campaign codes to keep in cache
s.campaignStackingCookieName = 's_cs'; //name of cookie that is used
s.campaignStackingDelimiter = '>';
s.campaignStackingSuccessEvent = 'event2';
s.campaign=s.getValOnce(removeAjaxAddition(s.getQueryParam('gbid1')),'s_gbid1');
if(typeof(s_eVar1)=="undefined")
s.eVar1=removeAjaxAddition(s.getQueryParam('gbid2'));
s.eVar9 = s.eVar1
s.eVar10=s.campaignStacking();
if(typeof(s_eVar42)=="undefined")
s.eVar42=removeAjaxAddition(s.getQueryParam('gbid1'));
if(typeof(s_eVar45)=="undefined")
s.eVar45=removeAjaxAddition(s.getQueryParam('gbid3'));
/* Form Analysis Config */
// s.formList="";
// s.trackFormList=false;
// s.trackPageName=true;
// s.useCommerce=true;
// s.varUsed="eVar20,prop20";
// s.linkTrackVars="prop3,prop9,prop20,prop22,eVar20";
// s.eventList="event10"; Abandon,Success,Error
// s.setupFormAnalysis();
// s.prop31=(typeof(s.prop19)!="undefined"&&s.prop19!=""?s.prop19+" - ":"")+ s.pageName;
// s.prop32=(typeof(s.campaign)!="undefined"&&s.campaign!=""?s.campaign+" - ":"")+ s.pageName;
// s.prop34=(typeof(s.eVar34)!="undefined"&&s.eVar34!=""?s.eVar34+" - ":"")+ s.pageName;
// s.prop35=(typeof(s.eVar1)!="undefined"&&s.eVar1!=""?s.eVar1+" - ":"")+ s.pageName;
}
/* Custom Function - Instanciate oo Omniture code based on non-oo code or a default value*/
function setOV(name,defaultVal)
{
if(typeof(window['s_'+name])!=UNDEFINED)
{
if(typeof(window['s_'+name])=="string")
{
eval("s."+name+"='"+eval('s_'+name+'.replace(/['"]/g,"")')+"'");
}
else
{
eval("s."+name+"=s_"+name);
}
}
else
{
if(typeof(defaultVal)=="string")
{
if(defaultVal!="")
{
eval("s."+name+"='"+defaultVal.replace(/['"]/g,'')+"'");
}
else
{
eval("s."+name+"=''");
}
}
else if(typeof(defaultVal)!=UNDEFINED)
{
eval("s."+name+"="+defaultVal);
}
}
}
/* Custom Function - triggers the instanciation of all oo omniture variables */
function setPrevDefinedOmniVars(){
var k;
for(k=1;k<=50;k++){
setOV('prop'+k,"");
setOV('eVar'+k,"");
}
for(k=1;k<=5;k++){
setOV('hier'+k,"");
}
setOV('pageName',"");
setOV('channel',"");
setOV('products',"");
setOV('zip',"");
setOV('state',"");
setOV('events',"");
setOV('currencyCode',"USD");
setOV('trackDownloadLinks',true);
setOV('trackExternalLinks',true);
setOV('trackInlineStats',true);
setOV('linkDownloadFileTypes',"exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls,flv");
setOV('linkLeaveQueryString',true);
setOV('linkTrackVars',"None");
setOV('linkTrackEvents',"None");
setOV('purchaseID');
setOV('pageType');
setOV('linkInternalFilters',"javascript:");
setOV('dynamicAccountSelection', true);
setOV('dynamicAccountList');
setOV('dynamicAccountMatch');
setOV('visitorNamespace');
setOV('dc');
setOV('trackingServer');
setOV('trackingServerSecure');
setOV('vmk');
setOV('server');
setOV('cookieDomainPeriods');
setOV('charSet','UTF-8');
}