var remote = null;     	
	function fnOpenWindow( _url, _name, _top, _left, _width, _height, scroll ){		

		var feature; 

		feature = "width="+_width+", height=" +_height+",resizable=0,menubar=0,status=0,scrollbars=" + scroll; 
		remote = window.open('',_name, feature);
				
		remote.moveTo(_top,_left);						
		
		if (remote != null) {
			if (remote.opener == null) {
				remote.opener = self;
			}
			remote.location.href = _url;
		}
		remote.focus();
	} 
	

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function correct(){
if (finished){
setTimeout("begin()",3000)
}
return true
}
window.onerror=correct
function begin(){
if (!document.all)
return
if (maxheight==null)
maxheight=temp.offsetHeight
whatsnew.style.height=maxheight
temp.style.display="none"
c=1
finished=true
change()
}






var x = 0
var y = 0
drag = 0
move = 0

function inforHelp(divid) {
	imgwidth = 500
	imgheight = 500
	pgyoffset = parseInt(window.document.body.scrollTop);
	
	horzpos = window.document.body.scrollLeft + window.document.body.clientWidth / 2 - imgwidth / 2;
	//horzpos = window.document.body.scrollLeft + 550 / 2 - imgwidth / 2;

	vertpos = pgyoffset + window.document.body.clientHeight / 2 - imgheight / 2;
		
	vertpos = Math.max(pgyoffset, vertpos);

	document.all.Help.style.left = 530;
	document.all.Help.style.top = 440;

	if(divid == "inforOrder") {
		document.all.Help.innerHTML = "<table border=1 cellpadding=0 cellspacing=0><tr><td><div align='right' style='background-color:gray;'><span onClick='javascript:void(inforHide(Help))' style='cursor:hand'> &nbsp; <font color=white><b>Close</b></font> &nbsp; </span></div><img src='/images/common/infororder.gif' width=462 height=391 border=0></td></tr></table>"
	} else if(divid == "inforPrint") {
		document.all.Help.innerHTML = "<table border=1 cellpadding=0 cellspacing=0><tr><td><div align='right' style='background-color:gray;'><span onClick='javascript:void(inforHide(Help))' style='cursor:hand'> &nbsp; <font color=white><b>Close</b></font> &nbsp; </span></div><img src='/images/common/inforPrint.gif' width=462 height=391 border=0></td></tr></table>"
	} else if(divid == "inforalbum") {
		document.all.Help.innerHTML = "<table border=1 cellpadding=0 cellspacing=0><tr><td><div align='right' style='background-color:gray;'><span onClick='javascript:void(inforHide(Help))' style='cursor:hand'> &nbsp; <font color=white><b>Close</b></font> &nbsp; </span></div><img src='/images/common/inforalbum.gif' width=462 height=391 border=0></td></tr></table>"
	} else if(divid == "inforclub") {
		document.all.Help.innerHTML = "<table border=1 cellpadding=0 cellspacing=0><tr><td><div align='right' style='background-color:gray;'><span onClick='javascript:void(inforHide(Help))' style='cursor:hand'> &nbsp; <font color=white><b>Close</b></font> &nbsp; </span></div><table id='Table_01' width='462' height='391' border='0' cellpadding='0' cellspacing='0'><tr><td colspan='3'><img src='/images/common/club_01.gif' width='462' height='345' alt=''></td></tr><tr><td rowspan='2'><img src='/images/common/club_02.gif' width='264' height='46' alt=''></td><td><img src='/images/common/club_03.gif' width='174' height='23' alt=''></td><td rowspan='2'><img src='/images/common/club_04.gif' width='24' height='46' alt=''></td></tr><tr><td><img src='/images/common/club_05.gif' width='174' height='23' alt=''></td></tr></table></td></tr></table>"
	} 
	document.all.Help.filters.blendTrans.apply(); 
	document.all.Help.style.visibility = "visible"; 
	document.all.Help.filters.blendTrans.play(); 

	if(document.all.CartQtyAll) {
		document.all.CartQtyAll.style.visibility = "hidden";
		document.all.CartOptAll.style.visibility = "hidden";
	}
}

function inforHide() {
	document.all.Help.filters.blendTrans.apply();
	document.all.Help.style.visibility = "hidden";
	document.all.Help.filters.blendTrans.play();

	if(document.all.CartQtyAll) {
		document.all.CartQtyAll.style.visibility = "visible";
		document.all.CartOptAll.style.visibility = "visible";
	}
}


function  GetPictureURL(picture_id, userid) {
		GetPictureURL = GetPictureBase(picture_id, userid) + "l/" + GetPictureName(picture_id, userid)
         return GetPictureURL;
  }
	
	
  function  GetPictureBase(picture_id, userid){
		GetPictureBase = "http://"+GetPictureServer(picture_id, userid) +""+ GetPictureDir(picture_id, userid)
        return GetPictureBase;
 
 }
	


 function  GetPictureName(picture_id, userid) {
		GetPictureName = userid + "-" + picture_id + ".jpg"
        return GetPictureName;
		}
	
	
function GetPictureServer(picture_id, userid) {
		
		  
		   if (picture_id != 0) {  
						
			 if  (parseInt(picture_id / 100000) > 99)
			  { GetPictureServer = "photo1.iphotal.co.kr" }
			
			 else if (parseInt(picture_id / 100000) < 4)
			 {  GetPictureServer = "photo4.iphotal.com" }
			 else
			 {   GetPictureServer = "photo5.iphotal.com" }  
			
		}
		
		
		return 	GetPictureServer;
	}
	
	
	
function GetPictureDir(picture_id, userid) {
	GetPictureDir = "/photo/" + parseInt(picture_id / 10000000) + "/" + parseInt(picture_id / 100000) + "/" + parseInt(picture_id / 1000) + "/"	
	return GetPictureDir;
	}
  
	
