function onbutton(linkname, pic)
{
document.getElementById(linkname).src = (pic)
}
function hovercolor(color,linkname)
{
document.getElementById(linkname).style.color = (color)
}
function pop_normal_page(url)
{
window.open(url, 'user_page', "fullscreen=yes,scrollbars=yes,toolbar=yes,location=yes,menubar=yes,directories=yes,resizable=yes,status=yes")
}

function rotatad(iframe_id)
{
	var random_time = (Math.random())*240000;
	random_time = Math.floor(random_time);
	var fixed_time = 60000;
	var waiting_time = random_time + fixed_time;
	var javascrexpr = "exec_rotatad('" + iframe_id + "')";
	var t = setTimeout(javascrexpr,waiting_time);
}
function exec_rotatad(iframe_id)
{
	var thecurrent_src = document.getElementById(iframe_id).src;
	//reassign source
	document.getElementById(iframe_id).src = thecurrent_src;
	//call another turn
	//rotatad(iframe_id);
}

function popuphelp(url)
{
window.open(url, "popuphelp", "width=600,height=600,scrollbars=yes,resizable=yes,")
}

function report_not_working(userornabo, linkID, movieID)
{
var url='report_not_working.php?userornabo=' + userornabo + '&linkID=' + linkID + '&movieID=' + movieID
window.open(url, "report_not_working", "width=600,height=600,scrollbars=yes,resizable=yes,")
}

function open_url_decoder()
{
url="url_decoder.php"
window.open(url, "url_decoder", "width=600,height=200,scrollbars=yes,toolbar=no,location=no,menubar=0,directories=no,resizable=yes,status=0")
}

function wordwrap( str, int_width, str_break, cut ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Nick Callen
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Sakimori
    // *     example 1: wordwrap('Kevin van Zonneveld', 6, '|', true);
    // *     returns 1: 'Kevin |van |Zonnev|eld'
    // *     example 2: wordwrap('The quick brown fox jumped over the lazy dog.', 20, '<br />\n');
    // *     returns 2: 'The quick brown fox <br />\njumped over the lazy<br />\n dog.'
    // *     example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
    // *     returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim \nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \ncommodo consequat.'
 
    // PHP Defaults
    var m = ((arguments.length >= 2) ? arguments[1] : 75   );
    var b = ((arguments.length >= 3) ? arguments[2] : "\n" );
    var c = ((arguments.length >= 4) ? arguments[3] : false);
 
    var i, j, l, s, r;
 
    str += '';
 
    if (m < 1) {
        return str;
    }
 
    for (i = -1, l = (r = str.split("\n")).length; ++i < l; r[i] += s) {
        for(s = r[i], r[i] = ""; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : "")){
            j = c == 2 || (j = s.slice(0, m + 1).match(/\S*(\s)?$/))[1] ? m : j.input.length - j[0].length || c == 1 && m || j.input.length + (j = s.slice(m).match(/^\S*/)).input.length;
        }
    }
 
    return r.join("\n");
}

