// New Javascript
function readCookie() {
   if (document.cookie=='')   {
        return false;
   }
   
   var the_cookie = document.cookie;
   var i;
   var all_cookies;
   var broken_cookie;
   var sourceCode;
   var acquirerCode;
   var codes = "";
   all_cookies = the_cookie.split(';');
   

   for (i=0;i<all_cookies.length;i++){
       
       broken_cookie = all_cookies[i].split('=');
       var cname = broken_cookie[0].replace(/^\s+|\s+$/g, '');

       if (cname == "pscd_source_code"){
         codes = broken_cookie[1].split('/');
         sourceCode =codes[0];
         acquirerCode = codes[1];
      }
   }
   return codes;
}

function localToggle($item) {
    $item.each(function(i) {
    var $this = $(this);
    $this.find('h3.question a').bind('click', function() {
        $this.find('.answer').toggle();
        return false;
    }).click();
    
    });
}



$(document).ready(function(){
  $("#customer-options a").click(function(){
        var url = $(this).attr("href");
        var txt = $(this).attr("text");
        if (url.indexOf("https://secure.partnershipcard.co.uk/servicing/index.axp?resetstate=yes") > -1) {
            sc_trackPCMyAccount("My Account Hdr Link")
        } 
  });
   
  $("#navigation a").click(function(){
        var url = $(this).attr("href");
        var txt = $(this).attr("text");
        if (url.indexOf("https://secure.partnershipcard.co.uk/servicing/index.axp?resetstate=yes") > -1) {
            sc_trackPCMyAccount("My Account Nav Bar")
        } 
   });
   $(".homemainpartop a").click(function(){
        var url = $(this).attr("href");
        var txt = $(this).attr("text");
        if (url.indexOf("https://secure.partnershipcard.co.uk/servicing/index.axp?resetstate=yes") > -1) {
            sc_trackPCMyAccount("My Account Main")
        } 
   });
   
    $(".twoTabPanel a").click(function(){
        var url = $(this).attr("href");
        var txt = $(this).attr("text");
        if (url.indexOf("https://secure.partnershipcard.co.uk/servicing/index.axp?resetstate=yes") > -1) {
            sc_trackPCMyAccount("My Account Activate")
        } 
   });
   
    $("#footer a").click(function(){
        var url = $(this).attr("href");
        var txt = $(this).attr("text");
        if (url.indexOf("https://secure.partnershipcard.co.uk/servicing/index.axp?resetstate=yes") > -1) {
            sc_trackPCMyAccount("My Account Footer")
        } 
   });
   
   $("#footer a").click(function(){
        var url = $(this).attr("href");
        var txt = $(this).attr("text");
        if (url.indexOf("https://secure.partnershipcard.co.uk/app/status.axp?resetstate=yes") > -1) {
            sc_trackPCMyAccount("Account Status Footer")
        } 
   });
 
 localToggle($("#main .faq"));

});


