function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div style="display: none;" id="bo_ns_id_' + bo_ns_id + '">');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    if(theObject.firstChild.data){
      theObject.firstChild.removeAttribute('data');
    }
    var theParams = theObject.getElementsByTagName("param");
    var theParamsLength = theParams.length;
    for (var j = 0; j < theParamsLength; j++) {
      if(theParams[j].name.toLowerCase() == 'flashvars'){
        var theFlashVars = theParams[j].value;
      }
    }
    var theInnnerHTML = theObject.innerHTML;
    var re = /<param name="FlashVars" value="">/ig;
    theInnnerHTML = theInnnerHTML.replace(re, "<param name='FlashVars' value='" + theFlashVars + "'>");
    theObject.outerHTML = theInnnerHTML;
  }
}

function isIE(){
  var strBrwsr = navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    return true;
  }else{
    return false;
  }
}

function showPictureEmbedOptions() {

	if (document.getElementById('showmoreembed').style.display == 'none') {

		document.getElementById('showmoredesc').style.display = 'none';
		document.getElementById('showmoreembed').style.display = '';
		document.getElementById('showlessdesc').style.display = '';

	}

}


function HidePictureEmbedOptions() {
        document.getElementById('showmoreembed').style.display = 'none';
        document.getElementById('showlessdesc').style.display = 'none';
	document.getElementById('showmoredesc').style.display = '';
}


function showMoreEmbedOptions(the_layer)
{
  if(document.getElementById(the_layer))
  {
    if(document.getElementById(the_layer).style.display == 'none')
    {
      document.getElementById(the_layer).style.display = 'inline';
    }
    else
    {
      document.getElementById(the_layer).style.display = 'none';
    }
  }
}


function showLessEmbedOptions() {
        document.getElementById('showmoreembed').style.display = 'none';
        document.getElementById('showlessdesc').style.display = 'none';
}

function verify_email(status) {
	if (status == "true") {
		alert("Your email address has been verified!");
	} else {
		alert("This email confirmation link is no longer valid.");
	}
}

function createNewGroup() {
	var name = prompt('Enter a new group name:','');
		if (name) {
			addFormValue("group_name", name);
			doAction("add_group");
		}
}

	function addFormValue(name, value)
	{
		var e = document.createElement('input');
		e.setAttribute('type', 'hidden');
		e.setAttribute('name', name);
		e.setAttribute('value', value);
		document.friendsForm.appendChild(e);
	}
	
	function doAction(action)
	{
		var e = document.createElement('input');
		e.setAttribute('type', 'hidden');
		e.setAttribute('name', action);
		e.setAttribute('value', "1");
		document.friendsForm.appendChild(e);
		document.friendsForm.submit();
	}

function deleteGroup(status) {
	if (confirm("Are you sure you want to delete this group?")) {
		var status;
		addFormValue("deleteid",status)
		doAction("delete_group");
	}
}

function doCopy(selector)
{
	var action = selector.options[selector.selectedIndex].value;
	if (action)
	{
		doAction("ctg");
	}
}

function confirmDelete(vargrp) {
	var val = confirm("Sure you wanna delete these users from the "+vargrp+" group?");

	if (val) {
		return true;
	} else {
		return false;
	}

}

function confirmPermDelete(vargrp) {
        var val = confirm("These contacts will be permanently deleted.  Are you sure you want to do this?");

        if (val) {
                return true;
        } else {
                return false;
        }

}

function confirmDeleteFromFavorites() {
	var val = confirm("Are you sure you want to delete this as a favorite?");

        if (val) {
                return true;
        } else {
                return false;
        }

}

function toggleVideoPlayer() { 
	if (document.getElementById('vidplaya').style.visibility == '') {
		document.getElementById('vidplaya').style.visibility='none';
	} else {
		document.getElementById('vidplaya').style.visibility = '';
	}
}

