/*
This was created by Ujeen
*/
/* Banner Blik Animation */
$(document).ready(function(){
	if(!$.browser.msie){
	  $('.for_blick').css('position','relative');	
	  $('.for_blick').each(function(item){
	  	var link = $(this).children('a');
	  	var href = link.attr('href');
	  	var a_height;
	  	var a_width;
	  			a_height = link.innerHeight();
	  			a_width = link.innerWidth();
	  	$(this).children('a').children().each(function(){
	  		if (this.tagName == 'IMG') {
	  			a_height = $(this).height();
	  			a_width = $(this).width();
	  		}
	  	})	
	  	var target = '_self';
	  	var speed = 150;
	  	var offset = 100;
	  	var pad = 2;	  	
	  	if ($(this).children('a').attr('target')) {
	  		 target = $(this).children('a').attr('target');
	  	}
	  	var button;
	  	button = '<a class="blick iePNG" href='+href+' target='+target+'></a>';
	  	$(this).append(button);
	  	var blik = $(this).children('a.blick');
	  	var blik_css = {
	  		'position':'absolute',
	  		'left':pad,
	  		'top':'0px',
	  		'height':a_height,
	  		'width':(a_width-(pad*2)),
	  		'display':'block',
	  		'zindex':'1000',
	  		'background':'url("/theme/images/blik.png") no-repeat -'+offset+'px top',
	  		'opacity':0.8
	  	}
	  	blik.css(blik_css);
	  	var anim_width = a_width;
	  	blik.mouseover(function(){
	  		$(this).stop();
	  		$(this)
	  		.animate({
	  			backgroundPosition:'('+(anim_width+offset)+'px 0px)'
	  		},speed)
	  		
	  	});
	  	blik.mouseout(function(){
	  		$(this).stop();
	  		$(this)
	  		.animate({
	  			backgroundPosition:'(-'+offset+'px 0px)'
	  		},speed)
	  	});
	  })
	  
	  
	  
	}
});
/* Slide Background */
$(document).ready(function(){
	if(!($.browser.msie && (jQuery.browser.version != '1.0'))) {
	$('#header').css({
		'background': 'url("/theme/images/header_top_bg.png") no-repeat left +158px'
	});
	$('.content_topbg').css({
		'background': 'url("/theme/images/content_topbg.png") no-repeat left -219px'
	});
	$.timer(1500, function (timer) {
   	$('#header').animate({
   		backgroundPosition: '(0 -25px)'
   	},300)
   	timer.stop();
   });
   $.timer(2000, function (timer) {
   	$('.content_topbg').animate({
   		backgroundPosition: '(0 137px)'
   	},300)
   	timer.stop();
   });
	}
if ($.browser.msie && $.browser.version == 8) {
    $('#header').css({
		'background': 'url("/theme/images/header_top_bg.png") no-repeat left +158px'
	});
	$('.content_topbg').css({
		'background': 'url("/theme/images/content_topbg.png") no-repeat left -219px'
	});
	$.timer(1500, function (timer) {
   	$('#header').animate({
   		backgroundPosition: '(0 -25px)'
   	},300)
   	timer.stop();
   });
   $.timer(2000, function (timer) {
   	$('.content_topbg').animate({
   		backgroundPosition: '(0 137px)'
   	},300)
   	timer.stop();
   });
  }
});
