var selectedId = null;
var oldClassName = null;
var typeId = null;

function selectActions(){
	if (selectedActions){
		for(var i=0; i < selectedActions.length; i++){
			var obj = document.getElementById(selectedActions[i]);
			if (obj){
				obj.className = 'action';
			}
		}
	}
	if (disabledActions){
		for(var i=0; i < disabledActions.length; i++){
			var obj = document.getElementById(disabledActions[i]);
			if (obj){
				obj.className = 'actionDisabled';
			}
		}
	}
}

function getId(){
	return parseInt(selectedId);
}

function showDialog(link, width, height){
	var newWin = window.open(link,"newWin","height="+height+",width="+width+",status=no,toolbar=no,menubar=no,location=no, scrollbars=yes, resizable=yes");	
	if (newWin) newWin.focus();
}

function CloseWindow(){
	if (window.opener){
		window.opener.focus();
	}
	window.close();
}

var images = new Array(7);
var oldsrc = null;
function init(prefix) {
	if (document.images){
			images[0] = new Image();
	        images[1] = new Image();
	        images[2] = new Image();
	        images[3] = new Image();
	        images[4] = new Image();
	        images[5] = new Image();
	        images[0].src = "/images/template/"+prefix+"button_about_over.jpg";
	        images[1].src = "/images/template/"+prefix+"button_artist_over.jpg";
	        images[2].src = "/images/template/"+prefix+"button_contactus_over.jpg";
	        images[3].src = "/images/template/"+prefix+"button_catalog_over.jpg";
	        images[4].src = "/images/template/"+prefix+"button_gallery_over.jpg";
	        images[5].src = "/images/template/"+prefix+"button_cart_over.jpg";
	}
}

function over(img, i){
	if (document.images) {
		oldsrc = img.src;
		img.src = images[i].src;
	}
}
function out(img, i){
	if ((document.images) && (oldsrc)) {
		img.src = oldsrc;
	}
}

var addtocart = new Image();
addtocart.src = "/images/template/addtocart_over.gif";
function cartover(img, i){
	if (document.images) {
		img.src = addtocart.src;
	}
}
function cartout(img, i){
	if (document.images) {
		img.src = "/images/template/addtocart.gif";
	}
}
