﻿function loadImages()
{
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	var arrPic = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var ShowType = document.getElementById("jsShowType").value;
	var getShowType = document.getElementById("jsShowType2").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
	
	MagicShowTypeA.register();
    MagicShowTypeB.register();
	MagicShowTypeC.register();
    mshow = new MagicShow();
	var imagepath = siteImagePath;

	for(var i = 0;i < arrPic.length;i++) {
		if (arrPic[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
			var temppath = "";
			if(ShowType == "TypeA")
			{
				temppath = imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-showa.jpg");
			}
			else
			{
				temppath = imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-big.jpg");
			}
			mshow.appendimg(imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-origin.jpg"),
			temppath,
			imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-icon.jpg"),
			imagepath + arrPic[i]);
		} else {
			var temppath = "";
			if(ShowType == "TypeA")
			{
				temppath = imagepath + arrPic[i].toLowerCase().replace(".jpg", "-showa.jpg");
			}
			else
			{
				temppath = imagepath + arrPic[i].toLowerCase().replace(".jpg", "-big.jpg");
			}
			mshow.appendimg(imagepath + arrPic[i].toLowerCase().replace(".jpg", "-origin.jpg"),
				temppath,
				imagepath + arrPic[i].toLowerCase().replace(".jpg", "-icon.jpg"),
				imagepath + arrPic[i]);
		}
	}
	
	 var tempIsStopSaleStr = false;;
	 if(IsStopSaleStr == 1)
	 {
		tempIsStopSaleStr = true;	 
	 }
	 else
	 {
		 tempIsStopSaleStr = false;	 
	 }
	 mshow.init("magicshow1",getShowType, tempIsStopSaleStr);	
}

function productImageShow_info()
{
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	arrPic = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
	
	MagicShowTypeE.register();
    mshow = new MagicShow();
	var imagepath = siteImagePath;

	for(var i = 0;i < arrPic.length;i++) {
		if (arrPic[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
			mshow.appendimg(imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-origin.jpg"),
				imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-showa.jpg"),
				imagepath + arrPic[i].toLowerCase().replace("-gallay.jpg", "-icon.jpg"),
				imagepath + arrPic[i]);
		} else {
			mshow.appendimg(imagepath + arrPic[i].toLowerCase().replace(".jpg", "-origin.jpg"),
				imagepath + arrPic[i].toLowerCase().replace(".jpg", "-showa.jpg"),
				imagepath + arrPic[i].toLowerCase().replace(".jpg", "-icon.jpg"),
				imagepath + arrPic[i]);
		}
	}
	 mshow.init("magicshow1", "TypeE", IsStopSaleStr);
}

function productImageShow_cosplay()
{
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	arrPic2 = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
    MagicShowTypeG.register();
    mshow = new MagicShow();
	mshow.deleteimg();
	if (arrPic2.length == 0)
		arrPic2 = arrPic;
	var imagepath = siteImagePath;
	for(var i = 0;i < arrPic2.length;i++) {
		if(arrPic2[i]){
			if (arrPic2[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yforigin.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			} else {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yforigin.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			}
		}
	}
	//var MoreImageURL = jsAllImageShowURL;
	mshow.init("magicshow1", "TypeG",IsStopSaleStr);
}


function productImageShow_dress()
{
	//alert(jsImagepath);
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	arrPic2 = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
    MagicShowTypeF.register();
    mshow = new MagicShow();
	mshow.deleteimg();
	if (arrPic2.length == 0)
		arrPic2 = arrPic;
	var imagepath = siteImagePath;
	for(var i = 0;i < arrPic2.length;i++) {
		if(arrPic2[i]){
			if (arrPic2[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfbig.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			} else {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfbig.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			}
		}
	}
	//var MoreImageURL = jsAllImageShowURL;
	mshow.init("magicshow1", "TypeF",IsStopSaleStr);
}

function productImageShow_curtain()
{
	//alert(jsImagepath);
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	arrPic2 = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
    MagicShowTypeH.register();
    mshow = new MagicShow();
	mshow.deleteimg();
	if (arrPic2.length == 0)
		arrPic2 = arrPic;
	var imagepath = siteImagePath;
	for(var i = 0;i < arrPic2.length;i++) {
		if(arrPic2[i]){
			if (arrPic2[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfbig.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			} else {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfbig.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			}
		}
	}
	//var MoreImageURL = jsAllImageShowURL;

	mshow.init("magicshow1", "TypeH",IsStopSaleStr);

}

function productImageShow_ring()
{
	//alert(jsImagepath);
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	arrPic2 = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
    MagicShowTypeR.register();
    mshow = new MagicShow();
	mshow.deleteimg();
	if (arrPic2.length == 0)
		arrPic2 = arrPic;
	var imagepath = siteImagePath;
	for(var i = 0;i < arrPic2.length;i++) {
		if(arrPic2[i]){
			if (arrPic2[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yfbig.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			} else {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfgallay.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yfbig.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-yficon.jpg"),
					imagepath + arrPic2[i]);
			}
		}
	}
	//var MoreImageURL = jsAllImageShowURL;
	mshow.init("magicshow1", "TypeR",IsStopSaleStr);
}

function productImageShow_diy()
{
	//alert(jsImagepath);
	var jsPhotosPath = document.getElementById("jsPhotosPath").value;
	arrPic2 = jsPhotosPath.split("@");
	var siteImagePath = document.getElementById("jsImagePath").value;
	var IsStopSaleStr = document.getElementById("jsIsStopSaleStr").value;
    MagicShowTypeY.register();
    mshow = new MagicShow();
	mshow.deleteimg();
	if (arrPic2.length == 0)
		arrPic2 = arrPic;
	var imagepath = siteImagePath;
	for(var i = 0;i < arrPic2.length;i++) {
		if(arrPic2[i]){
			if (arrPic2[i].toLowerCase().indexOf("-gallay.jpg") != -1) {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-origin.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-showa.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace("-gallay.jpg", "-icon.jpg"),
					imagepath + arrPic2[i]);
			} else {
				mshow.appendimg(imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-origin.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-showa.jpg"),
					imagepath + arrPic2[i].toLowerCase().replace(".jpg", "-icon.jpg"),
					imagepath + arrPic2[i]);
			}
		}
	}
	//var MoreImageURL = jsAllImageShowURL;
	mshow.init("magicshow1", "TypeY",IsStopSaleStr);
}


function productImageShow(arrPic){
	var strPic="";
	for(var i=0;i<arrPic.length;i++){
		if(strPic==""){
			strPic = arrPic[i];
		}else{
			strPic = strPic + "@" + arrPic[i];
		}
	}
	document.getElementById("jsPhotosPath").value = strPic;
	if(chooseValue == 1){
		loadImages();
	}else if(chooseValue == 2){
		productImageShow_dress();
	}else if(chooseValue == 3){
		productImageShow_info();
	}else if(chooseValue == 4){
		productImageShow_cosplay();
	}else if(chooseValue == 5){
		productImageShow_curtain();
	}else if(chooseValue == 6){
		productImageShow_ring();
	}else if(chooseValue == 7){
		productImageShow_diy();
	}
}

MoreImageURL = document.getElementById("jsMoreImageURL").value;

var chooseValue = document.getElementById("jsloadImageChoose").value;
if(chooseValue == 1){
	loadImages();
}else if(chooseValue == 2){
	productImageShow_dress();
}else if(chooseValue == 3){
	productImageShow_info();
}else if(chooseValue == 4){
	productImageShow_cosplay();
}else if(chooseValue == 5){
	productImageShow_curtain();
}else if(chooseValue == 6){
	productImageShow_ring();
}else if(chooseValue == 7){
	productImageShow_diy();
}
