function thisFlash(flashName) {
    if(navigator.appName.indexOf("Microsoft") != -1){
        return window[flashName];
    } else {
        return document[flashName];
    }
}

function applyCreamonFactory(eye,nose,mouth,decoration){
    thisFlash("CreamonFactory").applyCreamonFactory(eye,nose,mouth,decoration);
}

function showPopup(type, url, height, width) {
	$.fancybox({
		"type" : type,
		"href" : url,
		"height" : height,
		"width" : width,
		"scrolling" : "no"
	});
}

function closeCreamonSaveGrid() {
	$.fancybox.close();
	if(thisFlash("CreamonFavorite")){thisFlash("CreamonFavorite").initializeGrid();}
}

function closeCreamonFaceResponseGrid() {
	$.fancybox.close();
	location.reload();
}

function showByName(element, name) {
	$(element).find("[name=" + name + "]").show();
}

function hideByName(element, name) {
	$(element).find("[name=" + name + "]").hide();
}

function changeDisplayElement(showElement, hideElement) {
	$(showElement).show();
	$(hideElement).hide();
}
