<!--
var division = "Main";
var property = "sonypictures";
var url = document.URL.toLowerCase();


var useTitleTag = "";
var prettyPageName = "";
var startDir4Property = 2;
var site = "";


	if (url.match(/^https?:\/\/.*/)) {
	site = url.replace(/^(https?:\/\/)([^\/]+\.)([^\.\/]+)(\.?(:8080)?\/.*)$/,"$3");
	} else {
	site = url.replace(/^([^\/]*\/?\/?[^\/]+\.)([^\.\/]+)(\.?(:8080)?\/.*)$/,"$2");
	}

var QI = url.indexOf("//");
if(QI != -1){
	dom = url.substring(QI+2);
	TI = dom.indexOf("/");
	if(TI != -1){
	dom = dom.substring(0,TI);
	}
	QI = dom.indexOf(".")
	while(QI >= 0)
	{
	dom = dom.substring(QI+1);
	QI = dom.indexOf(".");
	site = dom;
	}
    site = site.replace(/:8080/, "");
	site = site.replace(/:8081/, "");
	site = site.replace(/\./, "");
		
	if (site.match(/^\d+$/)) 
	{site = "us";}
	if(dom == 'com'||dom == 'net'||dom == 'org'||dom =='info')
	{site = "us";}
	
	if(site.length > 2){
	site = "us";}


}


if (document.pgOvr && document.pgOvr.pgNm)
{
  url = document.pgOvr.pgNm.value;
  url = url.replace ("/m2/ftp","http://www.sonypictures.com");
  
  intl = url.indexOf("intl");  
  if (intl != -1) {
   intl = url.substring(intl + 5);
   slash = intl.indexOf("/");
   site = intl.substring(0,slash);
   
   if (site == "uk"){  
   	  url = url.replace ("http://www.sonypictures.com","http://www.sonypictures.co.uk");
   }else if(site == "jp"){
      url = url.replace ("http://www.sonypictures.com","http://www.sonypictures.jp");
   }
    
   if (site == "global")
   {    division = "Sonypictures.net";
        startDir4Property = 0;
   }else if(site == "cn"){
      division = "Movies";
	  property = "kungfuhustle";
	  startDir4Property = 0;   
   }else{ url = url.replace(/\/intl\/\w+/, "");}
   }
 }
 
 
  
function getData()
{
    
    var foundSectionName = true;
    var foundPropertyVariable = false;
    if (url.match(/https?:\/\/[^\/]+\/movies\/.*/i))
    {   division = "Movies";
    } else if (url.match(/https?:\/\/[^\/]+\/[^\/]+\/movies\/.*/i)) {
        division = "Movies";
        startDir4Property = 3;
    } else if (url.match(/https?:\/\/[^\/]+\/tv\/.*/i)) {
        division = "Television";
		startDir4Property = 3;
    } else if (url.match(/https?:\/\/[^\/]+\/[^\/]+\/tv\/.*/i)) {
        division = "Television";
        startDir4Property = 4;
    } else if (url.match(/https?:\/\/[^\/]+\/homevideo\/promotions.html/i)) {
        division = "Home+Video";
    } else if (url.match(/https?:\/\/[^\/]+\/homevideo\/.*/i)) {
        division = "Home+Video";
    } else if (url.match(/https?:\/\/[^\/]+\/mobile\/.*/i)) {
        division = "Mobile";
		startDir4Property = 2;
    } else if (url.match(/https?:\/\/[^\/]+\/digent\/games\/.*/i)) {
        division = "Digent+Games";
		startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/digent\/mediasoftware\/.*/i)) {
        division = "Media+Software";
		startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/digent\/.*/i)) {
        division = "Digital+Entertainment";
		startDir4Property = 1;
	} else if (url.match(/https?:\/\/[^\/]+\/previews\/.*/i)) {
        division = "Previews+and+Clips";
        startDir4Property = 4;
    } else if (url.match(/https?:\/\/[^\/]+\/shop\/.*/i)) {
        division = "Shop";
		startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/corp\/.*/i)) {
        division = "Corporate";
		startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/win\/.*/i)) {
        division = "Win";
		startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/jspin2\/jsp\/spn\/.*/i)) {
        division = "SPN";
		startDir4Property = 3;
    } else if (url.match(/https?:\/\/[^\/]+\/spnet\/.*/i)){
        division = "SPN";
		startDir4Property = 0;
		property = "spn";
    } else if (url.match(/https?:\/\/[^\/]+\/cgi\/cgi-bin\/templates\/.*/i)) {
	    division = "SPN";
		startDir4Property = 0;
		property = "spn";
    } else if (url.match(/https?:\/\/[^\/]+\/classics\/.*/i)) {
        division = "Classics";
    } else if (url.match(/https?:\/\/[^\/]+\/cthe\/.*/i)) {
        division = "Home+Video";
    } else if (url.match(/https?:\/\/[^\/]+\/cthv\/.*/i)) {
        division = "Home+Video";
    } else if (url.match(/https?:\/\/[^\/]+\/metreon\/.*/i)) {
        division = "Metreon"; 
        startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/imageworks\/.*/i)) {
        division = "Imageworks";
        startDir4Property = 1;
    } else if (url.match(/https?:\/\/[^\/]+\/games\/.*/i)) {
	division = "Games";
    } else if (url.match(/https?:\/\/[^\/]+\/partners\/.*/i)) {
	division = "Partners";
    } else {
	foundSectionName = false;
    }

    if (startDir4Property == 1) {
        if (url.match(/(^https?:\/\/[^\/]+\/)([^\/]+)(\/.*$)/i)) {
            property = url.replace(/(^https?:\/\/[^\/]+\/)([^\/]+)(\/.*$)/i, "$2");
            foundPropertyVariable = true;
        }
    } else if (startDir4Property == 2) {
        if (url.match(/(^https?:\/\/[^\/]+\/[^\/]+\/)([^\/]+)(\/.*$)/i)) {
            property = url.replace(/(^https?:\/\/[^\/]+\/[^\/]+\/)([^\/]+)(\/.*$)/i, "$2");
            foundPropertyVariable = true;
        }
    } else if (startDir4Property == 3) {
        if (url.match(/(^https?:\/\/[^\/]+\/[^\/]+\/)([^\/]+\/)([^\/]+)(\/.*$)/i)) {
            property = url.replace(/(^https?:\/\/[^\/]+\/[^\/]+\/)([^\/]+\/)([^\/]+)(\/.*$)/i, "$3");
            foundPropertyVariable = true;
        }
    } else if (startDir4Property == 4) {
        if (url.match(/(^https?:\/\/[^\/]+\/[^\/]+\/)([^\/]+\/)([^\/]+\/)([^\/]+)(\/.*$)/i)) {
            property = url.replace(/(^https?:\/\/[^\/]+\/[^\/]+\/)([^\/]+\/)([^\/]+\/)([^\/]+)(\/.*$)/i, "$4");
            foundPropertyVariable = true;
        }
    }

    if (foundPropertyVariable == true) {
        property = property.replace(/[^\w\d_\-]/g, "");
    }
}

var vanityURL = url;
var domainCut= vanityURL.indexOf("//");
var endString = vanityURL.substring (domainCut+2);
    domainCut= endString.indexOf("/");
    if (domainCut== -1) { endString = "Home-index.html"; }
    else { endString = endString.substring (domainCut+1);
    domainCut= endString.indexOf ("?");}
    if ( endString == "" ) { endString = "Home"; }

//Updates tag for Movie and Tv Show Names
getData();
//changes digent for UK to Mobile
if(property == "digent" && site == "uk")
{ division = "Mobile";
  property = "mobile";}
  
//clarification for games

if(division == "Games"){
  property = property + "game";
}
  
//Creates HomePage Traffic

var homepage = 0;
var OT = url.indexOf("//");
if (OT != -1){
	checkindex = url.substring(OT+2);
	OU = checkindex.indexOf("/");
	if(OU == -1)
	{property = division + "-Home";
	 homepage = 1;
	}
	if(OU != -1){
	checkindex = checkindex.substring(OU);
	}
	OT = checkindex.indexOf("/");
	while(OT >= 0)
	{
	checkindex = checkindex.substring(OT+1);
	OT = checkindex.indexOf("/");
	}
    var checkhome = checkindex.indexOf("index");
	if(property == "sonypictures"){
	if(checkindex == ""||checkhome != -1 ){
	property = division + "-Home";}
	else if(homepage != 1)
	{ property = division + "-default";}
	}
}
  
  
var subdivision = division.toLowerCase();
//Dynamic variables passed to the Global Include
var title = escape (document.title.toLowerCase());
var affiliate = property + "-" + site;
endString = escape(endString);

if (document.flag && document.flag.useTitleTag.value == "true" && !document.pageName){
	useTitleTag = document.flag.useTitleTag.value;
	document.write("<form style='display:inline' name='h_xes_ao'><input type=hidden name='x_ao' value='53~" + endString + "~232~" + division + "~28~" + affiliate + "~221~" + site + "~" + "225~" + site + "^" + property + "^" + subdivision + "^" + title + "~5~" + title + "~'></form>");
  } else if (document.pageName && document.pageName.prettyPageName){
	 prettyPageName = document.pageName.prettyPageName.value;
	 if(prettyPageName == ""){
	  document.write("<form style='display:inline' name='h_xes_ao'><input type=hidden name='x_ao' value='53~"  + endString + "~5~" + url + "~232~" + division + "~28~" + affiliate + "~221~" + site + "~" + "225~" + site + "^" + property + "^" + subdivision + "^" + endString + "~'></form>");
     	 }else{
	 if(!document.flag){	 
	  document.write("<form style='display:inline' name='h_xes_ao'><input type=hidden name='x_ao' value='53~" + endString + "~232~" + division + "~28~" + affiliate + "~5~" + prettyPageName + "~221~" + site + "~" + "225~" + site + "^" + property + "^" + subdivision + "^" +  prettyPageName + "~'></form>");
  	 } else if(document.flag.useTitleTag.value == "false"){
	  document.write("<form style='display:inline' name='h_xes_ao'><input type=hidden name='x_ao' value='53~" + endString + "~232~" + division + "~28~" + affiliate + "~5~" + prettyPageName + "~221~" + site + "~" + "225~" + site + "^" + property + "^" + subdivision + "^" + prettyPageName + "~'></form>");
  	 } else{ 
	  document.write("<form style='display:inline' name='h_xes_ao'><input type=hidden name='x_ao' value='53~"  + endString + "~5~" + url + "~232~" + division + "~28~" + affiliate + "~221~" + site + "~" + "225~" + site + "^" + property + "^" + subdivision + "^" + endString + "~'></form>");
  	 }}
  } else{
     document.write("<form style='display:inline' name='h_xes_ao'><input type=hidden name='x_ao' value='53~"  + endString + "~5~" + url + "~232~" + division + "~28~" + affiliate + "~221~" + site + "~" + "225~" + site + "^" + property + "^" + subdivision + "^" + endString + "~'></form>");
  }

  function tracklink(landingpage)
  {
  var cutoffhttp = landingpage.indexOf("//");
	if(cutoffhttp != -1){
	linkname = landingpage.substring(cutoffhttp+2);}
  buildurl = "http://wvw.sonypictures.com/spacer.gif?event=28~" + affiliate + "~242~" + escape (linkname) + "~98~" + escape (landingpage);
  document.location = buildurl;
  }

var hs_aOE = "";
//-->