function addBookmark(url, title)
{
 if (!url) url = location.href;
 if (!title) title = document.title;
 
 //Gecko
 if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) window.sidebar.addPanel (title, url, "");
 //IE4+
 else if (typeof window.external == "object") window.external.AddFavorite(url, title);
 //Opera7+
 else if (window.opera && document.createElement)
 {
   var a = document.createElement('A');
   if (!a) return false; //IF Opera 6
   a.setAttribute('rel','sidebar');
   a.setAttribute('href',url);
   a.setAttribute('title',title);
   a.click();
 }
 else return false;
 
 return true;
}


function ShowBlock(id, ids){
    for(i=0;i<ids.length;i++)  {
        document.getElementById(ids[i]).style.display = 'none';
        document.getElementById(ids[i]+'-li').setAttribute("class", "");
    }
    document.getElementById(id).style.display = 'block';
        document.getElementById(id+'-li').setAttribute("class", "selected");
}       

function ShowHide(id){
   if ( document.getElementById(id).style.display == 'block')
    document.getElementById(id).style.display = 'none';
   else
    document.getElementById(id).style.display = 'block';
}

function getSubCategory(categoryId){
  if ( categoryId != '')
    $("#companyTypeId")[0].innerHTML = $.ajax({
      url: rootPath+"companies/subcategorylist/"+categoryId,
      async: false
    }).responseText;
  else
    $("#companyTypeId")[0].innerHTML = '';
}
function getInsertionSubCategory(categoryId){
  if ( categoryId != '')
    $("#insertionCategory")[0].innerHTML = $.ajax({
      url: rootPath+"insertions/subcategorylist/"+categoryId,
      async: false
    }).responseText;
  else
    $("#insertionCategory")[0].innerHTML = '';
}
function getCompanySubCategory(categoryId, search, active){
  if ( categoryId != '')
    $("#companySubcategoryId")[0].innerHTML = $.ajax({
      url: rootPath+"panel/admincompanyreference/subcategorylist/subcategory/"+categoryId+(search!=null?'searchkey/'+search+'/':'')+(active!=null?'active/'+active:''),
      async: false
    }).responseText;
  else
    $("#companySubcategoryId")[0].innerHTML = '';
}
function getQuestionSubCategory(categoryId){
  if ( categoryId != '')
    $("#questionCategory")[0].innerHTML = $.ajax({
      url: rootPath+"questions/subcategorylist/"+categoryId,
      async: false
    }).responseText;
  else
    $("#questionCategory")[0].innerHTML = '';
}
function getSubCategoryForNew(categoryId){
  if ( categoryId != '')
    $("#companyTypeId")[0].innerHTML = $.ajax({
      url: rootPath+"companies/subcategorylistnew/"+categoryId,
      async: false
    }).responseText;
  else
    $("#companyTypeId")[0].innerHTML = '';
}
function getCategoryReferenceList(categoryId){
  if ( $("#companyReferenceIdList")[0] != null ) {
	  if ( categoryId != '')
		$("#companyReferenceIdList")[0].innerHTML = $.ajax({
		  url: rootPath+"companies/companyreferencelist/"+categoryId,
		  async: false
		}).responseText;
	  else
		$("#companyReferenceIdList")[0].innerHTML = '';
	}
}

function showClass(showClass, hideClass){
  $("li."+hideClass).removeClass("visible");
  $("li."+showClass).addClass("visible");
}

function checkAll(chkbxClass){
  $("."+chkbxClass).attr('checked', true);
}
function unCheckAll(chkbxClass){
  $("."+chkbxClass).attr('checked', false);
}


$(document).ready(function() {
	if ( $('#rightBanners')[0] != null ) {
		$('#rightBanners')[0].innerHTML = $.ajax({
			url: rootPath+'index/rightbanners',
			async: false
			}).responseText; 
		if ( $('#befeaterBanner')[0] != null ) {
		var ITCGRef = 'none';if (document.referrer) ITCGRef = escape(document.referrer);
		var ITCGuTail = '?randad' + Math.round((Math.random()*10000000)) + '&' + ITCGRef;
		var ITCGSc = '<'+'script language="JavaScript" type="text/javascript" ';
		ITCGSc += 'src="http://www.itcgin.net/show/24132433/show.js'+ITCGuTail;
		ITCGSc += '"><'+'/script'+'>';
		
		$('#befeaterBanner')[0].innerHTML = ITCGSc; 
	}
	}/*
	if ( $('#informers')[0] != null ) {
		$('#informers')[0].innerHTML = $.ajax({
			url: rootPath+'index/informers',
			async: false
			}).responseText; 
	}*/
	
	
	
	
});