﻿// Javascript helper used by the java applet

function AddText() {
	expressiaCardEditor.OpenText();
}

function LoadFile(fileName, hres, vres) {
    if(document.getElementById('expressiaCardEditor') != null) {
	    var cEditor = document.getElementById('expressiaCardEditor');
	    cEditor.OpenFile(fileName, hres, vres);
	} else if(expressiaCardEditor != null) {
	    expressiaCardEditor.OpenFile(fileName, hres, vres);
	}
}

function ChangeAction(action) {
	expressiaCardEditor.ExpressiaAction(action);
}

function Zoom() {
	comboobj = document.all? document.all.zoom : document.getElementById? document.getElementById("zoom") : document.layers? document.zoom : 0;
	expressiaCardEditor.Zoom(comboobj.value);
}

function Flip(action) {
	expressiaCardEditor.Flip(action);		
}

function Rotate(action) {
	expressiaCardEditor.Rotate(action);		
}

function Position(action) {
	expressiaCardEditor.ChangePostion(action);
}

function ChangeLayer(action) {
	expressiaCardEditor.ChangeLayer(action);
}

function RotateLayer(action) {
	expressiaCardEditor.RotateLayer(action);
}

function Delete() {
	expressiaCardEditor.DeleteItem();
}

function OpenFrame() {
	expressiaCardEditor.OpenFrame();
}

function SaveTemplate() {
	expressiaCardEditor.SaveTemplate();
}

function OpenImage(artworkid) {
    newwindow=window.open("Popup/OpenImage.aspx?artworkID=" + artworkid,"nwin" , "width=320, height=100 ,scrollbars=yes");
    newwindow.opener = this;
    self.opener = this;
}


