﻿ window.onload = function(){
            var imgs = $("img[name='altImg']");
            imgs.each(function(i,item){
                  $(item).click(
                     function(){
                        for(var j=0;j<imgs.length;j++){
                            imgs[j].parentNode.className="";
                        }
                        document.getElementById("imgPic").src="../"+templates[i];
                         document.getElementById("photoTitle").innerHTML = tempnotes[i];
                        item.parentNode.className="on";
                     }
                  );
            });
        }
        
 


function openPicDialog(){
     win_pic.show();
}

function closePicDialog(){
      win_pic.hide();
}

function closePic(){
    $.modalbox.close();
}

function openPic(){
    document.getElementById("window_pic").src=document.getElementById("imgPic").src;
    document.getElementById("detailTxt").innerHTML  = document.getElementById("photoTitle").innerHTML;
    tb_show(document.getElementById("photoTitle").innerHTML,document.getElementById("window_pic").src,false);
//    $.modalbox.show({
//                modal: true,
//                content:  document.getElementById("dpic").innerHTML,
//                draggable: false,
//                showTitle: false,
//                showCancel: false, 
//                showOk: false,
//                width: 700,
//                height:480,
//                scroll:"no"

//            });
}


function openNotlogin(path){
   if(path=="en/")
        alert("You are not login,please login first.");
    else
        alert("您还没登陆。");
}


function showTip(path){
    if(path=="en/")
        alert("Add success!");
    else
        alert("添加成功！");
}

function showError(path){
    if(path=="en/")
        alert("You have added this design!");
    else
        alert("您已经添加过该作品了。");
}