window.onload=function() {

	spn=document.getElementsByTagName('h4');
	for(c=0;c<spn.length;c++) {
		spn[c].onclick=function() {			
			if(this.id!='') {
				stuff(this.id.split('s')[1]);
			}
		}
	}
	headtitle=document.getElementById('heading0');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(0);
    }
  }
	headtitle=document.getElementById('heading1');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(1);
    }
  }
	headtitle=document.getElementById('heading2');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(2);
    }
  }
	headtitle=document.getElementById('heading3');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(3);
    }
  }
	headtitle=document.getElementById('heading4');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(4);
    }
  }
	headtitle=document.getElementById('heading5');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(5);
    }
  }
	headtitle=document.getElementById('heading6');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(6);
    }
  }
	headtitle=document.getElementById('heading7');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(7);
    }
  }
	headtitle=document.getElementById('heading8');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(8);
    }
  }
	headtitle=document.getElementById('heading9');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(9);
    }
  }
	headtitle=document.getElementById('heading10');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(10);
    }
  }
	headtitle=document.getElementById('heading11');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(11);
    }
  }
	headtitle=document.getElementById('heading12');
  if(headtitle){
    headtitle.onclick=function() {
      mainhead(12);
    }
  }
	//expand();
}

function displaysubscription(n)
{
if(n==0)
{
document.getElementById('s0').className='collapse-title';
document.getElementById('div0').className='off';
stuff(1);
GetSubscription()

}
}

function stuff(n) {
	info=document.getElementById('div'+n);
	pic=document.getElementById('s'+n);	
	if(info.className=='on') {
		info.className='off';
		pic.className='collapse-title';
	}
	else {
		info.className='on';
		pic.className='expand-title';
	}
}

function mainhead(n) {
	info=document.getElementById('content'+n);
	pic=document.getElementById('heading'+n);
	
	if(info.className=='container on') {
		info.className='container off';
		pic.className='collapse-heading';
	}
	else {
		info.className='container on';
		pic.className='expand-heading';
	}
}
function GetSubscriptionMatches()
{
alert("GetSubscriptionMatches");
}
function GetBookmarkMatches(url){
	  var strURL=url;
      var insertURLS = "";
      $(document).ready(function(){
        $.ajax({ type: "GET",
          dataType: "jsonp",
          url: strURL,
          success: function(data){
            for(var i=0;i<data.length;i++){
              if (data.length > 0) {			  	    
                insertURLS += "<dt>web</dt><dd><a href=" + data[i].u + " target='_blank' class='tooltip'>" + data[i].n + "</a></dd>";
              }
            }
			//alert(insertURLS.length);
			if(insertURLS.length==0)
		{		
		
		document.getElementById("ser").innerHTML='<span style="font-size:13px;font-weight:bold;color:Red;">No Matches Found<span>'
		
		}
		else
		{
		document.getElementById("ser").innerHTML=insertURLS;
		document.getElementById("load").style.display="none";
		}
			//document.getElementById("ser").innerHTML=insertURLS;
	       }
        });
		
		
	  });
	  
    }
