$.noConflict();
jQuery(document).ready(function($) {
	
        $('a.hover img[src], .hover[src]').live('mouseover mouseout', function(event) {

                        hovimgend = "_on";

                        chkimgend = /_on/;


                        pattern = /\.(jpg|jpeg|png|gif)$/;

                        imgsrc = $(this).attr("src");

                        extmatch = imgsrc.match(pattern)[0];

                        matches = imgsrc.match(chkimgend);

                if (!matches && event.type == 'mouseover') {
                        $(this).attr("src", imgsrc.replace(pattern, hovimgend + extmatch));
                }
                else if (matches && event.type == 'mouseover') {
                }
                else {
                        $(this).attr("src", imgsrc.replace(hovimgend + extmatch, extmatch));
                }

                $(window).bind( 'unload', function(){
                                $(this).attr("src", imgsrc.replace(hovimgend + extmatch, extmatch));
                });
        });


	/* Popup Windows */
	
	$('a.popup01').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=900,width=830,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$('a.popup02').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=900,width=680,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$('a.popup03').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=450,width=470,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$('a.popup04').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=600,width=600,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$('a.popup05').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=680,width=1000,menubar=no,toolbar=no,scrollbars=no');
		if (window.focus) {newwindow.focus()}
		return false;
	});

	$('a.popup06').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=900,width=1000,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$('a.popup07').live('click', function(){
		newwindow=window.open('','posttype','height=550,width=700,menubar=no,toolbar=no,scrollbars=yes');
		window.document.popupform.action=$(this).attr('href');
		window.document.popupform.target = "posttype"; 
		window.document.popupform.method="POST";
		window.document.popupform.submit() ; 

		if (window.focus) {newwindow.focus()}
		return false;
	});

	$('a.popup08').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=600,width=800,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});

	$('a.popup09').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=800,width=1000,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});

	$('a.popup10').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=900,width=1024,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});

	$('a.popup11').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=844,width=1130,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
		$('a.popup12').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','height=700,width=470,menubar=no,toolbar=no,scrollbars=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});
	
	$(".highlightTableCell td").live('mouseover mouseout click', function(event) {
		if (event.type == 'mouseover') {
			if (!($(this).is(':empty') || $(this).hasClass("disabled") )) {
				$(this).addClass("hover");
			}
			/*else if($(this).is(':empty')) {
				
			}*/
		}
		if (event.type == 'mouseout') {
			$(this).removeClass("hover");
		}
		if (event.type == 'click') {
			var href = $(this).find("a").attr("href");
			if(href) {
				window.location = href;
			}			
		}
	});

	$('a.movie').live('click', function(){
		newwindow=window.open($(this).attr('href'),'','width=940,height=530,menubar=no,toolbar=no,scrollbars=yes,resizable=yes');
		if (window.focus) {newwindow.focus()}
		return false;
	});

});
