﻿	function openNewWindow(URLtoOpen) { 
		newWindow=window.open(URLtoOpen);
	}; 
	
	function flashReSizeHandler(){
		if (jQuery.browser.mozilla ){
			jQuery("#flash").height("413px");
		}else{
			jQuery("#flash").animate({height:"413px"});
		}
	};

	function getCitySelect(obj){
		var options = obj.options;
		var provinceCode ;
		for(var i = 0 ; i < options.length ; i++){
			if(options[i].selected)
				provinceCode = options[i].value;
		}

		jQuery("#citySelect").load(Constant.baseURL+"/exhibition!loadCityRegion.do?districtCode=" + provinceCode);
	}

	function submitExhibitionSearch(){
		if(jQuery("#citySelect").val() != '') 
			jQuery("#districtCode").val(jQuery("#citySelect").val());
		else if(jQuery("#provinceSelect").val() != '')
			jQuery("#districtCode").val(jQuery("#provinceSelect").val());
	}

	function tab_change_project(id , obj){
		var divs = jQuery('.projectList');
		for(var i = 0 ;i < divs.length ;i++){
			divs[i].style.display = 'none';
		    
		}
		jQuery('.projecta').removeClass("tab_on");
		jQuery("#"+id).attr("style","display:");
		jQuery(obj).addClass("tab_on");
	}

jQuery.noConflict();
jQuery(function(){
    //tab 效果
    ~function(){
        var selectObj    = jQuery('#index_tab') , QTab_content = selectObj.find('.QTab_content');

        //定仪各个items的宽高
        selectObj.find('.QTab_items').each(function(){
            jQuery(this).width( QTab_content.width() ).height( QTab_content.height() )
        });

        //设置 选中效果 && 显示内容
        selectObj.find('.QTab_nav li').click(function(){
            selectObj.find('.QTab_nav li').removeClass('borderL tab_on');
            jQuery(this).addClass('borderL tab_on');
            selectObj.find('.QTab_items').css({ top : -100 }).hide();
            jQuery(jQuery(this).find('a').attr('href')).show().animate({  top : 0 }, {duration: 300 , easing: 'easeOutQuad'})
            return false;
        })

        //选中第一个
        jQuery('#index_tab_on_click').click();
    }();

  //3d效果
    ~function(){
        var selectObj = jQuery('#index_3d_box');
        var oldIndex  = 2;
        
        //位置坐标

var location = [
{ left : 0 , top : 30 , zIndex : 1 , width : '140px' , height : '114px' , imgHeight : '94px' , fontSize : '9px' },
{ left : 92 , top : 17 , zIndex : 2 , width : '202px' , height : '152px' , imgHeight : '120px' , fontSize : '12px' },
{ left : 207 , top : 4 , zIndex : 3 , width : '250px' , height : '179px' , imgHeight : '150px' , fontSize : '14px' },
{ left : 394 , top : 17 , zIndex : 2 , width : '202px' , height : '152px' , imgHeight : '120px' , fontSize : '12px' },
{ left : 517 , top : 30 , zIndex : 1 , width : '140px' , height : '114px' , imgHeight : '94px' , fontSize : '9px' }
]; 
        
        
        /*
        var location = [
            { left : 0 , top : 30 , zIndex : 1  , width : '120px' , height : '114px' , imgHeight : '74px' , fontSize : '9px' },
            { left : 92 , top : 17 , zIndex : 2  , width : '162px' , height : '152px' , imgHeight : '100px' , fontSize : '12px' },
            { left : 207 , top : 4 , zIndex : 3  , width : '210px' , height : '179px' , imgHeight : '130px' , fontSize : '14px' },
            { left : 394 , top : 17 , zIndex : 2  , width : '162px' , height : '152px' , imgHeight : '100px' , fontSize : '12px' },
            { left : 517 , top : 30 , zIndex : 1  , width : '100px' , height : '114px' , imgHeight : '74px' , fontSize : '9px' }
        ];*/

        //设置对象的css
        var setCss = function( obj , css ){
            var setCss = css;
            delete setCss.imgHeight;
            setCss.position = 'absolute'

            obj.css(setCss).find('img').css( { width : css.width , height : css.imgHeight } )

            obj.find('span').css({
                textAlign : 'center' ,
                position  : 'absolute' ,
                bottom    : '0' ,
                left      : '0',
                width     : css.width
            })
        }

        //初始样式
        jQuery.each(location , function( k ,v ){
            setCss( jQuery( selectObj.find('.content li').get(k) ) , v );
        })

        //播放路径
        var playArr  = [
            [ 3 , 4 , 0 , 1 , 2 ] ,
            [ 4 , 0 , 1 , 2 , 3 ] ,
            [ 0 , 1 , 2 , 3 , 4 ] ,
            [ 1 , 2 , 3 , 4 , 0 ] ,
            [ 2 , 3 , 4 , 0 , 1 ]
        ];

         //播放事件
        selectObj.find('.content li').click(function(){
            var index = selectObj.find('.content li').index( jQuery(this) );
            if( index == oldIndex )
            {
                window.open( jQuery(this).find('a').attr('href') );
            }
            else
            {
                oldIndex = index;
            }

            selectObj.find('.nav li.select').removeClass('select');
            jQuery( selectObj.find('.nav li').get(index) ).addClass('select');
            for( var i = 0 ; i < 5 ; i++ )
            {
                var css     = location[i] ;
                var thisObj = jQuery( selectObj.find('.content li').get( playArr[index][i] ) );
                thisObj.css( { zIndex : css.zIndex , width : css.width , height : css.height } ).animate( {
                                   left   : css.left ,
                                   top    : css.top
                               } , {duration: 700 }).find('img').css( { width : css.width , height : css.imgHeight } )
                thisObj.find('span').css( { fontSize : css.fontSize , width : css.width } )
            }

            return false;
        })

        //导航事件
        selectObj.find('.nav li').click(function(){
            var index = selectObj.find('.nav li').index( jQuery(this) );
            jQuery( selectObj.find('.content li').get(index) ).click();
        })

    }()



    
})


