function LayerShow(sID){
	document.getElementById(sID).style.display="";
}

function LayerHide(hID){
	document.getElementById(hID).style.display="NONE";
}

function LayerShowHide(sID1,hID1){
		document.getElementById(sID1).style.display="";
		document.getElementById(hID1).style.display="NONE";
	}

function delAlt(obj, elm, chk) {
	var inputField = "";
    document.getElementById(elm).value = inputField;
    document.getElementById(elm).onblur = function () {msg(this.value, elm, chk);};
}

function msg(var1, var2, var3) {
    if(var1 == "") {
        document.getElementById(var2).value = var3;
    } else {
        document.getElementById(var2).value = var1;
    }
}

function share_facebook(msg,url) {
	var href = "http://www.facebook.com/sharer.php?u=" + url + "&t=" + encodeURIComponent(msg);
	window.open(href, 'facebook', '');
}
function share_twitter(msg,url) {
	var href = "http://twitter.com/home?status=" + encodeURIComponent(msg) + " " + encodeURIComponent(url);
	window.open(href, 'twitter', '');
}
function share_me2day(msg,url,tag) {
	var href = "http://me2day.net/posts/new?new_post[body]=" + encodeURIComponent(msg) + " " + encodeURIComponent(url) + "&new_post[tags]=" + encodeURIComponent(tag);
	window.open(href, 'me2day', '');
}



function tabShow(n) {
	for(var i = 1; i <= 5; i++){
		con_div = document.getElementById("con"+i);
		if(con_div == null){
			continue;
		}
		
		selfcheck = con_div.style.display;

		if(i == n){    
			
			if(selfcheck == ""){
			con_div.style.display ="none";   			
				
			}else{
			con_div.style.display ="";   
			}
			
		}else{
			con_div.style.display ="none"; 
						  
			}
	}
}

function menuSelect() {

	for(var i = 1; i <= 5; i++){
		tab_div_menu = document.getElementById("tab"+i);
		con_div_menu = document.getElementById("con"+i);
		if(tab_div_menu == null || con_div_menu == null){
			continue;
		}
		
		if(typeof menu_big == "undefined"){
			continue;
		}

		if(i == menu_big){
			tab_div_menu.style.color = "bc0000";
			con_div_menu.style.display ="block"; 
			
			for(p = 1; p <= 10; p++){
				if("page" + p == menu_medium){
					document.getElementById("con"+i+"_page"+p).style.background = "#e4e4e4";
				}
			}
			  
			
		}else{
		con_div_menu.style.display ="none";   			
		}
	
	}
}



function seminarShow(m,n) {
	
	for(var i = 1; i <= m; i++){
		
		seminar_tab = document.getElementById("seminar_tab"+i);
		seminar_con = document.getElementById("seminar_con"+i);
		
		seminar_tab.style.display = "block";
		seminar_tab.style.display = "none";
		
		if (i == n){
			
			seminar_tab.style.display = "none";
			seminar_con.style.display = "block";
			
			
		}else{
			seminar_tab.style.display = "block";
			seminar_con.style.display = "none";
				
		}
		
		
	}
	
}

function portfolioShow(m,n) {
		for(var i = 1; i <= m; i++){

			if (i == n) {
				document.getElementById("portfolio_detail"+i).style.display = "";	
				
			}else{
				document.getElementById("portfolio_detail"+i).style.display = "none";	
				
			}
			
		}
}


function portfolioSlider () {
	
	if (portfolioPage =='yes'){
		var container = $('div.sliderGallery');
		var ul = $('ul', container);
					
		var itemsWidth = ul.innerWidth() - container.outerWidth();
					
		$('.slider', container).slider({
			min: 0,
			max: itemsWidth,
			handle: '.handle',
			stop: function (event, ui) {
				ul.animate({'left' : ui.value * -1}, 500);
			},
			slide: function (event, ui) {
				ul.css('left', ui.value * -1);
			}
		});
	}
};


window.getInnerWidth = function()
{   
	var browser=navigator.appName;
    if (browser=="Microsoft Internet Explorer")
    {
        if( document.documentElement.clientWidth == 0 )
            return window.document.body.clientWidth;
        return document.documentElement.clientWidth;       
    }
    else
    {
        return window.innerWidth;
    }
};

window.getInnerHeight = function()
{
	var browser=navigator.appName;
    if (browser=="Microsoft Internet Explorer")
    {
        if( document.documentElement.clientHeight == 0 )
            return window.document.body.clientHeight;
        return document.documentElement.clientHeight;
    }
    else
    {
        return window.innerHeight;
    }
};

function layout(standard_id,one_id,two_id,add_num){ //jquery use.
//	var main_height = $('#'+main_id).height()+377;
//	var screen_height = window.getInnerHeight();
	
//	alert($('#'+left_id).height()+":"+$('#'+left_id).css("height"));
	//alert("g");
	//alert(parseInt(jQuery('#'+standard_id).offset().top));
	var chechObj = document.getElementById(standard_id);
	if(chechObj==null){
		return false;
	}
	var standard_height = parseInt(jQuery('#'+standard_id).offset().top)+add_num+jQuery('#'+standard_id).height();
	jQuery('#'+one_id).height(standard_height );
	jQuery('#'+two_id).height(standard_height);
	
	//alert(main_height+":"+screen_height);
//	if(main_height < screen_height){
//		$('#'+left_id).height(screen_height);
//		document.getElementById(left_id).style.height = screen_height+"px";
//	}else{
//		$('#'+left_id).height(main_height);
//		document.getElementById(left_id).style.height = main_height+"px";
//	}
	//alert(document.getElementById(left_id).style.height);
}


function seminarFn () {
	
		var height1 = jQuery('#seminar_con1').height();
		var height2 = jQuery('#seminar_con2').height();
		jQuery('.seminar_tab_selected').css('display','none').css('overflow','hidden').css('height','0').css('opacity','0.4');

		jQuery('.seminar_tab')
			.click(
				function(){
						var aid = this.id;
						var num = aid.slice(-1);
						var target = '#seminar_con'+num;
						var targetheight = eval('height'+num);

					if (jQuery(this).next().css('height') <= '1'){
						jQuery(target).css('display','').stop().animate({'height':targetheight, 'opacity':1},600);
						
					}else{
						jQuery(target).stop().animate({'height':0,'opacity':0.4},600);
						
					}
					
					setTimeout("layout('siteinfo','left_column','main_column_shadowbg',90)",800);


				}			
				
			
			);
		
}

