﻿// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 변수, 윈도우모드, 스케일) YSS Style
function flashWrite(url,w,h,id,bg,vars,win, scale){

	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='allowScriptAccess' value='always' />"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='FlashVars' value='"+vars+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<param name='scale' value="+scale+" />"+
	"<embed src='"+url+"' FlashVars='"+vars+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' scale='"+scale+"' align='middle' allowScriptAccess='always' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	
	"</object>";

	// 플래시 코드 출력
	document.write(flashStr);

}

// 탭뷰1
function tab1(item,num)
{
 var str="";
 for(i=1; i<=num; i++){
  if(i<10) str = "tab1_"+i;
  else str = "tab1_"+i;
  document.getElementById(str).style.display = "none";
 }
 document.getElementById(item).style.display = "";
}

// 탭뷰2
function tab2(item,num)
{
 var str="";
 for(i=1; i<=num; i++){
  if(i<10) str = "tab2_"+i;
  else str = "tab2_"+i;
  document.getElementById(str).style.display = "none";
 }
 document.getElementById(item).style.display = "";
}
function realsize(srcStr)
{
}
// 토글메뉴
function ShowContent(MenuName, ShowMenuID) {
	var i=1;
	while(document.getElementById(MenuName + i)){
		var menu=document.getElementById(MenuName + i).style;
		
		if ( i == ShowMenuID ) {
		
			if (menu.display=='block')
			{
				//menu.display='none';
			} else {
				menu.display='block';
			}
		} else {
			menu.display='none';
		}
	i++;
	
	}
}

// 미니 레이어 팝업
function mpop(MenuName, ShowMenuID) {
	var i=1;
	while(document.getElementById(MenuName + i)){
		var menu=document.getElementById(MenuName + i).style;
		if ( i == ShowMenuID ) {
		
			if (menu.display=='block')
			{
				menu.display='none';
			} else {
				menu.display='block';
			}
		} else {
			menu.display='none';
		}

	i++;
	}
}


// 팝업 설정
function pcenter_s_yes(theURL, name,  width, height ){
  var x = (screen.width) ? (screen.width-width)/2 : 0;
  var y = (screen.height) ? (screen.height-height)/2 : 0;  
  var pop = window.open(theURL,name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+width+",height="+height+",left="+x+",top="+y);
  pop.focus
}

function pcenter_s_no(theURL, name,  width, height ){
  var x = (screen.width) ? (screen.width-width)/2 : 0;
  var y = (screen.height) ? (screen.height-height)/2 : 0;  
  var pop = window.open(theURL,name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+width+",height="+height+",left="+x+",top="+y);
  pop.focus
}

function imageRatio(){ // 사진으로 보는 xx원 디테일페이지 하단 이미지리스트
	if( (document.getElementById('logophoto') != null) && (document.getElementById('logophoto').getElementsByTagName('IMG') != null) ){
	  var imageslogo = document.getElementById('logophoto').getElementsByTagName('IMG');
	  for( var i=0; i < imageslogo.length; i++){  
	    if(imageslogo[i].height > imageslogo[i].width){ 
	      imageslogo[i].height = 109; 
				  if(imageslogo[i].width > 153){
						imageslogo[i].width = 153;
				  }
	    }else{
		  	imageslogo[i].width = 153;
			  if(imageslogo[i].height > 109){
					imageslogo[i].height = 109;
			  }	
	    }    
	    imageslogo[i].style.visibility = "visible";  
    }  
  }
	if( (document.getElementById('blogphoto') != null) && (document.getElementById('blogphoto').getElementsByTagName('IMG') != null) ){
	  var images = document.getElementById('blogphoto').getElementsByTagName('IMG');
	  for( var i=0; i < images.length; i++){  
	    if(images[i].height > images[i].width){ 
	      images[i].height = 105; 
			  if(images[i].width > 160){
					images[i].width = 160;
			  }
	    }else{
	      images[i].width = 160;
			  if(images[i].height > 105){
					images[i].height = 105;
			  }
	    }      
	    images[i].style.visibility = "visible";
	  }  
	} 
	if( (document.getElementsByName("blogskinphoto") != null) ){
	  var images = document.getElementsByName("blogskinphoto") ;
	  for( var i=0; i < images.length; i++){  
	    if(images[i].height > images[i].width){ 
	      images[i].height = 105; 
			  if(images[i].width > 160){
					images[i].width = 160;
			  }
	    }else{
		   images[i].width = 160;
		   if(images[i].height > 105){
				images[i].height = 105;
		 	 }
	    } 
	    images[i].style.visibility = "visible";     
	  }  
	} 
	if( (document.getElementById('blogprofilephoto') != null) && (document.getElementById('blogprofilephoto').getElementsByTagName('IMG') != null) ){
	  var images = document.getElementById('blogprofilephoto').getElementsByTagName('IMG');
	  for( var i=0; i < images.length; i++){  
	    if(images[i].height > images[i].width){ 
	      images[i].height = 105; 
			  if(images[i].width > 156){
					images[i].width = 156;
			  }
	    }else{
	      images[i].width = 156;
	      if(images[i].height > 105){
		    	images[i].height = 105;
		   }
	    } 
	    images[i].style.visibility = "visible";     
	  }  
	} 
	return;
}
