﻿function addEvent( obj, type, fn ) {
	if (obj.addEventListener) {
		obj.addEventListener( type, fn, false );
		EventCache.add(obj, type, fn);
	}
	else if (obj.attachEvent) {
		obj["e"+type+fn] = fn;
		obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
		obj.attachEvent( "on"+type, obj[type+fn] );
		EventCache.add(obj, type, fn);
	}
	else {
		obj["on"+type] = obj["e"+type+fn];
	}
}

var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){

					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();

addEvent(window,'unload',EventCache.flush);

var win = null;

function ShowFormWindow(mypage, myname, w, h, scroll, pos) {

    if (pos == "random") {
        LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;
        TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
    }
    if (pos == "center") {
        LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
        TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
    } else if ((pos != "center" && pos != "random") || pos == null) {
        LeftPosition = 0;
        TopPosition = 20
    }

    settings = 'width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';

    win = window.open(mypage, myname, settings);
	win.document.write("<html>");
	win.document.write("<head>");
	win.document.write("<title>"+myname+"</title>");
	win.document.write("</head>");
	win.document.write("<body style=\"margin:0; padding:0;\">");
	win.document.write("<img style=\"display:block;\" src=\""+mypage+"\" width=\""+w+"\" height=\""+h+"\" />");
	win.document.write("</body>");
	win.document.write("</html>");
	win.document.close();
}


jQuery(document).ready(function(){
    
jQuery('.opener').click(function() {
jQuery('.hover_block_holder').hide();
jQuery(this).next().toggle();
});

jQuery('.hover_block_holder .big').click(function() {
jQuery('.hover_block_holder').hide();
});

jQuery('.closer').click(function() {
jQuery('.hover_block_holder').hide();
});

jQuery('table.data tr:odd').addClass('hl');

  });

$(document).ready(function(){
$('.selectblock123 .pseudo1').click(function() {									 
if ($(this).hasClass('tact')){return false}
$('.selectblock .pseudo1').removeClass('tact');
$('.selectblock .pseudo1').addClass('tunact');
$(this).removeClass('tunact');
$(this).addClass('tact');
var ttt = $(this).attr('id');
$('.tblockshow').hide();
$('.'+ttt).show();
}); 
});

