function visibleBox(id,visiblehide) 
{		
	elm3 = document.getElementById(id);
	if(!visiblehide)
	{
		if(elm3.style.display=="none")
		{
			visiblehide=""
		}
		else
		{
			visiblehide="none"
		}
	}
	showHideBox(id,visiblehide)	
}
function reportError(originalRequest)
{
	alert('Error in processing your request!');
}

function showHideBox(id,visiblehide)
{
	elm1 = document.getElementById("open"+id);
	elm2 = document.getElementById("close"+id);
	elm3 = document.getElementById(id);
	if(!elm3)return false;
	if(elm1) 
	{
		if (visiblehide == "none") 
		{
			elm1.style.display = "none";
			if(elm2)elm2.style.display = "";
			elm3.style.display = "none";
		}
		else 
		{
			elm1.style.display = "";
			if(elm2)elm2.style.display = "none";
			elm3.style.display = "";
		}
	}
}

var newWindow = null

function makeNewWindow(theUrl) {

    // check if window already exists

    if (!newWindow || newWindow.closed) {

        // store new window object in global variable

        newWindow = window.open(theUrl,"w" ,"width=500,height=500, scrollbars=yes");
    } else {
        newWindow.focus();
              newWindow = window.open(theUrl,"w", "width=500,height=500, scrollbars=yes");

    }

}

function changevideosites(pars,site_url)
{	
	url="http://"+site_url+"/admin/videos/changevideosites.php";
	var myAjax = new Ajax.Updater(
			{success: 'video_site'}, 
			url, 
			{
				method: 'get', 
				parameters: pars,	
				evalScripts:true,		
				onFailure: reportError
			});
}

function get_tfpt_points(userid){	
	var tfpturl;
	tfpturl = "get_current_tfptpoints.php?user_id=" + userid;
	window.open (tfpturl, "tfptpoints", "resizable=1,location=0,status=0,scrollbars=0,width=485,height=120");
	
}

