	function hoverTab(tabData){
		tabData.style.backgroundPosition = " 0% -50px";
		tabData.style.lineHeight = "24px";
	}
	
	function outTab(tabData){
		tabData.style.backgroundPosition = " 0% -25px";
	}
	
	function executeTab(tabData){
		tabData.className = "tabactive";
		tabData.style.backgroundPosition = " 0% -0px";
		tabData.onmouseover=function(){};
		tabData.onmouseout=function(){};
	}
	
	function showTabData(idForDisplay){
		var tabFeatured = document.getElementById('tab-featured'); 
		var tabToprated = document.getElementById('tab-toprated');
		var tabMostview = document.getElementById('tab-mostview');
		
		var featuretab = document.getElementById('featuretab');
		var topratedtab = document.getElementById('topratedtab');
		var mostviewedtab = document.getElementById('mostviewedtab');
		
		tabFeatured.style.display = "none";
		tabToprated.style.display = "none";
		tabMostview.style.display = "none";
		 
		featuretab.className = "";
		topratedtab.className = "";
		mostviewedtab.className = "";
		
		featuretab.style.backgroundPosition = " 0% -25px";
		topratedtab.style.backgroundPosition = " 0% -25px";
		mostviewedtab.style.backgroundPosition = " 0% -25px";
		
		featuretab.onmouseover=function(){hoverTab(this);}
		topratedtab.onmouseover=function(){hoverTab(this);}
		mostviewedtab.onmouseover=function(){hoverTab(this);}
		
		featuretab.onmouseout=function(){outTab(this);}
		topratedtab.onmouseout=function(){outTab(this);}
		mostviewedtab.onmouseout=function(){outTab(this);}
		
		if (idForDisplay == "featured"){	
			tabFeatured.style.display = "block";
			executeTab(featuretab);
		}			
		else if(idForDisplay == "toprated"){
			tabToprated.style.display = "block";
			executeTab(topratedtab);			
		}
		else if(idForDisplay == "mostview"){
			tabMostview.style.display = "block";
			executeTab(mostviewedtab);
		}

 	}

    function showDetail()
        {

          var detailContainer = document.getElementById('detailContainer');
          var shortDetailContainer = document.getElementById('shortDetailContainer');
          if(detailContainer.style.display == 'none')
          {
            detailContainer.style.display = '';
            shortDetailContainer.style.display = 'none';
          }else{
            detailContainer.style.display = 'none';
            shortDetailContainer.style.display = '';
          }
    }

    function ToggleCopyPaste(){

          var copyPasteColapsed = document.getElementById('copyPasteColapsed');
          var copyPasteExpanded = document.getElementById('copyPasteExpanded');
          if(copyPasteColapsed.style.display == 'none')
          {
            copyPasteColapsed.style.display = '';
            copyPasteExpanded.style.display = 'none';
          }else{
            copyPasteColapsed.style.display = 'none';
            copyPasteExpanded.style.display = '';
          }
    }

    function TogglePostDiv(){

          var postColapsed = document.getElementById('postColapsed');
          var postExpanded = document.getElementById('postExpanded');
          if(postColapsed.style.display == 'none')
          {
            postColapsed.style.display = '';
            postExpanded.style.display = 'none';
          }else{
            postColapsed.style.display = 'none';
            postExpanded.style.display = '';
          }
    }

     function ToggleEmailDiv(){

          var emailColapsed = document.getElementById('emailColapsed');
          var emailExpanded = document.getElementById('emailExpanded');
          if(emailColapsed.style.display == 'none')
          {
            emailColapsed.style.display = '';
            emailExpanded.style.display = 'none';
          }else{
            emailColapsed.style.display = 'none';
            emailExpanded.style.display = '';
          }
    }

    function Share()
    {

      var share_content = document.getElementById('share_content');
      var moreopt = document.getElementById('moreopt');
      var feweropt = document.getElementById('feweropt');

      if(share_content.style.display == 'none')
      {
        share_content.style.display = '';
        moreopt.style.display = 'none';
        feweropt.style.display = '';
      }else{
        share_content.style.display = 'none';
        moreopt.style.display = '';
        feweropt.style.display = 'none';
      }
            
       TogglePostDiv();
       ToggleEmailDiv();      
    }

    function toggleDiv(divId)
    {
        var myDiv = document.getElementById(divId);
        var myDivTitle = document.getElementById(divId+'Title');
        if(myDiv.style.display == 'none')
        {
          myDiv.style.display = '';
          myDivTitle.className= 'content_subtitle_expanded';
        }else{
          myDiv.style.display = 'none';
          myDivTitle.className= 'content_subtitle_colapsed';
        }
    }

    function updatePostalCodeVisibility() {
	   var select = document.getElementById('country');
       var postalCodeRow = document.getElementById('postalCode_container');
		switch (select.value) {
			default:
				postalCodeRow.style.display = 'none';
				break;
			case 'United States':
		     	postalCodeRow.style.display = '';
		}
	}

     function showHideDiv(divId)
    {
        var myDiv = document.getElementById(divId);
        if(myDiv.style.display == 'none')
        {
          myDiv.style.display = '';
        }else{
          myDiv.style.display = 'none';
        }
    }

    function addContact(contactName)
    {
        var contacts = document.getElementById('to');
        if(contactName == 'All Friends'){
            contacts.value = contactName;
        }
        else{
          var old_value = contacts.value;
          if(contacts.value == 'All Friends'){
               old_value = '';
          }
          if(old_value == ''){
              contacts.value = old_value + contactName;
          }
          else{
              var mystr = old_value.match(contactName);
              if(mystr == null)
              {
                contacts.value = old_value +',  '+contactName;
              }
          }
        }
    }

    function cancelMail(){
        document.getElementById('to').value = '';
        document.getElementById('messopt').value = '';
        ToggleEmailDiv();
        Share();
    }

     function toogleUpload(uType)
	{
		if (uType == 'original')
		{

			document.getElementById("featuredUpload").checked = false;
			document.getElementById('originalUpload').checked = true;
			document.getElementById("listch").value = document.getElementById("chlist").value;
		}
		else
		{
			document.getElementById('originalUpload').checked = false;
			document.getElementById("featuredUpload").checked = true;
			document.getElementById("listch").value = 1;
		}
	}

    function toggleComment(){
        var total_comments = document.getElementById('total_comments');
        if(total_comments.style.display == '')
        {
          total_comments.style.display = 'none';
          document.getElementById('txtComments').value = '' ;
          hideMe('divComResult1');
          hideMe('divComResult2');
          hideMe('divComResult3');
        }else{
          total_comments.style.display = '';
          showMe('divComments');
          hideMe('divComResult1');
          hideMe('divComResult2');
          hideMe('divComResult3');
        }

    }