function setSrc(id, src)
{
	try { document.getElementById(id).src = src; }
	catch(e) {}
}
function is_ua(text)
{
	try { return navigator.userAgent.toLowerCase().indexOf(text) >= 0; }
	catch(e) { return false; }
}
function open_live(href)
{
	try
	{
		var width = 450;
		var height = 360;
		if(is_ua("firefox"))
			width += 11;
		var chat = window.open(href, '_blank', 'scrollbars=no,menubar=no,resizable=0,location=no,screenX=50,screenY=100,width='+width+',height='+height+'');
		if (chat)
		{
			chat.focus();

			return true;
		}
	}
	catch(e) {}

	return false;
}

function is_skype_detected()
{
	try
	{
		if(typeof(navigator.mimeTypes["application/x-skype"]) == "object")
			return true;
			
	}
	catch(e)
	{
	}
	
	try
	{
		if(typeof(new ActiveXObject("Skype.Detection")) == "object")
			return true;
	}
	catch(e) {}
	
	return false;
}

function check_skype(tutor_skype)
{	
	if(is_skype_detected())
	{
		location.href = 'skype:'+tutor_skype;
		return false;
	}
	else
	{
		window.open('skype:'+tutor_skype, '_blank', 'scrollbars=no,menubar=no,location=yes,resizable=yes,screenX=0,left=0,screenY=0,top=0,width=1,height=1');
		return true;
	}
}

