window.resizeTo(screen.availWidth,screen.availHeight);
window.moveTo(0,0);

function f_init() {
	f_sizeTextArea();
	for( var apple in arrFb ) {
		var plum = apple.replace( "_","_fb" );
		blocking( plum );
	}
	if( navigator.appName.indexOf( "Microsoft" ) != -1 ) {
		document.getElementById( "div_download_titlebar" ).style.paddingBottom = 0;
	}

}
function f_DisplayDownload( blockNone ) {
	document.getElementById( "div_download" ).style.display = blockNone;
}


function f_TD( e,overOut ) {
	e.style.textDecoration = overOut;
}
function f_DisplayDownload( blockNone ) {
	document.getElementById( "div_download" ).style.display = blockNone;
}

function f_sendComments() {
    var url = "srvycmnts_4_updatedb.php";
    var sComments = document.getElementById( "comments" ).value;
    if( sComments.length > 0 ) {
        var sKV = "comments=" + sComments;
        postDataReturnText( url,sKV,f_sendCommentsReturn );
    }
}

function f_sendCommentsReturn( txt ) {
    alert( txt );
	document.getElementById( "comments" ).value="";
}

function f_sizeTextArea() {
    var oTa = document.getElementById( "comments" );
    if( document.all )
    {
        oTa.outerHTML = '<textarea id="comments" rows="9" cols="84"></textarea>';
    }
}
/*
function f_showFb_061015145226( eid, e ) {
	var tr_id = eid.replace( "_","_fb" );
	var td_id = eid.replace( "r_","d_fb" );

	var sFb = "&nbsp;<br />" + arrFb[ eid ].replace( "|", "<br /><br />" );
	sFb += "<div class=\"div_fb\" onclick=\"f_closeFb( '" + tr_id + "',event );\">Close</div>";
	document.getElementById( td_id ).innerHTML = sFb;
	if(navigator.appName.indexOf("Microsoft") > -1){
	var canSee = 'block'
	} else {
	var canSee = 'table-row';
	}
	document.getElementById( tr_id ).style.display = canSee;
	if( e ) {
		this.e = e;
	} else {
		this.e = window.event;
	}
	if( e.clientY > screen.height/2 ) {
		window.scrollBy( 0, e.clientY - (screen.height/2) );
	}

}
*/
function f_showFb( eid, e ) {
	var tr_id = eid.replace( "_","_fb" );
	var td_id = eid.replace( "r_","d_fb" );

	var sFb = "&nbsp;<br />" + arrFb[ eid ].replace( "|", "<br /><br />" ) + "<br />&nbsp;";
//	sFb += "<div class=\"div_fb\" onclick=\"f_closeFb( '" + tr_id + "',event );\">Close</div>";
	var td_fb = document.getElementById( td_id );
	td_fb.innerHTML = sFb;
	blocking( tr_id );

	if( e ) {
		this.e = e;
	} else {
		this.e = window.event;
	}
	if( e.clientY > screen.height/2 ) {
		window.scrollBy( 0, e.clientY - (screen.height/2) );
	}
}

function f_closeFb( eid, e ) {
	document.getElementById( eid ).style.display = '';
}
/////////////////////////////////////////////////////
function visi(nr)
{
	if (document.layers)
	{
		vista = (document.layers[nr].visibility == 'hide') ? 'show' : 'hide'
		document.layers[nr].visibility = vista;
	}
	else if (document.all)
	{
		vista = (document.all[nr].style.visibility == 'hidden') ? 'visible'	: 'hidden';
		document.all[nr].style.visibility = vista;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.visibility == 'hidden') ? 'visible' : 'hidden';
		document.getElementById(nr).style.visibility = vista;

	}
}

function blocking(nr)
{
	if (document.layers)
	{
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		if( current == 'block' ) {
			if( document.layers[ nr ].tagName == 'TR' || document.layers[ nr ].tagName == 'TD'  ) {
				current = f_CanSee();
			} else if( document.layers[ nr ].tagName == 'SPAN' ) {
				current = 'inline';
			}
		}
		document.layers[nr].display = current;
	}
	else if (document.all)
	{
		current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
		if( current == 'block' ) {
			if( document.all[ nr ].tagName == 'TR' || document.all[ nr ].tagName == 'TD' ) {
				current = f_CanSee();
			} else if( document.all[ nr ].tagName == 'SPAN' ) {
				current = 'inline';
			}
		}
		document.all[nr].style.display = current;
	}
	else if (document.getElementById)
	{
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		if( vista == 'block' ) {
			if( document.getElementById( nr ).tagName == 'TR' || document.getElementById( nr ).tagName == 'TD' ) {
				vista = f_CanSee();
			} else if( document.getElementById( nr ).tagName == 'SPAN' ) {
				vista = 'inline';
			}
		}
		document.getElementById(nr).style.display = vista;
	}
}

function f_CanSee() {
	if(navigator.appName.indexOf("Microsoft") > -1){
	var canSee = 'block'
	} else {
	var canSee = 'table-row';
	}
	return canSee;
}


