/* Fetch window width and hide/show right side */
function liveWidth(){
    var x;
	var y;
	x = window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;
	y = window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body != null ? document.body.clientHeight : null;
	document.getElementById('tframe').style.height = y-200+'px';
	
}


function comment_it(retur)
{
   // 1 - tutorials 2 - video 3 - article
	document.getElementById('tframe').style.display = 'none';
	document.getElementById('share').style.display = 'block';
	document.getElementById('top_img').innerHTML = '<img src="/images/iconite'+retur+'.jpg" alt="" onClick="retur('+retur+')" />';
}

function retur(returaa)
{
	// 1 - tutorials 2 - video 3 - article
	document.getElementById('share').style.display = 'none';
    document.getElementById('tframe').style.display = 'block';
	document.getElementById('top_img').innerHTML = '<img src="/images/iconite.jpg" alt="" onClick="comment_it('+returaa+')" />';
}

function rate_it(val,tutorial)
{
	if (document.getElementById('actions_frame') != undefined)
	{
		document.getElementById('actions_frame').src = '/index.php?doaction=true&tutorial='+tutorial+'&rate='+val;
	}
	else
	{
		document.actions_frame.location = '/index.php?doaction=true&tutorial='+tutorial+'&rate='+val;
	}
}

/* Atach to events */
window.onload = liveWidth;
document.onload = liveWidth;
window.onresize = liveWidth;
document.onresize = liveWidth;

