var $siteurl = window.location.host.replace(/(.+)/, "http://$1/");/*站点网址*/
var $url=window.location.href;/*当前页面url*/
$(function(){$("input[type='text'],input[type='password']").addClass('text');$("input[type='button'],input[type='submit'],input[type='reset']").addClass('button');$("input[type='radio']").addClass('radio');$("input[type='checkbox']").addClass('checkbox');$("input[type='textarea']").addClass('textarea');$("input[type='file']").addClass('file');
$("a[rel=_blank]").each(function(){$(this).attr("target","_blank");});/*新窗口打开的链接*/
$("a[rel=submit]").each(function(){$(this).click(function(){$(this).parents("form").submit();return false;});});
});

var csc = new Object(); //自定义组件
csc.tabs=function(hdId,bdId,howDo,hdClass,bdClass){
		var $hd=$(hdId),$bd=$(bdId),howDo=howDo||false,hC=hdClass||"current",bC=bdClass||"current";
		function tabsDo(wh,i){
			wh.addClass(hC).siblings().removeClass(hC);
			$bd.eq(i).addClass(bC).siblings().removeClass(bC);
			}
		$hd.each(function(i){
						  if(howDo=="over"||!howDo){
							  $(this).mouseover(function(){
														 tabsDo($(this),i);
														 });
							  }
							  else{
								  $(this).click(function(){
														 tabsDo($(this),i);
														 });
								  }
						  });
		}
csc.scroll=function(w,time,stime){
	var $w=$(w),mH=$w.outerHeight(true),wP=$w.parent(),time=time||3000,stime=stime||"normal";
	function scrollStar(){var $w=$(w).eq(0);$w.animate({marginTop:-mH},stime,function(){$w.hide().appendTo(wP).attr("style",false);});}
	scrolling=setInterval(scrollStar,time);
	wP.hover(function(){clearInterval(scrolling);},function(){scrolling=setInterval(scrollStar,time);});
	}	
csc.imgMax=function(w,maxValue,wH){//图片(jquery选择器)，最大值，设定是最大宽度还是高度(默认为空设定宽度)
	var $img=$(w);
	function doshow(w){	
		w.load(function(){
			if(w.width()>maxValue&&!wH){w.width(maxValue);}
			else if(w.height()>maxValue&&wH){w.height(maxValue);}
			w.show();
			})
		};	
	$img.hide().each(function(){	doshow($(this));	})
	}		
/*$(document).ready(function(){
　　$("input[type='text']").addClass('input_blur');
　　$("input[type='password']").addClass('input_blur');
    $("input[type='submit']").addClass('button_style');
    $("input[type='reset']").addClass('button_style');
    $("input[type='button']").addClass('button_style');
    $("input[type='radio']").addClass('radio_style');
    $("input[type='checkbox']").addClass('checkbox_style');
    $("input[type='textarea']").addClass('textarea_style');
    $("input[type='file']").addClass('file_style');
　　$("input[type='file']").blur(function () { this.className='input_blur'; } );
　　$("input[type='file']").focus(function () { this.className='input_focus'; } );
　　$("input[type='password']").blur(function () { this.className='input_blur'; } );
　　$("input[type='password']").focus(function () { this.className='input_focus'; } );
　　$("input[type='text']").blur(function () { this.className='input_blur'; } );
　　$("input[type='text']").focus(function () { this.className='input_focus'; } );
    $("textarea").blur(function () { this.className='textarea_style'; } );
　　$("textarea").focus(function () { this.className='textarea_focus'; } )
　　$(".table_list tr").mouseover(function () { this.className='mouseover'; } );
　　$(".table_list tr").mouseout(function () { this.className=''; } );
　　$("#title").focus(function () { this.className='inputtitle'; } );
　　$("#title").blur(function () { this.className='inputtitle'; } );

    $('img[tag]').css({cursor:'pointer'}).click(function(){
       var flag=$(this).attr('tag');
       var fck=$('#'+$(this).attr('fck')+'___Frame');

       var fckh=fck.height();
       (flag==1)?fck.height(fckh+120):fck.height(fckh-120) ;
    });

});*/