$(document).ready(function(){
 	$(window).resize(function(){
		if(popup == 1){
			if(screenHeight != $(window).height() || screenWidth != $(window).width()){
				screenSize();
				//popupPos();
			}
		}
		if(saveOn = 1){
			$('#saveBar').animate({
				'width' : '100%'
			}, 5);
		}
	});
	
	
	
	$('.yes').live('click', function(){
		func = $(this).attr('id');
		window[func]();
		return false;
	}).live('mouseover', function(){
		$(this).css('font-weight', 'bold');
	}).live('mouseout', function(){
		$(this).css('font-weight', 'normal');
	});
	
	$('.no').live('click', function(){
		if($(this).attr('id') != ''){
			func = $(this).attr('id');
			window[func]();
		}else{
			hidePopup();
		}
		return false;
	}).live('mouseover', function(){
		$(this).css('font-weight', 'bold');
	}).live('mouseout', function(){
		$(this).css('font-weight', 'normal');
	});
	
	$('#screen').hide();
	$('#popup').hide();
	
	screenHeight = $('body').height();
	screenWidth = $('body').width();

	
	$(".body-right .head").live('click', function(){
	  	if(!$(this).next().hasClass('empty')){
	  		$(this).next().toggle("slow");
	  	}
	 	$(this).next().siblings("li.content").hide();
	  	$(this).toggleClass("active1");
	  	$(this).siblings("h2").removeClass("active1");
	  		
		var largeImagegPath = $(this).children('h2').attr('title');//get a href from Thumb image for Image path of Large image 
		var popupImagePath = $(this).children('h2').attr('boxpic');
		var aw = $(this).children('h2').attr('aw');
		var ah = $(this).children('h2').attr('ah');
		
		//var largeAlt = $(this).attr('title'); //get the Title from Thumb image for Alt tag of Large image .children('b')
        if(largeImagegPath != '' && largeImagegPath !== null){
			$('#body-left img').attr({ src: largeImagegPath });//.attr('src', imagepath ); //give new large image path of src and Alt tag, which I get from href and Title of href
        	$('#body-left img').attr({ aw: aw });
        	$('#body-left img').attr({ ah: ah });
        	$('#body-left img').parent('a').attr({ href: popupImagePath });
        }

        //$(".output").html(largeAlt); 
		return false; // mention it when use clcik event specially for src
			
	});

	$('.newslink').bind('click', function(){
		showWaiting('Loading...');
		page = $(this).attr('id');
		$('#body-wrapper').load('newslist.php', {'newspage':page}, hidePopup);
		return false;
	});
		
 });

var screenHeight;
var screenWidth;
var popup = 0; 