$().ready(function(){
$(".tab_content").hide();
$("ul.tabs li:first").addClass("active").show();
$(".tab_content:first").show();
$("ul.tabs li").hover(function(){
$("ul.tabs li").removeClass("active");
$(this).addClass("active");
$(".tab_content").hide();
var activeTab=$(this).find("a").attr("href");
$(activeTab).show();
return false;});});
$(document).ready(
function(){
$("#scrollDiv").textSlider({
line:4,
speed:500,
timer:5000});
$(".scoll").textSlider({
line:4,
speed:500,
timer:5000});});(function($){
$.fn.textSlider=function(settings){
settings=jQuery.extend({
speed:"normal",
line:2,
timer:1000},settings);
return this.each(function(){
$.fn.textSlider.scllor($(this),settings);});};
$.fn.textSlider.scllor=function($this,settings){
var ul=$("ul:eq(0)",$this);
var timerID;
var li=ul.children();
var _btnUp=$(".up:eq(0)",$this)
var _btnDown=$(".down:eq(0)",$this)
var liHight=$(li[0]).height();
var upHeight=0-settings.line*liHight;
var scrollUp=function(){
_btnUp.unbind("click",scrollUp);
ul.animate({marginTop:upHeight},settings.speed,function(){
for(i=0;i<settings.line;i++){
ul.find("li:first").appendTo(ul);}
ul.css({marginTop:0});
_btnUp.bind("click",scrollUp);});};
var scrollDown=function(){
_btnDown.unbind("click",scrollDown);
ul.css({marginTop:upHeight});
for(i=0;i<settings.line;i++){
ul.find("li:last").prependTo(ul);}
ul.animate({marginTop:0},settings.speed,function(){
_btnDown.bind("click",scrollDown);});};
var autoPlay=function(){
timerID=window.setInterval(scrollUp,settings.timer);};
var autoStop=function(){
window.clearInterval(timerID);};
ul.hover(autoStop,autoPlay).mouseout();
_btnUp.css("cursor","pointer").click(scrollUp);
_btnUp.hover(autoStop,autoPlay);
_btnDown.css("cursor","pointer").click(scrollDown);
_btnDown.hover(autoStop,autoPlay)};})(jQuery);
var flag=false;
function DrawImage(ImgD,imageWidth,imageHeight){
var image=new Image();
image.src=ImgD.src;
if(image.width>0&&image.height>0){
flag=true;
if(image.width/image.height>= imageWidth/imageHeight){
if(image.width>imageWidth){
ImgD.width=imageWidth;
ImgD.height=(image.height*imageWidth)/image.width;}else{
ImgD.width=image.width;
ImgD.height=image.height;}}
else{
if(image.height>imageHeight){
ImgD.height=imageHeight;
ImgD.width=(image.width*imageHeight)/image.height;}else{
ImgD.width=image.width;
ImgD.height=image.height;}}}}


