


function jPageOpen( tgg, wnn, opp)
{
	if(!opp){
	    opp = 'location=yes, menubar=no, toolbar=no, resizable=yes, scrollbars=yes';
	}
	
	var w = window.open(tgg, wnn, opp);
	w.focus();
	return false;
}

jQuery(function(){ jQuery('a.jWindowOpen').click(function(){

var w = window.open(this.href, this.target);
w.focus();
return false;
})});


function excitingCountDown(){
	//var target = new Date("April 2,2011 11:00:00");
	
	//var target = new Date(2011, 03, 02, 00, 01, 00);  //y m d mは-1してね  2011ばん
	var target = new Date(2012, 03, 07, 00, 01, 00);  //y m d mは-1してね  2012ばん
	//var target = new Date(2011, 10, 05, 00, 01, 00);  //テスト
	
	//var target = new Date(2011, 01, 10, 10, 00, 00);  //y m d mは-1してね
	var today = new Date();
	var d = Math.ceil((target-today)/(24*60*60*1000));
	
	if( d > 0 ){
		var dstr = ""+d;
		var dlen = dstr.length;
		switch (dlen){
			case 1:
				dstr = "00"+dstr;
				break;
			case 2:
				dstr = "0"+dstr;
				break;
			case 3:
			default :
				break;
		}
		var dstr0 = strReplaceToImage(dstr.charAt(0));
		var dstr1 = strReplaceToImage(dstr.charAt(1));
		var dstr2 = strReplaceToImage(dstr.charAt(2));
		dstr = dstr0 + dstr1 + dstr2;
		jQuery('div.xcscountdown').html("<div class=\"plateTable\"><ul>"+dstr+"</ul></div>");
	} else if( d == 0 || d == -1){
		
		//jQuery('div.xcscountdown').addClass("theDay");
		jQuery('div.xcscountdown').html("<div class=\"plateTable\"><ul><li><img src=\"/img/icon/numberplate_0.jpg\" /></li><li><img src=\"/img/icon/numberplate_0.jpg\" /></li><li><img src=\"/img/icon/numberplate_0.jpg\" /></li></ul></div>");
	} else {
		jQuery('div.xcscountdown').addClass("thanksAll");
	}
}


function strReplaceToImage(str){
	
	var n = parseInt(str);
	var rep = "";
	
	switch(n){
		case 1:
			rep = str.replace("1", "<li><img src=\"/img/icon/numberplate_1.jpg\" /></li>");
			break;
		case 2:
			rep = str.replace("2", "<li><img src=\"/img/icon/numberplate_2.jpg\" /></li>");
			break;
		case 3:
			rep = str.replace("3", "<li><img src=\"/img/icon/numberplate_3.jpg\" /></li>");
			break;
		case 4:
			rep = str.replace("4", "<li><img src=\"/img/icon/numberplate_4.jpg\" /></li>");
			break;
		case 5:
			rep = str.replace("5", "<li><img src=\"/img/icon/numberplate_5.jpg\" /></li>");
			break;
		case 6:
			rep = str.replace("6", "<li><img src=\"/img/icon/numberplate_6.jpg\" /></li>");
			break;
		case 7:
			rep = str.replace("7", "<li><img src=\"/img/icon/numberplate_7.jpg\" /></li>");
			break;
		case 8:
			rep = str.replace("8", "<li><img src=\"/img/icon/numberplate_8.jpg\" /></li>");
			break;
		case 9:
			rep = str.replace("9", "<li><img src=\"/img/icon/numberplate_9.jpg\" /></li>");
			break;
		
		default :
			rep = str.replace("0", "<li><img src=\"/img/icon/numberplate_0.jpg\" /></li>");
			break;
	}
	return rep;
}


jQuery(window).ready(function(){

jQuery('img.over_effect_type_a').hover(
	function(){
		jQuery(this).css('border-color', '#e73101');
	},
	function(){
		jQuery(this).css('border-color', '#2b2b2b');
	}
);

jQuery('input.over_effect_type_a').hover(
	function(){
		jQuery(this).css('border-color', '#018dee');
	},
	function(){
		jQuery(this).css('border-color', '#3E3E3E');
	}
);


jQuery('img.over_effect_type_b').hover(
	function(){
		var ih = jQuery(this).height();
		var ihh = '0 ' + '-' + ih + 'px';
		jQuery(this).css('background-position', ihh);
	},
	function(){
		jQuery(this).css('background-position', '0 0');
	}
);

jQuery('input.over_effect_type_b').hover(
	function(){
		var ih = jQuery(this).height();
		var ihh = '0 ' + '-' + ih + 'px';
		jQuery(this).css('background-position', ihh);
	},
	function(){
		jQuery(this).css('background-position', '0 0');
	}
);

jQuery('li.over_effect_type_b').hover(
	function(){
		var ih = jQuery(this).height();
		var ihh = '0 ' + '-' + ih + 'px';
		jQuery(this).css('background-position', ihh);
	},
	function(){
		jQuery(this).css('background-position', '0 0');
	}
);


});

jQuery(window).load(function(){
    
	var nurl  = location.pathname;
	//var color = "#e73101"; 2011
	var color = "#52b018";
	
    if(nurl.match("/eventprogram")){
        //alert("product");
        jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_2 a').css('border-color', color);
    } else if(nurl.match("/news")){
    	//alert("news");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_3 a').css('border-color', color);
    } else if(nurl.match("/exhibitor")){
    	//alert("contact");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_4 a').css('border-color', color);
    } else if(nurl.match("/eventsummary")){
    	//alert("contact");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_5 a').css('border-color', color);
    } else if(nurl.match("/access")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_6 a').css('border-color', color);
    } else if(nurl.match("/contact")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_7 a').css('border-color', color);
    } else if(nurl.match("/organizer")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_8 a').css('border-color', color);
    } else if(nurl.match("/forexhibitor")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_9 a').css('border-color', color);
    } else if(nurl.match("/forvolunteer")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_10 a').css('border-color', color);
    } else if(nurl.match("/forpress")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_11 a').css('border-color', color);
    } else if(nurl.match("/eventreport")){
    	//alert("companyinfo");
    	jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_12 a').css('border-color', color);
    } else {
		jQuery('#primaryLeftBloc div#navi li#navimenu_buttons_1 a').css('border-color', color);
	}
	
	excitingCountDown();
});


