﻿function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){
this.name=name;
this.initH=initH;
this.initW=initW;
this.heightB=heightB;
this.widthB=widthB;
this.content=content;
this.initBg=initBg;
this.Bg=Bg;
this.iniFl=initFl;
this.speed=parseInt(speed);
this.timer = name + "Timer";
this.elem;
this.getElement = getElement;
this.createLayer=createLayer;
this.scrollLayer = scrollLayer; 
this.scrollLoop=scrollLoop;
this.createLayer();
this.getElement();
this.scrollLayer();
}

function scrollLoop(s){this.speed = s;}
function scrollLayer(){
if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1))){
this.elem.style.top = parseInt(this.elem.style.top)-this.speed;
}
else {this.elem.style.top = this.initH;}
}


function getElement(){
if(document.getElementById){
this.elem = document.getElementById(this.name);
}
else if (document.all){
this.elem = document.all[name];
}
else if (document.layers){
this.elem = document.layers[name];
}
}

function createLayer(){
if(document.getElementById || document.all){

document.write('<div id="layer'+this.name+'" class="scrollLayer" style="position:relative;overflow:hidden;float:'+this.initFl+';background-color1:#'+this.initBg+';border:0px solid black;width:'+this.initW+'px;height:'+this.initH+'px;" onMouseover="'+this.name+'.scrollLoop(0)" onMouseout="'+this.name+'.scrollLoop('+this.speed+')">');

document.write('<div id="'+this.name+'" style="position:absolute;top:'+this.initH+'px;left:0px;border:0px solid black;width:'+this.widthB+'px;height:'+this.heightB+'px;background-color1:#'+this.Bg+'">');

document.write(this.content);
document.write('<\/div><\/div>');}
else if(document.layers){
document.write('<ilayer name="'+this.name+'" bgcolor="#'+this.Bg+'" width="'+this.widthB+'" height="'+this.heightB+'">'+this.content+'<\/ilayer>');
return;
}
if(this.scrollLayer)
{this.timer = setInterval(this.name+'.scrollLayer()','60');}
}


function showPoster(posterpath, cId)
{
if(posterpath.length==0)
return false;
var url = "poster/" + posterpath + "?cid=" + cId;
var height = 600;
var width = 700;
var aw = (screen.width - width)/2; 
var ah = (screen.Height - height)/2; 
window.open(url, "showPoster");
}

function PrePoster(fileName)
{
if(fileName.length==0)
return false;
var url = "PreviewPoster.aspx?fileName=" + fileName ;
var height = 600;
	var width = 700;
	var aw = (screen.width - width)/2; 
	var ah = (screen.Height - height)/2; 
	
	window.open(url, "PreviewPoster", "toolbar=yes; status=yes, scrollbars=yes, resizable=yes, width=" + width + ", height=" + height + ",left=" +aw + ",top=" + ah);
}

function makePostRequest(url, postStr, functionName)
{
    http_request = false;

    if (window.XMLHttpRequest) 
    { 
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) 
        {
            http_request.overrideMimeType('text/xml');
        }
    } 
    else if (window.ActiveXObject) 
    { 
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) 
        {
            try 
            {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) 
    {
        return false;
    }
    
    http_request.onreadystatechange = functionName;
    http_request.open('POST', url , true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.send(postStr);
}

function setMediaPlayer(src, height, width) 
{
    var divMedia=window.parent.document.getElementById("divMedia");
    
	var file=src;
    
	var FO = {	movie:"flvplayer/flvplayer.swf",width:"397",height:"369",majorversion:"7",build:"0",bgcolor:"#FFFFFF",
				flashvars:"file=../files/" + file + "&showdigits=true&autoStart=true&displayheight=265&repeat=true&lightcolor=0x557722&backcolor=0x000000&frontcolor=0xCCCCCC" };
	UFO.create(	FO, "divMedia");

} 

function setMediaPlayerGGao(src, height, width) 
{
	var file=src;
    
	var FO = {	movie:"flvplayer/flvplayer.swf",width:"397",height:"369",majorversion:"7",build:"0",bgcolor:"#FFFFFF",
				flashvars:"file=../files/" + file + "&showdigits=true&autoStart=true&displayheight=265&repeat=true&lightcolor=0x557722&backcolor=0x000000&frontcolor=0xCCCCCC" };
	UFO.create(	FO, "divMedia");

} 

function playIt(movieId)
{
	if(movieId.length==0)
		return false;

	var url = "getPlayInfo.aspx" ;
	var postStr = "movieId=" + movieId;
	var functionName = getPlayInfo;
	
	makePostRequest(url, postStr, functionName);
}


function popPlayPage(movieId, movieTitle)
{
	if(movieId.length==0)
		return false;
	
	var url = "showPlay.aspx?movieId=" + movieId + "&movieTitle=" + movieTitle ;
	var height = "300px";
	var width = "400px";
	var aw = (screen.width - width)/2; 
	var ah = (screen.Height - height)/2; 
	
	dv=window.showModalDialog(url, "", "center:1;help:no;status:no;dialogHeight:" + height + ";dialogWidth:" + width + ";scroll:no", movieTitle)
}


function previewPlay(fileName)
{
	if(fileName.length==0)
	
		return false;
	
	var url = "flvplay.aspx?fileName=" + fileName ;
	var height = "285px";
	var width = "389px";
	window.open(url,'openNew',"height="+height+", width="+width+", top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no");

}


function getPlayInfo() 
{
	
    if (http_request.readyState == 4) 
    {
    
        if (http_request.status == 200) 
        {
        
            var xmldoc = http_request.responseXML;
　　		var path = xmldoc.firstChild.childNodes.item(0).text;
　　　　	var desc = xmldoc.firstChild.childNodes.item(1).text;
　　		var title = xmldoc.firstChild.childNodes.item(2).text;
　　				
			if(path.length!=0)
			{
	　　		setMediaPlayer(path, "", "");
	　　		var divDescriptionFrame = window.parent.document.getElementById("divDescriptionFrame");
	　　	if(divDescriptionFrame!=null)
	　　		divDescriptionFrame.style.display = "";
		　　	
	　　	var divNewMessageFrame = window.parent.document.getElementById("divNewMessageFrame");
	　　	if(divNewMessageFrame!=null)
	　　		divNewMessageFrame.style.display = "none";
		　　
	　　	var divDescription = window.parent.document.getElementById("divDescription");
	　　	
	　　	if(divDescription!=null)
　　			divDescription.innerText = desc;
	　　	}
	　　	else
	　　	{
	　　		alert("コンテンツをご覧したい場合には、入会して下さい。");
	　　	}
				
        } 
        else 
        {

        }
        window.parent.document.title="Uchan:ホーム";
    }
}

function activeRow(obj)
{
	var row = obj.parentElement.parentElement;
	var objMovieId = row.cells(0).children(0);
	var objQuantity = row.cells(7).children(0);
	objMovieId.disabled = !obj.checked;
	objQuantity.disabled = !obj.checked;
	if(objQuantity.disabled)
		objQuantity.value = "";
	else
	{
		objQuantity.value = "1";
		objQuantity.focus();
	}
}


function isSpace(str) {
  if (str==null) return false
  var ch
  for (var i=0;i<str.length;i++) {
		ch = str.charAt(i)
		if (ch!='	' && ch!='' && ch!=' ') return false
  }
  return true
}

function maskDec(sValue,iLen,iDotLen)
{
	if (isNaN(sValue)) return "1"
	if (sValue<1) return "1"
	if (isNaN(iLen)) iLen = 10
	if (isNaN(iDotLen)) iDotLen = 2
	if (isSpace(sValue)) return "1"
 
	var flag = (sValue<0)
	if (flag) sValue = (-parseFloat(sValue)).toString()
	var i = sValue.indexOf('.')
	var temp1,temp2,temp
	
	if (i<0) {
		temp1 = sValue
		temp2 = ''
	}
	else {
		temp1 = sValue.substr(0,i)
		temp2 = sValue.substr(i+1)
	}
	
	if (flag) {
	  if (iDotLen<=0) 
			temp1 = temp1.substr(temp1.length-iLen+1)
	  else
			temp1 = temp1.substr(temp1.length-iLen+iDotLen+2)
	}
	else {
		if (iDotLen<=0) 
			temp1 = temp1.substr(temp1.length-iLen)
		else
			temp1 = temp1.substr(temp1.length-iLen+iDotLen+1)
	}
	
	sValue = (Math.round(parseFloat(temp1+'.'+temp2)*Math.pow(10,iDotLen))).toString()
	if (iDotLen<=0)  {
		if (flag)
			return '-'+sValue
		else
			return sValue
	}
	
	temp1 = ''  
	for (i=sValue.length;i<iDotLen;i++) temp1 += '0'
	if (flag)
		return '-'+sValue.substr(0,sValue.length-iDotLen)+'.'+temp1+sValue.substr(sValue.length-iDotLen)
	else
		return sValue.substr(0,sValue.length-iDotLen)+'.'+temp1+sValue.substr(sValue.length-iDotLen)
}

function renew(tableId)
{
	
	var objTable = document.getElementById(tableId);
	for(i=0; i<objTable.rows.length; i++)
	{
		if(objTable.rows(i).cells(1).children(0).checked)
		{
			objTable.rows(i).cells(0).children(0).disabled =false;
			objTable.rows(i).cells(6).children(0).disabled =false;
		}
	}
}

function confirmBuy(form)
{
	if(confirm(msg_1))
	{
		form.submit();
	}
	else
	{
		window.event.returnValue = false;
		return false;
	}
}

function getSearchCondition()
{

	var begintime = document.getElementById("txt_Begintime").value;
	var endtime = document.getElementById("txt_EndTime").value;
	var searchName=document.getElementById("txt_SearchName").value;
	
	var SearchClass=document.getElementById("txt_SearchClass").value;
	var SearchList=document.getElementById("txt_SearchList").value;
	
	searchName = escape(trim(searchName));
    SearchClass=escape(trim(SearchClass));
	var searchCondition = "searchName=" + searchName + "&begintime=" + begintime + "&endtime=" + endtime+ "&SearchClass=" + SearchClass+"&SearchList=" + SearchList;
    return searchCondition;
}


var currTabIndex = "1";

function shiftMovieClass(objId)
{
    var category0a=document.getElementById("category0a");    category0a.src="img/menu_left.gif";
    var category1a=document.getElementById("category1a");    category1a.src="img/2menu_left.gif";
    var category2a=document.getElementById("category2a");    category2a.src="img/2menu_left.gif";
    var category3a=document.getElementById("category3a");    category3a.src="img/2menu_left.gif";
    var category4a=document.getElementById("category4a");    category4a.src="img/2menu_left.gif";
    var category5a=document.getElementById("category5a");    category5a.src="img/2menu_left.gif";
    var category6a=document.getElementById("category6a");    category6a.src="img/2menu_left.gif";
    
    var category0b=document.getElementById("category0b");    category0b.background="img/menu_bg.gif";
    var category1b=document.getElementById("category1b");    category1b.background="img/menu_bg.gif";
    var category2b=document.getElementById("category2b");    category2b.background="img/menu_bg.gif";
    var category3b=document.getElementById("category3b");    category3b.background="img/menu_bg.gif";
    var category4b=document.getElementById("category4b");    category4b.background="img/menu_bg.gif";
    var category5b=document.getElementById("category5b");    category5b.background="img/menu_bg.gif";
    var category6b=document.getElementById("category6b");    category6b.background="img/menu_bg.gif";
   
    var category0c=document.getElementById("category0c");    category0c.src="img/2menu_right.gif";
    var category1c=document.getElementById("category1c");    category1c.src="img/2menu_right.gif";
    var category2c=document.getElementById("category2c");    category2c.src="img/2menu_right.gif";
    var category3c=document.getElementById("category3c");    category3c.src="img/2menu_right.gif";
    var category4c=document.getElementById("category4c");    category4c.src="img/2menu_right.gif";
    var category5c=document.getElementById("category5c");    category5c.src="img/2menu_right.gif";
    var category6c=document.getElementById("category6c");    category6c.src="img/menu_right.gif";
    
     if(objId=="-1") 
    {
    category0a.src="img/2blue_left.gif";
    category0b.background="img/blue_bg.gif";
    category0c.src="img/blue_right.gif";
   }
    if(objId=="0") 
    {
    category0a.src="img/2blue_left.gif";
    category0b.background="img/blue_bg.gif";
    category0c.src="img/blue_right.gif";
    alert("0");
    }
    if(objId=="1") 
     {
    category1a.src="img/blue_left.gif";
    category1b.background="img/blue_bg.gif";
    category1c.src="img/blue_right.gif";
    }
    if(objId=="2") 
       {
    category2a.src="img/blue_left.gif";
    category2b.background="img/blue_bg.gif";
    category2c.src="img/blue_right.gif";
    }
    if(objId=="3") 
        {
    category3a.src="img/blue_left.gif";
    category3b.background="img/blue_bg.gif";
    category3c.src="img/blue_right.gif";
    }
    if(objId=="4") 
        {
    category4a.src="img/blue_left.gif";
    category4b.background="img/blue_bg.gif";
    category4c.src="img/blue_right.gif";
    }
    if(objId=="5") 
        {
    category5a.src="img/blue_left.gif";
    category5b.background="img/blue_bg.gif";
    category5c.src="img/blue_right.gif";
    }
    if(objId=="6") 
        {
    category6a.src="img/blue_left.gif";
    category6b.background="img/blue_bg.gif";
    category6c.src="img/2blue_right.gif";
    }
    if(objId=="7") 
        {
    category7a.src="img/2blue_left.gif";
    category7b.background="img/blue_bg.gif";
    category7c.src="img/blue_right.gif";
    }
    if(objId=="8") 
        {
    category8a.src="img/blue_left.gif";
    category8b.background="img/blue_bg.gif";
    category8c.src="img/blue_right.gif";
    }
    if(objId=="9") 
        {
    category9a.src="img/blue_left.gif";
    category9b.background="img/blue_bg.gif";
    category9c.src="img/blue_right.gif";
    }
    if(objId=="10") 
        {
    category10a.src="img/blue_left.gif";
    category10b.background="img/blue_bg.gif";
    category10c.src="img/blue_right.gif";
    }
    if(objId=="11") 
        {
    category11a.src="img/blue_left.gif";
    category11b.background="img/blue_bg.gif";
    category11c.src="img/blue_right.gif";
    }
    if(objId=="12") 
        {
    category12a.src="img/blue_left.gif";
    category12b.background="img/blue_bg.gif";
    category12c.src="img/blue_right.gif";
    }
    if(objId=="13") 
        {
    category13a.src="img/blue_left.gif";
    category13b.background="img/blue_bg.gif";
    category13c.src="img/2blue_right.gif";
    }
    
    
	currTabIndex = objId;
	
	var searchCondition = "SearchClass=" + objId;
	
	showMovieListByShadowSearch(searchCondition);
}

function showMovieListByShadow(objId, searchCondition)
{
	oParentDiv=document.all("idParentDiv");
	
	with (oParentDiv) 
	{
		if (children[0].style.visibility=="hidden") 
			children[1].style.visibility="visible";
		else 
			children[1].style.visibility="hidden";
			
		filters[0].Apply();
		
		if (children[0].style.visibility=="hidden") 
			children[0].style.visibility="visible";
		else 
			children[0].style.visibility="hidden";
			
		if (children[1].style.visibility=="hidden") 
			children[1].style.visibility="visible";
		else 
			children[1].style.visibility="hidden";
			
		filters[0].play();
		
		if(children[0].style.visibility=="visible")
		{
			children[0].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
		    OpenPageNum.children[0].src = "PageNumOpen.aspx?"  + searchCondition;
			
		}
		else
		{
			children[1].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
			OpenPageNum.children[0].src = "PageNumOpen.aspx?"  + searchCondition;
			
		}
	}
}

function showMovieListByShadowSearch(searchCondition)
{
	oParentDiv=document.all("idParentDiv");
	OpenPageNum=document.all("OpenPageNum");
	with (oParentDiv) 
	{
		if (children[0].style.visibility=="hidden") 
			children[1].style.visibility="visible";
		else 
		children[1].style.visibility="hidden";
			
		filters[0].Apply();
		
		if (children[0].style.visibility=="hidden") 
			children[0].style.visibility="visible";
		else 
		children[0].style.visibility="hidden";
			
		if (children[1].style.visibility=="hidden") 
			children[1].style.visibility="visible";
	else 
			children[1].style.visibility="hidden";
			
		filters[0].play();
		
		if(children[0].style.visibility=="visible")
		{
			children[0].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
			OpenPageNum.children[0].src = "PageNumOpen.aspx?"  + searchCondition;
			
		}
		else
		{
			children[1].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
			OpenPageNum.children[0].src = "PageNumOpen.aspx?"  + searchCondition;
			
		}
	}
}
function OpenPageNum(searchCondition)
{
   
	oParentDiv=window.parent.document.getElementById("idParentDiv");
	with (oParentDiv) 
	{
		if (children[0].style.visibility=="hidden") 
			children[1].style.visibility="visible";
		else 
			children[1].style.visibility="hidden";
			
		filters[0].Apply();
		
		if (children[0].style.visibility=="hidden") 
			children[0].style.visibility="visible";
		else 
			children[0].style.visibility="hidden";
			
		if (children[1].style.visibility=="hidden") 
			children[1].style.visibility="visible";
		else 
			children[1].style.visibility="hidden";
			
		filters[0].play();
		
		if(children[0].style.visibility=="visible")
		{
			children[0].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
	    }
		else
		{
			children[1].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
		}

	}
	
}
function showMovieDescShadowed()
{
	oParentDiv=document.getElementById("divMovieDescShadowed");
	
	with (oParentDiv) 
	{
		if(style.visibility!="visible")
		{
			style.visibility="visible";
			style.pixelLeft = event.clientX	;
			style.pixelTop = event.clientY - document.body.scrollTop - 10;
		}
		else
		{
			style.visibility="hidden";
		}
	}
}

function showcalendar(obj)
{
	dv=window.showModalDialog("common/calendar.htm","44","center:1;help:no;status:no;dialogHeight:250px;dialogWidth:216px;scroll:no")
	if (dv) {if (dv=="null") obj.value='';else obj.value=dv;}
}
function ShowUserLoginDialog()
{
   var IFUserLogin=window.parent.document.getElementById("IFUserLogin");
   dv=window.showModalDialog("UserLogin.aspx","44","center:1;help:no;status:no;dialogHeight:274px;dialogWidth:260px;scroll:no")
   //alert(dv);
   if (dv=="1")
   {
      IFUserLogin.src="UserLoginInYes.aspx";
      //window.parent.document.location.reload();
   }
}
function ShowUserLoginDialog_Other()
{
   var IFUserLogin=window.parent.document.getElementById("IFUserLogin_Other");
   dv=window.showModalDialog("UserLogin.aspx","44","center:1;help:no;status:no;dialogHeight:274px;dialogWidth:260px;scroll:no")
   //alert(dv);
   if (dv=="1")
   {
      //IFUserLogin.src="UserLoginInYes.aspx";
      window.parent.document.location.reload();
   }
}

function UserLoginCheck()
{
   var UsrID = document.getElementById("txtUserName").value;
   var UserPass=document.getElementById("txtPassword").value;
   
   
   if (UsrID=="")
   {
       alert("ユーザー名前を入力してください。");
      // Msg("ユーザー名前を入力してください。");
       return false;
   }
   if (UserPass=="")
   {
       alert("パスワードを入力してください。");
       //Msg("パスワードを入力してください。");
       return false;
   }
   	var url = "UserLoginCheck.aspx?UsrID=" + UsrID + "&UserPass=" + UserPass;
	var functionName = getUserInfo;
	UserLoginInfoCheck(url,functionName);
	
	
    
}

function UserLoginInfoCheck(url,functionName)
{
    http_request = false;

    if (window.XMLHttpRequest) 
    { 
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) 
        {
            http_request.overrideMimeType('text/xml');
        }
    } 
    else if (window.ActiveXObject) 
    { 
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) 
        {
            try 
            {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) 
    {
        return false;
    }
    
    http_request.onreadystatechange = functionName;
    http_request.open('POST', url , true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.send(null);
}

function Msg(str)
{
    //MessageDIV
    var dvMsg = document.createElement("div");
    dvMsg.style.position = "absolute";
    dvMsg.setAttribute('id','msg');
    dvMsg.style.width = "400px";
    dvMsg.style.height = "100px";
    dvMsg.style.top="40%";
    dvMsg.style.left="45%";//zhangxs
    dvMsg.style.background = "white";
    dvMsg.style.border="1px solid #4F9D9D";
    dvMsg.style.zIndex = "1111";
    document.body.appendChild(dvMsg);
    
    //title
    var title = document.createElement("div");
    title.style.position = "absolute";
    title.setAttribute('id','title');
    title.style.width = "400px";
    title.style.height = "10px";
    title.style.top= "0";    
    title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=1,opacity=100,finishOpacity=100%)";
    title.style.zIndex = "1113";
    title.innerHTML = "<strong><font size='2' color='#ffffff'>Uchan ログイン</font></strong>";
    title.style.background = "#003E3E";
    
    //IMG
    var imgErr = document.createElement("img");
    imgErr.src = "images/err.gif";
    imgErr.style.marginLeft = "15px";
    imgErr.style.marginTop = "30px";
    imgErr.style.position = "absolute";
    
    //closeMig
    var imgClo = document.createElement("img");
    imgClo.src = "images/delete.gif";
    imgClo.style.marginLeft = "378px";
    imgClo.style.marginTop = "0px";
    imgClo.style.position = "absolute";
    imgClo.style.zIndex = "1115";
    imgClo.style.cursor = "hand";
    imgClo.onclick = function ()
    {
        document.body.removeChild(dvMsg);    
    }
    //btn
    var btn = document.createElement("input");
    btn.id = "ok";
    btn.type= "button";
    btn.value = "確  定";
    btn.style.marginTop = "75px";
    btn.style.marginLeft = "43%";
    btn.style.position = "absolute";
    btn.style.border = "1px solid #003399";
    btn.style.background = "#006699";
    btn.className="textColor";
    
    btn.onclick = function ()
          {
            document.body.removeChild(dvMsg);
          }        
    //Enter     
    btn.onkeydown = function ()
          {
            if (event.keyCode == "13")
            {
                document.body.removeChild(dvMsg);
            }
          }
    var msg = document.createElement("div");
    msg.style.marginTop = "30px";
    msg.style.marginLeft = "30%";
    msg.style.position = "absolute";
    msg.style.width = "300px";
    if(btn){}
    msg.innerHTML = "<strong><font size='2.5'>"+str+"</font></strong>";
    
    msg.style.wordWrap = "break-word";
    document.getElementById('msg').appendChild(msg);
    document.getElementById('msg').appendChild(btn);
    document.getElementById('msg').appendChild(imgErr);
    document.getElementById('msg').appendChild(imgClo);
    document.getElementById('msg').appendChild(title);         
    document.getElementById('ok').focus();
}

function getUserInfo()
{
    if (http_request.readyState == 4) 
    {
    
        if (http_request.status == 200) 
        {
            
            var xmldoc = http_request.responseXML;
            var userName = xmldoc.firstChild.childNodes.item(0).text;
　　		var msg = xmldoc.firstChild.childNodes.item(1).text;
　　		
　　		//ADD ↓↓↓ UserId 2007/12/06 陸 ↓↓↓ start
　　　　	var userId = xmldoc.firstChild.childNodes.item(2).text;
　　　　	//ADD ↑↑↑ UserId 2007/12/06 陸 ↑↑↑ end
　　　　	
			if(userName.length!=0)
			{
	　　	    Msg(" "+userName+"さん、Uchanへようこそ！")
	　　	    /*
	　　	    var bg = document.getElementById("bgcolor");
	            
				bg.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=1,opacity=90,finishOpacity=100%)";
	
				bg.bgColor="#FF9900";
	
				bg.className="textColor";
				*/
	　　	    
	　　	    //UPDATE ↓↓↓ 2007/12/04 陸 ↓↓↓ start
	　　	    //window.returnValue="1";
	　　	    //window.close();
	　　	    document.getElementById("div_guest").style.display = "none";
	　　	    document.getElementById("div_userLogin").style.display = "";
	　　	    document.getElementById("userWelcome").innerText = userId;
	　　	    document.getElementById("topright2").style.display = "none"; 
				
	　　	    //UPDATE ↑↑↑ 2007/12/04 陸 ↑↑↑ end
	　　	}
	　　	else
	　　	{
	　　		alert(msg);
	　　		//Msg(msg);
	　　	}
				
        } 
        else 
        {

        }
       
    }
}
function showcalendarBySvr(obj)
{
    //alert("00");
	dv=window.showModalDialog("../common/calendar.htm","44","center:1;help:no;status:no;dialogHeight:250px;dialogWidth:216px;scroll:no")
	if (dv) 
	{
	if (dv=="null") 
	{	
	     obj.value='';document.getElementById("txtPublishDate").value='';
	}
	else 
	{
		 obj.value=dv;document.getElementById("txtPublishDate").value=dv;}
	}
}
function showcalendarBySvr1(obj)
{
    //alert("00");
	dv=window.showModalDialog("../common/calendar.htm","44","center:1;help:no;status:no;dialogHeight:250px;dialogWidth:216px;scroll:no")
	if (dv) 
	{
	if (dv=="null") 
	{	obj.value='';document.getElementById("txtActiveD").value='';}
	else 
	{obj.value=dv;document.getElementById("txtActiveD").value=dv;}
	
	}
}
function showcalendarBySvr2(obj)
{
    //alert("00");
	dv=window.showModalDialog("../common/calendar.htm","44","center:1;help:no;status:no;dialogHeight:250px;dialogWidth:216px;scroll:no")
	if (dv) 
	{
	if (dv=="null") 
	{	obj.value='';document.getElementById("txtUnActiveD").value='';}
	else 
	{obj.value=dv;document.getElementById("txtUnActiveD").value=dv;}
	
	}
}
function showcalendarnew(obj)
{
	dv=window.showModalDialog("common/calendar.htm","44","center:1;help:no;status:no;dialogHeight:230px;dialogWidth:216px;scroll:no")
	
	if (dv) {if (dv=="null") obj.parentElement.children(0).value='';else obj.parentElement.children(0).value=dv;}
}

function txtSearchWordclear(obj)
{
	var txtsearch = document.getElementById("txtSearchWord");
	if (txtsearch.value == "key word")
	{
		txtsearch.value = ""
	}
}

function txtSearchOrderIDclear(obj)
{
	var txtsearch = document.getElementById("txtSearchOrderID");
	if (txtsearch.value == "key word")
	{
		txtsearch.value = ""
	}
}


function showShoppingCat(movieId)
{
	if(movieId.length==0)
		return false;
	
	var url = "CltUserShoppingCart.aspx?movieId=" + movieId + "&quantity=1";
	var height = 600;
	var width = 700;
	var aw = (screen.width - width)/2; 
	var ah = (screen.Height - height)/2; 
	
	
	window.open(url, "ShoppingCat");
}

function showOrderDetails(obj)
{
	var rowIndex = obj.parentElement.parentElement.rowIndex;
	var orderId =trim(obj.parentElement.parentElement.children(1).innerText);
	
	objSource = obj;
	
	orderdetails = document.getElementById("orderdetails" + objSource.row);
	
	if(orderdetails != null)
	{
		if(orderdetails.style.display != "block")
		{
			orderdetails.style.display = "block";
			window.event.srcElement.src="images/up.gif";
		}
		else
		{
			orderdetails.style.display = "none"
			window.event.srcElement.src="images/down.gif";
		}
	}
	else
	{
		var url = "getOrderDetails.aspx";
		var postStr = "orderId="+orderId;
		var functionName = getOrderDetails;

		makePostRequest(url,postStr, functionName);
	}			
}

function getOrderDetails()
{
	var rowIndex = objSource.parentElement.parentElement.rowIndex;
	
	if (http_request.readyState == 4)
	{
		if (http_request.status == 200) 
		{
			strHtml = http_request.responseText;
			var tbody = objSource.parentElement.parentElement.parentElement;
			var newRow = document.createElement("TR");
			newRow.id = "orderdetails" + objSource.row;
			newRow.style.display = "block";
			
			var newCell = document.createElement("TD");
			newCell.style.textAlign = "center";
			
			newCell.colSpan = tbody.childNodes(rowIndex).cells.length;
			
			newCell.innerHTML = strHtml;
			newCell.className = "OrderDetails";
			
			newRow.appendChild(newCell);

			tbody.insertBefore(newRow, tbody.childNodes(rowIndex + 1));
			objSource.src="images/up.gif";
		
			var newRowOther = document.createElement("TR");
			tbody.insertBefore(newRowOther, tbody.childNodes(rowIndex + 1));
		}
	}
}

function setShoppingNavigation(step)
{
	var imgUserBuy = "img/button2.gif";
	var imgShoppingCart = "img/button1.gif";
	var imgStep1 = "img/buy_1.gif";
	var imgStep2 = "img/buy_2.gif";
	var imgStep3 = "img/buy_3.gif";
	var imgStep4 = "img/buy_4.gif";
	var imgStep5 = "img/buy_5.gif";
	var imgStepHeight = "53";
	var imgStepWidth = "707";
	
	switch(step)
	{
		case 1:
			document.write("<img src='" + imgStep1 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 2:
			document.write("<img src='" + imgStep2 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 3:
			document.write("<img src='" + imgStep3 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 4:
			document.write("<img src='" + imgStep4 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 5:
			document.write("<img src='" + imgStep5 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
	}

}

function setRegNavigation(step)
{
	var imgUserBuy = "img/button2.gif";
	var imgShoppingCart = "img/button1.gif";
	var imgStep1 = "img/reg_1.gif";
	var imgStep2 = "img/reg_2.gif";
	var imgStep3 = "img/reg_3.gif";
	var imgStep4 = "img/reg_4.gif";
	var imgStep5 = "img/reg_5.gif";
	var imgStepHeight = "53";
	var imgStepWidth = "707";
	
	switch(step)
	{
		case 1:
			document.write("<img src='" + imgStep1 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 2:
			document.write("<img src='" + imgStep2 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 3:
			document.write("<img src='" + imgStep3 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 4:
			document.write("<img src='" + imgStep4 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
		case 5:
			document.write("<img src='" + imgStep5 + "' width='" + imgStepWidth + "' height='" + imgStepHeight + "' style='cursor:not-allowed' border=0>");
			break;
	}
}

var oldparent = null;
function highLightIt(obj)
{
	if(oldparent != null)
	{
		oldparent.className = "";
		oldparent.style.borderStyle = "none";
	}
	
	var parent = obj.parentElement.parentElement.parentElement.parentElement;
	parent.className = "HighLightArea";

	oldparent = parent;

}

function ChangeActiveFlg(obj)
{
	var txtActiveD = document.getElementById("txtActiveD");
	var txtUnActiveD = document.getElementById("txtUnActiveD");
	
	if(obj.id == "rdoActY")
	{
	    
		txtActiveD.disabled = !obj.checked;
		txtUnActiveD.disabled = !obj.checked;
	}
	else
	{
	    
	
		txtActiveD.disabled = obj.checked;
		txtUnActiveD.disabled = obj.checked;
	}
}

function expendLeftMenu(index)
{
	var leftMenus = document.getElementsByName("divLeftMenu");

	for(var i=0; i<leftMenus.length; i++)
	{
		if(i != index)
			leftMenus(i).style.display = "none";
		else
		{
				if(leftMenus(i).style.display == "none")
				leftMenus(index).style.display = "";
			else {leftMenus(index).style.display = "none"}

		}
	
	}
}


function DoSearch()
{
	var searchCondition = getSearchCondition();
	var SearchClass=document.getElementById("txt_SearchClass").value;
	
	if (SearchClass!='全ての種類')
	{
	var category0a=document.getElementById("category0a");    category0a.src="img/menu_left.gif";
    var category1a=document.getElementById("category1a");    category1a.src="img/2menu_left.gif";
    var category2a=document.getElementById("category2a");    category2a.src="img/2menu_left.gif";
    var category3a=document.getElementById("category3a");    category3a.src="img/2menu_left.gif";
    var category4a=document.getElementById("category4a");    category4a.src="img/2menu_left.gif";
    var category5a=document.getElementById("category5a");    category5a.src="img/2menu_left.gif";
    var category6a=document.getElementById("category6a");    category6a.src="img/2menu_left.gif";
    
    var category0b=document.getElementById("category0b");    category0b.background="img/menu_bg.gif";
    var category1b=document.getElementById("category1b");    category1b.background="img/menu_bg.gif";
    var category2b=document.getElementById("category2b");    category2b.background="img/menu_bg.gif";
    var category3b=document.getElementById("category3b");    category3b.background="img/menu_bg.gif";
    var category4b=document.getElementById("category4b");    category4b.background="img/menu_bg.gif";
    var category5b=document.getElementById("category5b");    category5b.background="img/menu_bg.gif";
    var category6b=document.getElementById("category6b");    category6b.background="img/menu_bg.gif";
   
    var category0c=document.getElementById("category0c");    category0c.src="img/2menu_right.gif";
    var category1c=document.getElementById("category1c");    category1c.src="img/2menu_right.gif";
    var category2c=document.getElementById("category2c");    category2c.src="img/2menu_right.gif";
    var category3c=document.getElementById("category3c");    category3c.src="img/2menu_right.gif";
    var category4c=document.getElementById("category4c");    category4c.src="img/2menu_right.gif";
    var category5c=document.getElementById("category5c");    category5c.src="img/2menu_right.gif";
    var category6c=document.getElementById("category6c");    category6c.src="img/menu_right.gif";
    
     if(SearchClass=="-1") 
    {
    category0a.src="img/2blue_left.gif";
    category0b.background="img/blue_bg.gif";
    category0c.src="img/blue_right.gif";
   }
    if(SearchClass=="0") 
    {
    category0a.src="img/2blue_left.gif";
    category0b.background="img/blue_bg.gif";
    category0c.src="img/blue_right.gif";
    alert("0");
    }
    if(SearchClass=="1") 
     {
    category1a.src="img/blue_left.gif";
    category1b.background="img/blue_bg.gif";
    category1c.src="img/blue_right.gif";
    }
    if(SearchClass=="2") 
       {
    category2a.src="img/blue_left.gif";
    category2b.background="img/blue_bg.gif";
    category2c.src="img/blue_right.gif";
    }
    if(SearchClass=="3") 
        {
    category3a.src="img/blue_left.gif";
    category3b.background="img/blue_bg.gif";
    category3c.src="img/blue_right.gif";
    }
    if(SearchClass=="4") 
        {
    category4a.src="img/blue_left.gif";
    category4b.background="img/blue_bg.gif";
    category4c.src="img/blue_right.gif";
    }
    if(SearchClass=="5") 
        {
    category5a.src="img/blue_left.gif";
    category5b.background="img/blue_bg.gif";
    category5c.src="img/blue_right.gif";
    }
    if(SearchClass=="6") 
        {
    category6a.src="img/blue_left.gif";
    category6b.background="img/blue_bg.gif";
    category6c.src="img/2blue_right.gif";
    }
    if(SearchClass=="7") 
        {
    category7a.src="img/2blue_left.gif";
    category7b.background="img/blue_bg.gif";
    category7c.src="img/blue_right.gif";
    }
    if(SearchClass=="8") 
        {
    category8a.src="img/blue_left.gif";
    category8b.background="img/blue_bg.gif";
    category8c.src="img/blue_right.gif";
    }
    if(SearchClass=="9") 
        {
    category9a.src="img/blue_left.gif";
    category9b.background="img/blue_bg.gif";
    category9c.src="img/blue_right.gif";
    }
    if(SearchClass=="10") 
        {
    category10a.src="img/blue_left.gif";
    category10b.background="img/blue_bg.gif";
    category10c.src="img/blue_right.gif";
    }
    if(SearchClass=="11") 
        {
    category11a.src="img/blue_left.gif";
    category11b.background="img/blue_bg.gif";
    category11c.src="img/blue_right.gif";
    }
    if(SearchClass=="12") 
        {
    category12a.src="img/blue_left.gif";
    category12b.background="img/blue_bg.gif";
    category12c.src="img/blue_right.gif";
    }
    if(SearchClass=="13") 
        {
    category13a.src="img/blue_left.gif";
    category13b.background="img/blue_bg.gif";
    category13c.src="img/2blue_right.gif";
    }
    
    showMovieListByShadowSearch(searchCondition);
	} else
	{
	oParentDiv=document.all("idParentDiv");
	OpenPageNum=document.all("OpenPageNum");
	with (oParentDiv) 
	{
		if (children[0].style.visibility=="hidden") 
			children[1].style.visibility="visible";
		else 
		children[1].style.visibility="hidden";
			
		filters[0].Apply();
		
		if (children[0].style.visibility=="hidden") 
			children[0].style.visibility="visible";
		else 
		children[0].style.visibility="hidden";
			
		if (children[1].style.visibility=="hidden") 
			children[1].style.visibility="visible";
	else 
			children[1].style.visibility="hidden";
			
		filters[0].play();
		
		if(children[0].style.visibility=="visible")
		{
			children[0].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
			OpenPageNum.children[0].src = "PageNumOpen.aspx?"  + searchCondition;
			
		}
		else
		{
			children[1].children[0].src = "ContentsSearch.aspx?"  + searchCondition;
			OpenPageNum.children[0].src = "PageNumOpen.aspx?"  + searchCondition;
			
		}
	}
	}
	
	
}

function trim(s)
{
	if (s == null)
		return s;

	var i;
	var beginIndex = 0;
	var endIndex = s.length - 1;

	for (i=0; i<s.length; i++)
	{
		if (s.charAt(i) == ' ' || s.charAt(i) == '　')
			beginIndex++;
		else
			break;
	}

	for (i = s.length - 1; i >= 0; i--)
	{
		if (s.charAt(i) == ' ' || s.charAt(i) == '　')
			endIndex--;
		else
			break;
	}

	if (endIndex < beginIndex)
		return "";

	return s.substring(beginIndex, endIndex + 1);
}

function RemoveElement(tablename1,tablename2)
{   
	var tfoot = document.createElement("TFOOT");
	var tablefrom=document.getElementById(tablename1);
	var tableto=document.getElementById(tablename2);
	var tfootRow = null;
	
	try
	{
		if(tablefrom != null)
		{
			tfootRow = tablefrom.rows(tablefrom.rows.length-1).removeNode(true);
		}
		
		if(tfootRow != null)
		{
			tfoot.appendChild(tfootRow);
			tableto.appendChild(tfoot)
		}
	}
	catch(e)
	{
	
	}
	finally
	{
	}		
}

function popRegBenefit()
{
	var url = "reg_benefit.html";
	var height = 300;
	var width = 400;
	var aw = (screen.width - width)/2; 
	var ah = (screen.Height - height)/2; 
	
	window.open(url, "popRegBenefit", "toolbar=no; status=no, scrollbars=auto, resizable=no, width=" + width + ", height=" + height + ",left=" +aw + ",top=" + ah);
}

function alertMessage(msg, focusId)
{
	alert(msg);
	
	var obj = document.getElementById(focusId);
	if(obj != null)
	{
		obj.focus();
	}
}

function getFocus(focusId)
{
	var obj=document.getElementById(focusId);
	if(obj != null)
	{
		obj.focus();
	}
}


function MoveLeft()
{
	var box = document.getElementById("uc_cltCata_lblCategory");
	var i = 0;
	var elements = box.children(0).rows(0).cells;
	var count = elements.length;
	var firstV = 0;
	var img = elements(0);
	
	for(i=0;i<count;i++)
	{
		img = elements(i);
		
		if(img.style.display == "")
		{
			firstV = i;
			break;
		}
	}
	
	if((firstV+4) >= count)
		return;

	img = elements(firstV);
	img.style.display = "none";

	firstV += 4;

	img = elements(firstV);
	img.style.display = "";
} 


function MoveRight()
{
    var box = document.getElementById("uc_cltCata_lblCategory");
	var i = 0;
	var elements = box.children(0).rows(0).cells;
	var count = elements.length;
	var firstV = 0;
	var img = elements(0);
	
	for(i=count-1;i>=0;i--)
	{
		img = elements(i);
		if(img.style.display =="")
		{
			firstV = i;
			break;
		}
	}
	
	if((firstV-4) <0 )
		return;
	
	img = elements(firstV);
	img.style.display = "none";
	
	firstV -= 4;
	
    img = elements(firstV);
	img.style.display = "";
}

function windowslogoff()
{	
	var myurl = "SvrLogin.aspx";
	
	parent.close();	
	
	window.open(myurl,"serverlogoff");
	setTimeout("window.opener=null;window.close()",1000);
}

function serverlogin()
{
	var myurl = "ShibaMediaConsole.aspx";
	window.open(myurl,"serverlogin","toolbar=no,status=yes");
	setTimeout("window.opener=null;window.close()",500);
}

function ShiftContent()
{ 
var objects=document.getElementsByTagName("A");
for(var i=0;i<objects.length;i++)
{objects[i].className="ANormal ";
var oParent=objects[i].parentElement.parentElement;
oParent.className="";
}
var srcObject =window.event.srcElement;
srcObject.className="AUnNormal";
var parent=srcObject.parentElement.parentElement;
parent.className="HighLightArea";

var shiftHref=srcObject.getAttribute("clickhref");
var frmObject=document.getElementById("ifrmSevice");
frmObject.src=shiftHref;

}



function  dynamicIframe()
{parent.document.all("ifrmSevice").style.height=document.body.scrollHeight; 
}


function TurnshopCart(movieId)
{ var myurl="WebService.aspx";
  var ifrSrc="CltUserShoppingCart.aspx?movieId="+movieId +"&quantity=1";
  newWindow=window.open(myurl,"WebService");
  var srcObject=newWindow.document.getElementById("CltUserShoppingCart");
  alert(srcObject.innerHTML);
  srcObject.clicked="1";
  var frmObject=newWindow.document.getElementById("ifrmSevice");
  frmObject.src=ifrSrc;
 

}
function TurnPage(pageurl,movieId)
{

   if (movieId!="-1" && pageurl!="")
   {
      var ifrSrc=pageurl+"?movieId="+movieId+"&quantity=1";
      
   } else if(movieId=="-1" && pageurl!="")
   
   {
      var ifrSrc=pageurl;
      
   } else if(movieId=="-1" && pageurl=="")
   
   {
   
     var ifrSrc="CltUserForgetPassword.aspx";
     
   }
 

var frmObject=document.getElementById("ifrmSevice");
  frmObject.src=ifrSrc;

  
var objects=document.getElementsByTagName("A");
  for(var i=0;i<objects.length;i++)
     {

       objects[i].className="ANormal ";

       var oParent=objects[i].parentElement.parentElement;
       oParent.className="";

       var shiftHref=objects[i].getAttribute("clickhref");
      
       if(shiftHref==ifrSrc || shiftHref==ifrSrc.substring(0,24))
       {

       var parent=objects[i].parentElement.parentElement;
       parent.className="HighLightArea";
       }
     }


}

function favorate()
{
window.external.AddFavorite('http://www.uchan.co.jp','ShibaMedia！');
}

var objState;
var fontColorOld;
var backColorOld;
function OnFoucsMouseOver(obj,fontColor,backColor)
{


var childobj=obj.children(0).children(0);

if (obj.rowIndex>=0)
{
fontColorOld=childobj.style.color;
backColorOld=childobj.style.backgroundColor;
childobj.style.color = fontColor;
childobj.style.backgroundColor = backColor;
}

}
function OnFoucsMouseOut(obj,fontColor,backColor)
{
fontColor=fontColorOld;
backColor=backColorOld;
if ( obj.rowIndex>=0 ){
if ( obj != objState )
{
var childobj=obj.children(0).children(0);
 childobj.style.color = fontColor;
 childobj.style.backgroundColor = backColor;
 }
  }
  }
function OnFoucsClick(obj,fontColor,backColor)
{

}
function OnFoucsDbClick(obj,fontColor,backColor,openUrl )
{
 
}
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) { //v4.01
  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);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_reloadPage(init) {
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_swapImgRestore() { 
  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_swapImage() {
  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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function OpenUserLoginDialog(){
var ReturnValue=window.showModalDialog('UserLogin.aspx',window,'center:1;help:no;status:no;dialogHeight:260px;dialogWidth:274px;scroll:no');
alert(ReturnValue);
if (ReturnValue==1)
{
window.location.href= window.location.href;
}
}
function ShowYW()
{
var YaoWang=document.all("YaoWang");
var TuPian=document.all("TuPian");
var ZheKou=document.all("ZheKou");
YaoWang.style.visibility="";
TuPian.style.display = "none";
ZheKou.style.display = "none";
}
function ShowTuPian(ContentID,YHJImages)
{
var YaoWang=document.all("YaoWang");
var TuPian=document.all("TuPian");
var ZheKou=document.all("ZheKou");
YaoWang.style.display = "none";
TuPian.style.display="";
ZheKou.style.display = "none";
var iframe_TuPian=document.getElementById("iframe_TuPian");
iframe_TuPian.src="ShowHuiYuanTeDian/"+ContentID+".htm";
var MyTuPian=document.getElementById("MyTuPian");
MyTuPian.src="ShowHuiYuanTeDian/YHJImages/"+YHJImages;
}
function ShowZheKou(DiscountS)
{
var YaoWang=document.all("YaoWang");
var TuPian=document.all("TuPian");
var ZheKou=document.all("ZheKou");
YaoWang.style.display = "none";
TuPian.style.display = "none";
ZheKou.style.display = "";
var ZhoKouText=document.getElementById("ZhoKouText");
ZhoKouText.text=DiscountS;
}
if (!document.layers&&!document.all) 
event="test" 
function showtip2(current,e,text){ 
var HttpTextL="<table width='102' height='58'  border='0' cellpadding='1' cellspacing='1'>";
HttpTextL=HttpTextL+"<tr><td height='58' align='center' bgcolor='#000000'>";
HttpTextL=HttpTextL+"<table width='98' height='54'  border='0' cellpadding='1' cellspacing='1' bgcolor='#FFFFE7'>";
HttpTextL=HttpTextL+"<tr><td height='54'><a class='Lanse'>";
var HttpTextR="</a></td></tr></table></td></tr></table>";



if (document.all&&document.readyState=="complete"){ 
document.all.tooltip2.innerHTML=HttpTextL+text+HttpTextR;
document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10 
document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10 
document.all.tooltip2.style.visibility="visible" 
} 

else if (document.layers){ 
document.tooltip2.document.nstip.document.write(HttpTextL+text+HttpTextR) 
document.tooltip2.document.nstip.document.close() 
document.tooltip2.document.nstip.left=0 
currentscroll=setInterval("scrolltip()",100) 
document.tooltip2.left=e.pageX+10 
document.tooltip2.top=e.pageY+10 
document.tooltip2.visibility="show" 
} 
} 
function hidetip2(){ 
if (document.all) 
document.all.tooltip2.style.visibility="hidden" 
else if (document.layers){ 
clearInterval(currentscroll) 
document.tooltip2.visibility="hidden" 
} 
} 

function scrolltip(){ 
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width) 
document.tooltip2.document.nstip.left-=5 
else 
document.tooltip2.document.nstip.left=102 
}
function UserLoginOut()
{
	//ADD ↓↓↓ 2007/12/13 陸 ↓↓↓ start
	if (false == confirm("ログアウトします。 よろしいですか?"))
	{
		return false;
	}
	//ADD ↑↑↑ 2007/12/13 陸 ↑↑↑ end
	
	//var url = "CltLogoffIndex.aspx";
	var url = "CltLogoffIndex.aspx?"+"ran=" + Math.random();
	var functionName = SetUserLoginOut;
	UserLoginOutCheck(url,functionName);
}
function UserLoginOutCheck(url,functionName)
{
    http_request = false;

    if (window.XMLHttpRequest) 
    { 
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType) 
        {
            http_request.overrideMimeType('text/xml');
        }
    } 
    else if (window.ActiveXObject) 
    { 
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) 
        {
            try 
            {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }

    if (!http_request) 
    {
        return false;
    }
    
    http_request.onreadystatechange = functionName;
    http_request.open('POST', url , true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.send(null);
}
function SetUserLoginOut()
{
    if (http_request.readyState == 4) 
    {
    
        if (http_request.status == 200) 
        {
			//UPDATE ↓↓↓ 2008/01/07 陸 ↓↓↓ start
            //window.document.location.reload();
            window.location.href = "cltindex.aspx";
            //UPDATE ↑↑↑ 2008/01/07 陸 ↑↑↑ end
	　　} 
        else 
        {

        }
       
    }
}

function setDisplalystyle()
{ var style=document.all.selstyle.options[document.all.selstyle.selectedIndex].value;
  var dlcontents=document.frames["Iframe1"].document.getElementById("style1");
  var  dgmovies=document.frames["Iframe1"].document.getElementById("style2");
  if(style=='01')
  { dlcontents.style.display="block";
     dgmovies.style.display="none";
    }
  else
  {dlcontents.style.display="none";
     dgmovies.style.display="block";
  }


}
  function loadDisplay()
  {
   var style=window.parent.document.all.selstyle.options[window.parent.document.all.selstyle.selectedIndex].value;
    var dlcontents=document.getElementById("style1");
  var  dgmovies=document.getElementById("style2");
  if(style=='01')
  { dlcontents.style.display="block";
     dgmovies.style.display="none";
    }
  else
  {dlcontents.style.display="none";
     dgmovies.style.display="block";
     
  }
  
  }
  
// for test discount input in admin 
function isNum(str)
{
   var regu=/^[0-9]+\.[0-9]{1}$|^[0-9]$/;
   var re = new RegExp(regu);
   
   if(!re.test(str))
   {
     alert("1桁の小数を入力して下さい。");
     return 0.0;
   }
   else
   {
	 return str;
   }
}
// End. Update 2008/05/15 by Liuying

// for check negative number used by admin
function isNum2(str)
{
   var regu=/^\d+$/;
   var re = new RegExp(regu);
   
   if(!re.test(str))
   {
     alert("正の整数を入力してください。");
     return 0;
   }
   else
   {
	 return str;
   }
}

/**
*
*
*
*/
function OrderDetailsByuserCheck()
{
   var UsrID = document.getElementById("txtUserName").value;
   var UserPass=document.getElementById("txtPassword").value;
   
   
   if (UsrID=="")
   {
       alert("ログインしてください。");
      // Msg("ユーザー名前を入力してください。");
       return false;
   }
   if (UserPass=="")
   {
       alert("ログインしてください。");
       //Msg("パスワードを入力してください。");
       return false;
   }
   	var url = "UserLoginCheck.aspx?UsrID=" + UsrID + "&UserPass=" + UserPass;

	var functionName = getUserInfo;
	UserLoginInfoCheck(url,functionName);

}




// End. Update 2008/08/21 by liuying


  function CashMsg(str)
{
    //MessageDIV
    var confirOrCancel = false;
    var dvMsg = document.createElement("div");
    dvMsg.style.position = "absolute";
    dvMsg.setAttribute('id','msg');
    dvMsg.style.width = "400px";
    dvMsg.style.height = "100px";
    dvMsg.style.top="40%";
    dvMsg.style.left="45%";//zhangxs
    dvMsg.style.background = "white";
    dvMsg.style.border="1px solid #4F9D9D";
    dvMsg.style.zIndex = "1111";
    document.body.appendChild(dvMsg);
    
    //title
    var title = document.createElement("div");
    title.style.position = "absolute";
    title.setAttribute('id','title');
    title.style.width = "400px";
    title.style.height = "10px";
    title.style.top= "0";    
    title.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=1,opacity=100,finishOpacity=100%)";
    title.style.zIndex = "1113";
    title.innerHTML = "<strong><font size='2' color='#ffffff'>Uchan ログイン</font></strong>";
    title.style.background = "#003E3E";
    
    //IMG
    var imgErr = document.createElement("img");
    imgErr.src = "images/err.gif";
    imgErr.style.marginLeft = "15px";
    imgErr.style.marginTop = "30px";
    imgErr.style.position = "absolute";
    
    //closeMig
    var imgClo = document.createElement("img");
    imgClo.src = "images/delete.gif";
    imgClo.style.marginLeft = "378px";
    imgClo.style.marginTop = "0px";
    imgClo.style.position = "absolute";
    imgClo.style.zIndex = "1115";
    imgClo.style.cursor = "hand";
    imgClo.onclick = function ()
    {
        document.body.removeChild(dvMsg);    
    }
    //btn
    var btn = document.createElement("input");
    btn.id = "ok";
    btn.type= "button";
    btn.value = "確  定";
    btn.style.marginTop = "75px";
    btn.style.marginLeft = "43%";
    btn.style.position = "absolute";
    btn.style.border = "1px solid #003399";
    btn.style.background = "#006699";
    btn.className="textColor";
    

          
      //btn cancel
    var btnCancel = document.createElement("input");
    btnCancel.id = "Cancel";
    btnCancel.type= "button";
    btnCancel.value = "Cancel";
    btnCancel.style.marginTop = "75px";
    btnCancel.style.marginLeft = "63%";
    btnCancel.style.position = "absolute";
    btnCancel.style.border = "1px solid #003399";
    btnCancel.style.background = "#006699";
    btnCancel.className="textColor";
    
    var msg = document.createElement("div");
    msg.style.marginTop = "30px";
    msg.style.marginLeft = "30%";
    msg.style.position = "absolute";
    msg.style.width = "300px";
    if(btn){}
    msg.innerHTML = "<strong><font size='2.5'>"+str+"</font></strong>";
    
    msg.style.wordWrap = "break-word";
    document.getElementById('msg').appendChild(msg);
    document.getElementById('msg').appendChild(btn);
     document.getElementById('msg').appendChild(btnCancel);
    document.getElementById('msg').appendChild(imgErr);
    document.getElementById('msg').appendChild(imgClo);
    document.getElementById('msg').appendChild(title);         
    document.getElementById('ok').focus();
    
    
        btn.onclick = function ()
          {
           confirOrCancel =true;
            document.body.removeChild(dvMsg);
            
          }    
    
    btnCancel.onclick = function ()
          {
            confirOrCancel =false;
            document.body.removeChild(dvMsg);
           
          }             
          
          
          
              
    //Enter     
    btn.onkeydown = function ()
          {
            if (event.keyCode == "13")
            {
                document.body.removeChild(dvMsg);
                confirOrCancel =true;
            }
          }

returnValue = confirOrCancel;

}